/* ============================================================
   VYAPAARBOOK — Professional Design System v3
   Light + Dark mode | Inter font | Indigo brand
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────
   LIGHT THEME TOKENS
───────────────────────────────────────────── */
:root {
  /* Brand */
  --vb-brand-50:   #EEF2FF;
  --vb-brand-100:  #E0E7FF;
  --vb-brand-500:  #6366F1;
  --vb-brand-600:  #4F46E5;
  --vb-brand-700:  #4338CA;
  --vb-brand-glow: rgba(99,102,241,.18);

  /* Page bg */
  --vb-bg:        #F0F2F8;

  /* Surfaces */
  --vb-surface:   #FFFFFF;
  --vb-surface-2: #F7F8FC;
  --vb-surface-3: #EEF0F7;

  /* Sidebar */
  --vb-sb-bg:           #1E1B4B;
  --vb-sb-bg-deep:      #17154A;
  --vb-sb-text:         #DBE2FF;
  --vb-sb-text-hover:   #FFFFFF;
  --vb-sb-active-bg:    rgba(129,140,248,.28);
  --vb-sb-active-text:  #E0E7FF;
  --vb-sb-active-dot:   #818CF8;
  --vb-sb-border:       rgba(129,140,248,.15);
  --vb-sb-section:      #A5B4FC;

  /* Text */
  --vb-text:       #111827;
  --vb-text-2:     #374151;
  --vb-text-muted: #6B7280;
  --vb-text-hint:  #9CA3AF;

  /* Borders */
  --vb-border:       rgba(17,24,39,.09);
  --vb-border-md:    rgba(17,24,39,.14);
  --vb-border-focus: #6366F1;

  /* Semantic */
  --vb-success:        #059669; --vb-success-light: #ECFDF5; --vb-success-border: #A7F3D0;
  --vb-warning:        #D97706; --vb-warning-light: #FFFBEB; --vb-warning-border: #FDE68A;
  --vb-danger:         #DC2626; --vb-danger-light:  #FEF2F2; --vb-danger-border:  #FECACA;
  --vb-info:           #2563EB; --vb-info-light:    #EFF6FF; --vb-info-border:    #BFDBFE;

  /* Aliases for backwards compat */
  --vb-success-bg: var(--vb-success-light);
  --vb-warning-bg: var(--vb-warning-light);
  --vb-danger-bg:  var(--vb-danger-light);
  --vb-info-bg:    var(--vb-info-light);
  --vb-success-border: var(--vb-success-border);
  --vb-warning-border: var(--vb-warning-border);
  --vb-danger-border:  var(--vb-danger-border);
  --vb-info-border:    var(--vb-info-border);

  /* Radii */
  --vb-r-xs: 4px;
  --vb-r-sm: 8px;
  --vb-r-md: 10px;
  --vb-r-lg: 14px;
  --vb-r-xl: 20px;

  /* Aliases */
  --vb-radius-sm: var(--vb-r-sm);
  --vb-radius-md: var(--vb-r-md);
  --vb-radius-lg: var(--vb-r-lg);
  --vb-radius-xl: var(--vb-r-xl);

  /* Shadows */
  --vb-sh-xs: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --vb-sh-sm: 0 2px 8px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
  --vb-sh-md: 0 4px 16px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05);
  --vb-sh-lg: 0 12px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.05);
  --vb-shadow-xs: var(--vb-sh-xs);
  --vb-shadow-sm: var(--vb-sh-sm);
  --vb-shadow-md: var(--vb-sh-md);
  --vb-shadow-lg: var(--vb-sh-lg);

  /* Layout */
  --vb-sidebar-w: 48px;
  --vb-sidebar-expanded-w: 232px;
  --vb-topbar-h:  44px;
  --vb-focus-ring: 0 0 0 3px rgba(99,102,241,.18);

  /* Typography */
  --vb-font:       'Plus Jakarta Sans','Inter','Segoe UI',system-ui,sans-serif;
  --vb-font-mono:  'JetBrains Mono','Fira Code','Consolas',monospace;
  --vb-font-size:  14px;
  --vb-line-height: 1.65;
  --vb-transition: 0.16s cubic-bezier(.4,0,.2,1);

  /* Amount colors */
  --vb-amt-pos:      #059669;
  --vb-amt-pos-bg:   rgba(5,150,105,.08);
  --vb-amt-neg:      #DC2626;
  --vb-amt-neg-bg:   rgba(220,38,38,.08);
  --vb-amt-neutral:  var(--vb-text-muted);

  /* Skeleton */
  --vb-skeleton-base: rgba(17,24,39,.06);
  --vb-skeleton-shine: rgba(17,24,39,.02);
}

/* ─────────────────────────────────────────────
   DARK THEME — rich, deep, true dark
───────────────────────────────────────────── */
[data-theme="dark"] {
  /* Brand shifts lighter in dark */
  --vb-brand-500:  #818CF8;
  --vb-brand-600:  #6366F1;
  --vb-brand-glow: rgba(129,140,248,.15);

  /* Page bg — true deep dark, not grey */
  --vb-bg:        #080C14;

  /* Surfaces — layered dark blues */
  --vb-surface:   #0E1525;
  --vb-surface-2: #141E30;
  --vb-surface-3: #1A2540;

  /* Sidebar — even deeper */
  --vb-sb-bg:           #0F172A;
  --vb-sb-bg-deep:      #0B1120;
  --vb-sb-text:         #CBD5E1;
  --vb-sb-text-hover:   #FFFFFF;
  --vb-sb-active-bg:    rgba(148,163,184,.15);
  --vb-sb-active-text:  #F1F5F9;
  --vb-sb-active-dot:   #94A3B8;
  --vb-sb-border:       rgba(255,255,255,.08);
  --vb-sb-section:      #475569;

  /* Text — crisp whites, not full white */
  --vb-text:       #E8EDF5;
  --vb-text-2:     #C5CDD8;
  --vb-text-muted: #5A6A84;
  --vb-text-hint:  #3A4A5C;

  /* Borders — subtle blue-tinted dark */
  --vb-border:     rgba(100,130,200,.1);
  --vb-border-md:  rgba(100,130,200,.16);
  --vb-border-focus: #818CF8;

  /* Semantic — vibrant in dark for readability */
  --vb-success:        #34D399; --vb-success-light: #022C22; --vb-success-border: #065F46;
  --vb-warning:        #FBBF24; --vb-warning-light: #1C1200; --vb-warning-border: #78350F;
  --vb-danger:         #F87171; --vb-danger-light:  #1A0808; --vb-danger-border:  #7F1D1D;
  --vb-info:           #60A5FA; --vb-info-light:    #071428; --vb-info-border:    #1E3A5F;

  --vb-success-bg: var(--vb-success-light);
  --vb-warning-bg: var(--vb-warning-light);
  --vb-danger-bg:  var(--vb-danger-light);
  --vb-info-bg:    var(--vb-info-light);

  /* Shadows stronger in dark */
  --vb-sh-xs: 0 1px 3px rgba(0,0,0,.4);
  --vb-sh-sm: 0 2px 8px rgba(0,0,0,.5);
  --vb-sh-md: 0 6px 24px rgba(0,0,0,.6);
  --vb-sh-lg: 0 16px 48px rgba(0,0,0,.7);
}

/* ─────────────────────────────────────────────
   BASE RESET
───────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--vb-font-size); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--vb-font);
  background: var(--vb-bg);
  color: var(--vb-text);
  line-height: var(--vb-line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--vb-transition), color var(--vb-transition);
}
a { color: var(--vb-brand-500); text-decoration: none; }
a:hover { text-decoration: none; }

/* ─────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────── */
.vb-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.vb-sidebar {
  width: var(--vb-sidebar-w);
  background: var(--vb-sb-bg);
  background-image: linear-gradient(180deg, var(--vb-sb-bg) 0%, var(--vb-sb-bg-deep) 100%);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: visible;
  border-right: 1px solid var(--vb-sb-border);
  transition: width .22s cubic-bezier(.4,0,.2,1),
              transform .22s cubic-bezier(.4,0,.2,1);
  will-change: width;
}

/* Expanded state — driven purely by CSS attribute selector */
.vb-sidebar[data-expanded="true"] {
  width: var(--vb-sidebar-expanded-w);
}

.vb-sidebar-brand {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--vb-sb-border);
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  border-radius: var(--vb-r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.brand-icon i { font-size: 19px; color: #fff; }
.brand-name {
  font-size: 15px; font-weight: 700;
  color: #fff; letter-spacing: -.4px; line-height: 1.2;
}
.brand-tag {
  font-size: 11px; color: #A5B4FC;
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 150px;
}

.vb-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.vb-nav::-webkit-scrollbar { width: 4px; }
.vb-nav::-webkit-scrollbar-track { background: transparent; }
.vb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.vb-nav-section {
  padding: 16px 16px 5px;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--vb-sb-section);
}
.vb-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 13px;
  margin: 1px 8px;
  color: var(--vb-sb-text);
  font-size: 13.5px; font-weight: 500;
  border-radius: var(--vb-r-sm);
  transition: background var(--vb-transition), color var(--vb-transition);
  position: relative;
  letter-spacing: .01em;
}
.vb-nav a:hover {
  background: rgba(255,255,255,.07);
  color: var(--vb-sb-text-hover);
}
.vb-nav a.active {
  background: var(--vb-sb-active-bg);
  color: var(--vb-sb-active-text);
  font-weight: 600;
}
.vb-nav a.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 6px; bottom: 6px;
  width: 3px;
  background: #818CF8;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px rgba(129,140,248,.7);
}
.vb-nav a i { font-size: 17px; flex-shrink: 0; opacity: .85; }
.vb-nav a.active i { opacity: 1; color: var(--vb-sb-active-dot); }
.vb-nav a:hover i { opacity: 1; }

.vb-sidebar-footer {
  padding: 10px 8px 14px;
  border-top: 1px solid var(--vb-sb-border);
  display: flex; flex-direction: column; gap: 1px;
}
.vb-sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  color: #A5B4FC; font-size: 12.5px; font-weight: 500;
  padding: 7px 10px;
  border-radius: var(--vb-r-sm);
  transition: background var(--vb-transition), color var(--vb-transition);
}
.vb-sidebar-footer a:hover {
  background: rgba(129,140,248,.15);
  color: #EEF2FF;
}
.vb-sidebar-footer a i { font-size: 16px; }

/* ── Main area ── */
.vb-main {
  margin-left: var(--vb-sidebar-w);
  transition: margin-left .22s cubic-bezier(.4,0,.2,1);
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}

/* ── Topbar ── */
.vb-topbar {
  height: var(--vb-topbar-h);
  background: var(--vb-surface);
  border-bottom: 1px solid var(--vb-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
[data-theme="dark"] .vb-topbar {
  background: rgba(10,15,30,.92);
  border-bottom-color: rgba(255,255,255,.07);
}

.vb-topbar-title {
  font-size: 15px; font-weight: 600;
  color: var(--vb-text); letter-spacing: -.3px;
}

.vb-topbar-actions { display: flex; align-items: center; gap: 6px; }

/* Icon buttons */
.vb-icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--vb-r-sm);
  cursor: pointer;
  color: var(--vb-text-muted); font-size: 17px;
  transition: background var(--vb-transition), color var(--vb-transition);
}
.vb-icon-btn:hover {
  background: var(--vb-surface-2);
  color: var(--vb-text);
}

/* User chip — avatar style */
.vb-user-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--vb-text);
  padding: 4px 12px 4px 4px;
  border-radius: 20px;
  background: var(--vb-surface-2);
  border: 1px solid var(--vb-border);
  cursor: default;
  transition: background var(--vb-transition);
}
.vb-user-chip:hover { background: var(--vb-surface-3); }
.vb-user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vb-brand-500), var(--vb-brand-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.vb-user-chip i { font-size: 16px; color: var(--vb-brand-500); }

/* Topbar divider between actions */
.vb-topbar-sep {
  width: 1px; height: 20px;
  background: var(--vb-border);
  margin: 0 4px;
}

/* ── Page content ── */
.vb-page { padding: 14px 20px; flex: 1; }

/* ─────────────────────────────────────────────
   CARDS
───────────────────────────────────────────── */
.vb-card {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-lg);
  box-shadow: var(--vb-sh-sm);
  transition: box-shadow var(--vb-transition);
}
[data-theme="dark"] .vb-card {
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  border-color: var(--vb-border);
}

.vb-card-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--vb-border);
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--vb-text);
  background: transparent;
  border-radius: var(--vb-r-lg) var(--vb-r-lg) 0 0;
  gap: 10px;
}
[data-theme="dark"] .vb-card-header { background: transparent; }

.vb-card-body { padding: 20px; }

