/* ============================================================
   CREDVENDOR — COMPLETE DESIGN SYSTEM
   Navy Blue + Natural Color Palette
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Typography — matches login page (Inter) */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.625rem;
  --leading-tight: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.65;
  --tracking-tight: -0.025em;
  --tracking-normal: -0.01em;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.06em;

  /* Navy Palette */
  --navy-950: #050d1a;
  --navy-900: #0a1628;
  --navy-800: #0e2040;
  --navy-700: #1a3a6b;
  --navy-600: #1e4d8c;
  --navy-500: #2460b0;
  --navy-400: #3b82d4;
  --navy-300: #60a5e8;
  --navy-200: #93c5f8;
  --navy-100: #dbeafe;
  --navy-50:  #eef5fc;

  /* Natural Palette */
  --nat-50:  #fefcf7;
  --nat-100: #f5f0e8;
  --nat-200: #e8dfc9;
  --nat-300: #d4c4a0;
  --nat-400: #b8a07a;
  --nat-500: #9a8060;
  --nat-600: #7a6048;

  /* Gold Accent */
  --gold-600: #a8780a;
  --gold-500: #c9952a;
  --gold-400: #e0a830;
  --gold-300: #f0c060;
  --gold-100: #fef3c7;

  /* Semantic Colors */
  --success:      #16a34a;
  --success-bg:   #dcfce7;
  --warning:      #d97706;
  --warning-bg:   #fef3c7;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --info:         #2563eb;
  --info-bg:      #dbeafe;

  /* Typography */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-on-dark:   #f0f6ff;
  --text-on-dark-muted: #94b4d4;

  /* Surfaces */
  --bg-page:    #f0ebe0;
  --bg-card:    #ffffff;
  --bg-card-2:  #fdfaf4;
  --bg-input:   #f8f5ef;

  /* Layout */
  --sidebar-w:      260px;
  --sidebar-w-sm:   72px;
  --header-h:       64px;
  --sidebar-transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(10,22,40,0.06);
  --shadow-sm: 0 1px 4px rgba(10,22,40,0.10), 0 1px 2px rgba(10,22,40,0.06);
  --shadow-md: 0 4px 12px rgba(10,22,40,0.12), 0 2px 4px rgba(10,22,40,0.08);
  --shadow-lg: 0 10px 30px rgba(10,22,40,0.16), 0 4px 8px rgba(10,22,40,0.10);
  --shadow-xl: 0 20px 60px rgba(10,22,40,0.22), 0 8px 20px rgba(10,22,40,0.12);

  /* Border Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 250ms ease;
  --t-slow: 400ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100%;
  overflow-x: hidden;
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mono, .field-input.mono, .po-bank-value.mono, .po-mini-muted.mono,
.po-summary-row strong.mono, .po-issuer-meta-grid .mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0.02em;
}
.tabular-nums { font-feature-settings: 'tnum' 1, 'lnum' 1; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--nat-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--nat-400); }

/* ============================================================
   LOGIN PAGE — SPLIT SCREEN
   ============================================================ */
.login-page {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ── LEFT PANEL ─────────────────────────────────────────── */
.login-left {
  width: 52%;
  height: 100vh;
  background: linear-gradient(145deg, var(--navy-950) 0%, var(--navy-800) 55%, #1a3a6b 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Animated dot-grid overlay */
.ll-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* Floating decorative shapes */
.ll-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  animation: shapeFloat 10s ease-in-out infinite;
}
.ll-shape-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(36,96,176,0.45) 0%, transparent 70%);
  top: -80px; left: -80px;
  animation-delay: 0s;
}
.ll-shape-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(201,149,42,0.2) 0%, transparent 70%);
  bottom: -40px; right: -60px;
  animation-delay: -4s;
}
.ll-shape-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(59,130,212,0.25) 0%, transparent 70%);
  top: 55%; left: 55%;
  animation-delay: -7s;
}
@keyframes shapeFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(12px, -18px) scale(1.04); }
  66%       { transform: translate(-8px, 12px) scale(0.97); }
}

/* Left content */
.ll-content {
  position: relative;
  z-index: 10;
  padding: 56px;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: llContentIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes llContentIn {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Logo */
.ll-logo {
  display: flex;
  align-items: center;
  margin: 0;
}
.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
}
.brand-logo-wrap-login {
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.brand-logo-wrap-sidebar {
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
  background: transparent;
}
.brand-logo-login {
  height: 56px;
  max-width: min(100%, 300px);
}
.brand-logo-mobile {
  height: 52px;
  max-width: min(100%, 280px);
}
.brand-logo-wrap-mobile {
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 12px;
  border-radius: 10px;
}
.brand-logo-sidebar {
  height: 38px;
  max-width: 190px;
  transition: max-width var(--sidebar-transition), height var(--sidebar-transition);
}
.sidebar.collapsed .brand-logo-wrap-sidebar {
  padding: 6px;
}
.sidebar.collapsed .brand-logo-sidebar {
  height: 30px;
  max-width: 42px;
  object-fit: cover;
  object-position: left center;
}

/* Headline */
.ll-headline { margin: 0; }
.ll-title {
  font-size: 38px;
  font-weight: 900;
  color: white;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.ll-title-accent {
  background: linear-gradient(90deg, var(--gold-300), var(--gold-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ll-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  max-width: 380px;
}

/* Features */
.ll-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
}
.ll-feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: featureIn 0.5s ease both;
  min-height: 40px;
}
.ll-feature:nth-child(1) { animation-delay: 0.15s; }
.ll-feature:nth-child(2) { animation-delay: 0.25s; }
.ll-feature:nth-child(3) { animation-delay: 0.35s; }
.ll-feature:nth-child(4) { animation-delay: 0.45s; }
@keyframes featureIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ll-feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-300);
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.ll-feature:hover .ll-feature-icon {
  background: rgba(255,255,255,0.13);
}
.ll-feature-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.ll-feature-desc {
  font-size: 12.5px;
  color: rgba(255,255,255,0.45);
  line-height: 1.55;
}

/* Stats strip */
.ll-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 20px 24px;
  margin: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}
.ll-stat {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.ll-stat-val {
  font-size: 20px;
  font-weight: 900;
  color: white;
  letter-spacing: -0.5px;
}
.ll-stat-lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 0;
  letter-spacing: 0.3px;
}
.ll-stat-divider {
  width: 1px;
  align-self: stretch;
  min-height: 36px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}

/* ── RIGHT PANEL ─────────────────────────────────────────── */
.login-right {
  width: 48%;
  height: 100vh;
  background: var(--nat-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
}
.login-right::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--nat-200) 30%, var(--nat-200) 70%, transparent);
}

