/* ============================================================
   Arabic RTL Invoice System — Main Stylesheet
   Font: Tajawal (Google Fonts)
   Direction: RTL
   ============================================================ */

/* === Variables & Base === */
:root {
  --primary:        #27a637;
  --primary-dark:   #15601f;
  --primary-light:  #dcf6de;
  --secondary:      #64748b;
  --success:        #16a34a;
  --success-light:  #dcfce7;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --info:           #0891b2;
  --info-light:     #cffafe;
  --sidebar-bg:     #103a17;
  --sidebar-text:   #c5e6cb;
  --sidebar-hover:  rgba(255, 255, 255, 0.08);
  --sidebar-active: #27a637;
  --sidebar-width:  260px;
  --navbar-height:  64px;
  --content-bg:     #f8fafc;
  --card-bg:        #ffffff;
  --border-color:   #e2e8f0;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      18px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:      0 4px 12px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 30px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.07);
  --transition:     .2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', 'Segoe UI', Arial, sans-serif;
  direction: rtl;
  background-color: var(--content-bg);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic numerals — keep Eastern Arabic if needed */
.arabic-nums {
  font-feature-settings: "numr";
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition), width var(--transition);
  box-shadow: -4px 0 20px rgba(0,0,0,.25);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Logo / brand area */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--sidebar-active));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo .company-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}

.sidebar-logo .company-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
}

.sidebar-nav .nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 14px 12px 6px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav .nav-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: .85;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #f1f5f9;
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(39,166,55,.35);
}

.sidebar-nav .nav-link.active i { opacity: 1; }