/* ─────────────────────────────────────────────
   STAT CARDS
───────────────────────────────────────────── */
.vb-stat {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-lg);
  padding: 18px 20px;
  box-shadow: var(--vb-sh-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--vb-transition), box-shadow var(--vb-transition);
}
.vb-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--vb-sh-md);
}
.vb-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--vb-brand-500), var(--vb-brand-600));
  opacity: .7;
}
[data-theme="dark"] .vb-stat {
  background: var(--vb-surface);
  border-color: var(--vb-border);
  box-shadow: 0 2px 16px rgba(0,0,0,.45);
}
.vb-stat-label {
  font-size: 11px; font-weight: 600;
  color: var(--vb-text-muted);
  margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .06em;
}
.vb-stat-value {
  font-size: 22px; font-weight: 700;
  color: var(--vb-text);
  letter-spacing: -.5px; line-height: 1;
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.vb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px;
  border-radius: var(--vb-r-sm);
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--vb-transition);
  white-space: nowrap;
  line-height: 1.4;
  font-family: var(--vb-font);
  letter-spacing: -.1px;
}
.vb-btn i { font-size: 15px; }

.vb-btn-primary {
  background: var(--vb-brand-500);
  color: #fff;
  border-color: var(--vb-brand-600);
  box-shadow: 0 1px 4px var(--vb-brand-glow), 0 1px 2px rgba(0,0,0,.1);
}
.vb-btn-primary:hover {
  background: var(--vb-brand-600);
  color: #fff;
  box-shadow: 0 3px 10px var(--vb-brand-glow), 0 1px 4px rgba(0,0,0,.15);
  transform: translateY(-1px);
}
.vb-btn-primary:active { transform: translateY(0); box-shadow: none; }

.vb-btn-outline {
  background: var(--vb-surface);
  color: var(--vb-text-muted);
  border-color: var(--vb-border-md);
}
.vb-btn-outline:hover {
  background: var(--vb-surface-2);
  color: var(--vb-text);
  border-color: var(--vb-text-muted);
}
[data-theme="dark"] .vb-btn-outline {
  background: var(--vb-surface-2);
  border-color: var(--vb-border-md);
}
[data-theme="dark"] .vb-btn-outline:hover {
  background: var(--vb-surface-3);
  color: var(--vb-text);
}

.vb-btn-danger { background: var(--vb-danger); color: #fff; border-color: var(--vb-danger); }
.vb-btn-danger:hover { opacity: .88; color: #fff; transform: translateY(-1px); }

.vb-btn-sm  { padding: 5px 10px; font-size: 12px; }
.vb-btn-sm i { font-size: 13px; }
.vb-btn-lg  { padding: 10px 22px; font-size: 14px; }
.vb-btn-lg i { font-size: 16px; }

/* ─────────────────────────────────────────────
   FORMS
───────────────────────────────────────────── */
.vb-form-group { margin-bottom: 16px; }

.vb-label {
  display: block;
  font-size: 11.5px; font-weight: 600;
  color: var(--vb-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}

.vb-input, .vb-select, .vb-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--vb-border-md);
  border-radius: var(--vb-r-sm);
  background: var(--vb-surface);
  color: var(--vb-text);
  font-size: 14px;
  font-family: var(--vb-font);
  line-height: 1.5;
  transition: border-color var(--vb-transition), box-shadow var(--vb-transition), background var(--vb-transition);
  outline: none;
}
[data-theme="dark"] .vb-input,
[data-theme="dark"] .vb-select,
[data-theme="dark"] .vb-textarea {
  background: var(--vb-surface-2);
  border-color: var(--vb-border-md);
  color: var(--vb-text);
}
.vb-input:focus, .vb-select:focus, .vb-textarea:focus {
  border-color: var(--vb-border-focus);
  box-shadow: 0 0 0 3px var(--vb-brand-glow);
  background: var(--vb-surface);
}
[data-theme="dark"] .vb-input:focus,
[data-theme="dark"] .vb-select:focus,
[data-theme="dark"] .vb-textarea:focus {
  background: var(--vb-surface-2);
}
.vb-input:hover:not(:focus),
.vb-select:hover:not(:focus),
.vb-textarea:hover:not(:focus) {
  border-color: var(--vb-text-hint);
}
.vb-input::placeholder { color: var(--vb-text-hint); }
.vb-textarea { resize: vertical; min-height: 72px; }
.vb-select {
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px !important;
}
.vb-select:focus-visible {
  border-color: var(--vb-brand-500) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
  outline: none;
}

/* ─────────────────────────────────────────────
   TABLES — Premium unified style
───────────────────────────────────────────── */

/* Card wrapper */
.vb-table-card {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 14px;
  box-shadow: var(--vb-sh-sm);
  overflow: hidden;
}
.vb-table-card > div { overflow-x: auto; }

/* Table base */
.vb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

/* Header */
.vb-table thead tr {
  background: linear-gradient(
    to bottom,
    rgba(99,102,241,.04),
    rgba(99,102,241,.01)
  );
}
[data-theme="dark"] .vb-table thead tr {
  background: linear-gradient(
    to bottom,
    rgba(129,140,248,.06),
    rgba(129,140,248,.02)
  );
}
.vb-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--vb-text-muted);
  border-bottom: 1px solid var(--vb-border);
  white-space: nowrap;
  user-select: none;
}
.vb-table th:first-child { padding-left: 20px; }
.vb-table th:last-child  { padding-right: 20px; }

/* Rows */
.vb-table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,.04);
  transition: background var(--vb-transition);
}
[data-theme="dark"] .vb-table tbody tr {
  border-bottom-color: rgba(255,255,255,.04);
}
.vb-table tbody tr:last-child { border-bottom: none; }
.vb-table tbody tr:hover { background: rgba(99,102,241,.03); }
[data-theme="dark"] .vb-table tbody tr:hover { background: rgba(129,140,248,.05); }

/* Cells */
.vb-table td {
  padding: 11px 16px;
  color: var(--vb-text);
  vertical-align: middle;
  font-size: 13.5px;
}
.vb-table td:first-child { padding-left: 20px; }
.vb-table td:last-child  { padding-right: 20px; }

/* Text alignment helpers */
.vb-table .text-right,
.vb-table th.text-right { text-align: right; }
.vb-table .text-center  { text-align: center; }

/* Muted cell */
.vb-table .td-muted { color: var(--vb-text-muted); font-size: 13px; }

/* Action buttons in table */
.tbl-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}
.tbl-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  font-size: 16px;
  color: var(--vb-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--vb-font);
  transition: background .13s, color .13s;
}
.tbl-action-btn:hover           { background: var(--vb-surface-2); color: var(--vb-text); }
.tbl-action-btn.success:hover   { background: rgba(5,150,105,.1);  color: var(--vb-success); }
.tbl-action-btn.warning:hover   { background: rgba(217,119,6,.1);  color: var(--vb-warning); }
.tbl-action-btn.danger:hover    { background: rgba(220,38,38,.1);  color: var(--vb-danger);  }

/* Empty state inside table */
.vb-table .tbl-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--vb-text-muted);
}
.vb-table .tbl-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
  opacity: .5;
}
.vb-table .tbl-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--vb-text);
  margin-bottom: 5px;
}
.vb-table .tbl-empty-sub {
  font-size: 13px;
  margin-bottom: 16px;
}

/* Mobile */
@media (max-width: 768px) {
  .vb-table th:first-child,
  .vb-table td:first-child { padding-left: 14px; }
  .vb-table th:last-child,
  .vb-table td:last-child  { padding-right: 14px; }
  .vb-table th,
  .vb-table td             { padding-top: 9px; padding-bottom: 9px; }
}

/* ─────────────────────────────────────────────
   BADGES
───────────────────────────────────────────── */
.vb-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap; letter-spacing: .01em;
}
.vb-badge-success { background: var(--vb-success-light); color: var(--vb-success); border: 1px solid var(--vb-success-border); }
.vb-badge-warning { background: var(--vb-warning-light); color: var(--vb-warning); border: 1px solid var(--vb-warning-border); }
.vb-badge-danger  { background: var(--vb-danger-light);  color: var(--vb-danger);  border: 1px solid var(--vb-danger-border); }
.vb-badge-info    { background: var(--vb-info-light);    color: var(--vb-info);    border: 1px solid var(--vb-info-border); }

/* ─────────────────────────────────────────────
   ALERTS
───────────────────────────────────────────── */
.vb-alert {
  padding: 11px 15px;
  border-radius: var(--vb-r-sm);
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
  line-height: 1.55;
  border-left: 3px solid;
}
.vb-alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.vb-alert-danger  { background: var(--vb-danger-light);  color: var(--vb-danger);  border-color: var(--vb-danger);  border: 1px solid var(--vb-danger-border); border-left: 3px solid var(--vb-danger); }
.vb-alert-success { background: var(--vb-success-light); color: var(--vb-success); border: 1px solid var(--vb-success-border); border-left: 3px solid var(--vb-success); }
.vb-alert-warning { background: var(--vb-warning-light); color: var(--vb-warning); border: 1px solid var(--vb-warning-border); border-left: 3px solid var(--vb-warning); }
.vb-alert-info    { background: var(--vb-info-light);    color: var(--vb-info);    border: 1px solid var(--vb-info-border);    border-left: 3px solid var(--vb-info); }

/* ─────────────────────────────────────────────
   LOGIN PAGE
───────────────────────────────────────────── */
.vb-login-bg {
  min-height: 100vh;
  background: var(--vb-bg);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.vb-login-bg::before {
  content: '';
  position: absolute;
  top: -30%; left: -10%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse, rgba(99,102,241,.07) 0%, transparent 70%);
  pointer-events: none;
}
.vb-login-bg::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 50%; height: 70%;
  background: radial-gradient(ellipse, rgba(99,102,241,.05) 0%, transparent 70%);
  pointer-events: none;
}
[data-theme="dark"] .vb-login-bg::before {
  background: radial-gradient(ellipse, rgba(99,102,241,.12) 0%, transparent 70%);
}

.vb-login-card {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border-md);
  border-radius: var(--vb-r-xl);
  box-shadow: var(--vb-sh-lg);
  width: 100%; max-width: 400px;
  padding: 40px 36px;
  position: relative; z-index: 1;
}
[data-theme="dark"] .vb-login-card {
  box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  background: var(--vb-surface);
}

.vb-login-logo { text-align: center; margin-bottom: 32px; }
.vb-login-logo .logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--vb-brand-500), var(--vb-brand-700));
  border-radius: var(--vb-r-lg);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px var(--vb-brand-glow);
}
.vb-login-logo .logo-icon i { font-size: 30px; color: #fff; }
.vb-login-logo .logo-name {
  font-size: 23px; font-weight: 800;
  color: var(--vb-text); letter-spacing: -.6px;
}
.vb-login-logo .logo-tag {
  font-size: 13px; color: var(--vb-text-muted); margin-top: 4px;
}

/* ─────────────────────────────────────────────
   MOBILE
───────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Sidebar drawer ── */
  .vb-sidebar {
    left: auto !important;
    right: 0 !important;
    top: 0 !important; bottom: 0 !important;
    width: 280px !important;
    transform: translateX(110%) !important;
    transition: transform .28s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: none;
    z-index: 300;
    overflow: hidden !important;
    border-radius: 0 !important;
  }
  .vb-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: -6px 0 40px rgba(0,0,0,.4) !important;
  }

  /* ── Brand ── */
  .vb-sidebar .rail-brand {
    height: 64px !important;
    padding: 0 16px !important;
    justify-content: flex-start !important;
    gap: 12px !important;
  }
  .vb-sidebar .rail-brand-text { display: block !important; }
  .vb-sidebar .rail-app-name   { opacity: 1 !important; font-size: 15px !important; }
  .vb-sidebar .rail-firm-name  { opacity: 1 !important; font-size: 11px !important; }

  /* Pin button hide, close button show */
  .vb-sidebar .rail-toggle-btn { display: none !important; }
  .vb-sidebar .rail-close-btn  { display: flex !important; }

  /* Edge pill hide */
  .vb-sidebar .rail-edge-pill { display: none !important; }

  /* ── Nav items — bigger touch targets ── */
  .vb-sidebar .rail-item {
    width: auto !important;
    height: 48px !important;
    margin: 2px 8px !important;
    padding: 0 16px !important;
    justify-content: flex-start !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }
  .vb-sidebar .rail-icon {
    width: 24px !important;
    font-size: 20px !important;
  }

  /* ── Group heads — section labels (no accordion on mobile) ── */
  .vb-sidebar .rail-group-head {
    height: 32px !important;
    width: auto !important;
    margin: 10px 8px 2px !important;
    padding: 0 16px !important;
    justify-content: flex-start !important;
    background: transparent !important;
    pointer-events: none !important;
    cursor: default !important;
    font-size: 10px !important;
    letter-spacing: .1em !important;
  }
  /* Show section label text, hide icon and arrow */
  .vb-sidebar .rail-group-head .rail-icon   { display: none !important; }
  .vb-sidebar .rail-group-head .rail-label  { opacity: 1 !important; display: block !important; }
  .vb-sidebar .rail-group-arrow             { display: none !important; }
  .vb-sidebar .rail-group-head .rail-tooltip{ display: none !important; }

  /* ── Group body — always visible on mobile ── */
  .vb-sidebar .rail-group-body {
    max-height: none !important;
    overflow: visible !important;
  }

  /* ── Sub-items — slight indent ── */
  .vb-sidebar .rail-sub {
    width: auto !important;
    padding: 0 16px 0 20px !important;
    margin: 2px 8px !important;
    height: 44px !important;
    justify-content: flex-start !important;
  }
  .vb-sidebar .rail-sub .rail-icon { font-size: 17px !important; }

  /* Show labels */
  .vb-sidebar .rail-label { opacity: 1 !important; }

  /* ── Footer items ── */
  .vb-sidebar .rail-footer .rail-item {
    height: 46px !important;
    margin: 2px 8px !important;
    padding: 0 16px !important;
    width: auto !important;
    justify-content: flex-start !important;
  }

  /* ── Main ── */
  .vb-main { margin-left: 0 !important; transition: none !important; }
    

  /* ── Overlay ── */
  .vb-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 299;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  .vb-overlay.show,
  .vb-overlay.active { display: block; }

  /* ── Hamburger ── */
}