.login-form-wrap {
  width: 100%;
  max-width: 420px;
  animation: formIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@keyframes formIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile logo (only visible on small screens) */
.login-mobile-logo {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

/* Form header */
.lf-header { margin-bottom: 32px; }
.lf-title {
  font-size: 30px;
  font-weight: 900;
  color: var(--navy-900);
  letter-spacing: -0.7px;
  margin-bottom: 6px;
}
.lf-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Form layout */
.login-form-new {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lf-group { display: flex; flex-direction: column; gap: 7px; }
.lf-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.1px;
}

.forgot-pwd-link {
  font-size: 12px;
  color: var(--navy-500);
  font-weight: 500;
  transition: color var(--t-fast);
}
.forgot-pwd-link:hover {
  color: var(--navy-600);
  text-decoration: underline;
}

.lf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.lf-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  transition: color var(--t-fast);
}
.lf-input {
  width: 100%;
  padding: 13px 44px 13px 46px;
  border: 1.5px solid var(--nat-200);
  border-radius: 12px;
  background: white;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  outline: none;
  box-shadow: 0 1px 3px rgba(10,22,40,0.05);
}
.lf-input::placeholder { color: var(--text-muted); }
.lf-input:focus {
  border-color: var(--navy-500);
  box-shadow: 0 0 0 4px rgba(36,96,176,0.10), 0 1px 3px rgba(10,22,40,0.05);
}
.lf-input-wrap:focus-within .lf-icon { color: var(--navy-500); }

.lf-eye-btn {
  position: absolute; right: 13px;
  background: none; border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--t-fast), background var(--t-fast);
}
.lf-eye-btn:hover { color: var(--navy-600); background: var(--nat-100); }

/* Remember me */
.lf-row { margin-top: -4px; }
.lf-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}
.lf-check-input { display: none; }
.lf-checkmark {
  width: 19px; height: 19px;
  border: 1.5px solid var(--nat-300);
  border-radius: 5px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
  box-shadow: 0 1px 2px rgba(10,22,40,0.06);
}
.lf-check-input:checked + .lf-checkmark {
  background: var(--navy-600);
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(36,96,176,0.15);
}
.lf-check-input:checked + .lf-checkmark::after {
  content: '';
  display: block;
  width: 10px; height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

/* Error */
.lf-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  animation: shake 0.4s ease;
}

/* Submit button */
.lf-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 60%, var(--navy-500) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 20px rgba(10,32,64,0.35), 0 1px 3px rgba(10,32,64,0.2);
  margin-top: 4px;
}
.lf-submit-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.5s ease;
}
.lf-submit-btn:hover::before { left: 100%; }
.lf-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(10,32,64,0.4), 0 2px 6px rgba(10,32,64,0.2);
}
.lf-submit-btn:active { transform: translateY(0); }
.lf-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.lf-btn-arrow {
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t-fast);
}
.lf-submit-btn:hover .lf-btn-arrow { transform: translateX(3px); }

/* Divider */
.lf-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}
.lf-divider::before, .lf-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--nat-200);
}

/* Security badges */
.lf-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.lf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 99px;
  background: white;
  border: 1px solid var(--nat-200);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(10,22,40,0.06);
}
.lf-badge svg { color: var(--navy-600); }

.lf-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 28px;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-page { flex-direction: column; height: auto; min-height: 100vh; overflow: auto; }
  .login-left  { display: none; }
  .login-right { width: 100%; height: auto; min-height: 100vh; overflow: auto; }
  .login-mobile-logo { display: flex; }
  .login-form-wrap { max-width: 440px; }
}
@media (max-width: 480px) {
  .login-right { padding: 36px 20px; }
  .lf-title { font-size: 26px; }
}



/* ============================================================
   BUTTON SYSTEM
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-fast);
  cursor: pointer; border: none;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
  color: white;
  box-shadow: 0 4px 16px rgba(30,77,140,0.4);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  box-shadow: 0 6px 20px rgba(30,77,140,0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--nat-100);
  color: var(--text-primary);
  border: 1px solid var(--nat-300);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--nat-200);
  border-color: var(--nat-400);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fca5a5;
}
.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}
.btn-success:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(22,163,74,0.4);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-500));
  color: white;
  box-shadow: 0 4px 12px rgba(201,149,42,0.35);
}
.btn-gold:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(201,149,42,0.45);
}

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn-icon {
  padding: 8px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.btn-icon:hover {
  background: var(--nat-100);
  border-color: var(--nat-300);
  color: var(--text-primary);
}
.btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); border-color: #fca5a5; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  display: flex;
  flex-direction: column;
  transition: width var(--sidebar-transition), min-width var(--sidebar-transition);
  overflow: hidden;
  position: relative;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0,0,0,0.25);
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
}
.sidebar.collapsed {
  width: var(--sidebar-w-sm);
  min-width: var(--sidebar-w-sm);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: var(--header-h);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-toggle {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.06);
  color: var(--text-on-dark-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: all var(--t-fast);
  flex-shrink: 0;
  line-height: 1;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.12); color: white; }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  color: var(--text-on-dark-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-on-dark);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(30,77,140,0.6), rgba(36,96,176,0.4));
  color: white;
  box-shadow: 0 2px 8px rgba(30,77,140,0.3);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--navy-300);
  border-radius: 0 2px 2px 0;
}
.nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-label {
  transition: opacity var(--sidebar-transition), width var(--sidebar-transition);
  opacity: 1;
}
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
  flex-shrink: 0;
}
.sidebar-user-info {
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: opacity var(--sidebar-transition);
}
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text-on-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text-on-dark-muted); white-space: nowrap; }

.logout-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.06);
  color: var(--text-on-dark-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.logout-btn:hover { background: rgba(220,38,38,0.2); color: #fca5a5; }

/* ============================================================
   MAIN AREA
   ============================================================ */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--nat-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.mobile-menu-btn {
  display: none;
  padding: 8px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  transition: all var(--t-fast);
}
.mobile-menu-btn:hover { background: var(--nat-100); color: var(--text-primary); }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
}
#page-title {
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.header-right { display: flex; align-items: center; gap: 16px; }
.header-clock {
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.header-divider { width: 1px; height: 24px; background: var(--nat-200); }
.header-user { display: flex; align-items: center; gap: 10px; }
.header-user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
}
.header-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg-page);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header-info h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.page-header-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.65;
}
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--nat-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--nat-200);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.3;
}
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.card-body { padding: 22px; }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--nat-200);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--navy-500));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.kpi-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  background: var(--kpi-bg, var(--navy-100));
}
.kpi-icon-wrap svg { color: var(--kpi-color, var(--navy-500)); }
.kpi-value {
  font-size: 28px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.8px;
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.kpi-change {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.kpi-change.up { background: var(--success-bg); color: var(--success); }
.kpi-change.down { background: var(--danger-bg); color: var(--danger); }

.currency-value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.42em;
  white-space: nowrap;
}
.currency-symbol {
  font-weight: 700;
  opacity: 0.9;
}
.currency-amount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Invoice history summary cards */
.invoice-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}
.invoice-kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 22px 24px 26px;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid var(--nat-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  min-height: 112px;
  height: 100%;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.invoice-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--kpi-color, var(--navy-500)) 24%, var(--nat-200));
}
.invoice-kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--kpi-color, var(--navy-500));
}
.invoice-kpi-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kpi-bg, var(--navy-100));
  color: var(--kpi-color, var(--navy-500));
}
.invoice-kpi-icon svg { display: block; }
.invoice-kpi-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
  padding-bottom: 2px;
}
.invoice-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.3;
}
.invoice-kpi-value {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.03em;
}
.invoice-kpi-value.is-currency {
  font-size: clamp(0.9rem, 1.2vw, 1.35rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.invoice-kpi-value.is-currency .currency-value {
  gap: 0.5em;
}

.vendor-account-dash {
  margin-bottom: 22px;
}
.vendor-account-dash-greeting {
  margin-bottom: 16px;
}
.vendor-account-dash-greeting h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-900);
  margin: 0 0 4px;
}
.vendor-account-dash-greeting p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead tr {
  background: var(--nat-50);
  border-bottom: 2px solid var(--nat-200);
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-secondary);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--nat-100);
  transition: background var(--t-fast);
}
tbody tr:hover { background: var(--nat-50); }
tbody tr:last-child { border-bottom: none; }
tbody td {
  padding: 13px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}
