/* ============================================================
   PROCUREFLOW — Bright Professional Theme
   Clean white + indigo blue + vivid accents
   Font: Nunito (display) + DM Sans (body) + JetBrains Mono
   ============================================================ */

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

:root {
  --bg-base:      #f0f4ff;
  --bg-surface:   #ffffff;
  --bg-card:      #ffffff;
  --bg-hover:     #f5f7ff;
  --bg-input:     #ffffff;
  --bg-muted:     #f8f9fc;
  --border:       #dde3f0;
  --border-light: #eef1f8;
  --text-primary:   #1a1f36;
  --text-secondary: #4a5578;
  --text-muted:     #8892ac;
  --text-light:     #b0b8cc;
  --indigo:       #4f6ef7;
  --indigo-dark:  #3855d4;
  --indigo-light: #eef1ff;
  --indigo-glow:  rgba(79,110,247,0.15);
  --green:        #10b981;
  --green-bg:     #ecfdf5;
  --green-border: #a7f3d0;
  --amber:        #f59e0b;
  --amber-bg:     #fffbeb;
  --amber-border: #fde68a;
  --red:          #ef4444;
  --red-bg:       #fef2f2;
  --red-border:   #fecaca;
  --blue:         #3b82f6;
  --blue-bg:      #eff6ff;
  --blue-border:  #bfdbfe;
  --purple:       #8b5cf6;
  --purple-bg:    #f5f3ff;
  --purple-border:#ddd6fe;
  --cyan:         #06b6d4;
  --orange:       #f97316;
  --orange-bg:    #fff7ed;
  --shadow-xs:  0 1px 3px rgba(26,31,54,0.08);
  --shadow-sm:  0 2px 8px rgba(26,31,54,0.10);
  --shadow:     0 4px 20px rgba(26,31,54,0.12);
  --shadow-lg:  0 8px 40px rgba(26,31,54,0.16);
  --shadow-indigo: 0 4px 20px rgba(79,110,247,0.25);
  --sidebar-w:  256px;
  --topbar-h:   60px;
  --radius:     10px;
  --radius-sm:  6px;
  --radius-lg:  14px;
  --transition: .18s ease;
  --font-display: 'Nunito', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&family=JetBrains+Mono:wght@400;500;600&display=swap');

html { font-size: 14px; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f4ff; }
::-webkit-scrollbar-thumb { background: #c5cde0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9aa3bb; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 2px 0 16px rgba(26,31,54,0.07);
  transition: transform var(--transition);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c5cde0 transparent;
}
/* Sidebar scrollbar visible */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #c5cde0; border-radius: 2px; }

/* Brand + user pinned, nav scrolls, footer stays at bottom */
.sidebar-brand  { flex-shrink: 0; position: sticky; top: 0; z-index: 10; }
.sidebar-user   { flex-shrink: 0; }
.sidebar-nav    { flex: 1; padding: 10px 0 60px; }
.sidebar-footer { flex-shrink: 0; position: sticky; bottom: 0; z-index: 1; background: var(--bg-surface); border-top: 1px solid var(--border); padding: 12px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(135deg, var(--indigo) 0%, #6366f1 100%);
  flex-shrink: 0;
}
.brand-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.22);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 900;
  color: #fff; letter-spacing: -0.3px; flex: 1;
}
.sidebar-toggle-btn {
  background: rgba(255,255,255,0.18); border: none;
  color: #fff; cursor: pointer; font-size: 15px;
  padding: 5px 8px; border-radius: 6px; display: none;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #fafbff, #f5f7ff);
}
.user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; font-size: 16px; color: #fff;
  flex-shrink: 0; box-shadow: 0 3px 10px rgba(79,110,247,0.35);
}
.user-info { min-width: 0; }
.user-name { font-size: .85rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; color: var(--indigo); font-weight: 700; font-family: var(--font-mono); }
.user-dept { font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-group-label {
  font-size: .63rem; font-weight: 800; letter-spacing: .14em;
  color: var(--text-light); padding: 14px 20px 5px;
  text-transform: uppercase; font-family: var(--font-display);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin: 2px 8px;
  color: var(--text-secondary); text-decoration: none;
  font-size: .855rem; font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition); position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--indigo-light); color: var(--indigo);
  font-weight: 700; box-shadow: var(--shadow-xs);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -8px; top: 20%; bottom: 20%;
  width: 3px; background: var(--indigo);
  border-radius: 0 3px 3px 0;
}
.nav-icon  { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--red); color: #fff;
  font-size: .62rem; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; font-family: var(--font-mono);
}
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; background: var(--red-bg);
  border: 1.5px solid var(--red-border); color: var(--red);
  border-radius: var(--radius-sm); text-decoration: none;
  font-size: .82rem; font-weight: 700; transition: all var(--transition);
  font-family: var(--font-display);
}
.logout-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ── MAIN LAYOUT ── */
.main-wrapper { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 8px rgba(26,31,54,0.08);
}
.topbar-menu-btn {
  background: var(--bg-muted); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; font-size: 18px;
  padding: 5px 8px; border-radius: var(--radius-sm); display: none;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 800;
  color: var(--text-primary); letter-spacing: -0.2px;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-time {
  font-family: var(--font-mono); font-size: .78rem;
  color: var(--text-muted); background: var(--bg-muted);
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
}
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--text-secondary); }
.top-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px; color: #fff;
  box-shadow: 0 2px 8px rgba(79,110,247,0.3);
}
.topbar-logout {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-bg); border: 1.5px solid var(--red-border);
  border-radius: var(--radius-sm); color: var(--red);
  text-decoration: none; font-size: 16px; transition: all var(--transition);
}
.topbar-logout:hover { background: var(--red); color: #fff; }

.page-content { flex: 1; padding: 28px; max-width: 1700px; width: 100%; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 14px;
}
.page-header h1 {
  font-family: var(--font-display); font-size: 1.55rem;
  font-weight: 900; color: var(--text-primary); letter-spacing: -0.4px;
}
.page-header p { font-size: .84rem; color: var(--text-muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 16px; margin-bottom: 26px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-xs);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.blue::after   { background: linear-gradient(90deg, var(--indigo), var(--blue)); }
.stat-card.green::after  { background: linear-gradient(90deg, var(--green), #34d399); }
.stat-card.amber::after  { background: linear-gradient(90deg, var(--amber), var(--orange)); }
.stat-card.red::after    { background: linear-gradient(90deg, var(--red), #f87171); }
.stat-card.purple::after { background: linear-gradient(90deg, var(--purple), #a78bfa); }

.stat-icon   { font-size: 26px; margin-bottom: 12px; display: block; }
.stat-value  {
  font-family: var(--font-display); font-size: 1.9rem;
  font-weight: 900; color: var(--text-primary);
  line-height: 1; margin-bottom: 5px; letter-spacing: -0.6px;
}
.stat-label  {
  font-size: .71rem; color: var(--text-muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  font-family: var(--font-display);
}
.stat-sub    { font-size: .72rem; color: var(--text-muted); margin-top: 6px; font-family: var(--font-mono); }

/* ── CARDS ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 20px; box-shadow: var(--shadow-xs);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg-muted); flex-wrap: wrap; gap: 8px;
}
.card-title {
  font-family: var(--font-display); font-size: .95rem;
  font-weight: 800; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.data-table thead th {
  background: #f4f6fc; color: var(--text-secondary);
  font-weight: 700; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .08em; padding: 12px 16px; text-align: left;
  border-bottom: 2px solid var(--border); white-space: nowrap;
  font-family: var(--font-display);
}
.data-table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle; color: var(--text-primary); font-size: .855rem;
}
.data-table tbody tr:hover td { background: #f8f9ff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
  background: #f4f6fc; font-weight: 700; padding: 12px 16px;
  border-top: 2px solid var(--border); font-family: var(--font-mono);
  color: var(--text-primary);
}
.code-cell { font-family: var(--font-mono); font-size: .78rem; color: var(--indigo); font-weight: 600; }
.code-cell a { color: var(--indigo); text-decoration: none; }
.code-cell a:hover { text-decoration: underline; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: .69rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap; font-family: var(--font-display);
}
.badge-success   { background: var(--green-bg);   color: #065f46;    border: 1px solid var(--green-border); }
.badge-danger    { background: var(--red-bg);      color: #991b1b;    border: 1px solid var(--red-border); }
.badge-warning   { background: var(--amber-bg);   color: #92400e;    border: 1px solid var(--amber-border); }
.badge-info      { background: var(--blue-bg);     color: #1e40af;    border: 1px solid var(--blue-border); }
.badge-secondary { background: #f1f5f9;            color: var(--text-muted); border: 1px solid var(--border); }
.badge-l1        { background: var(--green-bg); color: #065f46; border: 1px solid var(--green-border); font-size: .72rem; padding: 4px 10px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; font-size: .85rem; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: all var(--transition);
  font-family: var(--font-display); line-height: 1.4; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: var(--indigo); color: #fff; border-color: var(--indigo); box-shadow: 0 2px 8px rgba(79,110,247,0.3); }
.btn-primary:hover  { background: var(--indigo-dark); box-shadow: var(--shadow-indigo); }
.btn-success  { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 8px rgba(16,185,129,0.25); }
.btn-success:hover  { background: #059669; }
.btn-danger   { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 2px 8px rgba(239,68,68,0.25); }
.btn-danger:hover   { background: #dc2626; }
.btn-warning  { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn-warning:hover  { background: #d97706; }
.btn-secondary{ background: var(--bg-surface); color: var(--text-secondary); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn-secondary:hover{ background: var(--bg-hover); color: var(--text-primary); border-color: #c5cde0; }
.btn-sm  { padding: 5px 12px; font-size: .78rem; }
.btn-xs  { padding: 3px 9px;  font-size: .72rem; }
.btn-group { display: flex; gap: 4px; }

/* ── FORMS ── */
.form-grid   { display: grid; gap: 18px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }

label {
  font-size: .72rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-display);
}
label .req { color: var(--red); margin-left: 2px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="tel"], input[type="url"], select, textarea {
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 9px 13px; font-size: .87rem; font-family: var(--font-body);
  width: 100%; transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-glow);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
input[readonly] { background: var(--bg-muted); opacity: .8; cursor: default; }
.form-hint  { font-size: .72rem; color: var(--text-muted); }
.form-error { font-size: .72rem; color: var(--red); font-weight: 600; }

.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 18px; padding: 16px 18px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.filter-bar .form-group { min-width: 150px; flex: 1; }

/* ── ALERTS ── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: .86rem; font-weight: 500; margin-bottom: 18px; border: 1.5px solid;
  animation: slideDown .2s ease;
}
@keyframes slideDown { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.alert-success { background: var(--green-bg); border-color: var(--green-border); color: #065f46; }
.alert-error, .alert-danger { background: var(--red-bg); border-color: var(--red-border); color: #991b1b; }
.alert-warning { background: var(--amber-bg); border-color: var(--amber-border); color: #92400e; }
.alert-info    { background: var(--blue-bg);  border-color: var(--blue-border);  color: #1e40af; }
.alert-icon    { font-size: 16px; flex-shrink: 0; }
.alert-close   { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; font-size: 18px; opacity: .6; line-height: 1; }

/* ── MODAL ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(26,31,54,0.45); z-index: 200;
  backdrop-filter: blur(3px); align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto;
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 900px; } .modal-xl { max-width: 1200px; }
@keyframes modalIn { from { transform: scale(.96) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border); background: var(--bg-muted);
}
.modal-title { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 22px; line-height: 1; transition: color var(--transition); }
.modal-close:hover { color: var(--red); }
.modal-body   { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--bg-muted); }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; gap: 2px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 20px; background: none; border: none; color: var(--text-muted);
  font-size: .85rem; font-weight: 700; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition); font-family: var(--font-display);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--indigo); border-bottom-color: var(--indigo); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* ── PROGRESS ── */
.progress-bar-wrap { background: var(--border-light); border-radius: 4px; height: 7px; overflow: hidden; width: 120px; }
.progress-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--indigo), var(--cyan)); transition: width .5s ease; }
.progress-label { font-size: .72rem; color: var(--text-muted); font-family: var(--font-mono); font-weight: 600; }

/* ── COMPARISON ── */
.compare-table thead th.vendor-col { background: var(--indigo-light); border-bottom: 2px solid var(--indigo); text-align: center; color: var(--indigo); }
.highlight-l1 { color: var(--green); font-weight: 700; }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -25px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--indigo); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--indigo-light); }
.timeline-date   { font-size: .72rem; color: var(--text-muted); font-family: var(--font-mono); }
.timeline-content{ font-size: .86rem; margin-top: 3px; }
.timeline-status { font-weight: 700; color: var(--text-primary); }
.timeline-user   { color: var(--text-secondary); }
.timeline-remark { color: var(--text-muted); font-style: italic; font-size: .8rem; margin-top: 2px; }

/* ── BANK TRANSACTIONS ── */
.txn-row-debit td  { border-left: 3px solid var(--red); }
.txn-amount-debit  { color: var(--red);   font-family: var(--font-mono); font-weight: 700; }
.txn-amount-credit { color: var(--green); font-family: var(--font-mono); font-weight: 700; }
.txn-ref { font-family: var(--font-mono); font-size: .76rem; color: var(--text-muted); }
.txn-mode-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .69rem; font-weight: 700; font-family: var(--font-display); }
.mode-NEFT   { background: var(--blue-bg);   color: #1e40af; border: 1px solid var(--blue-border); }
.mode-RTGS   { background: var(--purple-bg); color: #5b21b6; border: 1px solid var(--purple-border); }
.mode-Cheque { background: var(--amber-bg);  color: #92400e; border: 1px solid var(--amber-border); }
.mode-Cash   { background: var(--green-bg);  color: #065f46; border: 1px solid var(--green-border); }
.mode-UPI    { background: var(--red-bg);    color: #991b1b; border: 1px solid var(--red-border); }
.mode-IMPS   { background: var(--orange-bg); color: #9a3412; border: 1px solid #fed7aa; }
.mode-DD     { background: #f1f5f9;          color: var(--text-secondary); border: 1px solid var(--border); }
.balance-outstanding { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; color: var(--red); }
.balance-paid { font-family: var(--font-mono); font-weight: 700; color: var(--green); }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 16px 0 0; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--bg-surface); border: 1.5px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  text-decoration: none; font-size: .82rem; font-family: var(--font-mono);
  font-weight: 600; transition: all var(--transition); box-shadow: var(--shadow-xs);
}
.page-btn:hover { background: var(--indigo-light); color: var(--indigo); border-color: var(--indigo); }
.page-btn.active { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 700; }
.page-info { margin-left: 10px; font-size: .74rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── INFO GRID ── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.info-item { padding: 13px 16px; background: var(--bg-muted); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.info-item.full { grid-column: 1/-1; }
.info-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-family: var(--font-display); margin-bottom: 5px; }
.info-value { font-size: .9rem; color: var(--text-primary); font-weight: 500; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f4ff 50%, #faf5ff 100%);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(79,110,247,0.13) 0%, transparent 70%);
  top: -300px; right: -150px; border-radius: 50%;
}
.login-box { width: 100%; max-width: 420px; padding: 20px; position: relative; z-index: 1; }
.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 36px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon-wrap {
  width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--indigo) 0%, #818cf8 100%);
  border-radius: 18px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 28px;
  box-shadow: 0 8px 28px rgba(79,110,247,0.4);
}
.login-logo h1 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 900; color: var(--text-primary); letter-spacing: -0.5px; }
.login-logo p  { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }
.login-form    { display: flex; flex-direction: column; gap: 16px; }
.login-form .btn { padding: 11px; font-size: .92rem; justify-content: center; border-radius: 8px; }
.login-footer {
  text-align: center; margin-top: 22px; padding: 16px;
  background: var(--bg-muted); border-radius: 10px; border: 1px solid var(--border);
  font-size: .76rem; color: var(--text-secondary); line-height: 1.9;
}
.login-footer strong { color: var(--text-primary); display: block; margin-bottom: 4px; font-family: var(--font-display); font-size: .82rem; }

/* ── CHART ── */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { width: 100% !important; }

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: white; color: black; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    /* On mobile sidebar overlays and must scroll independently */
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(26,31,54,0.2);
  }
  /* Dim overlay when sidebar open */
  .sidebar.open::after {
    content: '';
    position: fixed;
    top: 0; left: var(--sidebar-w);
    right: 0; bottom: 0;
    background: rgba(26,31,54,0.4);
    z-index: -1;
  }
  .main-wrapper { margin-left: 0; }
  .topbar { left: 0; }
  .topbar-menu-btn { display: flex; }
  .sidebar-toggle-btn { display: block; }
  .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .data-table thead th, .data-table tbody td { padding: 9px 10px; }
}

/* ── UTILITIES ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.text-right   { text-align: right; } .text-center { text-align: center; }
.text-muted   { color: var(--text-muted) !important; }
.text-danger  { color: var(--red) !important; }
.text-success { color: var(--green) !important; }
.text-warning { color: var(--amber) !important; }
.text-info    { color: var(--blue) !important; }
.font-mono    { font-family: var(--font-mono) !important; }
.fw-bold      { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; gap: 8px; }
.gap-1        { gap: 8px; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.empty-state  { text-align: center; padding: 52px 20px; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: .35; display: block; }
.empty-state p { font-size: .9rem; color: var(--text-muted); }
