/* ==========================================================================
   SK Parking YMS - Modern Design Tokens & Shared Components
   Enhanced with contemporary micro-interactions, clean elevation,
   authentic WhatsApp branding, and polished typography.
   ========================================================================== */

:root {
  /* Colors */
  --bg: #F8FAFC;                 /* crisp modern slate canvas */
  --surface: #FFFFFF;            /* pure card surface */
  --ink: #0F172A;                /* deep executive slate - sidebar, primary buttons */
  --ink-soft: #334155;           /* body text */
  --text-muted: #64748B;          /* subtext and labels */
  --border: #E2E8F0;             /* clean subtle dividers */
  --border-light: #F1F5F9;

  /* Brand Accents */
  --accent-blue: #2563EB;
  --accent-blue-light: #EFF6FF;

  /* WhatsApp Brand Colors */
  --whatsapp: #25D366;           /* authentic WhatsApp green */
  --whatsapp-dark: #128C7E;
  --whatsapp-hover: #20BA5A;
  --whatsapp-tint: #ECFDF5;
  --whatsapp-border: #A7F3D0;

  /* Status Accents (WCAG AA Compliant) */
  --accent-amber: #92400E;       /* status: in_yard / warnings */
  --accent-amber-bg: #FEF3C7;
  --accent-amber-border: #FDE68A;

  --accent-teal: #065F46;        /* status: released / success */
  --accent-teal-bg: #D1FAE5;
  --accent-teal-border: #A7F3D0;

  --accent-brick: #991B1B;       /* status: overdue / danger / delete */
  --accent-brick-bg: #FEE2E2;
  --accent-brick-border: #FECACA;

  /* Typography */
  --font-heading: "Plus Jakarta Sans", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", "Courier New", monospace;

  /* Geometry & Shadows */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--ink);
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #1D4ED8;
}

/* ---------- App Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  color: #E2E8F0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
  padding: 22px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
}
.sidebar-brand small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  color: #94A3B8;
  font-size: 11px;
  margin-top: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.sidebar-brand small::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #94A3B8;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.sidebar-nav li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transform: translateX(2px);
}
.sidebar-nav li a.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.28) 0%, rgba(37, 99, 235, 0.1) 100%);
  color: #FFFFFF;
  font-weight: 600;
  border-left: 3px solid #38BDF8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.sidebar-nav .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1.3;
  margin-left: auto;
}
.nav-badge.badge-warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}
.nav-badge.badge-danger {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}


.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Top Bar ---------- */
.topbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.topbar .who {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .who strong {
  color: var(--ink);
  font-weight: 600;
}
.topbar .role-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #DBEAFE;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.hamburger:hover {
  background: #F1F5F9;
}

.content {
  padding: 28px;
  flex: 1;
}