td.actions { display: flex; gap: 6px; align-items: center; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-navy    { background: var(--navy-100);   color: var(--navy-700); }
.badge-gold    { background: var(--gold-100);   color: var(--gold-600); }
.badge-muted   { background: var(--nat-200);    color: var(--text-secondary); }
.badge-partial { background: #e0e7ff; color: #4338ca; } /* Indigo for Partial */

/* ============================================================
   FORMS
   ============================================================ */
.form-section { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group.full { grid-column: 1 / -1; }

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.1px;
}
.field-input, .field-select, .field-textarea {
  padding: 13px 14px;
  border: 1.5px solid var(--nat-200);
  border-radius: 12px;
  background: white;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  width: 100%;
  box-shadow: 0 1px 3px rgba(10, 22, 40, 0.05);
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--navy-500);
  box-shadow: 0 0 0 4px rgba(36, 96, 176, 0.1), 0 1px 3px rgba(10, 22, 40, 0.05);
}
.field-input:disabled { background: var(--nat-100); color: var(--text-muted); cursor: not-allowed; }
.field-input.field-input-readonly,
.field-input:read-only {
  background: var(--nat-100);
  color: var(--text-secondary);
  cursor: default;
}
.field-textarea { min-height: 90px; resize: vertical; }
.field-select { cursor: pointer; }

/* Plain numeric inputs — no browser spinner arrows */
.field-input-numeric {
  -moz-appearance: textfield;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
}
.field-input-numeric::-webkit-outer-spin-button,
.field-input-numeric::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Search Bar */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 340px;
}
.search-bar input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--nat-200);
  border-radius: var(--r-md);
  background: white;
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.search-bar input:focus {
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(59,130,212,0.10);
}
.search-bar .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* Raise Orders date filter bar */
.ro-card-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.ro-toolbar {
  justify-content: flex-end;
  max-width: 100%;
}
.ro-date-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ro-date-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.ro-date-input {
  width: auto;
  min-width: 140px;
  padding: 8px 10px;
  font-size: 13px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,13,26,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }

.modal-container {
  background: white;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlide 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal-container.modal-wide { max-width: 760px; }
.modal-container.modal-xl { max-width: 1200px; }
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--nat-200);
}
.modal-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-header-actions.hidden {
  display: none;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--nat-100);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--nat-200);
  background: var(--nat-50);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: white;
  border: 1px solid var(--nat-200);
  box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 380px;
  font-size: 13.5px; font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--navy-500); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; color: var(--text-primary); }
.toast-close { color: var(--text-muted); font-size: 14px; padding: 2px; transition: color var(--t-fast); }
.toast-close:hover { color: var(--text-primary); }

/* ============================================================
   ANALYTICS
   ============================================================ */
.analytics-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.chart-area {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--nat-200);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.chart-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; }
.chart-container { position: relative; }

/* SVG Charts */
.bar-chart svg, .line-chart svg { width: 100%; overflow: visible; }
.chart-bar { transition: opacity var(--t-fast); cursor: default; }
.chart-bar:hover { opacity: 0.75; }
.chart-axis-label { font-size: 11px; fill: var(--text-muted); font-family: var(--font-sans); }
.chart-value-label { font-size: 10px; fill: var(--text-secondary); font-family: var(--font-sans); font-weight: 600; }
.chart-grid-line { stroke: var(--nat-200); stroke-width: 1; stroke-dasharray: 3 3; }

.activity-feed { display: flex; flex-direction: column; gap: 1px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--nat-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-text { font-size: 13px; color: var(--text-primary); flex: 1; }
.activity-time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   INVENTORY
   ============================================================ */
.stock-indicator {
  display: flex; align-items: center; gap: 8px;
}
.stock-bar {
  width: 60px; height: 5px;
  background: var(--nat-200);
  border-radius: var(--r-full);
  overflow: hidden;
}
.stock-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--success);
}
.stock-fill.low { background: var(--warning); }
.stock-fill.critical { background: var(--danger); }

/* ============================================================
   PROJECTS (KANBAN)
   ============================================================ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban-col {
  background: var(--nat-100);
  border-radius: var(--r-lg);
  border: 1px solid var(--nat-200);
  overflow: hidden;
}
.kanban-col-header {
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--col-color, var(--nat-300));
}
.kanban-col-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.kanban-col-title .col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--col-color, var(--nat-300));
}
.kanban-count {
  background: white; border: 1px solid var(--nat-200);
  border-radius: var(--r-full);
  padding: 1px 8px;
  font-size: 11px; font-weight: 700;
  color: var(--text-secondary);
}
.kanban-cards { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; }

.project-card {
  background: white;
  border-radius: var(--r-md);
  border: 1px solid var(--nat-200);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
  cursor: pointer;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.project-card-client { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.project-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-card-deadline { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.project-progress { margin-top: 10px; }
.progress-bar {
  height: 4px; background: var(--nat-200); border-radius: var(--r-full); overflow: hidden;
}
.progress-fill { height: 100%; border-radius: var(--r-full); background: var(--navy-500); transition: width 0.4s ease; }
.project-card-actions { display: flex; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--nat-100); }

/* ============================================================
   INVOICE
   ============================================================ */
.invoice-preview {
  background: white;
  border-radius: var(--r-lg);
  border: 2px solid var(--nat-200);
  padding: 40px;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.invoice-preview-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--navy-900);
}
.invoice-preview-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 62%;
}
.invoice-company-logo {
  flex-shrink: 0;
  max-height: 72px;
  max-width: 200px;
  object-fit: contain;
  object-position: left top;
}
.invoice-preview-company { min-width: 0; width: 100%; }
.invoice-preview .company-name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
.invoice-preview .company-sub { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 8px; line-height: var(--leading-normal); }
.invoice-address-block {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 8px;
}
.invoice-number-badge {
  background: var(--navy-900); color: white;
  padding: 8px 18px; border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.invoice-number-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.invoice-po-under-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.invoice-header-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}
