/* ============================================================
   InvoiceApp — Premium Modern UI
   ============================================================ */

:root {
  --primary:       #253287;
  --primary-dark:  #1a2460;
  --primary-light: #e8eaf6;
  --secondary:     #FAA84F;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #06b6d4;

  --sidebar-bg:    #1a2260;
  --sidebar-hover: rgba(250,168,79,.12);
  --sidebar-active:#253287;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;

  --navbar-height: 64px;
  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --border-subtle: #f1f5f9;

  --text-primary:  #1e293b;
  --text-secondary:#64748b;
  --text-muted:    #94a3b8;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md:     0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg:     0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);

  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     16px;
  --radius-xl:     20px;

  --transition:    .2s ease;
  --font:          'Poppins', sans-serif;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Layout ───────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.content-area {
  flex: 1;
  padding: 24px;
  padding-top: calc(var(--navbar-height) + 24px);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition), transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-icon-box {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  flex-shrink: 0;
}

.company-logo-img {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-text { overflow: hidden; }
.brand-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.brand-sub {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,.4);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-close {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 18px; cursor: pointer; padding: 4px; line-height: 1;
}

/* Search */
.sidebar-search { padding: 12px 16px; }
.search-wrapper { position: relative; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.3); font-size: 12px;
}
.sidebar-search-input {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 8px 12px 8px 32px;
  color: rgba(255,255,255,.8);
  font-size: 12px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}
.sidebar-search-input::placeholder { color: rgba(255,255,255,.3); }
.sidebar-search-input:focus { background: rgba(255,255,255,.1); border-color: rgba(99,102,241,.5); }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-list { list-style: none; padding: 0 10px; }
.nav-item { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.nav-link:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
}
.nav-item.active .nav-link {
  background: rgba(99,102,241,.2);
  color: #a5b4fc;
}
.nav-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; white-space: nowrap; }

/* Nav group labels */
.nav-group-label {
  padding: 12px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: .08em;
  list-style: none;
}
.active-indicator {
  width: 3px; height: 18px;
  background: var(--primary);
  border-radius: 2px;
  position: absolute;
  right: 0;
}

/* Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-quick-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 10px 14px;
}
.quick-stat-item { text-align: center; flex: 1; }
.qs-value { display: block; font-size: 18px; font-weight: 700; color: #e2e8f0; }
.qs-label { font-size: 10px; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .5px; }

.sidebar-logout {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 10px;
  color: rgba(239,68,68,.7);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
}
.sidebar-logout:hover { background: rgba(239,68,68,.1); color: #ef4444; }

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

/* ── Top Navbar ───────────────────────────────────────────── */
.top-navbar {
  height: var(--navbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
  transition: left var(--transition);
}

.navbar-left, .navbar-right { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 16px; cursor: pointer; padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
  line-height: 1;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text-primary); }

.page-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.btn-new-invoice {
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  letter-spacing: .2px;
}

/* Admin dropdown */
.admin-avatar-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px; border-radius: 10px;
  transition: var(--transition);
}
.admin-avatar-btn:hover { background: var(--bg); }

.avatar-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: white; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.admin-menu { min-width: 210px; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); }
.admin-menu .dropdown-header { padding: 12px 16px; }
.admin-menu .dropdown-item { font-size: 13px; padding: 9px 16px; border-radius: 8px; }
.admin-menu .dropdown-item:hover { background: var(--bg); }