/* ─────────────────────────────────────────────
   GRID HELPERS
───────────────────────────────────────────── */
.vb-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vb-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.vb-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 1100px) { .vb-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width:  768px) { .vb-grid-2,.vb-grid-3,.vb-grid-4 { grid-template-columns: 1fr; } }

/* ─────────────────────────────────────────────
   UTILITIES
───────────────────────────────────────────── */
.text-muted    { color: var(--vb-text-muted) !important; }
.text-success  { color: var(--vb-success) !important; }
.text-danger   { color: var(--vb-danger) !important; }
.text-info     { color: var(--vb-info) !important; }
.text-warning  { color: var(--vb-warning) !important; }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-0   { margin-bottom: 0 !important; }
.mb-8   { margin-bottom: 8px; }
.mb-14  { margin-bottom: 14px; }
.mb-16  { margin-bottom: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.w-100  { width: 100%; }
.font-mono { font-family: var(--vb-font-mono); }

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

.vb-empty { text-align: center; padding: 52px 24px; color: var(--vb-text-muted); }
.vb-empty i { font-size: 44px; display: block; margin-bottom: 14px; opacity: .3; }
.vb-empty p { font-size: 14px; margin-bottom: 16px; }

/* ─────────────────────────────────────────────
   SCROLLBAR (webkit)
───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 6px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.25);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.18);
}

/* ─────────────────────────────────────────────
   SELECTION
───────────────────────────────────────────── */
::selection {
  background: var(--vb-brand-glow);
  color: var(--vb-brand-600);
}
[data-theme="dark"] ::selection {
  background: rgba(129,140,248,.25);
  color: #A5B4FC;
}

/* ─────────────────────────────────────────────
   MOBILE RESPONSIVE — Extra rules
   480px = small phones, 768px = tablets
───────────────────────────────────────────── */

/* Inline grid override for mobile */
@media (max-width: 640px) {
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Line item tables — horizontal scroll on mobile */
.vb-line-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -18px;
  padding: 0 18px;
}
.vb-line-table-wrap::after {
  content: '';
  display: block;
  height: 1px;
}

/* Topbar title truncate on small screens */
@media (max-width: 480px) {
  .vb-topbar-title {
    font-size: 14px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .vb-user-chip span { display: none; }
    .vb-card-body { padding: 14px; }
  .vb-card-header { padding: 11px 14px; font-size: 13px; }
  .vb-stat-value { font-size: 17px; }
  .vb-stat { padding: 13px 14px; }
  .vb-btn-lg { padding: 9px 16px; font-size: 13.5px; }
}

/* Toolbar — search + button row */
@media (max-width: 600px) {
  .vb-toolbar, .vb-toolbar > div,
  [style*="display:flex;align-items:center;justify-content:space-between"] {
    flex-wrap: wrap !important;
  }
  /* Action buttons full width on very small */
  .vb-toolbar .vb-btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* Form grids inside cards — single column on mobile */
@media (max-width: 600px) {
  .vb-card-body .vb-grid-2 {
    grid-template-columns: 1fr !important;
  }
  .vb-card-body .vb-grid-2 > [style*="grid-column:1/-1"] {
    grid-column: 1 !important;
  }
}

/* Stat grid — 2 col on mobile instead of 1 */
@media (max-width: 600px) {
  .vb-grid-4 { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .vb-grid-3 { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 380px) {
  .vb-grid-4, .vb-grid-3 { grid-template-columns: 1fr !important; }
}

/* Tables — hide less important columns on mobile */
@media (max-width: 600px) {
  .vb-table .hide-mobile { display: none !important; }
  .vb-table th, .vb-table td { padding: 9px 10px; font-size: 12.5px; }
}

/* Summary card in invoice create/edit */
@media (max-width: 600px) {
  .vb-summary-card {
    min-width: unset !important;
    width: 100%;
  }
}

/* Login card */
@media (max-width: 420px) {
  .vb-login-card { padding: 28px 20px; }
  .vb-login-logo .logo-name { font-size: 20px; }
}

/* Print button row mobile */
@media (max-width: 600px) {
  .print-bar {
    flex-direction: column;
    align-items: center;
  }
}

/* Sidebar footer spacing */
@media (max-width: 768px) {
  .vb-sidebar-footer { padding-bottom: 20px; }
}

/* Invoice/Purchase line items scroll hint */
.scroll-hint {
  display: none;
  font-size: 11px;
  color: var(--vb-text-muted);
  text-align: center;
  padding: 5px;
  margin-bottom: 6px;
}
@media (max-width: 768px) {
  .scroll-hint { display: block; }
}

/* Quick action buttons grid */
@media (max-width: 480px) {
  .vb-quick-actions {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Payment page tabs */
@media (max-width: 500px) {
  .vb-payment-tabs {
    flex-direction: column;
  }
  .vb-payment-tabs .vb-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Report filter bar */
@media (max-width: 650px) {
  .vb-report-filter {
    flex-direction: column;
    align-items: stretch !important;
  }
  .vb-report-filter .vb-input,
  .vb-report-filter .vb-select {
    width: 100%;
  }
  .vb-report-filter button {
    width: 100%;
    justify-content: center;
  }
}

/* Ledger stat cards */
@media (max-width: 500px) {
  .vb-ledger-actions {
    flex-direction: column;
    width: 100%;
  }
  .vb-ledger-actions .vb-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────
   ACCORDION NAV — Variant A
───────────────────────────────────────────── */
.vb-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 13px;
  margin: 1px 8px;
  color: var(--vb-sb-text);
  font-size: 13px; font-weight: 500;
  border-radius: var(--vb-r-sm);
  text-decoration: none;
  transition: background var(--vb-transition), color var(--vb-transition);
  position: relative;
  letter-spacing: .01em;
}
.vb-nav-link:hover {
  background: rgba(255,255,255,.07);
  color: var(--vb-sb-text-hover);
}
.vb-nav-link.active {
  background: var(--vb-sb-active-bg);
  color: var(--vb-sb-active-text);
  font-weight: 600;
}
.vb-nav-link.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 6px; bottom: 6px;
  width: 3px;
  background: #818CF8;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px rgba(129,140,248,.7);
}
.vb-nav-link i { font-size: 17px; flex-shrink: 0; opacity: .85; }
.vb-nav-link.active i { opacity: 1; color: var(--vb-sb-active-dot); }
.vb-nav-link:hover i { opacity: 1; }

/* Group container */
.vb-nav-group { margin: 2px 0; }

/* Group header — clickable */
.vb-nav-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 6px 14px;
  margin: 4px 8px 2px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--vb-r-sm);
  transition: background var(--vb-transition);
}
.vb-nav-group-head:hover {
  background: rgba(255,255,255,.05);
}
.vb-nav-group-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--vb-sb-section);
  transition: color var(--vb-transition);
}
.vb-nav-group-head:hover .vb-nav-group-label,
.vb-nav-group-head.open .vb-nav-group-label {
  color: #818CF8;
}
.vb-nav-group-ic {
  font-size: 14px;
  color: var(--vb-sb-section);
  transition: transform .22s cubic-bezier(.4,0,.2,1), color var(--vb-transition);
  flex-shrink: 0;
}
.vb-nav-group-head:hover .vb-nav-group-ic { color: #818CF8; }
.vb-nav-group-head.open .vb-nav-group-ic {
  transform: rotate(45deg);
  color: #818CF8;
}

/* Collapsible body */
.vb-nav-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s cubic-bezier(.4,0,.2,1);
}
.vb-nav-group-body.open {
  max-height: 300px;
}

/* ═══════════════════════════════════════════════════════════
   ICON RAIL SIDEBAR
═══════════════════════════════════════════════════════════ */

/* Brand area */
.rail-brand {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  border-bottom: 1px solid var(--vb-sb-border);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  user-select: none;
}
/* Collapsed — center logo */
.vb-sidebar:not([data-expanded="true"]) .rail-brand {
  padding: 0;
  justify-content: center;
  gap: 0;
}
.vb-sidebar:not([data-expanded="true"]) .rail-brand-text,
.vb-sidebar:not([data-expanded="true"]) .rail-toggle-btn {
  display: none;
}
.rail-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(99,102,241,.4);
  font-size: 17px; color: #fff;
}
.rail-brand-text { flex: 1; min-width: 0; overflow: hidden; }
.rail-app-name {
  font-size: 14px; font-weight: 700; color: #fff;
  letter-spacing: -.3px; line-height: 1.2;
  white-space: nowrap;
  opacity: 0; transition: opacity .15s .05s;
}
.rail-firm-name {
  font-size: 11px; color: var(--vb-sb-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity .15s .05s;
}
.vb-sidebar[data-expanded="true"] .rail-app-name,
.vb-sidebar[data-expanded="true"] .rail-firm-name { opacity: 1; }

/* Toggle / Pin button */
.rail-toggle-btn {
  position: relative; z-index: 102;
  width: 28px; height: 28px;
  background: rgba(129,140,248,.12);
  border: 1px solid rgba(129,140,248,.2);
  border-radius: 8px;
  cursor: pointer;
  color: #A5B4FC;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .18s, background .15s, border-color .15s, transform .15s;
}
/* Show on hover or when expanded */
.vb-sidebar:hover .rail-toggle-btn { opacity: 1; }
.vb-sidebar[data-expanded="true"] .rail-toggle-btn { opacity: 1; }
.rail-toggle-btn:hover {
  background: rgba(129,140,248,.25);
  border-color: rgba(129,140,248,.4);
  color: #C7D2FE;
}
/* Pinned state — filled look */
.vb-sidebar[data-pinned="true"] .rail-toggle-btn {
  background: rgba(99,102,241,.3);
  border-color: rgba(129,140,248,.5);
  color: #E0E7FF;
}
#rail-toggle-ic { transition: transform .2s; }
/* Pin icon rotates when pinned */
.vb-sidebar[data-pinned="true"] #rail-toggle-ic { transform: rotate(45deg); }

/* Nav */
.rail-nav { flex: 1; padding: 6px 0; overflow-y: auto; overflow-x: clip; position: relative; }
.rail-nav::-webkit-scrollbar { width: 3px; }
.rail-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Rail item (link) */
.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  border-radius: var(--vb-r-sm);
  color: var(--vb-sb-text);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;

  /* Collapsed default — icon perfectly centered in 56px rail */
  width: 40px;
  margin: 1px auto;
  padding: 0;
  justify-content: center;
}

/* Expanded — full width left-aligned */
.vb-sidebar[data-expanded="true"] .rail-item {
  width: auto;
  margin: 1px 6px;
  padding: 0 12px;
  justify-content: flex-start;
}
.rail-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--vb-sb-text-hover);
}
.rail-item.active {
  background: var(--vb-sb-active-bg);
  color: var(--vb-sb-active-text);
  font-weight: 600;
}
.rail-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: #818CF8;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(129,140,248,.6);
}
/* Expanded — pull bar to outer edge */
.vb-sidebar[data-expanded="true"] .rail-item.active::before {
  left: -6px;
}
.rail-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
  transition: color var(--vb-transition);
}
.rail-icon i { opacity: 1; transition: color .15s; }
.rail-item.active .rail-icon i { color: var(--vb-sb-active-text); }

/* Sub items */
.rail-sub .rail-icon { font-size: 16px; }
/* Collapsed — sub items same as top items (already handled by rail-item) */
.vb-sidebar:not([data-expanded="true"]) .rail-sub {
  width: 40px;
  margin: 1px auto !important;
  padding: 0 !important;
  justify-content: center !important;
}

