/* ============================================================
   app.css — Phone Repair Shop SaaS
   Color scheme:
     Primary blue  : #2563eb
     Success green : #16a34a
     Danger red    : #dc2626
     Warning orange: #d97706
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ----------------------------------------------------------
   2. Typography helpers
   ---------------------------------------------------------- */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }

.text-success { color: #16a34a; }
.text-danger  { color: #dc2626; }
.text-warning { color: #d97706; }
.text-muted   { color: #64748b; }

.ml-1 { margin-left: 0.25rem; }
.mr-1 { margin-right: 0.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }

/* ----------------------------------------------------------
   3. Layout – Containers
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-md {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-sm {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ----------------------------------------------------------
   4. Navbar
   ---------------------------------------------------------- */
.navbar {
  background-color: #1e293b;
  color: #f8fafc;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.navbar-links a {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background-color 0.15s, color 0.15s;
  text-decoration: none;
}

.navbar-links a:hover {
  background-color: #334155;
  color: #f8fafc;
  text-decoration: none;
}

.navbar-links a.active {
  background-color: #2563eb;
  color: #ffffff;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.875rem;
  color: #cbd5e1;
  font-weight: 500;
}

.btn-logout {
  background-color: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.btn-logout:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* ----------------------------------------------------------
   5. Main content wrapper
   ---------------------------------------------------------- */
.main-content {
  padding: 2rem 0 3rem;
}

/* ----------------------------------------------------------
   6. Page header
   ---------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------
   7. Auth pages
   ---------------------------------------------------------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 2rem 1rem;
}

.auth-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo span {
  font-size: 2.5rem;
}

.auth-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-form .form-group {
  margin-bottom: 1rem;
}

.auth-link {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 1.25rem;
}

.auth-link a {
  color: #2563eb;
  font-weight: 500;
}

/* ----------------------------------------------------------
   8. Cards
   ---------------------------------------------------------- */
.card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background-color: #f8fafc;
  gap: 0.75rem;
}

.card-header h2,
.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.card-body {
  padding: 1.25rem;
}

/* ----------------------------------------------------------
   9. Stats grid
   ---------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}

.stat-ca    .stat-icon { background-color: #dbeafe; }
.stat-profit .stat-icon { background-color: #dcfce7; }
.stat-expenses .stat-icon { background-color: #fee2e2; }
.stat-invoices .stat-icon { background-color: #fef3c7; }

.stat-body {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.2rem;
  font-weight: 500;
}

.stat-ca       .stat-value { color: #2563eb; }
.stat-profit   .stat-value { color: #16a34a; }
.stat-expenses .stat-value { color: #dc2626; }
.stat-invoices .stat-value { color: #d97706; }

/* ----------------------------------------------------------
   10. Dashboard grid (2 columns)
   ---------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ----------------------------------------------------------
   11. Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s,
    box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  text-decoration: none;
}

.btn-success {
  background-color: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background-color: #15803d;
  border-color: #15803d;
  color: #ffffff;
  text-decoration: none;
}

.btn-danger {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  border-color: #cbd5e1;
  color: #374151;
}

.btn-outline:hover:not(:disabled) {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
  text-decoration: none;
}

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: #64748b;
}

.btn-ghost:hover:not(:disabled) {
  background-color: #f1f5f9;
  color: #1e293b;
  text-decoration: none;
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
}

.btn-lg {
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
  display: flex;
}

/* ----------------------------------------------------------
   12. Forms
   ---------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 0.9375rem;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}

/* ----------------------------------------------------------
   13. Alerts / Flash messages
   ---------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  transition: opacity 0.4s ease;
}

.alert-success {
  background-color: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.alert-error {
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.alert-warning {
  background-color: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.alert-info {
  background-color: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

/* ----------------------------------------------------------
   14. Badges
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  line-height: 1;
  white-space: nowrap;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-neutral {
  background-color: #f1f5f9;
  color: #475569;
}

/* ----------------------------------------------------------
   15. Tables
   ---------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table thead tr {
  background-color: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.table th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

/* Invoice-specific table */
.table-invoice {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.table-invoice th,
.table-invoice td {
  padding: 0.6rem 0.75rem;
}

.total-row td {
  font-weight: 700;
  background-color: #f8fafc;
  border-top: 2px solid #e2e8f0;
  font-size: 1rem;
}

.row-danger td {
  background-color: #fff1f2;
  color: #9f1239;
}

.row-warning td {
  background-color: #fffbeb;
  color: #78350f;
}

.total-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

/* Product select inside table cell */
.product-select {
  width: 100%;
}

/* Actions cell */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

/* ----------------------------------------------------------
   16. Filters bar
   ---------------------------------------------------------- */
.filters-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filters-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filters-form .form-group {
  margin-bottom: 0;
  min-width: 160px;
}

.filters-form .form-group label {
  font-size: 0.8125rem;
}

/* ----------------------------------------------------------
   17. Empty states
   ---------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #64748b;
}

.empty-state-full {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: #64748b;
}

.empty-state .empty-icon,
.empty-state-full .empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  opacity: 0.45;
}

.empty-state h3,
.empty-state-full h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.empty-state p,
.empty-state-full p {
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.empty-state.success {
  color: #166534;
}

.empty-state.success .empty-icon {
  opacity: 0.7;
}

/* ----------------------------------------------------------
   18. Stock alerts
   ---------------------------------------------------------- */
.stock-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stock-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.875rem;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background-color: #fafafa;
  font-size: 0.875rem;
  gap: 0.5rem;
}

.stock-alert-item .alert-name {
  font-weight: 500;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-alert-item.out {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

.stock-alert-item.out .alert-name {
  color: #991b1b;
}

.stock-alert-item.low {
  background-color: #fffbeb;
  border-color: #fcd34d;
}

.stock-alert-item.low .alert-name {
  color: #78350f;
}

.stock-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stock-alert-item.out .stock-badge {
  background-color: #dc2626;
  color: #fff;
}

.stock-alert-item.low .stock-badge {
  background-color: #d97706;
  color: #fff;
}

/* ----------------------------------------------------------
   19. Invoice preview (print/detail view)
   ---------------------------------------------------------- */
.invoice-preview {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 2.5rem;
  max-width: 860px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #2563eb;
  gap: 1.5rem;
}

.invoice-header .invoice-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
}

.invoice-header .invoice-number {
  font-size: 1rem;
  font-weight: 600;
  color: #2563eb;
  margin-top: 0.2rem;
}

.invoice-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.invoice-info dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.invoice-info dd {
  font-size: 0.9375rem;
  color: #1e293b;
}

.client-info {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.client-info h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.client-info p {
  font-size: 0.9375rem;
  color: #1e293b;
  line-height: 1.6;
}

.invoice-notes {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #78350f;
}

.invoice-notes h4 {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* Invoice totals section */
.invoice-totals {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

.invoice-totals table {
  min-width: 240px;
}

.invoice-totals td {
  padding: 0.35rem 0.5rem;
  font-size: 0.9375rem;
}

.invoice-totals tr.grand-total td {
  font-weight: 700;
  font-size: 1.1rem;
  border-top: 2px solid #1e293b;
  padding-top: 0.5rem;
}

/* ----------------------------------------------------------
   20. Margin preview (stock form)
   ---------------------------------------------------------- */
#margin-preview {
  display: none;
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #166534;
  font-weight: 500;
}

#margin-preview.negative {
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* ----------------------------------------------------------
   21. Pagination
   ---------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem 0 0.5rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  color: #374151;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.pagination a:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  text-decoration: none;
}

.pagination .active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ----------------------------------------------------------
   22. Utility — dividers, spacing, misc
   ---------------------------------------------------------- */
.divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1.25rem 0;
}

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fs-sm { font-size: 0.8125rem; }

/* ----------------------------------------------------------
   23. Print styles
   ---------------------------------------------------------- */
@media print {
  .navbar,
  .page-header .header-actions,
  .btn,
  .filters-bar,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 12pt;
  }

  .invoice-preview {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ----------------------------------------------------------
   24. Responsive adjustments (tablet ~768px)
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .navbar-links {
    display: none; /* simplification for mobile */
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .invoice-info {
    grid-template-columns: 1fr;
  }

  .invoice-header {
    flex-direction: column;
  }

  .filters-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-form .form-group {
    min-width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table th,
  .table td {
    padding: 0.6rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  .invoice-preview {
    padding: 1.25rem;
  }
}