/* Flash */
.flash-wrapper { position: fixed; top: calc(var(--navbar-height) + 12px); right: 20px; z-index: 1100; min-width: 300px; max-width: 420px; }
.flash-alert { border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow-md); border: none; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  background: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0; }
.card-body { padding: 20px; }
.card-footer { background: none; border-top: 1px solid var(--border-subtle); padding: 14px 20px; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: .06;
  transform: translate(20px, -30px);
}
.stat-card.primary::before  { background: var(--primary); }
.stat-card.success::before  { background: var(--success); }
.stat-card.warning::before  { background: var(--warning); }
.stat-card.danger::before   { background: var(--danger); }
.stat-card.info::before     { background: var(--info); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}
.stat-icon.primary { background: rgba(99,102,241,.12); color: var(--primary); }
.stat-icon.success { background: rgba(16,185,129,.12); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.danger  { background: rgba(239,68,68,.12);  color: var(--danger); }
.stat-icon.info    { background: rgba(6,182,212,.12);  color: var(--info); }
.stat-icon.orange  { background: rgba(249,115,22,.12); color: #f97316; }

.stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.stat-change {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; margin-top: 8px;
}
.stat-change.up   { background: rgba(16,185,129,.1);  color: var(--success); }
.stat-change.down { background: rgba(239,68,68,.1);   color: var(--danger); }

/* ── Status Badges ────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-paid    { background: rgba(16,185,129,.12); color: #059669; }
.badge-unpaid  { background: rgba(239,68,68,.1);   color: #dc2626; }
.badge-partial { background: rgba(245,158,11,.12); color: #d97706; }
.badge-overdue { background: rgba(239,68,68,.18);  color: #b91c1c; border: 1px solid rgba(239,68,68,.2); }

/* ── Tables ───────────────────────────────────────────────── */
.table-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.table-responsive { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  background: #f8fafc;
  padding: 13px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #fafbff; }

/* ── Forms ────────────────────────────────────────────────── */
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: .2px; }
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.form-control::placeholder { color: var(--text-muted); }
.input-group-text {
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.form-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  font-family: var(--font);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all .2s;
  letter-spacing: .2px;
}
.btn-primary  { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success  { background: var(--success); border-color: var(--success); }
.btn-warning  { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-danger   { background: var(--danger); border-color: var(--danger); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 8px;
}
.action-btn { font-size: 12px; padding: 6px 12px; border-radius: 7px; }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-header-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Search & Filter Bar ──────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.search-input-wrapper { position: relative; flex: 1; min-width: 220px; }
.search-input-wrapper .search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px; pointer-events: none;
}
.search-input-wrapper .form-control { padding-left: 36px; }

/* ── Invoice Items Table ──────────────────────────────────── */
.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.items-table td {
  padding: 10px 12px; vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
}
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table .form-control, .items-table .form-select {
  padding: 8px 10px; font-size: 12px;
}

.item-total { font-weight: 600; color: var(--text-primary); }
.btn-remove-item {
  background: none; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: color .2s, background .2s;
  line-height: 1;
}
.btn-remove-item:hover { color: var(--danger); background: rgba(239,68,68,.08); }

/* ── Totals Section ───────────────────────────────────────── */
.totals-box {
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.totals-row:last-child { border-bottom: none; }
.totals-row.grand-total {
  background: var(--primary);
  color: white;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 20px;
}
.totals-label { color: var(--text-secondary); font-weight: 500; }
.totals-value { font-weight: 700; color: var(--text-primary); }
.totals-row.grand-total .totals-label,
.totals-row.grand-total .totals-value { color: white; }

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.3) 0%, transparent 70%);
  top: -200px; left: -100px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,.2) 0%, transparent 70%);
  bottom: -150px; right: -50px;
}
.login-card {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px rgba(0,0,0,.3);
  position: relative;
  z-index: 1;
}
.login-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.login-title { font-size: 24px; font-weight: 700; color: var(--text-primary); text-align: center; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 32px; }
.login-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.login-input {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font);
  transition: border-color .2s, box-shadow .2s;
  outline: none; width: 100%;
}
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.btn-login {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: white; border: none;
  border-radius: 10px;
  padding: 13px; width: 100%;
  font-size: 15px; font-weight: 700;
  font-family: var(--font);
  cursor: pointer; transition: opacity .2s, transform .2s;
}
.btn-login:hover { opacity: .92; transform: translateY(-1px); }

/* ── Empty States ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-icon { font-size: 48px; color: var(--text-muted); margin-bottom: 16px; opacity: .5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: var(--text-muted); }

/* ── Dashboard Charts ─────────────────────────────────────── */
.chart-card { height: 100%; }
.chart-container { position: relative; height: 260px; }

/* ── Activity Feed ────────────────────────────────────────── */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px;
}
.activity-dot.invoice  { background: rgba(99,102,241,.12);  color: var(--primary); }
.activity-dot.customer { background: rgba(16,185,129,.12);  color: var(--success); }
.activity-dot.payment  { background: rgba(245,158,11,.12);  color: var(--warning); }
.activity-content .text { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.activity-content .time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── Customer Card (mobile) ───────────────────────────────── */
.customer-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

/* ── Invoice Preview (print-ready) ───────────────────────── */
.invoice-preview-wrapper {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 0; overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ── Modals ───────────────────────────────────────────────── */
.modal-content { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border-subtle); padding: 20px 24px; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--border-subtle); padding: 16px 24px; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { gap: 4px; }
.page-link { border-radius: 8px !important; border-color: var(--border); font-size: 13px; color: var(--text-primary); }
.page-link:hover { background: var(--bg); border-color: var(--border); color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── Upload Area ──────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-area:hover { border-color: var(--primary); background: rgba(99,102,241,.03); }
.upload-icon { font-size: 32px; color: var(--text-muted); margin-bottom: 8px; }

/* ── Utility ──────────────────────────────────────────────── */
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-right { text-align: right; }
.cursor-pointer { cursor: pointer; }
.border-start-primary { border-left: 4px solid var(--primary) !important; }
.border-start-success { border-left: 4px solid var(--success) !important; }
.border-start-warning { border-left: 4px solid var(--warning) !important; }
.border-start-danger  { border-left: 4px solid var(--danger) !important; }

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Responsive ───────────────────────────────────────────── */

/* Sidebar collapsed */
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }
.sidebar-collapsed .top-navbar { left: var(--sidebar-collapsed); }
.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-search,
.sidebar-collapsed .sidebar-footer .sidebar-logout span,
.sidebar-collapsed .sidebar-quick-stats { display: none; }
.sidebar-collapsed .nav-link { justify-content: center; padding: 12px; gap: 0; }
.sidebar-collapsed .nav-icon { width: auto; }
.sidebar-collapsed .sidebar-header { justify-content: center; }
.sidebar-collapsed .brand-logo { justify-content: center; }

@media (max-width: 1199px) {
  :root { --sidebar-width: 240px; }
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); width: 260px !important; }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0 !important; }
  .top-navbar { left: 0 !important; }
  .content-area { padding: 16px; padding-top: calc(var(--navbar-height) + 16px); }
}