/* Label — hidden when collapsed */
.rail-label {
  flex: 1;
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vb-sidebar[data-expanded="true"] .rail-label { opacity: 1; }

/* Tooltip — shown when collapsed */
.rail-tooltip {
  position: fixed;
  left: calc(var(--vb-sidebar-w) + 12px);
  background: #0F172A;
  color: #f1f5f9;
  font-size: 12.5px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .1s;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.08);
  transform: none;
  top: auto;
}

/* Tooltip shown by JS (mouseenter/mouseleave) for accurate fixed positioning */

/* Group head */
.rail-group-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 28px;
  padding: 0 10px;
  margin: 6px 4px 2px;
  border-radius: var(--vb-r-sm);
  cursor: pointer;
  color: var(--vb-sb-section);
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
/* Collapsed — show only a thin divider line, no icon/text */
.vb-sidebar:not([data-expanded="true"]) .rail-group-head {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 8px auto;
  width: 32px;
  padding: 0;
  border-radius: 1px;
  cursor: default;
  pointer-events: none;
}
.vb-sidebar:not([data-expanded="true"]) .rail-group-head * { display: none; }
/* Expanded — normal */
.vb-sidebar[data-expanded="true"] .rail-group-head {
  justify-content: flex-start;
  padding: 0 14px;
  margin: 8px 6px 2px;
  height: 28px;
  background: transparent;
}
.rail-group-head:hover { background: rgba(255,255,255,.06); color: var(--vb-sb-text-hover); }
.vb-sidebar:not([data-expanded="true"]) .rail-group-head:hover { background: rgba(255,255,255,.1); }
.rail-group-head.open { color: var(--vb-sb-active-text); }
.rail-group-head.open .rail-icon i { color: var(--vb-sb-active-text); }
.rail-group-head .rail-icon { font-size: 16px; }

.rail-group-arrow {
  margin-left: auto;
  font-size: 13px;
  transition: transform .22s, opacity .18s;
  flex-shrink: 0;
  opacity: 0;
}
.vb-sidebar[data-expanded="true"] .rail-group-arrow { opacity: 1; }
.rail-group-head.open .rail-group-arrow { transform: rotate(180deg); }

/* Group body */
.rail-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s cubic-bezier(.4,0,.2,1);
}
/* Only expand group body when sidebar is also expanded */
.vb-sidebar[data-expanded="true"] .rail-group-body.open {
  max-height: 300px;
}
/* Collapsed — show ALL items flat (no accordion), hide group structure */
.vb-sidebar:not([data-expanded="true"]) .rail-group-body {
  max-height: none !important;
  overflow: visible !important;
}

/* Sub-item indent when expanded */
.vb-sidebar[data-expanded="true"] .rail-sub {
  padding-left: 20px;
}

/* Footer */
.rail-footer { overflow: visible;
  padding: 4px 0 6px;
  border-top: 1px solid var(--vb-sb-border);
  flex-shrink: 0;
}
/* Footer items same height as nav items */
.rail-footer .rail-item {
  height: 38px;
}
.vb-sidebar:not([data-expanded="true"]) .rail-footer .rail-item {
  width: 40px;
  margin: 1px auto;
  padding: 0;
  justify-content: center;
}

/* Topbar height sync */


/* Responsive */
/* Mobile rules consolidated above */

/* ═══════════════════════════════════════════
   FLYOUT MENU (collapsed sidebar)
═══════════════════════════════════════════ */
.rail-flyout {
  position: fixed;
  left: var(--vb-sidebar-w);
  top: 0;
  z-index: 200;
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 0 var(--vb-r-lg) var(--vb-r-lg) 0;
  box-shadow: 4px 4px 24px rgba(0,0,0,.15);
  min-width: 200px;
  padding: 8px 0 10px;
  animation: flyout-in .15s cubic-bezier(.4,0,.2,1);
}
@keyframes flyout-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.rail-flyout-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--vb-text-muted);
  padding: 4px 14px 8px;
  border-bottom: 1px solid var(--vb-border);
  margin-bottom: 4px;
}
.rail-flyout-items a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--vb-text);
  text-decoration: none;
  transition: background var(--vb-transition);
  white-space: nowrap;
}
.rail-flyout-items a:hover {
  background: var(--vb-surface-2);
}
.rail-flyout-items a.active {
  color: var(--vb-brand-500);
  background: var(--vb-brand-50);
}
.rail-flyout-items a i {
  font-size: 16px;
  color: var(--vb-text-muted);
  flex-shrink: 0;
}
.rail-flyout-items a.active i { color: var(--vb-brand-500); }
.rail-flyout-items a:hover i  { color: var(--vb-text); }

/* ── Edge Pill — expand/collapse trigger ─────────────────── */
.rail-edge-pill {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 48px;
  background: #6366F1;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  box-shadow: 3px 0 12px rgba(99,102,241,.45);
  transition: background .15s, box-shadow .15s, width .15s;
}
.rail-edge-pill:hover {
  background: #4F46E5;
  width: 18px;
  box-shadow: 3px 0 16px rgba(99,102,241,.6);
}
.rail-edge-pill i {
  font-size: 12px;
  color: #fff;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
/* Expanded — arrow flips */
.vb-sidebar[data-expanded="true"] .rail-edge-pill i {
  transform: rotate(180deg);
}
/* Hide inside sidebar overflow — pill needs overflow:visible on sidebar */
.vb-sidebar { overflow: visible !important; }

/* ── Mobile close button ─────────────────────────── */
.rail-close-btn {
  display: none; /* hidden on desktop */
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  align-items: center; justify-content: center;
  cursor: pointer;
  color: #94A3B8;
  font-size: 16px;
  flex-shrink: 0;
  transition: background var(--vb-transition);
}
.rail-close-btn:hover {
  background: rgba(255,255,255,.15);
  color: #E2E8F0;
}

/* ════════════════════════════════════════════════════════════
   GLOBAL MOBILE RESPONSIVE — all modules
   ════════════════════════════════════════════════════════════ */

/* Scrollable table wrapper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--vb-r-md);
}

/* Action bar — stack on mobile */
@media (max-width: 600px) {
  /* Page header row */
  .vb-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .vb-page-header .vb-btn { width: 100%; justify-content: center; }

  /* Card body padding reduce */
  .vb-card-body { padding: 14px !important; }
  .vb-card-header { padding: 12px 14px !important; }

  /* Filter bar — stack */
  .vb-filter-bar { flex-wrap: wrap !important; }
  .vb-filter-bar .vb-input,
  .vb-filter-bar select { width: 100% !important; }

  /* Form grids — single column */
  .vb-form-grid { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns"]:not(.items-table):not(.vb-table) {
    grid-template-columns: 1fr !important;
  }

  /* Inline grids in cards */
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1.2fr"],
  div[style*="grid-template-columns: 200px"],
  div[style*="grid-template-columns: 220px"],
  div[style*="grid-template-columns: 1fr 200px"],
  div[style*="grid-template-columns: 1fr 260px"] {
    grid-template-columns: 1fr !important;
  }

  /* Stat strip */
  .kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

  /* Buttons full width in forms */
  .vb-form-actions { flex-direction: column !important; }
  .vb-form-actions .vb-btn { width: 100%; justify-content: center; }

  /* Hide less important table columns */
  .col-hide-sm { display: none !important; }

  /* Tables — horizontal scroll */
  .vb-card > div[style*="overflow-x"] { overflow-x: auto !important; }
  .vb-table { min-width: 500px; }

  /* Modal / overlay panels */
  .vb-modal { width: 95vw !important; margin: 10px auto !important; }

  /* Tab bars — scroll */
  .vb-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; }
  .vb-tab { white-space: nowrap; flex-shrink: 0; }

  /* Topbar title — shorter */
  .vb-topbar-title { font-size: 15px !important; }
  .vb-user-chip span { display: none; }

  /* Dashboard middle grid */
  .dash-grid,
  div[style*="grid-template-columns:1fr 200px"],
  div[style*="grid-template-columns: 1fr 200px"],
  div[style*="grid-template-columns:200px 1fr 200px"],
  div[style*="grid-template-columns:1fr 260px"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .vb-page { padding: 10px !important; }
}

/* ── Hamburger button ─────────────────────── */
.vb-menu-btn-mobile { display: none; }         /* hidden on desktop */
@media (max-width: 768px) {
  .vb-menu-btn-mobile { display: flex !important; }   /* visible on mobile */
  .vb-topbar-title { font-size: 15px; max-width: 160px;
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-name-text  { display: none; }   /* hide username text, keep icon */
  .vb-user-chip    { padding: 5px 8px; }
  
}
@media (max-width: 380px) {
  .vb-topbar-title { max-width: 110px; font-size: 14px; }
  .vb-theme-btn-wrap { display: none; }  /* hide theme btn on tiny screens */
}

/* ════════════════════════════════════════════
   PAGE LISTING IMPROVEMENTS
════════════════════════════════════════════ */

/* Page header row */
.vb-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.vb-page-head-left { display: flex; flex-direction: column; gap: 2px; }
.vb-page-head-title {
  font-size: 19px; font-weight: 700;
  color: var(--vb-text); letter-spacing: -.4px;
  line-height: 1.2;
}
.vb-page-head-sub {
  font-size: 13.5px; color: var(--vb-text-muted);
  margin-top: 2px;
}
.vb-page-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Filter/search bar */
.vb-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.vb-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.vb-search-wrap i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--vb-text-muted);
  pointer-events: none;
}
.vb-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-sm);
  background: var(--vb-surface);
  color: var(--vb-text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  height: 36px;
}
.vb-search-input:focus {
  outline: none;
  border-color: var(--vb-brand-400);
  box-shadow: 0 0 0 3px var(--vb-brand-glow);
}
.vb-search-input::placeholder { color: var(--vb-text-muted); }

/* Table card — tighter, cleaner */


/* Empty state */
.vb-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--vb-text-muted);
}
.vb-empty-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--vb-surface-2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 26px;
  color: var(--vb-text-muted);
}
.vb-empty-title {
  font-size: 15px; font-weight: 600;
  color: var(--vb-text); margin-bottom: 6px;
}
.vb-empty-sub {
  font-size: 13px; margin-bottom: 20px;
  color: var(--vb-text-muted);
}

/* Table action column */
.vb-table .col-actions { width: 80px; text-align: right; }
.vb-table td.col-actions { padding-right: 12px; }

/* Amount cells */
.vb-table td.col-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
}

/* Row link style */
.vb-table tbody tr.clickable { cursor: pointer; }

/* Count badge in card header */
.vb-count-badge {
  display: inline-flex; align-items: center;
  background: var(--vb-surface-2);
  border: 1px solid var(--vb-border);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 12px; font-weight: 600;
  color: var(--vb-text-muted);
  margin-left: 6px;
}

/* Status dots */
.vb-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.vb-dot-success { background: var(--vb-success); }
.vb-dot-danger  { background: var(--vb-danger); }
.vb-dot-warning { background: var(--vb-warning); }
.vb-dot-muted   { background: var(--vb-text-muted); }

/* ════════════════════════════════════════════════════════════
   PAGE POLISH — listing pages
════════════════════════════════════════════════════════════ */

/* vb-table inside table-card — tighter first/last td padding */
.vb-table-card .vb-table th:first-child,
.vb-table-card .vb-table td:first-child { padding-left: 20px; }
.vb-table-card .vb-table th:last-child,
.vb-table-card .vb-table td:last-child  { padding-right: 20px; }

/* Page head icon */
.vb-page-head-title i { vertical-align: -3px; margin-right: 6px; }

/* Subtle row number in tables */
.vb-table td.col-sr {
  color: var(--vb-text-muted);
  font-size: 12px;
  width: 36px;
  text-align: center;
}

/* Amount cells */
.vb-table td.fw-600,
.vb-table td.text-right.fw-600 { font-weight: 600; letter-spacing: -.2px; }

/* Action buttons in table rows */
.tbl-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.tbl-action-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--vb-text-muted);
  text-decoration: none;
  font-size: 16px;
  border: none; background: transparent;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.tbl-action-btn:hover { background: var(--vb-surface-2); color: var(--vb-text); }
.tbl-action-btn.danger:hover { background: rgba(244,63,94,.1); color: var(--vb-danger); }
.tbl-action-btn.success:hover { background: rgba(16,185,129,.1); color: var(--vb-success); }

/* Filter row search input height */
.vb-filter-row .vb-input,
.vb-filter-row .vb-select { height: 36px; }
.vb-filter-row .vb-search-input { height: 36px; }

/* Form pages — card layout */
.form-card {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-lg);
  box-shadow: var(--vb-sh-sm);
}
.form-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--vb-border);
  font-size: 14px; font-weight: 600;
  color: var(--vb-text);
  display: flex; align-items: center; gap: 8px;
}
.form-card-header i { font-size: 17px; color: var(--vb-text-muted); }
.form-card-body { padding: 20px; }