/* ---------- App Footer ---------- */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 28px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.app-footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.app-footer a {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.app-footer a:hover {
  color: #1D4ED8;
  text-decoration: underline;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.split-grid-wide {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  margin-top: 6px;
}
.split-grid-even {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Stat Cards */
.stat-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid #3B82F6;
  border-radius: var(--radius);
  padding: 20px 22px;
}
.stat-card:nth-child(2) { border-top-color: #10B981; }
.stat-card:nth-child(3) { border-top-color: #F59E0B; }
.stat-card:nth-child(4) { border-top-color: #8B5CF6; }
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
  line-height: 1.1;
  font-feature-settings: "tnum";
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.08);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #0F172A 0%, #020617 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.btn-secondary {
  background: var(--surface);
  color: #1E293B;
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  color: #0F172A;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

.btn-danger {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}
.btn-danger:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}
.btn-icon {
  padding: 6px 9px;
  line-height: 0;
}

/* Focus Outline */
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* ---------- WhatsApp Buttons & Icon (Vibrant Authentic Green) ---------- */
.whatsapp-icon {
  color: var(--whatsapp);
  fill: currentColor;
  transition: transform 0.2s ease;
}

/* Primary WhatsApp intimation button (e.g. in inward_view.php) */
.whatsapp-btn,
.btn-whatsapp {
  background: linear-gradient(180deg, #25D366 0%, #1EBE5D 100%) !important;
  color: #FFFFFF !important;
  border-color: #1DA851 !important;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
  font-weight: 600;
}
.whatsapp-btn:hover,
.btn-whatsapp:hover {
  background: linear-gradient(180deg, #28E06E 0%, #20BA5A 100%) !important;
  color: #FFFFFF !important;
  border-color: #199E4A !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}
.whatsapp-btn svg,
.btn-whatsapp svg {
  fill: #FFFFFF !important;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

/* Secondary / icon-only in tables (e.g. inventory.php table actions) */
.btn-secondary.whatsapp-btn {
  background: #ECFDF5 !important;
  color: #047857 !important;
  border-color: #A7F3D0 !important;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.1);
}
.btn-secondary.whatsapp-btn svg {
  fill: #10B981 !important;
}
.btn-secondary.whatsapp-btn:hover {
  background: linear-gradient(180deg, #25D366 0%, #1EBE5D 100%) !important;
  color: #FFFFFF !important;
  border-color: #1DA851 !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  transform: translateY(-1.5px);
}
.btn-secondary.whatsapp-btn:hover svg {
  fill: #FFFFFF !important;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}
input[type=text], input[type=password], input[type=email], input[type=date], input[type=tel], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=date]:focus, input[type=tel]:focus, input[type=number]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
textarea { resize: vertical; min-height: 75px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox-row input { width: auto; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.table-scroll-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  text-align: left;
  padding: 12px 16px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: #334155;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background 0.15s ease;
}
tbody tr:hover {
  background: #F8FAFC;
}
.table-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Vehicle Photo Upload/Gallery ---------- */
.photo-preview { margin-top: 8px; }
.photo-preview-box {
  position: relative;
  width: 100%;
  max-width: 180px;
  height: 120px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #F1F5F9;
}
.photo-preview-box img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.photo-thumb-box {
  position: relative;
  width: 100%;
  height: 115px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #F1F5F9;
  display: block;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.photo-thumb-box:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-card);
}
.photo-thumb-box img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.photo-caption {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 5px;
  text-transform: capitalize;
  font-weight: 500;
}
.photo-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1.5px solid #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s ease, transform 0.1s ease;
  padding: 0;
  text-decoration: none;
}
.photo-remove-btn:hover {
  background: #DC2626;
  color: #fff;
  transform: scale(1.1);
}

.photo-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  gap: 4px;
}
.photo-caption-bar .photo-caption {
  margin-top: 0;
  text-align: left;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-dl-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover, #F1F5F9);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 11px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.photo-dl-icon-btn:hover {
  background: var(--primary, #0D9488);
  color: #fff;
  border-color: var(--primary, #0D9488);
  text-decoration: none;
}
.photo-thumb-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}
.photo-thumb-dl-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  text-decoration: none;
  z-index: 5;
  transition: all 0.15s ease;
  line-height: 1;
}
.photo-thumb-dl-badge:hover {
  background: var(--primary, #0D9488);
  color: #fff;
  transform: scale(1.1);
  text-decoration: none;
}


/* ---------- Plate Badge (Authentic HSRP Registration Plate) ---------- */
.plate-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border: 1.5px solid #1E293B;
  border-radius: 5px;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  line-height: 1.3;
}
.plate-badge::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 11px;
  background: #2563EB;
  border-radius: 1px;
  margin-right: 6px;
}

/* ---------- Status Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.pill-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}
.pill-amber::before {
  background: #D97706;
}

.pill-teal {
  background: var(--accent-teal-bg);
  color: var(--accent-teal);
  border: 1px solid var(--accent-teal-border);
}
.pill-teal::before {
  background: #10B981;
}

.pill-brick {
  background: var(--accent-brick-bg);
  color: var(--accent-brick);
  border: 1px solid var(--accent-brick-border);
}
.pill-brick::before {
  background: #EF4444;
}

.pill-muted {
  background: #F1F5F9;
  color: var(--text-muted);
  border: 1px solid #E2E8F0;
}
.pill-muted::before {
  background: #94A3B8;
}

/* ---------- Flash Messages ---------- */
.flash {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-sm);
}
.flash-success {
  background: var(--accent-teal-bg);
  color: var(--accent-teal);
  border-left-color: #10B981;
}
.flash-error {
  background: var(--accent-brick-bg);
  color: var(--accent-brick);
  border-left-color: #EF4444;
}
.flash-info {
  background: #EFF6FF;
  color: #1E40AF;
  border-left-color: #3B82F6;
}

/* ---------- Login Page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1E293B 0%, #0F172A 100%);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 38px 34px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.login-card .brand {
  text-align: center;
  margin-bottom: 26px;
}
.login-card .brand h1 {
  font-family: var(--font-heading);
  font-size: 22px;
  margin-bottom: 4px;
  color: var(--ink);
}
.login-card .brand span {
  font-size: 12.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 11px 18px;
  font-size: 14.5px;
}
.login-hint {
  margin-top: 20px;
  padding: 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.login-footer a {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
}
.login-footer a:hover {
  text-decoration: underline;
}

/* ---------- Simple Bar Chart (Bank-wise distribution etc.) ---------- */
.barchart { display: flex; flex-direction: column; gap: 12px; }
.barchart-row {
  display: grid;
  grid-template-columns: 140px 1fr 36px;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}
.barchart-label {
  color: var(--ink-soft);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barchart-track {
  background: #E2E8F0;
  border-radius: 100px;
  height: 9px;
  overflow: hidden;
}
.barchart-fill {
  background: linear-gradient(90deg, #2563EB 0%, #3B82F6 100%);
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
}
.barchart-value {
  text-align: right;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #CBD5E1;
  color: var(--ink);
  background: var(--surface);
  transition: all 0.15s ease;
}
.pagination a:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  transform: translateY(-1px);
}
.pagination .active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}
.pagination .disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--bg);
}
.pagination .ellipsis {
  border: none;
  background: transparent;
  min-width: 24px;
  color: var(--text-muted);
}

/* ---------- Dropdown Menu ---------- */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 100;
}
.dropdown.open .dropdown-menu {
  display: block;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.dropdown-item:hover {
  background: #F1F5F9;
  color: var(--ink);
}
.dropdown-item .icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 5px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .content { padding: 16px; }
  .split-grid-wide, .split-grid-even { grid-template-columns: 1fr; }

  .table-wrap { position: relative; }
  .table-wrap::after {
    content: "Swipe left/right to see more \2192";
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    padding: 7px 14px;
    background: #F8FAFC;
    border-top: 1px solid var(--border);
  }

  .app-footer {
    padding: 14px 16px;
  }
  .app-footer .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