.sidebar-nav .nav-badge {
  margin-right: auto;
  margin-left: 0;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.88rem;
  transition: background var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-footer .nav-link:hover {
  background: var(--sidebar-hover);
  color: #f1f5f9;
}

/* Collapsed sidebar (mobile overlay) */
.sidebar.collapsed {
  transform: translateX(100%);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* === Main Content === */
.main-content {
  margin-right: var(--sidebar-width);
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-right var(--transition);
}

.page-body {
  flex: 1;
  padding: 24px;
}

/* === Navbar === */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.navbar-start {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  margin-left: 0;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: background var(--transition);
}

.hamburger-btn:hover { background: var(--content-bg); }

.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.navbar-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.navbar-icon-btn:hover {
  background: var(--content-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.navbar-icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 5px 12px 5px 8px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-primary);
}

.user-menu-btn:hover { background: var(--content-bg); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
}

/* === Cards === */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card .icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card .icon.icon-primary   { background: var(--primary-light);  color: var(--primary); }
.stat-card .icon.icon-success   { background: var(--success-light);  color: var(--success); }
.stat-card .icon.icon-danger    { background: var(--danger-light);   color: var(--danger); }
.stat-card .icon.icon-warning   { background: var(--warning-light);  color: var(--warning); }
.stat-card .icon.icon-info      { background: var(--info-light);     color: var(--info); }

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

.stat-card .value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card .label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.stat-card .trend {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
}
.stat-card .trend.up   { color: var(--success); }
.stat-card .trend.down { color: var(--danger); }

/* Generic white card */
.card-panel {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.card-panel .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 1rem;
  background: #fafbfc;
}

.card-panel .card-body-inner { padding: 20px; }

/* === Tables === */
.table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-custom thead tr {
  background: #f1f5f9;
  position: sticky;
  top: var(--navbar-height);
  z-index: 10;
}

.table-custom th {
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.table-custom td {
  padding: 13px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid #f0f4f8;
  vertical-align: middle;
}

.table-custom tbody tr {
  transition: background var(--transition);
}

.table-custom tbody tr:hover { background: #f8fafc; }
.table-custom tbody tr:last-child td { border-bottom: none; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}

.badge-draft      { background: #f1f5f9;             color: var(--secondary); }
.badge-issued     { background: var(--primary-light); color: var(--primary); }
.badge-paid       { background: var(--success-light); color: var(--success); }
.badge-cancelled  { background: var(--danger-light);  color: var(--danger); }
.badge-overdue    { background: var(--warning-light); color: var(--warning); }
.badge-pending    { background: #fef9c3;              color: #92400e; }

/* === Forms === */
.form-section {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 22px;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title i { color: var(--primary); }

label.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

label.form-label .required {
  color: var(--danger);
  margin-right: 3px;
}

.form-control,
.form-select {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  background: #ffffff;
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39,166,55,.12);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.invalid-feedback {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
}

/* === Invoice Builder === */
.invoice-builder-wrap {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

#invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

#invoice-items-table th {
  background: #f8fafc;
  padding: 11px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--border-color);
}

#invoice-items-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #f0f4f8;
  vertical-align: middle;
}

#invoice-items-table tbody tr:last-child td { border-bottom: none; }

#invoice-items-table .form-control {
  padding: 7px 10px;
  font-size: 0.86rem;
}

.btn-remove-row {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: background var(--transition);
}

.btn-remove-row:hover { background: var(--danger-light); }

.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 14px 14px 0;
  padding: 8px 16px;
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.btn-add-row:hover { background: #bfdbfe; border-color: var(--primary-dark); }

/* Totals box */
.invoice-totals {
  border-top: 2px solid var(--border-color);
  padding: 20px 24px;
  background: #fafbfc;
}

.totals-grid {
  max-width: 340px;
  margin-right: auto;
  margin-left: 0;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border-color);
}

.totals-row:last-child { border-bottom: none; }

.totals-row.grand-total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  padding-top: 12px;
}

.totals-row .amount { font-weight: 600; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(39,166,55,.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #0f4517);
  box-shadow: 0 4px 14px rgba(39,166,55,.4);
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #15803d);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(22,163,74,.3);
}

.btn-success:hover { background: linear-gradient(135deg, #15803d, #166534); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220,38,38,.3);
}

.btn-danger:hover { background: linear-gradient(135deg, #b91c1c, #991b1b); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-sm { padding: 6px 13px; font-size: 0.82rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-md); }

/* === Alerts / Flash Messages === */
.flash-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  border-width: 1px;
  border-style: solid;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInDown .3s ease;
  position: relative;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flash-alert .alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.flash-alert .alert-close {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: .6;
  transition: opacity var(--transition);
  color: inherit;
  padding: 4px;
}
.flash-alert .alert-close:hover { opacity: 1; }

.flash-success { background: var(--success-light); border-color: #86efac; color: #166534; }
.flash-danger  { background: var(--danger-light);  border-color: #fca5a5; color: #991b1b; }
.flash-warning { background: var(--warning-light); border-color: #fde68a; color: #92400e; }
.flash-info    { background: var(--info-light);    border-color: #67e8f9; color: #164e63; }

/* === Dark Mode === */
[data-theme="dark"] {
  --content-bg:     #0f172a;
  --card-bg:        #1e293b;
  --border-color:   #334155;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
}

[data-theme="dark"] .top-navbar {
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #0f172a;
  border-color: #334155;
  color: var(--text-primary);
}

[data-theme="dark"] .table-custom thead tr { background: #0f172a; }
[data-theme="dark"] .table-custom tbody tr:hover { background: #1e293b; }
[data-theme="dark"] .invoice-totals { background: #0f172a; }
[data-theme="dark"] #invoice-items-table th { background: #0f172a; }

/* Sidebar always stays dark regardless of theme */
.sidebar { background-color: var(--sidebar-bg) !important; }

/* === Utilities === */
.text-sar {
  font-size: 0.78em;
  font-weight: 700;
  opacity: .75;
  margin-left: 3px;
}

.text-primary-color { color: var(--primary); }
.text-success-color { color: var(--success); }
.text-danger-color  { color: var(--danger); }
.text-muted-color   { color: var(--text-muted); }

.print-hide { /* hidden in print — see print.css */ }

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 18px 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--text-secondary); font-weight: 600; }

/* Pagination */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.pagination .page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background var(--transition), border-color var(--transition);
  text-decoration: none;
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination .page-item .page-link:hover:not(.active) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: .5; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 0.88rem; }

/* === Responsive === */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .hamburger-btn { display: flex; }
}

@media (max-width: 768px) {
  .page-body { padding: 16px; }
  .top-navbar { padding: 0 16px; }

  .stat-card { padding: 16px 14px; }
  .stat-card .value { font-size: 1.45rem; }
  .stat-card .icon { width: 44px; height: 44px; font-size: 1.2rem; }

  .form-section { padding: 16px; }

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

  .table-custom { font-size: 0.82rem; }
  .table-custom th,
  .table-custom td { padding: 10px 10px; }

  .totals-grid { max-width: 100%; }

  .btn { padding: 8px 15px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }

  .top-navbar { height: 56px; }
  .main-content { --navbar-height: 56px; }

  .page-title { font-size: 1rem; }

  .stat-card { flex-direction: column; text-align: center; }
  .totals-row { font-size: 0.82rem; }
}
