/* ==========================================================================
   Supplier Due Diligence Platform — Professional Design System v3
   Theme: Modern Professional | Enhanced Interactions | Smooth Animations
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ─────────────── CSS Variables ─────────────── */
:root {
  /* Colors */
  --bg-app-gradient: linear-gradient(135deg, #0f172a 0%, #1f8e6e 55%, #0f4d3a 100%);
  --bg:           #0d3b2e;
  --bg-card:      #ffffff;
  --bg-card-alt:  #f1f5f9;
  --bg-hover:     #e2e8f0;
  
  --navy:         #0f172a;
  --navy-light:   #1e293b;
  --navy-muted:   #94a3b8;
  
  --primary:      #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;
  --primary-soft: #ecfdf5;
  
  --success:      #10b981;
  --success-light: #d1fae5;
  --warning:      #f59e0b;
  --warning-light: #fef3c7;
  --danger:       #ef4444;
  --danger-light:  #fee2e2;
  --info:         #3b82f6;
  --info-light:   #dbeafe;
  
  --border:       #e2e8f0;
  --border-light: #f1f5f9;
  --border-dark:  #cbd5e1;
  
  --text:         #1e293b;
  --text-sub:     #64748b;
  --text-faint:   #94a3b8;
  --text-inverse: #f8fafc;
  
  /* RAG Status Colors */
  --c-critical: #dc2626; --bg-critical: #fee2e2; --bd-critical: #fecaca;
  --c-high:     #ea580c; --bg-high:     #ffedd5; --bd-high:     #fed7aa;
  --c-medium:   #d97706; --bg-medium:   #fef3c7; --bd-medium:   #fde68a;
  --c-low:      #059669; --bg-low:      #d1fae5; --bd-low:      #a7f3d0;
  
  /* Typography */
  --font-serif: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans:  'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;
  
  /* Spacing */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.25);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition:      200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────── Reset & Base ─────────────── */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-app-gradient) !important;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

/* ─────────────── SIDEBAR NAVIGATION ─────────────── */
.sidebar {
  background: linear-gradient(180deg, #0b111e 0%, #05080f 100%) !important; /* Ultra Sleek Charcoal-Navy */
  width: 280px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.45);
  border-right: 1px solid rgba(255, 255, 255, 0.04) !important;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0 0 0; /* Let footer sit perfectly at the bottom */
  transition: transform var(--transition);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.25rem 80px; /* Leave space for bottom footer */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-brand-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.25rem;
  padding: 0 1.25rem;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--navy-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color var(--transition-fast);
}

.sidebar-close-btn:hover {
  color: var(--danger);
}

.navbar-brand {
  font-family: var(--font-sans);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: opacity var(--transition-fast);
}

.navbar-brand:hover {
  opacity: .95;
}

.navbar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(16,185,129,.25);
  flex-shrink: 0;
}
.navbar-brand .brand-icon svg {
  width: 16px;
  height: 16px;
  color: #ffffff;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.brand-main-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-sub-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #10b981;
  opacity: 0.95;
}

/* Supplier selector card inside sidebar */
.navbar-supplier {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.03) 100%);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.navbar-supplier::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #34d399, #059669);
}
.navbar-supplier:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.06) 100%);
  border-color: rgba(16, 185, 129, 0.32);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}
.navbar-supplier .s-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: none; /* No uppercase */
  letter-spacing: 0.02em;
  color: #34d399; /* Colorful green highlight label */
}
.navbar-supplier .s-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  word-break: break-word;
}

/* ── Section label ── */
.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  padding: 0 0.85rem;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  letter-spacing: 0.08em;
}
.sidebar-section-title:first-child { margin-top: 0; }

/* ── Sidebar divider ── */
.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
  margin: 0.6rem 0.25rem;
  display: block;
}

/* ── Nav links ── */
.navbar-links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

.nav-link.active {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3.5px;
  background: #34d399;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

.nav-link .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: all 150ms;
}
.nav-link .nav-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.nav-link:hover .nav-icon {
  color: #ffffff;
}

.nav-link.active .nav-icon {
  color: #34d399;
}

.nav-link.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-link.nav-link-needs-supplier {
  opacity: 0.45;
  cursor: pointer;
}
.nav-link.nav-link-needs-supplier:hover {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.02) !important;
}
.nav-link.nav-link-needs-supplier::after {
  content: '↩';
  font-size: 0.65rem;
  margin-left: auto;
  opacity: 0.4;
}