.invoice-meta-bill > * + * { margin-top: 10px; }
.invoice-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; margin-bottom: 0; }
.invoice-meta-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  margin-bottom: 6px;
}
.invoice-meta-value { font-size: var(--text-base); color: var(--text-primary); font-weight: 600; line-height: var(--leading-tight); }
.invoice-meta-stack > div + div { margin-top: 14px; }
.invoice-conversion-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--nat-200);
  text-align: right;
}
.invoice-conversion-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.invoice-conversion-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}
.invoice-items-table { width: 100%; border-collapse: collapse; margin-bottom: 0; font-size: var(--text-sm); }
.invoice-items-table th {
  padding: 9px 12px; text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  background: var(--navy-900); color: white;
}
.invoice-items-table td { padding: 13px 14px; border-bottom: 1px solid var(--nat-200); }
.invoice-totals { display: flex; justify-content: flex-end; }
.invoice-totals-box { min-width: 240px; }
.invoice-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 28px 36px;
  align-items: start;
  margin-top: 0;
}
.invoice-summary-bank { min-width: 0; }
.invoice-summary-totals.invoice-totals {
  justify-content: flex-end;
  margin-bottom: 0;
}
.invoice-bank-block {
  padding-top: 2px;
}
.invoice-bank-block .invoice-meta-label {
  margin-bottom: 10px;
}
.invoice-bank-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.invoice-bank-row {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  line-height: 1.4;
}
.invoice-bank-row-label {
  flex: 0 0 100px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11.5px;
}
.invoice-bank-row-value {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}
.invoice-bank-row-value.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.invoice-bank-empty {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.invoice-history-card .invoice-history-table {
  overflow-x: auto;
}
.invoice-history-card table {
  font-size: 12.5px;
}
.invoice-history-card thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--nat-50);
  padding: 10px 12px;
  font-size: 11px;
}
.invoice-history-card thead th:first-child,
.invoice-history-card tbody td:first-child {
  padding-left: 20px;
}
.invoice-history-card tbody td {
  padding: 10px 12px;
}
.invoice-history-card .invoice-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: flex-start;
  justify-content: flex-start;
}
.invoice-history-card td.invoice-actions-cell {
  vertical-align: top;
  white-space: nowrap;
}
.modal-container.modal-xl .modal-body {
  padding: 20px;
}
.modal-container.modal-xl .invoice-preview {
  padding: 32px;
  gap: 28px;
}
@media (max-width: 720px) {
  .invoice-summary-row {
    grid-template-columns: 1fr;
  }
  .invoice-summary-totals .invoice-totals-box {
    width: 100%;
    min-width: 0;
  }
}
.invoice-total-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: var(--text-sm); }
.invoice-total-row.grand {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--navy-900);
  border-top: 2px solid var(--navy-900);
  padding-top: 14px;
  margin-top: 8px;
  letter-spacing: var(--tracking-tight);
}
.invoice-notes { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--nat-200); font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); }
.invoice-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 36px;
  align-items: start;
  margin-top: 0;
  padding-top: 20px;
  border-top: 1px solid var(--nat-200);
}
.invoice-footer-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.invoice-footer-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.invoice-footer-signature {
  text-align: center;
  min-width: 150px;
  align-self: start;
}
.invoice-signature-img {
  display: block;
  margin: 0 auto 2px;
  max-height: 72px;
  max-width: 160px;
  object-fit: contain;
}
.invoice-signature-placeholder {
  height: 36px;
}
.invoice-signature-line {
  border-top: 1px solid var(--nat-400);
  margin: 2px 0 4px;
}
.invoice-signature-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--text-muted);
}
.vendor-invoice-pdf-host {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 920px;
  background: #fff;
  z-index: -1;
  pointer-events: none;
}
.vendor-invoice-pdf-host .invoice-preview {
  box-shadow: none;
  border: none;
}
@media (max-width: 640px) {
  .invoice-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .invoice-footer-signature {
    justify-self: start;
  }
}

/* Steps */
.steps-bar {
  display: flex; align-items: center;
  gap: 0;
  margin-bottom: 30px;
}
.step {
  display: flex; align-items: center; gap: 0;
  flex: 1;
}
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  border: 2px solid var(--nat-200);
  background: white;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--t-base);
  z-index: 1;
}
.step.active .step-circle { border-color: var(--navy-600); background: var(--navy-600); color: white; }
.step.done .step-circle   { border-color: var(--success); background: var(--success); color: white; }
.step-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 10px;
  white-space: nowrap;
  letter-spacing: var(--tracking-wide);
}
.step.active .step-label, .step.done .step-label { color: var(--text-primary); }
.step-line {
  flex: 1; height: 2px;
  background: var(--nat-200);
  transition: background var(--t-base);
}
.step.done .step-line { background: var(--success); }
.step:last-child .step-line { display: none; }
.step-wrapper { display: flex; align-items: center; gap: 8px; flex: 1; }

/* Line Items */
.line-items-table { width: 100%; border-collapse: collapse; }
.line-items-table th {
  padding: 8px 10px; text-align: left;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary); border-bottom: 2px solid var(--nat-200);
}
.line-items-table td { padding: 8px 10px; border-bottom: 1px solid var(--nat-100); vertical-align: middle; }
.line-items-table input { padding: 7px 10px; border: 1.5px solid var(--nat-200); border-radius: var(--r-sm); font-size: 13px; width: 100%; outline: none; }
.line-items-table input:focus { border-color: var(--navy-400); box-shadow: 0 0 0 2px rgba(59,130,212,0.1); }
.totals-section { margin-top: 16px; padding: 16px; background: var(--nat-50); border-radius: var(--r-md); border: 1px solid var(--nat-200); }
.total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: var(--text-sm); color: var(--text-primary); font-feature-settings: 'tnum' 1, 'lnum' 1; }
.total-row.grand-total { font-size: var(--text-lg); font-weight: 800; color: var(--navy-800); border-top: 2px solid var(--nat-300); margin-top: 8px; padding-top: 12px; letter-spacing: var(--tracking-tight); }

/* ============================================================
   ACCOUNT PAGE
   ============================================================ */
