/* ============================================
   RESPONSIVE CSS - Invoice ERP v4
   Professional A4 Invoice & Full Website
   ============================================ */

/* ============================================
   BASE STYLES & RESET
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ============================================
   PROFESSIONAL A4 INVOICE STYLES
   ============================================ */
@page {
  size: A4;
  margin: 10mm;
}

.invoice-a4 {
  width: 210mm;
  min-height: 297mm;
  max-width: 210mm;
  margin: 0 auto;
  background: #ffffff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 9pt;
  line-height: 1.35;
  color: #333;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  position: relative;
}

.invoice-a4 .invoice-header {
  background: #ffffff;
  color: #333333;
  padding: 8mm 8mm;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #333333;
}

.invoice-a4 .company-info {
  flex: 1;
}

.invoice-a4 .company-logo {
  max-height: 15mm;
  max-width: 40mm;
  object-fit: contain;
  margin-bottom: 2mm;
}

.invoice-a4 .company-name {
  font-size: 14pt;
  font-weight: 700;
  margin: 0 0 1.5mm 0;
  letter-spacing: 0.5px;
}

.invoice-a4 .company-details {
  font-size: 8pt;
  line-height: 1.4;
  opacity: 0.95;
}

.invoice-a4 .invoice-title-section {
  text-align: right;
  flex-shrink: 0;
}

.invoice-a4 .invoice-title {
  font-size: 16pt;
  font-weight: 700;
  margin: 0 0 2mm 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.invoice-a4 .invoice-meta {
  font-size: 8pt;
  line-height: 1.4;
}

.invoice-a4 .invoice-meta strong {
  color: #333333;
}

.invoice-a4 .invoice-body {
  padding: 5mm 8mm;
}

.invoice-a4 .billing-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm;
  margin-bottom: 5mm;
}

.invoice-a4 .billing-box {
  border: 1px solid #cccccc;
  border-radius: 2mm;
  padding: 3mm;
  background: #ffffff;
}

.invoice-a4 .billing-box h3 {
  font-size: 9pt;
  font-weight: 700;
  color: #333333;
  margin: 0 0 2mm 0;
  padding-bottom: 1mm;
  border-bottom: 1px solid #333333;
}

.invoice-a4 .billing-box p {
  margin: 0.5mm 0;
  font-size: 8pt;
}

.invoice-a4 .items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 5mm;
  font-size: 8pt;
}

.invoice-a4 .items-table thead {
  background: #f5f5f5;
  color: #333333;
  border-bottom: 2px solid #333333;
}

.invoice-a4 .items-table th {
  padding: 2mm 1.5mm;
  text-align: left;
  font-weight: 600;
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.invoice-a4 .items-table th.text-right,
.invoice-a4 .items-table td.text-right {
  text-align: right;
}

.invoice-a4 .items-table th.text-center,
.invoice-a4 .items-table td.text-center {
  text-align: center;
}

.invoice-a4 .items-table td {
  padding: 1.5mm 1.5mm;
  border-bottom: 1px solid #eee;
  font-size: 8pt;
}

.invoice-a4 .items-table tbody tr:nth-child(even) {
  background: #ffffff;
}

.invoice-a4 .items-table tbody tr:hover {
  background: #ffffff;
}

.invoice-a4 .totals-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm;
  margin-bottom: 5mm;
}

.invoice-a4 .bank-details {
  border: 1px solid #cccccc;
  border-radius: 2mm;
  padding: 3mm;
  background: #ffffff;
}

.invoice-a4 .bank-details h3 {
  font-size: 9pt;
  font-weight: 700;
  color: #333333;
  margin: 0 0 2mm 0;
  padding-bottom: 1mm;
  border-bottom: 1px solid #333333;
}

.invoice-a4 .bank-details p {
  margin: 0.5mm 0;
  font-size: 8pt;
}

.invoice-a4 .totals-box {
  justify-self: end;
  width: 100%;
}

.invoice-a4 .totals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8pt;
}

.invoice-a4 .totals-table td {
  padding: 1.5mm 2mm;
  border: 1px solid #ddd;
}

.invoice-a4 .totals-table td:first-child {
  font-weight: 500;
  background: #ffffff;
}

.invoice-a4 .totals-table td:last-child {
  text-align: right;
  font-weight: 600;
}

.invoice-a4 .totals-table .grand-total td {
  background: #f5f5f5;
  color: #333333;
  font-size: 10pt;
  font-weight: 700;
  border-top: 2px solid #333333;
}