/* Section dividers in forms */
.form-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--vb-border);
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; }
.form-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--vb-text-muted);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--vb-border);
}

/* vb-select base style */
.vb-select {
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-sm);
  background: var(--vb-surface);
  color: var(--vb-text);
  font-size: 13px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  transition: border-color .15s;
}
.vb-select:focus-visible {
  outline: none;
  border-color: var(--vb-brand-400);
  box-shadow: 0 0 0 3px var(--vb-brand-glow);
}

/* ════════════════════════════════════════════════════════
   FINAL POLISH — listing pages
════════════════════════════════════════════════════════ */

/* Segmented tab control */
.vb-tab-group {
  display: flex;
  gap: 3px;
  background: var(--vb-surface-2);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-sm);
  padding: 3px;
}
.vb-tab-group a {
  padding: 5px 14px;
  border-radius: 5px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  color: var(--vb-text-muted);
  transition: background .12s, color .12s;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.vb-tab-group a.active {
  background: var(--vb-surface);
  color: var(--vb-text);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.vb-tab-group a:hover:not(.active) { color: var(--vb-text); }

/* Empty state */
.vb-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--vb-text-muted);
}
.vb-empty-state .icon {
  width: 52px; height: 52px;
  background: var(--vb-surface-2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 24px;
}
.vb-empty-state h3 {
  font-size: 15px; font-weight: 600;
  color: var(--vb-text); margin-bottom: 5px;
}
.vb-empty-state p { font-size: 13.5px; margin-bottom: 16px; }

/* Table action column */
.vb-table .col-actions { width: 90px; }
.vb-table td.col-actions {
  padding-right: 16px;
}

/* Doc number pill style */
.doc-no {
  font-family: var(--vb-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--vb-brand-600);
  letter-spacing: -.2px;
}
[data-theme="dark"] .doc-no { color: var(--vb-brand-400); }

/* Amount — green for receivable, red for payable */
.amt-positive { color: var(--vb-success); font-weight: 600; }
.amt-negative { color: var(--vb-danger);  font-weight: 600; }
.amt-neutral  { color: var(--vb-text);    font-weight: 600; }

/* Table: first col padding */
.vb-table-card .vb-table th:first-child,
.vb-table-card .vb-table td:first-child { padding-left: 20px; }
.vb-table-card .vb-table th:last-child,
.vb-table-card .vb-table td:last-child  { padding-right: 20px; }

/* Row hover — subtle indigo tint */
.vb-table tbody tr:hover { background: rgba(99,102,241,.04); }
[data-theme="dark"] .vb-table tbody tr:hover { background: rgba(99,102,241,.08); }

/* vb-btn-sm tighter */
.vb-btn-sm { padding: 4px 10px; font-size: 12.5px; height: 30px; }

/* Search input focus ring */
.vb-search-input:focus {
  outline: none;
  border-color: var(--vb-brand-400);
  box-shadow: 0 0 0 3px var(--vb-brand-glow);
}

/* Filter row gap */
.vb-filter-row { gap: 8px; }

/* Stat strip — cashbook summary */
.vb-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.vb-stat-strip-item {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-md);
  padding: 12px 16px;
}
.vb-stat-strip-item .label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--vb-text-muted); margin-bottom: 4px;
}
.vb-stat-strip-item .value {
  font-size: 20px; font-weight: 700;
  letter-spacing: -.5px; line-height: 1;
}

/* font-mono utility */
.font-mono { font-family: var(--vb-font-mono); }
.fw-600 { font-weight: 600; }
.text-right { text-align: right; }
.text-muted { color: var(--vb-text-muted); }
.text-sm { font-size: 12.5px; }
.text-success { color: var(--vb-success); }
.text-danger  { color: var(--vb-danger);  }
.text-warning { color: var(--vb-warning); }

/* ════════════════════════════════════════════════════════════
   LISTING PAGE FINAL POLISH
════════════════════════════════════════════════════════════ */

/* Party name — bold in listing */
.vb-table td.party-name { font-weight: 500; color: var(--vb-text); }

/* Invoice/doc number — monospace */
.vb-table td.doc-no {
  font-family: var(--vb-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--vb-brand-500);
  letter-spacing: -.2px;
}

/* Amount — tabular nums */
.vb-table td.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.3px;
  text-align: right;
}
.vb-table td.amount.receivable { color: var(--vb-danger); }
.vb-table td.amount.paid       { color: var(--vb-success); }

/* Empty state — better */
.vb-empty-state {
  text-align: center;
  padding: 56px 24px;
}
.vb-empty-state .empty-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--vb-surface-2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 24px;
  color: var(--vb-text-muted);
}
.vb-empty-state .empty-title {
  font-size: 15px; font-weight: 600;
  color: var(--vb-text); margin-bottom: 6px;
}
.vb-empty-state .empty-sub {
  font-size: 13.5px; color: var(--vb-text-muted);
  margin-bottom: 18px;
}

/* Table row — hover highlight stronger */
.vb-table tbody tr:hover { background: var(--vb-surface-2); }
[data-theme="dark"] .vb-table tbody tr:hover { background: rgba(255,255,255,.04); }

/* Table last row — no border */
.vb-table tbody tr:last-child td { border-bottom: none; }

/* Compact filter label */
.filter-label {
  font-size: 11.5px; font-weight: 500;
  color: var(--vb-text-muted);
  white-space: nowrap;
}

/* vb-table-card — clean wrapper */

.vb-table-card .vb-table th:first-child,
.vb-table-card .vb-table td:first-child { padding-left: 20px; }
.vb-table-card .vb-table th:last-child,
.vb-table-card .vb-table td:last-child  { padding-right: 20px; }

/* Page head icon size consistent */
.vb-page-head-title i.page-icon {
  font-size: 20px;
  vertical-align: -3px;
  margin-right: 8px;
  color: var(--vb-brand-500);
}

/* Status badge — dot style alternative */
.status-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 500;
}
.status-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.paid::before    { background: var(--vb-success); }
.status-dot.unpaid::before  { background: var(--vb-danger); }
.status-dot.partial::before { background: var(--vb-warning); }

/* Muted text helper */
.text-muted { color: var(--vb-text-muted); }
.text-sm    { font-size: 12.5px; }
.fw-600     { font-weight: 600; }
.text-right { text-align: right; }
.text-center{ text-align: center; }

/* ── Form submit loading state ─────────────────────────── */
.vb-btn.loading {
  opacity: .7;
  pointer-events: none;
  cursor: not-allowed;
  position: relative;
}
.vb-btn.loading .btn-text { opacity: 0; }
.vb-btn.loading::after {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .6s linear infinite;
}
.vb-btn-outline.loading::after {
  border-color: rgba(99,102,241,.25);
  border-top-color: var(--vb-brand-500);
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ── Breadcrumb back nav ────────────────────────────────── */
.vb-breadcrumb { margin-bottom: 14px; }
.vb-breadcrumb-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 500;
  color: var(--vb-text-muted);
  padding: 6px 10px 6px 6px;
  border-radius: var(--vb-r-sm);
  transition: background var(--vb-transition), color var(--vb-transition);
  text-decoration: none;
}
.vb-breadcrumb-back i { font-size: 16px; transition: transform var(--vb-transition); }
.vb-breadcrumb-back:hover {
  background: var(--vb-surface-2);
  color: var(--vb-brand-500);
}
.vb-breadcrumb-back:hover i { transform: translateX(-3px); }

/* ── Quick action cards — Dashboard ─────────────────────── */
.vb-quick-action {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 12px;
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-lg);
  box-shadow: var(--vb-sh-xs);
  text-decoration: none; cursor: pointer;
  transition: all var(--vb-transition);
  text-align: center;
}
.vb-quick-action span {
  font-size: 12.5px; font-weight: 600;
  color: var(--vb-text); white-space: nowrap;
}
.vb-quick-action:hover {
  border-color: var(--vb-brand-500);
  box-shadow: 0 4px 16px rgba(99,102,241,.15);
  transform: translateY(-2px);
}
.vb-quick-action:hover span { color: var(--vb-brand-500); }

/* ── GSTIN input validation ─────────────────────────────── */
input.gstin-input:valid   { border-color: var(--vb-success); }
input.gstin-input:invalid { border-color: var(--vb-danger); }
input.gstin-input:placeholder-shown { border-color: var(--vb-border); }

/* ════════════════════════════════════════════════════════════
   LIST PAGE TOP — Premium redesign
════════════════════════════════════════════════════════════ */

/* Page head — bordered bottom, icon box */
.vb-page-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--vb-border);
  margin-bottom: 18px;
}
.vb-page-head-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vb-page-head-title i {
  width: 36px; height: 36px;
  background: var(--vb-brand-50);
  border: 1px solid rgba(99,102,241,.15);
  border-radius: var(--vb-r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--vb-brand-500);
  flex-shrink: 0;
  vertical-align: unset;
  margin-right: 0;
}
[data-theme="dark"] .vb-page-head-title i {
  background: rgba(99,102,241,.12);
  border-color: rgba(129,140,248,.2);
}
.vb-page-head-sub {
  font-size: 13px;
  color: var(--vb-text-muted);
  margin-top: 4px;
}

/* Filter row — unified toolbar */
.vb-filter-row {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-md);
  padding: 6px 8px;
  box-shadow: var(--vb-sh-xs);
  margin-bottom: 14px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
@media (max-width: 600px) { .vb-filter-row { flex-wrap: wrap; } }

/* Inputs inside filter row — borderless, seamless */
.vb-filter-row .vb-search-input,
.vb-filter-row .vb-input,
.vb-filter-row .vb-select {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  height: 34px;
  outline: none;
}
.vb-filter-row .vb-search-wrap {
  border-right: 1px solid var(--vb-border);
}
.vb-filter-row .vb-input {
  border-right: 1px solid var(--vb-border) !important;
}
.vb-filter-row .vb-select {
  border-left: 1px solid var(--vb-border) !important;
}
.vb-filter-row .vb-search-input:focus,
.vb-filter-row .vb-input:focus,
.vb-filter-row .vb-select:focus-visible {
  background: var(--vb-surface-2) !important;
}