.account-layout { display: grid; grid-template-columns: 280px 1fr; gap: 22px; align-items: start; }
#account-tab-content { display: flex; flex-direction: column; gap: 18px; }
.profile-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--nat-200);
  box-shadow: var(--shadow-sm);
  padding: 28px 22px;
  text-align: center;
}
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
.profile-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: white;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(26,58,107,0.4);
}
.profile-badge {
  position: absolute; bottom: 4px; right: 0;
  background: var(--success);
  border: 2px solid white;
  border-radius: 50%; width: 18px; height: 18px;
}
.profile-name { font-size: 19px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }
.profile-email { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.profile-role-badge {
  display: inline-flex; margin-top: 10px;
  padding: 4px 14px;
  border-radius: var(--r-full);
  background: var(--navy-100);
  color: var(--navy-700);
  font-size: 12px; font-weight: 700;
}
.profile-stats { display: flex; gap: 0; margin-top: 22px; border-top: 1px solid var(--nat-200); }
.profile-stat { flex: 1; padding: 16px 8px; text-align: center; }
.profile-stat + .profile-stat { border-left: 1px solid var(--nat-200); }
.profile-stat-val { font-size: 18px; font-weight: 800; color: var(--navy-700); }
.profile-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 24px;
  text-align: center;
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-desc  { font-size: 13.5px; color: var(--text-secondary); max-width: 320px; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    position: fixed; inset: 0;
    padding: 32px;
    background: white;
    font-size: 12pt;
  }
  .no-print { display: none !important; }
}

.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  background: var(--nat-100);
  border: 1px solid var(--nat-200);
  border-radius: var(--r-md);
}
.account-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.account-tab.active {
  background: white;
  color: var(--navy-800);
  box-shadow: var(--shadow-sm);
}
.account-brand-box {
  min-height: 120px;
  border: 1.5px dashed var(--nat-300);
  border-radius: var(--r-md);
  background: var(--nat-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.account-brand-image {
  max-height: 72px;
  max-width: 100%;
  object-fit: contain;
}
.account-brand-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.account-pmt-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.account-pmt-alert {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.45;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .account-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app-shell { position: relative; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--sidebar-transition), width var(--sidebar-transition);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .page-content { padding: 16px; overflow-x: hidden; }
  .kanban-board { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .invoice-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .invoice-kpi-card { min-width: 0; }
  .dashboard-grid-row { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .invoice-kpi-grid { grid-template-columns: 1fr; row-gap: 16px; }
  .dashboard-grid-row { grid-template-columns: 1fr; gap: 10px; }
  .login-card { padding: 32px 24px; }
  .modal-container { max-width: 100%; border-radius: var(--r-lg); }
}

/* ============================================================
   PROJECT TABLE VIEW
   ============================================================ */

/* Filter bar */
.project-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pf-search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1.5px solid var(--nat-200);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--text-muted);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.pf-search:focus-within {
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(36,96,176,0.09);
  color: var(--navy-500);
}
.pf-search input {
  border: none; outline: none;
  font-size: 13.5px;
  color: var(--text-primary);
  background: transparent;
  width: 100%;
}
.pf-search input::placeholder { color: var(--text-muted); }

.pf-select {
  padding: 9px 14px;
  border: 1.5px solid var(--nat-200);
  border-radius: 10px;
  background: white;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.pf-select:focus { border-color: var(--navy-400); }

.pf-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--nat-100);
  border: 1.5px solid var(--nat-200);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.pf-reset-btn:hover { background: var(--nat-200); color: var(--text-primary); }

/* Status pills */
.status-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  background: white;
  border: 1.5px solid var(--nat-200);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
}
.status-pill span {
  background: var(--nat-100);
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.status-pill:hover { border-color: var(--navy-300); color: var(--navy-700); }
.status-pill.active {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: white;
}
.status-pill.active span { background: rgba(255,255,255,0.15); color: white; }

/* Project table */
.project-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.project-table thead tr {
  background: var(--nat-50);
  border-bottom: 2px solid var(--nat-200);
}
.project-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.project-table td {
  padding: 11px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--nat-100);
}
.project-table tbody tr:last-child td { border-bottom: none; }

.project-row {
  cursor: pointer;
  transition: background var(--t-fast);
}
.project-row:hover { background: var(--nat-50); }

/* Metric column headers */
.metric-header {
  text-align: center;
  font-size: 12px !important;
  letter-spacing: 0.5px !important;
}
.metric-header.oq { color: var(--navy-500) !important; }

/* Metric values */
.metric-val {
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.metric-val.oq.highlight {
  color: var(--navy-500);
  font-weight: 800;
  background: var(--navy-100);
  border-radius: 6px;
}
.metric-val.do_.warn { color: var(--warning); font-weight: 700; }

/* Project ID */
.proj-id {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-700);
  letter-spacing: 0.2px;
}

/* Region */
.region-cell { display: flex; flex-direction: column; gap: 2px; }
.country-code {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  background: var(--nat-100);
  border: 1px solid var(--nat-200);
  border-radius: 4px;
  padding: 1px 5px;
  width: fit-content;
}
.country-name { font-size: 12.5px; color: var(--text-primary); font-weight: 500; white-space: nowrap; }

/* Complete progress */
.complete-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.complete-frac {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.complete-frac span { color: var(--text-muted); font-weight: 500; }
.complete-bar-wrap {
  width: 56px; height: 4px;
  background: var(--nat-200);
  border-radius: 99px;
  overflow: hidden;
}
.complete-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-500), var(--navy-400));
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* Icon buttons */
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1.5px solid var(--nat-200);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--navy-100);
  border-color: var(--navy-300);
  color: var(--navy-600);
  box-shadow: 0 2px 6px rgba(36,96,176,0.12);
}
.icon-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Status badges (project-specific) */
.proj-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.status-live     { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-closed   { background: var(--nat-100); color: var(--text-secondary); border: 1px solid var(--nat-200); }
.status-paused   { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-supplier { background: var(--navy-100); color: var(--navy-700); border: 1px solid #bfdbfe; }
.status-testing  { background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe; }
.status-pending  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

/* Row action menu */
.row-menu-wrap { position: relative; display: inline-block; }
.row-menu-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  font-size: 18px; color: var(--text-muted);
  cursor: pointer; line-height: 1;
  transition: all var(--t-fast);
}
.row-menu-btn:hover { background: var(--nat-100); color: var(--text-primary); }
.row-menu {
  position: absolute;
  right: 0; top: calc(100% + 4px);
  background: white;
  border: 1.5px solid var(--nat-200);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 110px;
  z-index: 200;
  overflow: hidden;
}
.row-menu button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast);
}
.row-menu button:hover { background: var(--nat-50); }

/* ── Updates circle badge ─────────────────────────────── */
.updates-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  flex-shrink: 0;
}
.uc-zero { background: var(--nat-100); color: var(--text-muted);   border: 1.5px solid var(--nat-200); }
.uc-low  { background: #dbeafe;        color: #1d4ed8;             border: 1.5px solid #bfdbfe; }
.uc-mid  { background: #d1fae5;        color: #065f46;             border: 1.5px solid #a7f3d0; }
.uc-high { background: #fef3c7;        color: #92400e;             border: 1.5px solid #fde68a; }
.uc-max  { background: #fee2e2;        color: #991b1b;             border: 1.5px solid #fca5a5; }




/* ============================================================
   CHATBOT WIDGET
   ============================================================ */

#chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-sans);
}

#chatbot-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(30, 77, 140, 0.45), 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  color: white;
}
#chatbot-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 28px rgba(30, 77, 140, 0.55), 0 4px 12px rgba(0,0,0,0.2);
}
#chatbot-toggle:active { transform: scale(0.97); }

.chatbot-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: #ef4444; color: white;
  border-radius: 50%; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}