.invoice-a4 .amount-words {
  margin-top: 2mm;
  padding: 2mm;
  background: #ffffff;
  border-left: 2px solid #333333;
  font-size: 8pt;
}

.invoice-a4 .amount-words strong {
  color: #333333;
}

.invoice-a4 .footer-section {
  border-top: 1px solid #333333;
  padding-top: 3mm;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm;
  margin-top: auto;
}

.invoice-a4 .declaration {
  font-size: 7pt;
  color: #666;
  line-height: 1.4;
}

.invoice-a4 .declaration h4 {
  font-size: 8pt;
  color: #333333;
  margin: 0 0 1mm 0;
}

.invoice-a4 .signature-section {
  text-align: right;
}

.invoice-a4 .signature-section h4 {
  font-size: 8pt;
  color: #333333;
  margin: 0 0 1mm 0;
}

.invoice-a4 .signature-line {
  margin-top: 10mm;
  border-top: 1px solid #333;
  padding-top: 1mm;
  font-size: 8pt;
}

/* ============================================
   PRINT STYLES FOR A4 INVOICE
   ============================================ */
@media print {
  body * {
    visibility: hidden !important;
  }
  
  .invoice-a4,
  .invoice-a4 * {
    visibility: visible !important;
  }
  
  .invoice-a4 {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 190mm !important;
    max-width: 190mm !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    font-size: 8pt !important;
  }
  
  .invoice-a4 .invoice-header {
    padding: 5mm 6mm !important;
  }
  
  .invoice-a4 .invoice-body {
    padding: 3mm 6mm !important;
  }
  
  .invoice-a4 .company-name {
    font-size: 12pt !important;
  }
  
  .invoice-a4 .company-details {
    font-size: 7pt !important;
  }
  
  .invoice-a4 .invoice-title {
    font-size: 14pt !important;
  }
  
  .invoice-a4 .invoice-meta {
    font-size: 7pt !important;
  }
  
  .invoice-a4 .billing-section {
    gap: 4mm !important;
    margin-bottom: 4mm !important;
  }
  
  .invoice-a4 .billing-box {
    padding: 3mm !important;
  }
  
  .invoice-a4 .billing-box h3 {
    font-size: 8pt !important;
    margin-bottom: 1.5mm !important;
  }
  
  .invoice-a4 .billing-box p {
    font-size: 7pt !important;
    margin: 0.5mm 0 !important;
  }
  
  .invoice-a4 .items-table {
    font-size: 7pt !important;
    margin-bottom: 4mm !important;
  }
  
  .invoice-a4 .items-table th {
    padding: 2mm 1.5mm !important;
    font-size: 7pt !important;
  }
  
  .invoice-a4 .items-table td {
    padding: 1.5mm 1.5mm !important;
    font-size: 7pt !important;
  }
  
  .invoice-a4 .totals-section {
    gap: 4mm !important;
    margin-bottom: 4mm !important;
  }
  
  .invoice-a4 .bank-details {
    padding: 3mm !important;
  }
  
  .invoice-a4 .bank-details h3 {
    font-size: 8pt !important;
    margin-bottom: 1.5mm !important;
  }
  
  .invoice-a4 .bank-details p {
    font-size: 7pt !important;
    margin: 0.5mm 0 !important;
  }
  
  .invoice-a4 .totals-table {
    font-size: 7pt !important;
  }
  
  .invoice-a4 .totals-table td {
    padding: 1.5mm 2mm !important;
  }
  
  .invoice-a4 .totals-table .grand-total td {
    font-size: 9pt !important;
  }
  
  .invoice-a4 .amount-words {
    margin-top: 1.5mm !important;
    padding: 2mm !important;
    font-size: 7pt !important;
  }
  
  .invoice-a4 .footer-section {
    padding-top: 3mm !important;
    gap: 4mm !important;
  }
  
  .invoice-a4 .declaration {
    font-size: 6pt !important;
  }
  
  .invoice-a4 .declaration h4 {
    font-size: 7pt !important;
  }
  
  .invoice-a4 .signature-section h4 {
    font-size: 7pt !important;
  }
  
  .invoice-a4 .signature-line {
    margin-top: 10mm !important;
    font-size: 7pt !important;
  }
  
  .no-print {
    display: none !important;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  table {
    page-break-inside: auto;
  }
  
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  
  .invoice-a4 .billing-section,
  .invoice-a4 .totals-section,
  .invoice-a4 .footer-section {
    page-break-inside: avoid;
  }
}

/* ============================================
   RESPONSIVE SIDEBAR & LAYOUT
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #0f172a;
  color: #e2e8f0;
  z-index: 50;
  transform: translateX(-100%);
  overflow-y: auto;
}

.sidebar.ready {
  transition: transform 0.3s ease;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 15px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  color: #f39c12;
}

.sidebar-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: none;
}

.sidebar-close:hover {
  color: white;
}

.sidebar-nav {
  padding: 15px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: #1e293b;
  color: white;
  border-left-color: #f39c12;
}

.sidebar-nav a.active {
  background: #1e293b;
  color: #f39c12;
  border-left-color: #f39c12;
}

.main-content {
  margin-left: 0;
  min-height: 100vh;
}

.main-content.ready {
  transition: margin-left 0.3s ease;
}

.main-content.shrunk {
  margin-left: 240px;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.main-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  padding: 0 20px;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  display: block;
  border-radius: 5px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.back-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 5px;
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 14px;
}

.header-right a {
  color: #fca5a5;
  text-decoration: none;
  transition: color 0.2s;
}

.header-right a:hover {
  color: #fecaca;
}

/* ============================================
   PAGE CONTENT STYLES
   ============================================ */
.page-content {
  padding: 25px;
  background: #f1f5f9;
  min-height: calc(100vh - 60px);
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 20px 0;
}

.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 15px 0;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: #64748b;
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.data-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: white;
}