/* Filter row submit button */
.vb-filter-row .vb-btn {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Report page KPI strip — matches dashboard ───────────── */
.rpt-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .rpt-kpi-strip { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .rpt-kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ── KPI Strip — Dashboard & Reports (global) ────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: var(--vb-r-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--vb-sh-xs);
  transition: box-shadow .18s, transform .18s;
}
.kpi:hover { box-shadow: var(--vb-sh-sm); transform: translateY(-1px); }
.kpi-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.kpi-lbl {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--vb-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-val {
  font-size: 18px; font-weight: 700;
  letter-spacing: -.4px; line-height: 1.2;
  color: var(--vb-text);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-sub {
  font-size: 12px;
  color: var(--vb-text-muted);
  margin-top: 2px;
}
/* Dot colors */
.dot-blue  { background: #6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.dot-amber { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.dot-green { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.dot-red   { background: #F43F5E; box-shadow: 0 0 0 3px rgba(244,63,94,.15);  }
.dot-sky   { background: #0EA5E9; box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
/* Responsive */
@media (max-width: 900px) { .kpi-strip { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 600px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Comprehensive
   Breakpoints: 768px (tablet), 600px (mobile), 400px (small)
════════════════════════════════════════════════════════════ */

/* ── Base mobile fixes ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* Page padding */
  .vb-page { padding: 12px 14px !important; }

  /* Page head — stack vertically */
  .vb-page-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .vb-page-head-right { width: 100%; }
  .vb-page-head-right .vb-btn { width: 100%; justify-content: center; }

  /* Filter row — stack */
  .vb-filter-row { flex-wrap: wrap !important; }
  .vb-filter-row .vb-search-wrap { max-width: 100% !important; flex: 1 1 100% !important; }
  .vb-filter-row .vb-input,
  .vb-filter-row .vb-select { flex: 1 1 calc(50% - 8px) !important; min-width: 120px; }

  /* Cards — no max-width restriction */
  .vb-card { max-width: 100% !important; }

  /* Form grids — single column */
  .vb-grid-2,
  .vb-grid-3,
  .vb-grid-4,
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Tables — horizontal scroll */
  
  .vb-table { min-width: 400px; }

  /* Buttons full width in forms */
  .vb-card-body .vb-btn-primary:not(.tbl-action-btn) { width: 100%; justify-content: center; }

  /* KPI strip — 2 cols */
  .kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

  /* Topbar */
  .vb-topbar-title { font-size: 14px !important; }
  .vb-user-chip .vb-user-name { display: none; }

  /* Quick actions — 3 cols */
  .vb-quick-action-grid { grid-template-columns: repeat(3,1fr) !important; }

  /* Modal widths */
  [style*="width:380px"],
  [style*="width: 380px"] { width: 95vw !important; max-width: 380px; }

  /* Settings max-width */
  [style*="max-width:600px"],
  [style*="max-width: 600px"],
  [style*="max-width:680px"],
  [style*="max-width: 680px"] { max-width: 100% !important; }

  /* Invoice/Purchase create — line items table */
  .line-items-table { overflow-x: auto; }
  .line-items-table table { min-width: 600px; }

  /* Summary box */
  .inv-summary { font-size: 13px !important; }

  /* Chart container */
  .chart-card canvas { max-height: 200px !important; }

  /* Tabs — scroll horizontal */
  #settingsTabs { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 4px; }
  #settingsTabs .vb-tab-btn { white-space: nowrap; flex-shrink: 0; }
}

/* ── Small mobile (<600px) ──────────────────────────────── */
@media (max-width: 600px) {

  .vb-page { padding: 10px 12px !important; }

  /* KPI — single col on very small */
  .kpi { padding: 12px 14px !important; }
  .kpi-val { font-size: 16px !important; }

  /* Quick actions — 2 cols */
  .vb-quick-action-grid { grid-template-columns: 1fr 1fr !important; }

  /* Page head title smaller */
  .vb-page-head-title { font-size: 17px !important; }

  /* Filter row full width inputs */
  .vb-filter-row .vb-input,
  .vb-filter-row .vb-select { flex: 1 1 100% !important; }

  /* Topbar actions — hide less important */
  .vb-topbar-sep { display: none; }

  /* Toast — full width */
  #vb-toasts { right: 10px !important; left: 10px !important; bottom: 10px !important; }
  #vb-toasts > div { max-width: 100% !important; min-width: unset !important; }

  /* Table font size */
  .vb-table td, .vb-table th { font-size: 12.5px !important; padding: 9px 10px !important; }
  .vb-table-card .vb-table th:first-child,
  .vb-table-card .vb-table td:first-child { padding-left: 12px !important; }
  .vb-table-card .vb-table th:last-child,
  .vb-table-card .vb-table td:last-child  { padding-right: 12px !important; }

  /* Btn smaller */
  .vb-btn { padding: 7px 14px !important; font-size: 13px !important; }
  .vb-btn i { font-size: 15px !important; }

  /* Badge */
  .vb-badge { font-size: 11px !important; padding: 2px 8px !important; }
}

/* ── Extra small (<400px) ───────────────────────────────── */
@media (max-width: 400px) {
  .vb-page { padding: 8px !important; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .vb-quick-action-grid { grid-template-columns: repeat(2,1fr) !important; }
}

/* ── Tablet (769px - 1024px) ────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .vb-page { padding: 16px 20px !important; }
  .kpi-strip { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  .vb-grid-4 { grid-template-columns: repeat(2,1fr) !important; }
}

/* ── Print media ────────────────────────────────────────── */
@media print {
  .vb-sidebar, .vb-topbar, .vb-page-head-right,
  .tbl-actions, .vb-btn, .hide-print { display: none !important; }
  .vb-main { margin-left: 0 !important; }
  .vb-page { padding: 0 !important; }
  .vb-table-card, .vb-card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── Dashboard specific mobile ───────────────────────────── */
@media (max-width: 768px) {
  /* Chart + side panel — stack */
  .dash-grid { grid-template-columns: 1fr !important; }

  /* Quick actions */
  [style*="grid-template-columns:repeat(auto-fit,minmax(140px"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 500px) {
  [style*="grid-template-columns:repeat(auto-fit,minmax(140px"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ════════════════════════════════════════════════════════════
   INVOICE LISTING PAGE
════════════════════════════════════════════════════════════ */

/* ── Invoice Listing — Premium Design ───────────────────── */

/* Page Head */
.il-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px; flex-wrap: wrap;
}
.il-head-title {
  display: flex; align-items: center; gap: 14px;
}
.il-head-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
  flex-shrink: 0;
}
.il-head-name {
  font-size: 20px; font-weight: 800;
  letter-spacing: -.5px; color: var(--vb-text);
}
.il-head-sub {
  font-size: 13px; color: var(--vb-text-muted); margin-top: 2px;
}
.il-new-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff; font-size: 13.5px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 3px 12px rgba(99,102,241,.4);
  transition: all .18s; white-space: nowrap;
}
.il-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,.5);
  color: #fff;
}
.il-new-btn i { font-size: 16px; }

/* Stats strip */
.il-stats {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.il-stat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 20px; padding: 5px 12px 5px 8px;
  box-shadow: var(--vb-sh-xs);
}
.il-stat-chip i { font-size: 15px; flex-shrink: 0; }
.il-chip-label {
  font-size: 11.5px; font-weight: 500;
  color: var(--vb-text-muted); letter-spacing: .01em;
}
.il-chip-val {
  font-size: 13.5px; font-weight: 700;
  color: var(--vb-text); letter-spacing: -.2px;
  margin-left: 2px;
}
.il-stat-chip.danger  .il-chip-val { color: var(--vb-danger); }
.il-stat-chip.success .il-chip-val { color: var(--vb-success); }
.il-stat-chip.warning .il-chip-val { color: var(--vb-warning); }

/* Filter bar */
.il-filter {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.il-search {
  flex: 1; min-width: 200px; max-width: 320px;
  display: flex; align-items: center; gap: 0;
  background: var(--vb-surface);
  border: 1.5px solid var(--vb-border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color .16s, box-shadow .16s;
}
.il-search:focus-within {
  border-color: var(--vb-brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.il-search i { color: var(--vb-text-muted); font-size: 16px; flex-shrink: 0; }
.il-search input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--vb-text); font-size: 13.5px; font-family: var(--vb-font);
  padding: 9px 10px; min-width: 0;
}
.il-search input::placeholder { color: var(--vb-text-muted); }

.il-filter-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.il-filter-field {
  display: flex; align-items: center; gap: 6px;
  background: var(--vb-surface); border: 1.5px solid var(--vb-border);
  border-radius: 10px; padding: 0 10px;
  transition: border-color .16s;
}
.il-filter-field:focus-within { border-color: var(--vb-brand-500); }
.il-date-input {
  border: none; outline: none; background: transparent;
  color: var(--vb-text); font-size: 13px; font-family: var(--vb-font);
  padding: 8px 4px; width: 140px;
}

/* Status tab pills */
.il-status-tabs {
  display: flex; gap: 3px;
  background: var(--vb-surface-2);
  border: 1px solid var(--vb-border);
  border-radius: 10px; padding: 3px;
}
.il-tab {
  padding: 5px 14px; border: none; background: transparent;
  border-radius: 7px; font-size: 13px; font-weight: 600;
  color: var(--vb-text-muted); cursor: pointer;
  font-family: var(--vb-font); transition: var(--vb-transition);
}
.il-tab.active {
  background: var(--vb-surface);
  color: var(--vb-text);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.il-tab:hover:not(.active) { color: var(--vb-text); }

/* Table */
.il-table-wrap {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--vb-sh-sm);
}
.il-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.il-table thead tr {
  background: linear-gradient(to bottom, rgba(99,102,241,.05), rgba(99,102,241,.02));
}
[data-theme="dark"] .il-table thead tr {
  background: linear-gradient(to bottom, rgba(129,140,248,.06), rgba(129,140,248,.02));
}
.il-table th {
  padding: 10px 16px; text-align: left;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--vb-text-muted);
  border-bottom: 1px solid var(--vb-border);
  white-space: nowrap;
}
.il-table th.text-right { text-align: right; }
.il-table th:first-child { padding-left: 22px; }
.il-table th:last-child  { padding-right: 20px; }
.il-row td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(99,102,241,.05);
  vertical-align: middle;
}
[data-theme="dark"] .il-row td { border-bottom-color: rgba(129,140,248,.07); }
.il-row:last-child td { border-bottom: none; }
.il-row { transition: background var(--vb-transition); }
.il-row:hover { background: rgba(99,102,241,.03); }
[data-theme="dark"] .il-row:hover { background: rgba(129,140,248,.05); }
.il-row td:first-child { padding-left: 18px; }
.il-row td:last-child  { padding-right: 16px; }

/* Invoice no */
.il-inv-no {
  font-family: var(--vb-font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--vb-brand-500); letter-spacing: -.1px;
}
.il-inv-date {
  font-size: 12px; color: var(--vb-text-muted); margin-top: 2px;
}
.il-show-sm { display: none; }

/* Party */
.il-party { font-weight: 500; font-size: 14px; color: var(--vb-text); }
.il-mode  { font-size: 12px; color: var(--vb-text-muted); margin-top: 2px; text-transform: capitalize; }

.il-date-cell { font-size: 13px; color: var(--vb-text-muted); white-space: nowrap; }

/* Type badge */
.il-type-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; letter-spacing: .02em;
}
.il-type-badge.tax { background: rgba(37,99,235,.1); color: #2563EB; }
.il-type-badge.bos { background: rgba(217,119,6,.1);  color: #D97706; }

/* Amount */
.il-amount {
  font-size: 14px; font-weight: 700;
  letter-spacing: -.3px; color: var(--vb-text);
}
.il-bal { font-size: 13.5px; font-weight: 700; }
.paid-text { color: var(--vb-success); }
.due-text  { color: var(--vb-danger); }

/* Status pill */
.il-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap; letter-spacing: .01em;
}
.il-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.il-status.paid    { background: rgba(5,150,105,.1);  color: #059669; }
.il-status.paid::before    { background: #059669; }
.il-status.partial { background: rgba(217,119,6,.1);  color: #D97706; }
.il-status.partial::before { background: #D97706; }
.il-status.unpaid  { background: rgba(220,38,38,.1);  color: #DC2626; }
.il-status.unpaid::before  { background: #DC2626; }
[data-theme="dark"] .il-status.paid    { background: rgba(52,211,153,.12); color: #34D399; }
[data-theme="dark"] .il-status.partial { background: rgba(251,191,36,.12); color: #FBBF24; }
[data-theme="dark"] .il-status.unpaid  { background: rgba(248,113,113,.12);color: #F87171; }

/* Action buttons */
.il-actions { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.il-act {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--vb-text-muted);
  border: none; background: transparent; cursor: pointer;
  text-decoration: none; transition: var(--vb-transition);
  font-family: inherit;
}
.il-act:hover      { background: var(--vb-surface-2); color: var(--vb-text); }
.il-act.wa:hover   { background: rgba(37,211,102,.1); color: #25D366; }
.il-act.edit:hover { background: rgba(99,102,241,.1); color: var(--vb-brand-500); }
.il-act.del:hover  { background: rgba(220,38,38,.1);  color: var(--vb-danger); }

/* Empty state */
.il-empty {
  text-align: center; padding: 64px 24px;
  background: var(--vb-surface); border: 1px solid var(--vb-border);
  border-radius: 16px; box-shadow: var(--vb-sh-xs);
}
.il-empty-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--vb-surface-2); border: 1px solid var(--vb-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--vb-text-muted);
  margin: 0 auto 14px;
}
.il-empty-title { font-size: 16px; font-weight: 700; color: var(--vb-text); margin-bottom: 6px; }
.il-empty-sub   { font-size: 14px; color: var(--vb-text-muted); margin-bottom: 20px; }

/* ── Mobile Cards — Compact (Variant C) ─── */
.il-cards { display: none; flex-direction: column; gap: 8px; }

.il-mc {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--vb-sh-xs);
  transition: box-shadow .14s;
}
.il-mc:active { box-shadow: var(--vb-sh-sm); }

/* Top row */
.il-mc-top {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 9px;
}
.il-mc-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.il-mc-mid { flex: 1; min-width: 0; }
.il-mc-no {
  font-family: var(--vb-font-mono);
  font-size: 12.5px; font-weight: 700;
  color: var(--vb-brand-500);
  white-space: nowrap;
}
.il-mc-party {
  font-size: 13.5px; font-weight: 500;
  color: var(--vb-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.il-mc-right { text-align: right; flex-shrink: 0; }
.il-mc-amt {
  font-size: 16px; font-weight: 800;
  letter-spacing: -.4px; color: var(--vb-text);
}
.il-mc-status {
  font-size: 11.5px; font-weight: 600; margin-top: 2px;
}
.il-mc-status.paid    { color: var(--vb-success); }
.il-mc-status.partial { color: var(--vb-warning); }
.il-mc-status.unpaid  { color: var(--vb-danger); }

/* Bottom row */
.il-mc-bot {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 9px;
  border-top: 1px solid var(--vb-border);
}
.il-mc-date {
  font-size: 12px; color: var(--vb-text-muted);
  display: flex; align-items: center; gap: 4px;
}
.il-mc-acts { display: flex; gap: 4px; }
.il-mc-act {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--vb-text-muted);
  background: var(--vb-surface-2);
  border: 1px solid var(--vb-border);
  text-decoration: none; transition: var(--vb-transition);
}
.il-mc-act:hover     { border-color: var(--vb-brand-500); color: var(--vb-brand-500); }
.il-mc-act.wa        { color: #25D366; border-color: rgba(37,211,102,.25); }
.il-mc-act.wa:hover  { background: rgba(37,211,102,.08); }

/* Responsive */
@media (max-width: 768px) {
  .il-table-wrap { display: none; }
  .il-cards      { display: flex; }
  .il-head-name  { font-size: 17px; }
  .il-stats { gap: 5px; }
  .il-filter { gap: 8px; }
  .il-search { max-width: 100%; }
  .il-filter-right { width: 100%; justify-content: space-between; }
}
@media (max-width: 900px) {
  .il-hide-md { display: none; }
}
@media (max-width: 640px) {
  .il-hide-sm { display: none !important; }
  .il-show-sm { display: block !important; }
  .il-stats { gap: 0; }

}
@media (max-width: 400px) {
  .il-status-tabs .il-tab { padding: 5px 10px; font-size: 12px; }
  .il-filter-field { display: none; }
}


/* ════════════════════════════════════════════════════════════
   COMPACT TOPBAR — Stats + Action inline
════════════════════════════════════════════════════════════ */
.vb-topbar { padding: 0 16px; }
.vb-topbar-left {
  display: flex; align-items: center;
  gap: 0; flex: 1; min-width: 0; overflow: hidden;
}
.vb-topbar-title {
  font-size: 13.5px; font-weight: 600;
  color: var(--vb-text); letter-spacing: -.2px;
  white-space: nowrap; flex-shrink: 0;
}

/* Inline stats chips in topbar */
.vb-topbar-stats {
  display: flex; align-items: center;
  gap: 0; margin-left: 16px;
  border-left: 1px solid var(--vb-border);
  padding-left: 16px; overflow-x: auto;
  flex: 1; min-width: 0;
}
.vb-tstat {
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px; border-right: 1px solid var(--vb-border);
  white-space: nowrap; flex-shrink: 0;
}
.vb-tstat:last-child { border-right: none; }
.vb-tstat-lbl { font-size: 11px; color: var(--vb-text-muted); }
.vb-tstat-val { font-size: 12.5px; font-weight: 700; }

/* Topbar action button */
.vb-topbar-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 12px; border-radius: 7px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff; font-size: 12px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: opacity var(--vb-transition); margin-right: 6px;
}
.vb-topbar-btn:hover { opacity: .88; color: #fff; }
.vb-topbar-btn i { font-size: 13px; }

/* Hide stats on small screens */
@media (max-width: 900px) { .vb-topbar-stats { display: none; } }
@media (max-width: 768px) { .vb-topbar-btn-txt { display: none; } }

/* ── User Avatar + Dropdown ─────────────────────────────── */
.vb-user-menu { position: relative; display: flex; align-items: center; }

.vb-user-avatar-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  color: #fff; font-size: 11px; font-weight: 700;
  border: 2px solid rgba(255,255,255,.2);
  cursor: pointer; letter-spacing: .3px;
  box-shadow: 0 2px 8px rgba(99,102,241,.4);
  transition: var(--vb-transition);
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.vb-user-avatar-btn:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(99,102,241,.5); }
.vb-user-avatar-btn.active { transform: scale(1.05); }

/* Dropdown — fixed to viewport top-right */
.vb-user-dropdown {
  position: fixed;
  top: 52px; right: 16px;
  width: 220px;
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15), 0 4px 16px rgba(0,0,0,.08);
  z-index: 9999;
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(.97);
  transition: opacity .18s, transform .18s, visibility .18s;
  transform-origin: top right;
}
[data-theme="dark"] .vb-user-dropdown {
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.3);
}
.vb-user-dropdown.open {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
}

/* Arrow tip */
.vb-udrop-arrow {
  position: absolute; top: -5px; right: 12px;
  width: 10px; height: 10px;
  background: var(--vb-surface);
  border-left: 1px solid var(--vb-border);
  border-top: 1px solid var(--vb-border);
  transform: rotate(45deg);
  border-radius: 2px;
}

/* Head */
.vb-user-dropdown-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--vb-border);
}
.vb-udrop-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: .3px;
}
.vb-user-dropdown-name {
  font-size: 13px; font-weight: 600; color: var(--vb-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vb-user-dropdown-firm {
  font-size: 11px; color: var(--vb-text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Body */
.vb-user-dropdown-body { padding: 5px; }
.vb-user-dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--vb-text); text-decoration: none;
  transition: background var(--vb-transition);
}
.vb-user-dropdown-item:hover { background: var(--vb-surface-2); color: var(--vb-text); }
.vb-user-dropdown-item i { font-size: 16px; color: var(--vb-text-muted); flex-shrink: 0; }
.vb-user-dropdown-item.danger { color: var(--vb-danger); }
.vb-user-dropdown-item.danger i { color: var(--vb-danger); }
.vb-user-dropdown-item.danger:hover { background: rgba(220,38,38,.08); }
.vb-udrop-divider { height: 1px; background: var(--vb-border); margin: 4px 10px; }

/* ════════════════════════════════════════════════════════════
   INVOICE LISTING PAGE
════════════════════════════════════════════════════════════ */
/* ── Invoice listing layout ─────────────────────── */
.inv-page { font-family: var(--vb-font); }

/* ══ TOP SECTION ════════════════════════════════ */
.inv-toolbar { margin-bottom: 12px; }

/* Row 1 — Stats bar */
.inv-topbar {
  display: flex; align-items: stretch;
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 10px;
  box-shadow: var(--vb-sh-xs);
  overflow: hidden; height: 44px;
  margin-bottom: 8px;
}
.inv-stats { display: flex; flex: 1; min-width: 0; overflow-x: auto; }
.inv-stat {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; flex: 1;
  border-right: 1px solid var(--vb-border);
  transition: background var(--vb-transition);
}
.inv-stat:last-child { border-right: none; }
.inv-stat:hover { background: var(--vb-surface-2); }
.inv-stat-icon { font-size: 16px; flex-shrink: 0; }
.inv-stat.s-total .inv-stat-icon { color: #6366F1; }
.inv-stat.s-due   .inv-stat-icon { color: #DC2626; }
.inv-stat.s-paid  .inv-stat-icon { color: #059669; }
.inv-stat.s-unpaid .inv-stat-icon { color: #D97706; }
.inv-stat-lbl {
  font-size: 12px; font-weight: 500;
  color: var(--vb-text-muted); white-space: nowrap; flex-shrink: 0;
}
.inv-stat-val {
  font-size: 14px; font-weight: 700;
  letter-spacing: -.3px; color: var(--vb-text); white-space: nowrap;
}
.inv-stat.s-due   .inv-stat-val { color: var(--vb-danger); }
.inv-stat.s-paid  .inv-stat-val { color: var(--vb-success); }
.inv-stat.s-unpaid .inv-stat-val { color: var(--vb-warning); }

/* Row 2 — Filter + New button */
.inv-filter-row {
  display: flex; align-items: stretch; gap: 8px;
}
.inv-filter {
  flex: 1; display: flex; align-items: stretch;
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 10px;
  box-shadow: var(--vb-sh-xs);
  overflow: hidden; height: 38px;
}
.inv-search {
  flex: 1; display: flex; align-items: center;
  padding: 0 12px; gap: 8px;
  border-right: 1px solid var(--vb-border);
  transition: background var(--vb-transition);
}
.inv-search:focus-within { background: var(--vb-surface-2); }
.inv-search i { font-size: 15px; color: var(--vb-text-muted); flex-shrink: 0; }
.inv-search input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--vb-text); font-size: 13px;
  font-family: var(--vb-font); min-width: 0;
}
.inv-search input::placeholder { color: var(--vb-text-muted); }
.inv-date-wrap {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px; border-right: 1px solid var(--vb-border);
  transition: background var(--vb-transition);
}
.inv-date-wrap:focus-within { background: var(--vb-surface-2); }
.inv-date-wrap i { font-size: 14px; color: var(--vb-text-muted); }
.inv-date-wrap input {
  border: none; outline: none; background: transparent;
  color: var(--vb-text); font-size: 13px;
  font-family: var(--vb-font); width: 130px;
}
.inv-tabs {
  display: flex; align-items: center;
  gap: 2px; padding: 4px 6px;
}
.inv-tab {
  padding: 4px 11px; border: none; background: transparent;
  border-radius: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--vb-text-muted); cursor: pointer;
  font-family: var(--vb-font); transition: var(--vb-transition);
}
.inv-tab.active { background: rgba(99,102,241,.1); color: var(--vb-brand-600); }
[data-theme="dark"] .inv-tab.active { background: rgba(129,140,248,.15); color: var(--vb-brand-400); }

/* New Invoice button */
.inv-new-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 18px; border-radius: 10px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff; font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(99,102,241,.3);
  transition: opacity var(--vb-transition);
}
.inv-new-btn:hover { opacity: .88; color: #fff; }
.inv-new-btn i { font-size: 15px; }

/* ── DESKTOP TABLE ───────────────────────────────── */
.inv-table-wrap {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 14px;
  box-shadow: var(--vb-sh-sm);
  overflow: hidden;
}
.inv-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-tbl thead tr {
  background: linear-gradient(to bottom, rgba(99,102,241,.04), rgba(99,102,241,.01));
}
.inv-tbl th {
  padding: 11px 14px; text-align: left;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--vb-text-muted);
  border-bottom: 1px solid var(--vb-border);
  white-space: nowrap;
}
.inv-tbl th:first-child { padding-left: 20px; }
.inv-tbl th:last-child  { padding-right: 16px; text-align: right; }
.inv-tbl tbody tr {
  border-bottom: 1px solid rgba(99,102,241,.05);
  transition: background var(--vb-transition);
}
.inv-tbl tbody tr:last-child { border-bottom: none; }
.inv-tbl tbody tr:hover { background: rgba(99,102,241,.03); }
.inv-tbl td {
  padding: 12px 14px; vertical-align: middle;
  color: var(--vb-text); font-size: 14px;
}
.inv-tbl td:first-child { padding-left: 20px; }
.inv-tbl td:last-child  { padding-right: 16px; }

/* Table cell styles */
.td-no    { font-family: var(--vb-font-mono); font-size: 13px; font-weight: 700; color: var(--vb-brand-500); }
.td-date  { font-size: 13px; color: var(--vb-text-muted); white-space: nowrap; }
.td-party { font-weight: 500; }
.td-mode  { font-size: 12px; color: var(--vb-text-muted); text-transform: capitalize; }
.td-amt   { font-weight: 700; letter-spacing: -.2px; text-align: right; white-space: nowrap; }
.td-bal   { font-weight: 700; text-align: right; white-space: nowrap; }
.td-bal.paid    { color: var(--vb-success); }
.td-bal.due     { color: var(--vb-danger); }

/* Status dot */
.st-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.st-dot::before {
  content: ''; width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
}
.st-dot.paid::before    { background: var(--vb-success); }
.st-dot.partial::before { background: var(--vb-warning); }
.st-dot.unpaid::before  { background: var(--vb-danger); }
.st-dot.paid    { color: var(--vb-success); }
.st-dot.partial { color: var(--vb-warning); }
.st-dot.unpaid  { color: var(--vb-danger); }

/* Action buttons */
.tbl-acts { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.tbl-act {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--vb-text-muted);
  border: none; background: transparent; cursor: pointer;
  text-decoration: none; transition: var(--vb-transition);
  font-family: var(--vb-font);
}
.tbl-act:hover      { background: var(--vb-surface-2); color: var(--vb-text); }
.tbl-act.wa:hover   { background: rgba(37,211,102,.1); color: #25D366; }
.tbl-act.edit:hover { background: rgba(99,102,241,.1); color: var(--vb-brand-500); }
.tbl-act.del:hover  { background: rgba(220,38,38,.1);  color: var(--vb-danger); }

/* Hide cols */
.hide-md { }
.hide-sm { }

/* ── MOBILE CARDS ────────────────────────────────── */
.inv-cards {
  display: none;
  flex-direction: column;
  gap: 8px;
}
.inv-card {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: var(--vb-sh-xs);
}

/* Card top row: dot + info + amount */
.inv-card-top {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 10px;
}
.inv-card-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.inv-card-dot.paid    { background: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.15); }
.inv-card-dot.partial { background: #D97706; box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.inv-card-dot.unpaid  { background: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.inv-card-info { flex: 1; min-width: 0; }
.inv-card-no {
  font-family: var(--vb-font-mono);
  font-size: 12.5px; font-weight: 700;
  color: var(--vb-brand-500);
}
.inv-card-party {
  font-size: 14px; font-weight: 500;
  color: var(--vb-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.inv-card-right { text-align: right; flex-shrink: 0; }
.inv-card-amt {
  font-size: 16px; font-weight: 800;
  color: var(--vb-text); letter-spacing: -.4px;
}
.inv-card-status { font-size: 12px; font-weight: 600; margin-top: 2px; }
.inv-card-status.paid    { color: var(--vb-success); }
.inv-card-status.partial { color: var(--vb-warning); }
.inv-card-status.unpaid  { color: var(--vb-danger); }

/* Card bottom row: date + actions */
.inv-card-bot {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--vb-border);
}
.inv-card-date {
  font-size: 12px; color: var(--vb-text-muted);
  display: flex; align-items: center; gap: 4px;
}
.inv-card-date i { font-size: 12px; }
.inv-card-acts { display: flex; gap: 5px; }
.inv-card-act {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--vb-text-muted);
  background: var(--vb-surface-2);
  border: 1px solid var(--vb-border);
  text-decoration: none; transition: var(--vb-transition);
}
.inv-card-act:hover      { border-color: var(--vb-brand-500); color: var(--vb-brand-500); }
.inv-card-act.wa         { color: #25D366; border-color: rgba(37,211,102,.25); }
.inv-card-act.wa:hover   { background: rgba(37,211,102,.08); }

/* Empty state */
.inv-empty {
  background: var(--vb-surface);
  border: 1px solid var(--vb-border);
  border-radius: 14px;
  box-shadow: var(--vb-sh-xs);
  text-align: center; padding: 60px 24px;
}
.inv-empty-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--vb-surface-2); border: 1px solid var(--vb-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--vb-text-muted);
  margin: 0 auto 14px;
}
.inv-empty-title { font-size: 16px; font-weight: 700; color: var(--vb-text); margin-bottom: 6px; }
.inv-empty-sub   { font-size: 13.5px; color: var(--vb-text-muted); margin-bottom: 18px; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) { .hide-md { display: none !important; } }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

@media (max-width: 768px) {
  /* Show cards, hide table */
  .inv-table-wrap { display: none !important; }
  .inv-cards      { display: flex !important; }

  /* Stats bar mobile */
  .inv-stats { overflow-x: auto; }
  .inv-topbar { height: 40px; }
  .inv-stat   { padding: 0 10px; gap: 6px; }
  .inv-stat-icon { font-size: 14px; }
  .inv-stat-lbl  { font-size: 10.5px; }
  .inv-stat-val  { font-size: 13px; }
  .inv-btn-txt   { display: none; }
  .inv-new-btn   { padding: 0 12px; }
  .inv-date-wrap { display: none; }

  /* Filter */
  .inv-search     { max-width: 100%; flex: 1 1 100%; }
  .inv-filter     { gap: 6px; }
  .inv-btn-txt    { display: none; }
  .inv-new-btn    { padding: 8px 12px; }
  .inv-topbar     { gap: 8px; }
}

/* ════════════════════════════════════════════════════════════
   INNOVATION LAYER — Accounting UX Improvements
════════════════════════════════════════════════════════════ */

/* ── Amount color classes ────────────────────────────────── */
.amt-pos  { color: var(--vb-amt-pos)  !important; font-weight: 600; }
.amt-neg  { color: var(--vb-amt-neg)  !important; font-weight: 600; }
.amt-zero { color: var(--vb-text-muted) !important; }
.amt-pos-bg { background: var(--vb-amt-pos-bg); color: var(--vb-amt-pos); }
.amt-neg-bg { background: var(--vb-amt-neg-bg); color: var(--vb-amt-neg); }

/* ── Number mono — tabular, aligned ─────────────────────── */
.num-mono {
  font-family: var(--vb-font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ── Row hover — subtle slide (listing tables) ───────────── */
.vb-table tbody tr {
  transition: background var(--vb-transition), transform var(--vb-transition);
}
.vb-table tbody tr:hover {
  background: rgba(99,102,241,.03);
  transform: translateX(2px);
}
[data-theme="dark"] .vb-table tbody tr:hover {
  background: rgba(129,140,248,.05);
}

/* ── Button press micro-interaction ─────────────────────── */
.vb-btn:active,
.tbl-action-btn:active,
.inv-new-btn:active,
.pg-new-btn:active {
  transform: scale(.97) !important;
  transition: transform .08s !important;
}
.vb-btn-primary:active {
  box-shadow: 0 1px 4px rgba(99,102,241,.2) !important;
}

/* ── Skeleton loading ────────────────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--vb-skeleton-base) 25%,
    var(--vb-skeleton-shine) 50%,
    var(--vb-skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--vb-r-sm);
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}
.skeleton-text  { height: 13px; border-radius: 4px; }
.skeleton-title { height: 20px; border-radius: 6px; }
.skeleton-badge { height: 22px; border-radius: 20px; width: 60px; }
.skeleton-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--vb-border);
  align-items: center;
}
.skeleton-row:last-child { border-bottom: none; }

/* ── Pulsing live dot ────────────────────────────────────── */
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(5,150,105,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(5,150,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--vb-success);
  animation: live-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--vb-success);
}

/* ── Improved print CSS ──────────────────────────────────── */
@media print {
  .vb-sidebar, .vb-topbar, .pv-actions,
  .tbl-actions, .vb-btn, .hide-print,
  .inv-filter, .pg-filter-bar,
  .inv-filter-row, nav { display: none !important; }

  .vb-main  { margin-left: 0 !important; }
  .vb-page  { padding: 0 !important; }

  .vb-table-card,
  .vb-card,
  .pv-card { box-shadow: none !important; border: 1px solid #ddd !important; }

  body { font-size: 12px !important; }

  .vb-table th,
  .vb-table td { padding: 6px 10px !important; font-size: 11px !important; }

  @page {
    margin: 1.5cm;
    size: A4;
  }
}

/* ── Dark mode skeleton ──────────────────────────────────── */
[data-theme="dark"] {
  --vb-skeleton-base:  rgba(255,255,255,.06);
  --vb-skeleton-shine: rgba(255,255,255,.02);
  --vb-amt-pos-bg:  rgba(52,211,153,.1);
  --vb-amt-neg-bg:  rgba(248,113,113,.1);
}
[data-theme="dark"] .amt-pos { color: #34D399 !important; }
[data-theme="dark"] .amt-neg { color: #F87171 !important; }


/* ── Clock Dots Loader ───────────────────────────────────── */
#vb-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: none;
  opacity: 1;
  transition: opacity .3s ease;
}
#vb-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.vbl-clock {
  position: relative;
  width: 44px;
  height: 44px;
}
.vbl-clock span {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6366F1;
  top: 50%; left: 50%;
  margin: -3.5px;
}
@keyframes vbl-fade {
  0%, 100% { opacity: .12; transform: scale(.75); }
  50%       { opacity: 1;   transform: scale(1);   }
}
.vbl-clock span:nth-child(1) { transform: translate(17px, 0);             animation: vbl-fade 1.2s ease-in-out -.0s   infinite; background:#6366F1; }
.vbl-clock span:nth-child(2) { transform: translate(12px, 12px);          animation: vbl-fade 1.2s ease-in-out -.15s  infinite; background:#7C72F3; }
.vbl-clock span:nth-child(3) { transform: translate(0, 17px);             animation: vbl-fade 1.2s ease-in-out -.3s   infinite; background:#818CF8; }
.vbl-clock span:nth-child(4) { transform: translate(-12px, 12px);         animation: vbl-fade 1.2s ease-in-out -.45s  infinite; background:#93A0F9; }
.vbl-clock span:nth-child(5) { transform: translate(-17px, 0);            animation: vbl-fade 1.2s ease-in-out -.6s   infinite; background:#A5B4FC; }
.vbl-clock span:nth-child(6) { transform: translate(-12px, -12px);        animation: vbl-fade 1.2s ease-in-out -.75s  infinite; background:#B8C4FD; }
.vbl-clock span:nth-child(7) { transform: translate(0, -17px);            animation: vbl-fade 1.2s ease-in-out -.9s   infinite; background:#C7D2FE; }
.vbl-clock span:nth-child(8) { transform: translate(12px, -12px);         animation: vbl-fade 1.2s ease-in-out -1.05s infinite; background:#DDE4FF; }

/* ─────────────────────────────────────────────
   MOBILE HARDENING
───────────────────────────────────────────── */

/* iOS Safari kisi bhi input ko 16px se chhota dekhte hi page zoom kar deta
   hai, aur wapas zoom out nahi hota. Isliye mobile par 16px. */
@media (max-width: 768px) {
  .vb-input, .vb-select, .vb-textarea,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="date"], input[type="tel"],
  input[type="search"], select, textarea {
    font-size: 16px !important;
  }
}

/* Ungli se tap karne layak targets (mouse par purane size hi rahenge) */
@media (pointer: coarse) {
  .vb-btn, .vb-icon-btn, .tbl-action-btn,
  button, .rail-item, .vb-tab {
    min-height: 40px;
  }
  .tbl-action-btn { min-width: 40px; }
  .vb-input, .vb-select { min-height: 42px; }
  input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; }
}

/* Grey flash hatao, par focus outline chhedo mat */
* { -webkit-tap-highlight-color: rgba(99,102,241,.12); }

/* Notch waale phones — bottom content kat jaata tha */
@supports (padding: max(0px)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .vb-sidebar, .rail-nav { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* Koi bhi cheez page ko chaudा na kare — horizontal scroll sabse aam
   mobile bug hai aur pakadna mushkil */
@media (max-width: 768px) {
  /* NOTE: yahan `overflow-x: hidden` MAT lagana.
     Wo html/body ko scroll container bana deta hai, aur phir
     `position: sticky` kaam karna band kar deta hai — topbar
     (app.css:319) aur invoice create ka sidebar dono sticky hain.
     `clip` scroll container nahi banata, isliye sticky safe rehta hai. */
  body { max-width: 100%; overflow-x: clip; }
  img, svg, canvas, video { max-width: 100%; height: auto; }
  table { max-width: 100%; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
  .vb-card, .vb-alert { max-width: 100%; }
}

/* Har table wrapper me scroll — jahan inline style nahi laga hai wahan bhi */
@media (max-width: 768px) {
  .vb-table-card, .vb-card > .vb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Superadmin — mobile drawer ─────────────────────────────
   Pehle sidebar mobile par display:none tha aur kholne ka koi
   tareeka nahi tha — matlab phone par SA panel me navigation
   hi nahi thi. Ab hamburger se drawer khulta hai. */
.sa-menu-btn { display: none; }

@media (max-width: 768px) {
  .sa-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-right: 8px;
    background: transparent; border: 1px solid var(--vb-border);
    border-radius: var(--vb-r-sm); color: var(--vb-text-2);
    font-size: 20px; cursor: pointer; flex-shrink: 0;
  }
  .sa-sidebar {
    display: flex !important;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 1200;
  }
  .sa-sidebar.sa-open { transform: translateX(0); }
  .sa-main { margin-left: 0 !important; }
  .sa-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 1150; opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  .sa-backdrop.sa-open { opacity: 1; pointer-events: auto; }
  .sa-topbar { padding-left: 10px !important; }
}

@media (max-width: 640px) {
  .sa-topbar h1, .sa-topbar .sa-title { font-size: 15px; }
  .sa-stat-grid, .sa-cards { grid-template-columns: 1fr !important; }
  .sa-form-grid, .form-grid { grid-template-columns: 1fr !important; }
}

/* ── Topbar — mobile par width ke andar rehna chahiye ────────
   380px par topbar me title + "+" + search + Ctrl K + theme +
   avatar + hamburger sab tha; milakar screen se bahar nikal jaata tha. */
@media (max-width: 768px) {
  .vb-topbar { padding: 0 10px; overflow: hidden; }
  .vb-topbar-actions { gap: 4px; min-width: 0; flex-shrink: 0; }
  .vb-kbd-hint { display: none; }          /* "Ctrl K" phone par bekaar hai */
  .vb-topbar-btn { padding: 0 10px; margin-right: 2px; }
  .vb-topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 420px) {
  .vb-topbar { padding: 0 8px; }
  .vb-topbar-actions { gap: 2px; }
  .vb-topbar-title { max-width: 96px; }
  /* Search icon-only ho jaayega, Ctrl K pehle hi hidden hai */
  .vb-topbar-actions .vb-icon-btn { padding: 0 8px !important; }
}

/* Grid columns kabhi apne content se chhote nahi ho paate jab tak
   minmax(0,...) na ho — ye poori app ke grids par safety net hai */
@media (max-width: 768px) {
  .vb-grid-2, .vb-grid-3, .vb-grid-4,
  .kpi-strip, .rpt-kpi-strip, .qa-grid, .pv-stats {
    grid-auto-columns: minmax(0, 1fr);
  }
  .vb-grid-2 > *, .vb-grid-3 > *, .vb-grid-4 > *,
  .kpi-strip > *, .rpt-kpi-strip > *, .qa-grid > *, .pv-stats > * {
    min-width: 0;
  }
}