.chatbot-badge.hidden { display: none; }

.chatbot-panel {
  position: absolute; bottom: 66px; right: 0; width: 360px;
  background: white; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(10, 22, 40, 0.18), 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid var(--nat-200);
  display: flex; flex-direction: column; overflow: hidden;
  transition: opacity 0.25s, transform 0.25s;
  transform-origin: bottom right;
}
.chatbot-closed { opacity: 0; transform: scale(0.85) translateY(12px); pointer-events: none; }
.chatbot-open   { opacity: 1; transform: scale(1) translateY(0);        pointer-events: all; }

.chatbot-header {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.chatbot-header-info { display: flex; align-items: center; gap: 10px; }
.chatbot-avatar {
  width: 34px; height: 34px; background: rgba(255,255,255,0.15);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1.5px solid rgba(255,255,255,0.2);
}
.chatbot-header-title { color: white; font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.chatbot-header-sub   { color: rgba(255,255,255,0.65); font-size: 11px; font-weight: 500; margin-top: 1px; }
.chatbot-header-btn {
  width: 28px; height: 28px; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  color: rgba(255,255,255,0.8); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.chatbot-header-btn:hover { background: rgba(255,255,255,0.22); color: white; }

.chatbot-messages {
  flex: 1; overflow-y: auto; padding: 14px 14px 8px; max-height: 320px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--nat-300) transparent;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: var(--nat-300); border-radius: 4px; }

.chatbot-msg { display: flex; align-items: flex-end; gap: 8px; }
.chatbot-msg-bot  { flex-direction: row; }
.chatbot-msg-user { flex-direction: row-reverse; }

.chatbot-msg-avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chatbot-msg-bubble { max-width: 82%; }
.chatbot-msg-bot .chatbot-msg-bubble {
  background: var(--nat-50); border: 1px solid var(--nat-200);
  border-radius: 16px 16px 16px 4px; padding: 10px 13px;
}
.chatbot-msg-user .chatbot-msg-bubble {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  border-radius: 16px 16px 4px 16px; padding: 10px 13px;
}
.chatbot-msg-text { font-size: 12.5px; line-height: 1.55; color: var(--text-primary); }
.chatbot-msg-text ul {
  margin: 6px 0 8px 0;
  padding-left: 18px;
}
.chatbot-msg-text li {
  margin: 2px 0;
}
.chatbot-msg-user .chatbot-msg-text { color: white; }
.chatbot-msg-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-align: right; }
.chatbot-msg-user .chatbot-msg-time { color: rgba(255,255,255,0.55); }

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chat-qr-btn {
  padding: 5px 12px;
  border: 1px solid var(--navy-500, #2460b0);
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--navy-700, #1e4d8c);
  transition: all 0.15s;
  line-height: 1.3;
}
.chat-qr-btn:hover {
  background: var(--navy-600, #2460b0);
  color: #fff;
  border-color: var(--navy-600, #2460b0);
}
.chat-qr-btn:active { transform: scale(0.97); }

.chatbot-typing-dots { display: flex; gap: 4px; align-items: center; padding: 4px 2px; }
.chatbot-typing-dots span {
  width: 7px; height: 7px; background: var(--navy-400); border-radius: 50%;
  animation: chatbotBounce 1.2s infinite;
}
.chatbot-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatbotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chatbot-chips {
  padding: 8px 12px 4px; display: flex; gap: 6px; flex-wrap: wrap;
  border-top: 1px solid var(--nat-100);
}
.chatbot-chip {
  background: var(--nat-50); border: 1px solid var(--nat-200);
  color: var(--navy-700); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 99px; cursor: pointer;
  transition: all 0.15s; font-family: var(--font-sans); white-space: nowrap;
}
.chatbot-chip:hover { background: var(--navy-100); border-color: var(--navy-300); color: var(--navy-800); transform: translateY(-1px); }

.chatbot-input-area {
  padding: 10px 12px 12px; display: flex; gap: 8px; align-items: center;
  border-top: 1px solid var(--nat-200); background: white;
}
.chatbot-input {
  flex: 1; border: 1.5px solid var(--nat-200); border-radius: 12px;
  padding: 9px 14px; font-size: var(--text-sm); font-family: var(--font-sans);
  color: var(--text-primary); background: var(--nat-50); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chatbot-input:focus {
  border-color: var(--navy-400); box-shadow: 0 0 0 3px rgba(36, 96, 176, 0.1); background: white;
}
.chatbot-input::placeholder { color: var(--text-muted); }

.chatbot-send-btn {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  border: none; border-radius: 10px; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s; box-shadow: 0 2px 8px rgba(30, 77, 140, 0.3);
}
.chatbot-send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30, 77, 140, 0.4); }
.chatbot-send-btn:active { transform: scale(0.95); }




/* Chatbot status dot */
.chatbot-status-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid white;
}
.chatbot-status-dot.loading  { background: #f59e0b; animation: chatbotPulse 1.2s infinite; }
.chatbot-status-dot.ready    { background: #22c55e; }
.chatbot-status-dot.thinking { background: #3b82f6; animation: chatbotPulse 0.8s infinite; }
@keyframes chatbotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* Chatbot footer */
.chatbot-footer {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 12px 8px;
  font-size: 10px; font-weight: 500; color: var(--text-muted);
  border-top: 1px solid var(--nat-100);
  background: var(--nat-50);
}

/* Purchase Order searchable selects */
.po-search-select {
  position: relative;
  z-index: 1;
}

.po-search-select-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--nat-200);
  border-radius: 12px;
  background: white;
  box-shadow: 0 1px 3px rgba(10, 22, 40, 0.05);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.po-search-select-control:focus-within {
  border-color: var(--navy-500);
  box-shadow: 0 0 0 4px rgba(36, 96, 176, 0.1), 0 1px 3px rgba(10, 22, 40, 0.05);
}

.po-search-select-control .search-icon {
  position: static;
  transform: none;
  color: var(--text-muted);
  flex-shrink: 0;
}

.po-search-select-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
}

.po-search-select-input::placeholder {
  color: var(--text-muted);
}

.po-search-select-toggle {
  border: none;
  background: var(--nat-50);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}

.po-search-select-toggle:hover {
  background: var(--navy-100);
  color: var(--navy-700);
}

.po-search-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 320px;
  overflow-x: hidden;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--nat-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.po-search-select-menu.is-fixed {
  z-index: 5000;
  border-color: var(--navy-200);
}

.po-search-menu-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 16px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  background: var(--nat-50);
  border-bottom: 1px solid var(--nat-200);
}

.po-search-option {
  width: 100%;
  text-align: left;
  border: none;
  background: white;
  padding: 12px 16px;
  min-height: 52px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--nat-100);
  transition: background var(--t-fast);
}

.po-search-option:last-child {
  border-bottom: none;
}

.po-search-option:hover,
.po-search-option.active {
  background: var(--navy-50);
}

.po-search-option.active {
  box-shadow: inset 3px 0 0 var(--navy-500);
}

.po-search-option-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--leading-tight);
  word-break: break-word;
}