/* ── Sidebar footer (user + logout) ── */
.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 15, 26, 0.88) !important; /* Slightly more opaque background to shield content underneath */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.navbar-user-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.navbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.navbar-user .u-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.navbar-user .u-role {
  font-size: 0.62rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  line-height: 1.1;
}

.logout-form { display: flex; flex-shrink: 0; }

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms;
  padding: 0;
  flex-shrink: 0;
}
.btn-logout .logout-svg {
  width: 16px;
  height: 16px;
  color: #f87171;
  transition: transform 150ms;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-logout:hover .logout-svg {
  transform: translateX(2px);
  color: #ef4444;
}

/* ─────────────── PAGE LAYOUT ─────────────── */
.page-wrap {
  margin-left: 265px;
  padding: 2.5rem 3rem;
  animation: fadeIn var(--transition-slow);
  min-height: 100vh;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile header styling */
.mobile-header {
  display: none;
}

/* Responsive styles for tablet and mobile */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.25);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-close-btn {
    display: block;
  }
  
  .page-wrap {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 5.5rem;
  }
  
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 1.5rem;
    z-index: 150;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  
  .mobile-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .mobile-brand .brand-icon {
    font-size: 1.25rem;
  }
  
  .mobile-nav-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
  }
}


/* Step breadcrumb strip */
.step-strip {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .5rem .75rem;
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
}

.step-pill {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-sub);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.step-pill:hover { 
  background: var(--bg-hover); 
  color: var(--text);
  transform: translateY(-1px);
}

.step-pill.active { 
  background: var(--primary-light); 
  color: var(--primary-dark); 
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.step-pill .num { 
  font-family: var(--font-mono); 
  font-size: .7rem;
  font-weight: 600;
}

.step-arrow { 
  color: var(--text-faint); 
  font-size: .9rem; 
  padding: 0 .25rem; 
  flex-shrink: 0;
}

/* ─────────────── PAGE HEADER ─────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.page-header-left {}

.page-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: .5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-sub);
  font-weight: 400;
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

/* ─────────────── BUTTONS ─────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  transform: translate(-50%, -50%);
  transition: width 600ms, height 600ms;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary { 
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,.3);
}

.btn-primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16,185,129,.4);
}

.btn-secondary { 
  background: #fff;
  border-color: var(--border-dark);
  color: var(--text);
}

.btn-secondary:hover { 
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16,185,129,.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239,68,68,.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239,68,68,.4);
}

.btn-sm { 
  padding: .45rem .9rem;
  font-size: .85rem;
}

.btn-lg {
  padding: .75rem 1.75rem;
  font-size: 1rem;
}

.btn-group { 
  display: flex; 
  gap: .75rem;
  flex-wrap: wrap;
}

/* ─────────────── METHODOLOGY BUTTON & MODAL ─────────────── */
.btn-method {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.1rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #7dd3fc;
  border-radius: var(--radius);
  color: #0369a1;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  box-shadow: var(--shadow-xs);
}

.btn-method:hover { 
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-method .icon { 
  font-size: 1.1rem;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn var(--transition);
}

.modal-overlay.open { 
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { 
    transform: translateY(30px) scale(0.95); 
    opacity: 0; 
  }
  to { 
    transform: translateY(0) scale(1); 
    opacity: 1; 
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: var(--bg-hover);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-sub);
  padding: .5rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: all var(--transition-fast);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { 
  background: var(--danger-light);
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.method-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: var(--bg-card-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.method-step:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.method-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}

.method-step-body {}

.method-step-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: .4rem;
}

.method-step-desc {
  font-size: .9rem;
  color: var(--text-sub);
  line-height: 1.6;
}

.method-formula {
  font-family: var(--font-mono);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .85rem;
  color: var(--primary-dark);
  margin-top: .6rem;
  font-weight: 500;
}

.method-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin-top: .6rem;
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.method-table th {
  background: var(--bg);
  font-weight: 700;
  padding: .6rem .85rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .75rem;
  color: var(--text-sub);
}

.method-table td {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.method-table tr:last-child td { 
  border-bottom: none; 
}

.method-table .val { 
  font-family: var(--font-mono); 
  font-weight: 700; 
  color: var(--primary-dark);
}

/* ─────────────── SUPPLIER BANNER ─────────────── */
.supplier-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,.05);
}

.banner-item {
  padding: 1.25rem 1.75rem;
  border-right: 1px solid rgba(255,255,255,.08);
  transition: background var(--transition-fast);
}

.banner-item:hover {
  background: rgba(255,255,255,.03);
}

.banner-item:last-child { 
  border-right: none; 
}

.banner-label { 
  font-size: .7rem; 
  text-transform: uppercase; 
  letter-spacing: .1em; 
  color: #94a3b8; 
  font-weight: 600; 
  margin-bottom: .4rem;
}

.banner-value { 
  font-size: 1.05rem; 
  font-weight: 700; 
  color: #f1f5f9;
}

.banner-value.serif { 
  font-family: var(--font-serif); 
  font-size: 1.2rem;
}

/* ─────────────── SUPPLIER SUMMARY BAR ─────────────── */
.supplier-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,.05);
}