.data-table thead {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
}

.data-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  color: #334155;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.stat-icon.green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.stat-icon.orange {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.stat-icon.purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 10px 0;
}

.login-header p {
  color: #64748b;
  margin: 0;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet Landscape (1024px and below) */
@media screen and (max-width: 1024px) {
  .invoice-a4 {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    margin: 0;
    box-shadow: none;
  }
  
  .invoice-a4 .invoice-header {
    flex-direction: column;
    gap: 10mm;
  }
  
  .invoice-a4 .invoice-title-section {
    text-align: left;
  }
  
  .invoice-a4 .billing-section,
  .invoice-a4 .totals-section,
  .invoice-a4 .footer-section {
    grid-template-columns: 1fr;
  }
  
  .invoice-a4 .totals-box {
    justify-self: start;
  }
  
  .invoice-a4 .signature-section {
    text-align: left;
  }
}

/* Tablet Portrait (768px and below) */
@media screen and (max-width: 768px) {
  /* Sidebar */
  
  .sidebar-overlay.active {
    display: block;
  }
  
  /* Header */
  .sidebar-close {
    display: block;
  }
  
  .header-title {
    font-size: 16px;
  }
  
  .header-right {
    font-size: 12px;
    gap: 10px;
  }
  
  /* Page Content */
  .page-content {
    padding: 15px;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .stat-card {
    padding: 15px;
  }
  
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  /* Form Grid */
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  /* Tables */
  .data-table {
    font-size: 13px;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }
  
  /* Invoice A4 adjustments */
  .invoice-a4 .invoice-header {
    padding: 6mm 6mm;
  }
  
  .invoice-a4 .invoice-body {
    padding: 3mm 6mm;
  }
  
  .invoice-a4 .company-name {
    font-size: 11pt;
  }
  
  .invoice-a4 .invoice-title {
    font-size: 12pt;
  }
  
  .invoice-a4 .items-table {
    font-size: 6pt;
  }
  
  .invoice-a4 .items-table th,
  .invoice-a4 .items-table td {
    padding: 1.5mm 1mm;
  }
}

/* Mobile Landscape (576px and below) */
@media screen and (max-width: 576px) {
  /* Header */
  .main-header {
    padding: 0 15px;
    height: 50px;
  }
  
  .header-title {
    font-size: 14px;
  }
  
  .header-right {
    font-size: 11px;
    gap: 8px;
  }
  
  .header-right span {
    display: none;
  }
  
  /* Page Content */
  .page-content {
    padding: 10px;
  }
  
  .page-title {
    font-size: 18px;
    margin-bottom: 15px;
  }
  
  .card {
    padding: 15px;
    border-radius: 8px;
  }
  
  .card-title {
    font-size: 16px;
  }
  
  /* Stats Grid */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-icon {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
  
  .stat-value {
    font-size: 18px;
  }
  
  .stat-label {
    font-size: 11px;
  }
  
  /* Buttons */
  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  /* Forms */
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  /* Tables */
  .data-table {
    font-size: 12px;
    min-width: 500px;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }
  
  /* Login Page */
  .login-card {
    padding: 25px;
  }
  
  .login-header h1 {
    font-size: 24px;
  }
  
  /* Invoice A4 adjustments */
  .invoice-a4 {
    font-size: 7pt;
  }
  
  .invoice-a4 .invoice-header {
    padding: 5mm 5mm;
  }
  
  .invoice-a4 .invoice-body {
    padding: 3mm 5mm;
  }
  
  .invoice-a4 .company-name {
    font-size: 10pt;
  }
  
  .invoice-a4 .invoice-title {
    font-size: 11pt;
  }
  
  .invoice-a4 .company-details {
    font-size: 6pt;
  }
  
  .invoice-a4 .billing-box {
    padding: 2mm;
  }
  
  .invoice-a4 .billing-box h3 {
    font-size: 7pt;
  }
  
  .invoice-a4 .billing-box p {
    font-size: 6pt;
  }
  
  .invoice-a4 .items-table {
    font-size: 5.5pt;
  }
  
  .invoice-a4 .items-table th,
  .invoice-a4 .items-table td {
    padding: 1mm 0.8mm;
  }
  
  .invoice-a4 .bank-details {
    padding: 2mm;
  }
  
  .invoice-a4 .bank-details h3 {
    font-size: 7pt;
  }
  
  .invoice-a4 .bank-details p {
    font-size: 6pt;
  }
  
  .invoice-a4 .totals-table td {
    padding: 1mm 1.5mm;
    font-size: 6pt;
  }
  
  .invoice-a4 .totals-table .grand-total td {
    font-size: 8pt;
  }
  
  .invoice-a4 .amount-words {
    padding: 1.5mm;
    font-size: 6pt;
  }
  
  .invoice-a4 .declaration {
    font-size: 5pt;
  }
  
  .invoice-a4 .declaration h4 {
    font-size: 6pt;
  }
  
  .invoice-a4 .signature-section h4 {
    font-size: 6pt;
  }
}

/* Mobile Portrait (400px and below) */
@media screen and (max-width: 400px) {
  /* Header */
  .main-header {
    padding: 0 10px;
    height: 45px;
  }
  
  .header-title {
    font-size: 12px;
  }
  
  .menu-toggle {
    font-size: 20px;
  }
  
  /* Page Content */
  .page-content {
    padding: 8px;
  }
  
  .page-title {
    font-size: 16px;
  }
  
  .card {
    padding: 12px;
  }
  
  .card-title {
    font-size: 14px;
  }
  
  /* Stats */
  .stat-card {
    padding: 10px;
    gap: 10px;
  }
  
  .stat-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  
  .stat-value {
    font-size: 16px;
  }
  
  /* Buttons */
  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* Forms */
  .form-group label {
    font-size: 12px;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  /* Tables */
  .data-table {
    font-size: 11px;
    min-width: 400px;
  }
  
  .data-table th,
  .data-table td {
    padding: 6px 4px;
  }
  
  /* Login */
  .login-card {
    padding: 20px;
  }
  
  .login-header h1 {
    font-size: 20px;
  }
  
  /* Invoice A4 - Stack everything */
  .invoice-a4 .billing-section {
    gap: 5mm;
  }
  
  .invoice-a4 .items-table {
    font-size: 6pt;
  }
  
  .invoice-a4 .items-table th,
  .invoice-a4 .items-table td {
    padding: 1mm 0.5mm;
  }
  
  .invoice-a4 .footer-section {
    gap: 5mm;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.visible-mobile {
  display: none !important;
}

.visible-desktop {
  display: block !important;
}

@media screen and (max-width: 768px) {
  .visible-mobile {
    display: block !important;
  }
  
  .visible-desktop {
    display: none !important;
  }
  
  .hidden-mobile {
    display: none !important;
  }
}

/* ============================================
   PRINT BUTTON STYLES
   ============================================ */
.print-actions {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.print-actions .btn {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@media print {
  .print-actions {
    display: none !important;
  }
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.3s ease;
}

.stat-card {
  animation: fadeIn 0.3s ease;
}

/* ============================================
   SEARCH & FILTER STYLES
   ============================================ */
.search-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-filter-bar input,
.search-filter-bar select {
  flex: 1;
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
}

.search-filter-bar .btn {
  flex-shrink: 0;
}

@media screen and (max-width: 576px) {
  .search-filter-bar {
    flex-direction: column;
  }
  
  .search-filter-bar input,
  .search-filter-bar select,
  .search-filter-bar .btn {
    width: 100%;
  }
}

/* ============================================
   ACTION BUTTONS IN TABLES
   ============================================ */
.action-buttons {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.action-buttons a,
.action-buttons button {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}

@media screen and (max-width: 576px) {
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons a,
  .action-buttons button {
    width: 100%;
    text-align: center;
  }
}