.po-search-option-meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.po-search-empty {
  padding: 20px 16px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: var(--leading-relaxed);
}

.po-search-select-menu::-webkit-scrollbar {
  width: 8px;
}
.po-search-select-menu::-webkit-scrollbar-thumb {
  background: var(--nat-300);
  border-radius: var(--r-full);
}
.po-search-select-menu::-webkit-scrollbar-thumb:hover {
  background: var(--nat-400);
}

.po-project-panel {
  border: 1px solid var(--nat-200);
  border-radius: var(--r-md);
  background: white;
  overflow: hidden;
  margin-bottom: 20px;
}

.po-project-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nat-200);
  background: var(--nat-50);
  flex-wrap: wrap;
}

.po-project-search {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.po-project-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.po-project-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid var(--nat-200);
  border-radius: var(--r-md);
  background: white;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
}

.po-project-search input:focus {
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(59,130,212,0.10);
}

.po-project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.po-project-count {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  background: white;
  border: 1px solid var(--nat-200);
  border-radius: 999px;
}

.po-project-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.po-project-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.po-project-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.po-project-table thead tr {
  background: var(--nat-50);
  border-bottom: 2px solid var(--nat-200);
}

.po-project-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.po-project-table td {
  padding: 14px;
  border-bottom: 1px solid var(--nat-100);
  font-size: 13.5px;
  vertical-align: middle;
}

.po-col-check {
  width: 56px;
  text-align: center;
}

.po-col-id {
  width: 72px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
}

.po-col-title {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-col-country {
  width: 140px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-col-qty {
  width: 80px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.po-project-table th.po-col-qty {
  text-align: center;
}

.po-project-table th {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}
.po-project-table td { font-size: var(--text-sm); }
.po-col-cpi, .po-mini-line-amt, .po-mini-grand span:last-child {
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.po-col-cpi {
  width: 110px;
  text-align: right;
  font-weight: 700;
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
}

.po-project-table th.po-col-cpi {
  text-align: right;
}

.po-project-table th.po-col-check {
  text-align: center;
}

.po-project-check-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  cursor: pointer;
}

.po-project-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.po-project-row:hover {
  background: var(--nat-50);
}

.po-project-row.selected {
  background: var(--navy-50);
}

.po-project-row.selected:hover {
  background: #e8f0fa;
}

.po-project-checkbox {
  width: 17px;
  height: 17px;
  min-width: 17px;
  min-height: 17px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--navy-600);
}

.po-project-empty {
  padding: 18px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Purchase Order — layout & sections */
.po-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
.po-main-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.po-steps-outer {
  flex-shrink: 0;
  padding: 4px 2px 10px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.po-steps-outer.hidden {
  display: none;
}
.po-form-panel,
.po-form-panel.card,
.po-form-panel .card-body,
.po-step,
.po-section,
.po-client-picker {
  overflow: visible;
}
.po-form-panel.card {
  overflow: visible;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
.po-preview-panel { position: relative; }
.po-preview-card {
  position: sticky;
  top: 20px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
.po-form-panel .card-body {
  padding: 28px 32px;
}
.po-step {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.po-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.po-client-picker {
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--nat-200);
  background: linear-gradient(180deg, #fff 0%, var(--nat-50) 100%);
}
.po-client-field {
  margin: 0;
  gap: 8px;
}
.po-section-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.2px;
  line-height: 1.3;
}
.po-section-header p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.po-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--nat-200);
}
.po-step-actions .btn {
  min-height: 42px;
  padding: 11px 20px;
}
.po-totals-section { margin-top: 0; }
.po-notes-field { margin-top: 4px; }
.po-draft-label {
  margin-top: 0;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.po-invoice-preview .invoice-summary-row {
  margin-bottom: 0;
}

/* Issuer card (from PMT) */
.po-issuer-card {
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--navy-200);
  background: linear-gradient(135deg, #f8fbff 0%, #eef4fc 100%);
}
.po-issuer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.po-issuer-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy-600);
  margin-bottom: 4px;
}
.po-issuer-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.3px;
}
.po-issuer-address {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.po-issuer-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}
.po-issuer-meta-grid div span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.po-issuer-meta-grid div strong {
  font-size: 13px;
  color: var(--text-primary);
}
.po-issuer-meta-grid .mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* Bank details block */
.po-bank-card {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--nat-200);
  background: white;
}
.po-bank-card.compact {
  background: rgba(255,255,255,0.7);
  border-color: var(--navy-200);
}
.po-bank-card.invoice {
  margin-top: 0;
  padding: 10px 12px;
  background: var(--nat-50);
  border-color: var(--nat-200);
}
.po-bank-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--nat-200);
}
.po-review-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.po-template-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--nat-200);
}
.po-template-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.po-template-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--nat-200);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.po-template-option.active {
  border-color: var(--navy-500);
  background: var(--navy-50);
}
.po-template-option input {
  margin-top: 3px;
}
.po-template-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.po-template-desc {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
@media (max-width: 720px) {
  .po-template-options {
    grid-template-columns: 1fr;
  }
}
.po-bank-card.compact .po-bank-title {
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: none;
}
.po-bank-title .badge { font-size: 10px; margin-left: 2px; }
.po-bank-grid {
  display: grid;
  grid-template-columns: repeat(var(--po-bank-cols, 2), minmax(0, 1fr));
  gap: 8px 18px;
}
.po-bank-card.invoice .po-bank-grid {
  gap: 6px 14px;
}
@media (max-width: 720px) {
  .po-bank-card.invoice .po-bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.po-bank-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.po-bank-row.compact { gap: 1px; }
.po-bank-row.span-full {
  grid-column: 1 / -1;
  max-width: calc(50% - 9px);
}
.po-bank-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--text-muted);
  line-height: 1.3;
}
.po-bank-value {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}
.po-bank-card.invoice .po-bank-value {
  font-size: 12px;
}
.po-bank-value.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2px;
}
.po-mini-bank-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 2px;
}
.po-mini-bank-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.35;
}
.po-mini-bank-key {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.po-mini-bank-val {
  color: var(--text-secondary);
  text-align: right;
  word-break: break-word;
}
.po-bank-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--nat-50);
  border: 1px dashed var(--nat-300);
}