.summary-details {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.summary-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  font-weight: 600;
}

.summary-val {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* ─────────────── CARDS ─────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-dark);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  letter-spacing: -0.01em;
}

.card-2col { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 1.5rem; 
}

.card-3col { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 1.5rem; 
}

/* ─────────────── SCORE CARDS (big numbers) ─────────────── */
.score-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border);
}

.score-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.score-card.critical { 
  border-color: var(--bd-critical); 
  background: var(--bg-critical);
}

.score-card.critical::before {
  background: var(--c-critical);
}

.score-card.high { 
  border-color: var(--bd-high);     
  background: var(--bg-high);
}

.score-card.high::before {
  background: var(--c-high);
}

.score-card.medium { 
  border-color: var(--bd-medium);   
  background: var(--bg-medium);
}

.score-card.medium::before {
  background: var(--c-medium);
}

.score-card.low { 
  border-color: var(--bd-low);      
  background: var(--bg-low);
}

.score-card.low::before {
  background: var(--c-low);
}

.score-label { 
  font-size: .75rem; 
  text-transform: uppercase; 
  letter-spacing: .1em; 
  font-weight: 700; 
  color: var(--text-sub);
}

.score-big { 
  font-family: var(--font-mono); 
  font-size: 2.75rem; 
  font-weight: 700; 
  line-height: 1;
  transition: all var(--transition-fast);
}

.score-sub { 
  font-size: .85rem; 
  color: var(--text-sub);
  font-weight: 500;
}

.score-card.critical .score-big { 
  color: var(--c-critical); 
}

.score-card.high .score-big { 
  color: var(--c-high); 
}

.score-card.medium .score-big { 
  color: var(--c-medium); 
}

.score-card.low .score-big { 
  color: var(--c-low); 
}

/* Decision box */
.decision-hero {
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  transition: all var(--transition-fast);
}