@media (max-width: 767px) {
  .stat-card { padding: 18px 20px; }
  .stat-value { font-size: 22px; }
  .filter-bar { padding: 12px; }
  .data-table thead { display: none; }
  .data-table tbody tr { display: block; border-bottom: 2px solid var(--border); margin-bottom: 8px; border-radius: var(--radius); background: var(--surface); }
  .data-table tbody td {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
  }
  .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 700; font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-right: 12px;
    white-space: nowrap;
  }
  .data-table tbody td:last-child { border-bottom: none; }
  .page-header { gap: 10px; }
  .page-header-title { font-size: 18px; }
  .login-card { padding: 32px 24px; }
  .top-navbar { padding: 0 16px; }
  .navbar-right .btn-new-invoice { display: none; }
}

@media (max-width: 480px) {
  .content-area { padding: 12px; padding-top: calc(var(--navbar-height) + 12px); }
  .card-body { padding: 16px; }
  .modal-body { padding: 16px; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .sidebar, .top-navbar, .flash-wrapper,
  .no-print, .btn, nav { display: none !important; }
  .main-content { margin-left: 0; }
  .content-area { padding: 0; padding-top: 0; }
  body { background: white; }
  .card { box-shadow: none; border: none; }
}

/* ── Invoice PDF Page ─────────────────────────────────────── */
.pdf-invoice-wrapper {
  max-width: 820px; margin: 0 auto;
  background: white;
  font-family: var(--font);
}
.pdf-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
  padding: 40px 48px 32px;
  color: white;
}
.pdf-logo-area { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.pdf-logo-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.1); }
.pdf-company-name { font-size: 20px; font-weight: 700; }
.pdf-company-sub { font-size: 12px; opacity: .7; margin-top: 2px; }
.pdf-invoice-meta { display: flex; justify-content: space-between; align-items: flex-end; }
.pdf-invoice-title { font-size: 36px; font-weight: 800; opacity: .9; letter-spacing: -1px; }
.pdf-invoice-num { font-size: 14px; font-weight: 600; opacity: .7; }
.pdf-status-badge {
  display: inline-flex; align-items: center;
  padding: 6px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase;
}
.pdf-body { padding: 40px 48px; }
.pdf-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.pdf-party-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.pdf-party-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.pdf-party-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.pdf-dates { display: flex; gap: 32px; margin-bottom: 32px; }
.pdf-date-box { flex: 1; background: #f8fafc; border-radius: 10px; padding: 16px; border-left: 3px solid var(--primary); }
.pdf-date-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.pdf-date-value { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.pdf-items-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.pdf-items-table thead { background: #1e1b4b; }
.pdf-items-table thead th { color: white; padding: 13px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; text-align: left; }
.pdf-items-table thead th:last-child { text-align: right; }
.pdf-items-table tbody td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: top; }
.pdf-items-table tbody tr:hover td { background: #fafbff; }
.pdf-items-table tfoot td { padding: 10px 16px; font-size: 13px; border-top: 2px solid #e2e8f0; }
.pdf-grand-total-box {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: 12px; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}
.pdf-amount-words {
  background: #fffbeb; border-left: 4px solid var(--warning);
  border-radius: 8px; padding: 12px 16px;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 32px;
}
.pdf-bank-box {
  background: #f8fafc; border-radius: 10px;
  padding: 20px 24px; margin-bottom: 24px;
}
.pdf-bank-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.pdf-bank-row { display: flex; gap: 32px; flex-wrap: wrap; }
.pdf-bank-item { flex: 1; min-width: 120px; }
.pdf-bank-label { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }
.pdf-bank-value { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.pdf-footer { background: #f8fafc; border-top: 1px solid var(--border); padding: 24px 48px; display: flex; justify-content: space-between; align-items: center; }
.pdf-sign-area { text-align: center; }
.pdf-sign-img { max-height: 48px; margin-bottom: 8px; }
.pdf-sign-line { border-top: 1px solid var(--border); padding-top: 8px; font-size: 11px; color: var(--text-muted); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination-wrapper { display:flex; justify-content:center; gap:6px; margin-top:24px; flex-wrap:wrap; }
.page-btn { padding:7px 14px; border-radius:8px; font-size:13px; font-weight:600; border:1.5px solid var(--border); background:#fff; color:var(--text-primary); text-decoration:none; transition:var(--transition); }
.page-btn:hover { border-color:var(--primary); color:var(--primary); }
.page-btn.active { background:var(--primary); border-color:var(--primary); color:#fff; }