/* Mini preview panel */
.po-mini { font-size: var(--text-sm); display: flex; flex-direction: column; gap: 14px; line-height: var(--leading-normal); }
.po-mini-step {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--navy-600);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--nat-200);
}
.po-mini-block { display: flex; flex-direction: column; gap: 4px; }
.po-mini-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
}
.po-mini-strong { font-weight: 700; color: var(--text-primary); font-size: var(--text-sm); line-height: var(--leading-tight); }
.po-mini-muted { font-size: var(--text-xs); color: var(--text-secondary); line-height: var(--leading-normal); }
.po-mini-muted.mono { font-family: var(--font-mono); }
.po-mini-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--nat-100);
}
.po-mini-line-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 62%;
  color: var(--text-primary);
}
.po-mini-line-amt { font-weight: 700; color: var(--navy-700); flex-shrink: 0; }
.po-mini-totals {
  background: var(--nat-50);
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--nat-200);
}
.po-mini-total-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  padding: 3px 0;
  font-size: 12px;
}
.po-mini-grand {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--navy-800);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid var(--nat-300);
  letter-spacing: var(--tracking-tight);
}
.po-mini-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Success step */
.po-success {
  text-align: center;
  padding: 48px 24px;
}
.po-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #86efac;
}
.po-success h3 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: var(--tracking-tight);
}
.po-success-lead {
  color: var(--text-secondary);
  font-size: var(--text-base);
  margin: 0 0 6px;
  line-height: var(--leading-normal);
}
.po-success-lead strong { color: var(--navy-700); }
.po-success-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 28px;
}
.po-success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.po-steps-bar {
  padding: 0;
  margin-bottom: 0;
}
.po-steps-bar-5 .step-wrapper {
  gap: 8px;
}
.po-steps-bar-5 .step-circle {
  width: 36px;
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  border-width: 2px;
}
.po-steps-bar-5 .step-label {
  font-size: 13px;
  font-weight: 600;
  margin: 0 8px;
  letter-spacing: 0.02em;
}
.po-steps-bar-5 .step.active .step-label {
  font-weight: 700;
  color: var(--navy-800);
}
.po-steps-bar-5 .step-line {
  height: 2.5px;
  border-radius: 2px;
}
.po-layout-full { grid-template-columns: 1fr !important; }

@media (max-width: 1100px) {
  .po-layout { grid-template-columns: 1fr; }
  .po-preview-card { position: static; }
  .po-form-panel .card-body { padding: 22px 20px; }
}

@media (max-width: 640px) {
  .po-steps-bar-5 .step-label { font-size: 11px; margin: 0 4px; }
  .po-steps-bar-5 .step-circle { width: 30px; height: 30px; font-size: 12px; }
  .po-step-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .po-step-actions .btn { width: 100%; justify-content: center; }
  .po-step-actions > span:empty { display: none; }
}

.po-hint-card {
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--nat-50);
  border: 1px dashed var(--nat-300);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: var(--leading-relaxed);
}
.po-client-summary {
  margin-top: 4px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--navy-200);
  background: white;
  box-shadow: var(--shadow-xs);
}
.po-client-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.po-client-summary-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.po-summary-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--nat-100);
  font-size: 13px;
  align-items: center;
}
.po-summary-row:last-child { border-bottom: none; }
.po-summary-row span { color: var(--text-muted); font-size: 12px; }
.po-summary-row strong { color: var(--text-primary); font-weight: 600; }
.po-summary-row strong.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.po-summary-row strong.preline { font-weight: 500; white-space: pre-line; line-height: 1.45; }
.po-summary-row.stack { grid-template-columns: 1fr; gap: 4px; }
.po-summary-row.editable {
  grid-template-columns: 100px 1fr;
  align-items: center;
}
.po-summary-row.editable em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.po-summary-row.editable .field-input { padding: 7px 10px; font-size: 13px; }
.po-gst-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 10px;
  background: var(--nat-50);
  border: 1px solid var(--nat-200);
  border-radius: var(--r-sm);
}
.po-section-tight {
  gap: 12px;
}
.po-line-items-wrap {
  margin: 12px 0 20px;
  overflow-x: auto;
}
.po-hsn-input {
  width: 100%;
  min-width: 72px;
  padding: 6px 8px !important;
  font-size: 12px !important;
}
.po-gst-treatment {
  margin: 0;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--r-md);
}
.po-gst-treatment .field-label {
  color: #1e40af;
  margin-bottom: 6px;
}
.po-gst-treatment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.po-gst-treatment-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}
.po-gst-treatment-option input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}
.po-gst-treatment-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #2563eb;
  line-height: 1.35;
}
.po-totals-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.po-adjustments-section {
  margin: 0;
}
.po-adjustments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.po-adjustments-grid .field-group {
  gap: 4px;
  margin: 0;
}
.po-adjustments-grid .field-label {
  font-size: 12px;
}
.po-adjustments-grid .field-input {
  padding: 9px 12px;
  border-radius: 10px;
}
.po-totals-display.totals-section {
  margin-top: 0;
  padding: 12px 14px;
}

/* ============================================================
   RESPONSIVE DESIGN IMPROVEMENTS
   ============================================================ */

/* General Steps Bar - Hide labels on extra small screens */
@media (max-width: 480px) {
  .steps-bar .step-label,
  .po-steps-bar-5 .step-label {
    display: none !important;
  }
}

/* PO Bank Details Responsiveness */
@media (max-width: 480px) {
  .po-bank-grid {
    grid-template-columns: 1fr !important;
  }
  .po-bank-row.span-full {
    max-width: 100% !important;
  }
}

/* Project Modal Responsiveness */
.project-modal-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.project-modal-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.project-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .project-modal-details {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .project-modal-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .project-modal-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .project-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .project-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .project-filter-bar .pf-search,
  .project-filter-bar select,
  .project-filter-bar .pf-reset-btn {
    width: 100% !important;
  }
}

/* Shared target specifications details */
.inventory-detail-modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.inventory-detail-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inventory-detail-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.inventory-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.inventory-detail-grid.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.inventory-detail-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--nat-200);
  border-radius: 16px;
  background: white;
}
.inventory-detail-card.wide {
  grid-column: 1 / -1;
}
.inventory-detail-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #eef2ff;
  color: #334155;
}
.inventory-detail-icon svg {
  width: 20px;
  height: 20px;
}
.inventory-detail-icon.geo { background: #f1f5f9; color: #0f172a; }
.inventory-detail-icon.demo { background: #f3e8ff; color: #6b21a8; }
.inventory-detail-icon.audience { background: #ffe4e6; color: #be185d; }
.inventory-detail-icon.ir { background: #eff6ff; color: #1d4ed8; }
.inventory-detail-icon.loi { background: #fef3c7; color: #a16207; }
.inventory-detail-icon.cpi { background: #f1f5f9; color: #1e3a8a; }
.inventory-detail-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inventory-detail-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.inventory-detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.inventory-detail-subvalue {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.inventory-detail-divider {
  border-top: 1px solid var(--nat-200);
}

@media (max-width: 640px) {
  .inventory-detail-grid,
  .inventory-detail-grid.grid-3 {
    grid-template-columns: 1fr !important;
  }
}