.decision-hero:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.decision-hero.success { 
  background: linear-gradient(135deg, var(--bg-low) 0%, #ecfdf5 100%);
  border: 2px solid var(--bd-low); 
}

.decision-hero.warning { 
  background: linear-gradient(135deg, var(--bg-medium) 0%, #fffbeb 100%);
  border: 2px solid var(--bd-medium); 
}

.decision-hero.danger { 
  background: linear-gradient(135deg, var(--bg-critical) 0%, #fef2f2 100%);
  border: 2px solid var(--bd-critical); 
}

.decision-hero .dh-label { 
  font-size: .75rem; 
  text-transform: uppercase; 
  letter-spacing: .12em; 
  font-weight: 700;
}

.decision-hero.success .dh-label { 
  color: var(--c-low); 
}

.decision-hero.warning .dh-label { 
  color: var(--c-medium); 
}

.decision-hero.danger .dh-label { 
  color: var(--c-critical); 
}

.decision-hero .dh-value { 
  font-family: var(--font-serif); 
  font-size: 2.25rem; 
  font-weight: 800; 
  color: var(--text);
  letter-spacing: -0.02em;
}

.decision-hero .dh-score { 
  font-family: var(--font-mono); 
  font-size: .95rem; 
  color: var(--text-sub);
  font-weight: 500;
}

/* Score hero container */
.score-hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.decision-box {
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  transition: all var(--transition-fast);
}

.decision-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.decision-box.success { 
  background: linear-gradient(135deg, var(--bg-low) 0%, #ecfdf5 100%);
  border: 2px solid var(--bd-low); 
}

.decision-box.warning { 
  background: linear-gradient(135deg, var(--bg-medium) 0%, #fffbeb 100%);
  border: 2px solid var(--bd-medium); 
}

.decision-box.danger { 
  background: linear-gradient(135deg, var(--bg-critical) 0%, #fef2f2 100%);
  border: 2px solid var(--bd-critical); 
}

.decision-title { 
  font-size: .75rem; 
  text-transform: uppercase; 
  letter-spacing: .12em; 
  font-weight: 700;
}

.decision-box.success .decision-title { 
  color: var(--c-low); 
}

.decision-box.warning .decision-title { 
  color: var(--c-medium); 
}

.decision-box.danger .decision-title { 
  color: var(--c-critical); 
}

.decision-value { 
  font-family: var(--font-serif); 
  font-size: 2.25rem; 
  font-weight: 800; 
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ─────────────── LEDGER BARS ─────────────── */
.ledger-row {
  display: grid;
  grid-template-columns: 180px 1fr 60px;
  align-items: center;
  gap: 1.25rem;
  padding: .75rem 0;
  border-bottom: 1px dashed var(--border-light);
  transition: all var(--transition-fast);
}

.ledger-row:hover {
  background: var(--bg-card-alt);
  padding-left: .5rem;
  padding-right: .5rem;
  margin-left: -.5rem;
  margin-right: -.5rem;
  border-radius: var(--radius-sm);
}

.ledger-row:last-child { 
  border-bottom: none; 
}

.ledger-label { 
  font-size: .9rem; 
  font-weight: 600;
  color: var(--text);
}

.ledger-track {
  height: 20px;
  background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 100%);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  min-width: 50px;
  position: relative;
}

.ledger-bar { 
  height: 100%; 
  border-radius: 999px; 
  transition: width .6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 2px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.ledger-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.3) 0%, transparent 100%);
  border-radius: 999px;
}

.bar-inherent { 
  background: linear-gradient(90deg, #94a3b8, #475569); 
}

.bar-control { 
  background: linear-gradient(90deg, #60a5fa, #2563eb); 
}

.bar-critical { 
  background: linear-gradient(90deg, #f87171, var(--c-critical)); 
}

.bar-high { 
  background: linear-gradient(90deg, #fb923c, var(--c-high)); 
}

.bar-medium { 
  background: linear-gradient(90deg, #fbbf24, var(--c-medium)); 
}

.bar-low { 
  background: linear-gradient(90deg, #4ade80, var(--c-low)); 
}

.ledger-value { 
  font-family: var(--font-mono); 
  font-weight: 700; 
  font-size: .95rem; 
  text-align: right;
  color: var(--text);
}

/* ─────────────── TABLES ─────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  max-height: 600px;
  overflow-y: auto;
}

table { 
  width: 100%; 
  border-collapse: collapse;
}

th {
  background: linear-gradient(180deg, var(--bg-card-alt) 0%, #f8fafc 100%);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-sub);
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

td { 
  padding: 1rem 1.5rem; 
  border-bottom: 1px solid var(--border-light); 
  color: var(--text); 
  font-size: .9rem; 
  vertical-align: middle;
  transition: background var(--transition-fast);
}

tr:last-child td { 
  border-bottom: none; 
}

tr:hover td { 
  background: var(--bg-card-alt);
}

/* ─────────────── BADGES ─────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.badge-critical, .badge-danger { 
  background: var(--bg-critical); 
  color: var(--c-critical); 
  border: 1px solid var(--bd-critical);
}

.badge-high, .badge-warning { 
  background: var(--bg-high);     
  color: var(--c-high);     
  border: 1px solid var(--bd-high);
}

.badge-medium, .badge-info { 
  background: var(--bg-medium);   
  color: var(--c-medium);   
  border: 1px solid var(--bd-medium);
}

.badge-low, .badge-success { 
  background: var(--bg-low);      
  color: var(--c-low);      
  border: 1px solid var(--bd-low);
}

.badge-draft, .badge-pending { 
  background: #f1f5f9; 
  color: #475569; 
  border: 1px solid #cbd5e1;
}

.badge-under-review, .badge-under_review { 
  background: var(--info-light); 
  color: #1e40af; 
  border: 1px solid #93c5fd;
}

.badge-approved { 
  background: var(--bg-low);      
  color: var(--c-low);      
  border: 1px solid var(--bd-low);
}

.badge-conditional { 
  background: var(--bg-medium);   
  color: var(--c-medium);   
  border: 1px solid var(--bd-medium);
}

.badge-rejected { 
  background: var(--bg-critical); 
  color: var(--c-critical); 
  border: 1px solid var(--bd-critical);
}

/* ─────────────── FORMS ─────────────── */
.form-group { 
  margin-bottom: 1.5rem; 
}

.form-label { 
  display: block; 
  font-size: .8rem; 
  font-weight: 700; 
  color: var(--text); 
  margin-bottom: .5rem; 
  text-transform: uppercase; 
  letter-spacing: .05em;
}

.form-input {
  width: 100%; 
  padding: .8rem 1rem;
  font-family: var(--font-sans);
  font-size: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.form-input:focus { 
  outline: none; 
  border-color: var(--primary);
  background: #fff; 
  box-shadow: 0 0 0 4px rgba(16,185,129,.1), var(--shadow-sm);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.form-input:disabled {
  background: var(--bg-card-alt);
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: .6;
}

.form-textarea { 
  resize: vertical; 
  min-height: 120px; 
  line-height: 1.6;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 1.5rem; 
}

.form-grid-2 { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 1.5rem; 
}

.form-grid-3 { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 1.5rem; 
}

/* Form field helper text */
.form-helper {
  font-size: .8rem;
  color: var(--text-sub);
  margin-top: .4rem;
  line-height: 1.5;
  font-weight: 500;
}

/* Form field groups */
.form-field-group {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all var(--transition-fast);
}

.form-field-group:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-sm);
}

.form-field-group-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
  padding-bottom: .75rem;
}

/* Small form inputs for compact layouts */
.form-input-sm {
  padding: .5rem .85rem;
  font-size: .85rem;
}

/* Date input styling */
input[type="date"].form-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .6;
  transition: opacity var(--transition-fast);
}

input[type="date"].form-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Checkbox styling */
input[type="checkbox"].form-input {
  width: auto;
  padding: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ─────────────── ALERTS ─────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  border-left: 4px solid;
  animation: slideInLeft var(--transition-slow);
}

@keyframes slideInLeft {
  from { 
    transform: translateX(-20px); 
    opacity: 0; 
  }
  to { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

.alert .alert-icon { 
  font-size: 1.25rem; 
  flex-shrink: 0; 
  margin-top: .1rem;
}

.alert-success { 
  background: var(--bg-low);      
  border: 1px solid var(--bd-low);
  border-left-color: var(--c-low);
  color: #065f46; 
}

.alert-error { 
  background: var(--bg-critical); 
  border: 1px solid var(--bd-critical);
  border-left-color: var(--c-critical);
  color: #991b1b; 
}

.alert-info { 
  background: var(--info-light);  
  border: 1px solid #93c5fd;
  border-left-color: var(--info);
  color: #1e40af; 
}

.alert-warning { 
  background: var(--bg-medium);   
  border: 1px solid var(--bd-medium);
  border-left-color: var(--c-medium);
  color: #92400e; 
}

/* ─────────────── ISSUES ─────────────── */
.issue-card { 
  border-left: 4px solid; 
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 4px;
  transition: all var(--transition-fast);
}

.issue-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.issue-card.critical { 
  border-left-color: var(--c-critical); 
}

.issue-card.high { 
  border-left-color: var(--c-high); 
}

.issue-card.medium { 
  border-left-color: var(--c-medium); 
}

.issue-card.low { 
  border-left-color: var(--c-low); 
}

.action-list { 
  list-style: none; 
  display: flex; 
  flex-direction: column; 
  gap: .5rem; 
  margin-top: 1rem;
}

.action-item {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: .65rem 1rem;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: all var(--transition-fast);
}

.action-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-dark);
  transform: translateX(2px);
}

.action-item.complete { 
  opacity: .5; 
  text-decoration: line-through;
}

/* ─────────────── RISK TABS ─────────────── */
.risk-layout { 
  display: grid; 
  grid-template-columns: 260px 1fr; 
  gap: 1.75rem; 
}

.risk-grid-container { 
  display: grid; 
  grid-template-columns: 260px 1fr; 
  gap: 1.75rem; 
}

.category-tabs {
  background: var(--bg-card); 
  border: 1px solid var(--border);
  border-radius: var(--radius-xl); 
  padding: .75rem; 
  display: flex;
  flex-direction: column; 
  gap: .2rem; 
  position: sticky; 
  top: 80px;
  max-height: calc(100vh - 120px); 
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.cat-tabs {
  background: var(--bg-card); 
  border: 1px solid var(--border);
  border-radius: var(--radius-xl); 
  padding: .75rem; 
  display: flex;
  flex-direction: column; 
  gap: .2rem; 
  position: sticky; 
  top: 80px;
  max-height: calc(100vh - 120px); 
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.cat-tab {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: .75rem 1rem; 
  border-radius: var(--radius);
  text-decoration: none; 
  color: var(--text); 
  font-size: .85rem; 
  font-weight: 500;
  transition: all var(--transition-fast);
}

.cat-tab-link {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: .3rem .55rem; 
  border-radius: var(--radius);
  text-decoration: none; 
  color: var(--text); 
  font-size: .82rem; 
  font-weight: 600;
  transition: all var(--transition-fast);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin-bottom: 0;
}

.cat-tab-link:hover { 
  background: var(--bg-hover); 
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.cat-tab-link.active { 
  background: linear-gradient(135deg, var(--primary-light) 0%, #a7f3d0 100%); 
  color: var(--primary-dark); 
  font-weight: 700; 
  border-color: #34d399;
  box-shadow: 0 4px 12px rgba(16,185,129,.2);
}

.cat-tab .wt, .cat-tab-link .wt { 
  font-family: var(--font-mono); 
  font-size: .75rem; 
  opacity: .75; 
  background: rgba(0,0,0,.05);
  padding: .2rem .5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.cat-tab-link.active .wt {
  background: rgba(16,185,129,.15);
  color: var(--primary-dark);
}

.notes-cell { 
  width: 30%; 
}

.question-table { 
  width: 100%; 
  border-collapse: collapse; 
}

.question-table th {
  padding: 0.4rem 0.6rem;
  font-size: 0.7rem;
  white-space: nowrap;
}

.question-table td {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

/* HTMX Loading Indicator */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
  opacity: 1;
}

.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ─────────────── LOGIN ─────────────── */
body.login-page {
  background: #090d16 !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  font-family: var(--font-sans);
}

/* Background glowing circles for depth */
body.login-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
}

.login-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2.25rem 2.25rem 1.75rem 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(16, 185, 129, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
  animation: loginCardSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginCardSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.login-logo .icon-box {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-logo .icon-box svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

.login-logo .logo-text {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: 0.15rem;
}

.login-logo .logo-text span {
  color: var(--primary);
}

.login-logo small {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-muted);
  margin-top: 0.1rem;
}

.login-form-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  text-align: center;
}

.login-form-subtitle {
  font-size: 0.8rem;
  color: var(--navy-muted);
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-card .form-group {
  margin-bottom: 1.15rem;
}

.login-card .form-label {
  color: #cbd5e1;
  font-size: 0.7rem;
  margin-bottom: 0.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-card .form-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
}

.login-card .form-input:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12), 0 6px 16px rgba(0, 0, 0, 0.4);
}

.login-card .form-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: #ffffff;
}

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.login-card .form-input-password {
  padding-right: 2.75rem;
}

.login-alert {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.4;
}

.login-alert svg {
  width: 16px;
  height: 16px;
  color: #f87171;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.login-btn-primary {
  width: 100%;
  padding: 0.8rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}

.login-btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: all 0.6s ease;
}

.login-btn-primary:hover::before {
  left: 100%;
}

.login-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.login-btn-primary:active {
  transform: translateY(0);
}

.login-footer {
  margin-top: 1.75rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
  font-weight: 500;
}

/* ─────────────── APPROVAL ─────────────── */
.approval-row {
  display: grid; 
  grid-template-columns: 1fr auto;
  align-items: start; 
  gap: 1.25rem; 
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border); 
  border-radius: var(--radius);
  background: var(--bg-card-alt); 
  margin-bottom: .875rem;
  transition: all var(--transition-fast);
}

.approval-row:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
  border-color: var(--border-dark);
}

.approval-row.done { 
  border-color: var(--bd-low); 
  background: #f0fdf4;
}

.approval-row.rejected { 
  border-color: var(--bd-critical); 
  background: #fff5f5;
}

/* ─────────────── UTILS ─────────────── */
.mono { 
  font-family: var(--font-mono); 
}

.serif { 
  font-family: var(--font-serif); 
}

.text-sub { 
  color: var(--text-sub); 
}

.text-muted { 
  color: var(--text-faint); 
}

.text-right { 
  text-align: right; 
}

.text-center { 
  text-align: center; 
}

.flex { 
  display: flex; 
}

.flex-between { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.flex-center { 
  display: flex; 
  align-items: center; 
}

.gap-1 { 
  gap: .5rem; 
}

.gap-2 { 
  gap: 1rem; 
}

.mt-1 { 
  margin-top: .75rem; 
}

.mt-2 { 
  margin-top: 1.5rem; 
}

.mb-1 { 
  margin-bottom: .75rem; 
}

.mb-2 { 
  margin-bottom: 1.5rem; 
}

.w-full { 
  width: 100%; 
}

.divider { 
  height: 1px; 
  background: var(--border); 
  margin: 1.25rem 0; 
}

/* ─────────────── RESPONSIVE DESIGN ─────────────── */
@media (max-width: 1024px) {
  .page-wrap {
    padding: 1.5rem;
  }
  
  .score-hero-container {
    grid-template-columns: 1fr;
  }
  
  .card-2col,
  .card-3col {
    grid-template-columns: 1fr;
  }
  
  .risk-layout,
  .risk-grid-container {
    grid-template-columns: 1fr;
  }
  
  .category-tabs,
  .cat-tabs {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
  }
  
  .navbar-brand {
    font-size: 1rem;
    margin-right: 1rem;
  }
  
  .navbar-supplier {
    display: none;
  }
  
  .page-wrap {
    padding: 1rem;
  }
  
  .page-title {
    font-size: 1.75rem;
  }
  
  .page-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-grid,
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .supplier-summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .summary-details {
    gap: 1.5rem;
  }
  
  .ledger-row {
    grid-template-columns: 1fr;
    gap: .5rem;
  }
  
  .ledger-value {
    text-align: left;
  }
}

/* ─────────────── SCROLLBAR STYLING ─────────────── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-card-alt);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 10px;
  border: 2px solid var(--bg-card-alt);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

/* ─────────────── LOADING & SKELETON ─────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card-alt) 25%, var(--bg-hover) 50%, var(--bg-card-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─────────────── TOOLTIPS ─────────────── */
[title] {
  position: relative;
}

/* ─────────────── PRINT STYLES ─────────────── */
@media print {
  .navbar,
  .btn,
  .btn-method,
  .modal-overlay {
    display: none !important;
  }
  
  .page-wrap {
    padding: 0;
    max-width: 100%;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}

/* ─────────────── ACCESSIBILITY ─────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ─────────────── METHODOLOGY TABS & UPGRADED METRIC CARDS ─────────────── */
.modal-content-wide {
  max-width: 850px !important;
}

.modal-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.modal-tabs::-webkit-scrollbar {
  display: none;
}

.modal-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.modal-tab-btn:hover {
  background: var(--bg-card-alt);
  color: var(--text);
}

.modal-tab-btn.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary-dark);
  border-color: rgba(16, 185, 129, 0.2);
}

.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
  animation: modalContentFade var(--transition);
}

@keyframes modalContentFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tooltips styling */
.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg-card-alt);
  color: var(--text-sub);
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 6px;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.tooltip-container:hover .tooltip-icon {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.tooltip-content {
  visibility: hidden;
  width: 280px;
  background-color: var(--navy);
  color: #ffffff;
  text-align: left;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  position: absolute;
  z-index: 1000;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--navy) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Premium stats grid */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-premium-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.stat-premium-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-dark);
}

.stat-premium-card.card-green {
  border-top: 4px solid var(--success);
}

.stat-premium-card.card-blue {
  border-top: 4px solid var(--info);
}

.stat-premium-card.card-rose {
  border-top: 4px solid var(--danger);
}

.stat-premium-card-icon {
  position: absolute;
  right: 1.25rem;
  bottom: 0.5rem;
  font-size: 3.5rem;
  opacity: 0.08;
  transition: all var(--transition);
  pointer-events: none;
}

.stat-premium-card:hover .stat-premium-card-icon {
  opacity: 0.14;
  transform: scale(1.1) rotate(5deg);
}

.stat-premium-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.stat-premium-val {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-premium-sub {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 600;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Formulas inside modal */
.formula-box {
  font-family: var(--font-mono);
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--primary-dark);
  margin: 0.5rem 0 0.75rem 0;
  border-left: 3px solid var(--primary);
  line-height: 1.4;
}

.info-note {
  font-size: 0.8rem;
  color: var(--text-sub);
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-left: 3px solid var(--info);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  margin: 0.5rem 0;
}