/* ── Variables ── */
:root {
  --bg:        #080b10;
  --surface:   #0d1117;
  --surface2:  #131920b5;
  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(255,255,255,0.12);
  --gold:      #c9a84c;
  --red:       #e05252;
  --red-dim:   #4a1a1a;
  --orange:    #e07a32;
  --orange-dim:#3d2010;
  --amber:     #d4a017;
  --amber-dim: #3a2a05;
  --green:     #3ecf8e;
  --green-dim: #0d3020;
  --blue:      #4a9eff;
  --text:      #e8eaf0;
  --muted:     #5a6478;
  --muted2:    #8892a4;
  --ambient:   #607D8B;
  
  }

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed; top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.05) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Shared layout ── */
.wrapper {
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto; padding: 40px 48px 80px;
  min-height: 80vh;
}

/* ── Header ── */
header{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  border-bottom:1px solid var(--border);
  padding-bottom:18px;
  margin-bottom:64px;
}

.nav a{
  color:var(--muted2);
  text-decoration:none;
  margin-left:18px;
  font-size:13px;
}

.nav a:hover{color:var(--gold)}
.btn-login {
    border: 2px solid var(--gold); /* Axiom Gold/Yellow */
    color: var(--gold) !important;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: bold !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hover Effect - Makes it feel interactive */
.btn-login:hover {
    background-color: var(--gold);
    color: #000000 !important; /* Inverts colors on hover */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); /* Subtle glow */
}
.logo-group { display: flex; flex-direction: column; gap: 5px; }
.logo{
  font-family:'Barlow Condensed';
  font-size:30px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.logo span { color: var(--gold); }
.logo-sub {  font-family:'DM Mono';
  font-size:10px;
  color:var(--muted);
  letter-spacing:.22em;
  text-transform:uppercase;
  margin-top:6px;
}

.logo-link { text-decoration: none; color: inherit; }
.header-meta { text-align: right; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.client-tag {
  font-family: 'Barlow', sans-serif; font-size: 17px; font-weight: 600;
  color: var(--text); -webkit-font-smoothing: antialiased;
}
.snapshot-tag {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--muted); letter-spacing: 0.12em;
}
.logout-link {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.12em;
  color: var(--muted); text-decoration: none; text-align: right;
  transition: color 0.15s;
}
.logout-link:hover { color: var(--gold); }

/* ── Section labels ── */
.section-label {
  font-family: 'DM Mono', monospace; font-size: 12px; color: var(--gold);
  letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.section-label-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-label-row .section-label { margin-bottom: 0; flex-shrink: 0; }
.section-label-row .section-label::after { display: none; }
.section-label-annotation {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--muted2); letter-spacing: 0.06em; flex: 1;
}
.section-label-annotation::before {
  content: ''; display: inline-block; width: 20px; height: 1px;
  background: var(--border); vertical-align: middle; margin-right: 10px;
}
.section-label-annotation::after {
  content: ''; display: inline-block; width: 100%; height: 1px;
  background: var(--border); vertical-align: middle; margin-left: 10px;
}

/* ── KPI grid ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 40px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  padding: 20px 20px 16px; position: relative; overflow: hidden; transition: border-color 0.2s;
}
.kpi-card:hover { border-color: var(--border2); }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.kpi-card.red::before    { background: var(--red); }
.kpi-card.gold::before   { background: var(--gold); }
.kpi-card.green::before  { background: var(--green); }
.kpi-card.blue::before   { background: var(--blue); }
.kpi-label {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.kpi-value {
  font-family: 'Barlow', sans-serif; font-size: 28px; font-weight: 700;
  line-height: 1; margin-bottom: 6px; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
}
.kpi-card.red   .kpi-value { color: var(--red); }
.kpi-card.gold  .kpi-value { color: var(--gold); }
.kpi-card.green .kpi-value { color: var(--green); }
.kpi-card.blue  .kpi-value { color: var(--blue); }
.kpi-value.gold { color: var(--gold); }
.kpi-sub { font-size: 11px; color: var(--muted2); }

/* ── Overview section ── */
.overview-container { display: flex; gap: 20px; padding-bottom: 30px; }
.intro-text { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.intro-para { font-size: 13px; color: var(--muted2); line-height: 1.7; }

/* ── Main grid ── */
.main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }

/* ── Table panel ── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; overflow-x: auto; }
.panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.panel-title {
  font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em; -webkit-font-smoothing: antialiased;
}
.panel-count {
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
table { width: 100%; border-collapse: collapse; min-width: 560px; }
thead tr { background: var(--surface2); }
th {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); padding: 11px 16px;
  text-align: left; font-weight: 400; border-bottom: 1px solid var(--border); white-space: nowrap;
}
th.right { text-align: right; }
td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr.clickable-row { cursor: pointer; }
tbody tr.clickable-row:hover { background: rgba(201,168,76,0.04); }
.mono { font-family: 'DM Mono', monospace; font-size: 12px; }
.right { text-align: right; }
.member-id { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted2); white-space: nowrap; }

/* ── Badges ── */
.badge {
  display: inline-block; font-family: 'DM Mono', monospace; font-size: 9px;
  font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px; border: 1px solid; white-space: nowrap;
}
.badge.CRITICAL { color: var(--red);    background: var(--red-dim);    border-color: rgba(224,82,82,0.3); }
.badge.HIGH     { color: var(--orange); background: var(--orange-dim); border-color: rgba(224,122,50,0.3); }
.badge.ELEVATED { color: var(--amber);  background: var(--amber-dim);  border-color: rgba(212,160,23,0.3); }
.badge.MONITOR  { color: var(--muted2); background: var(--surface2);   border-color: var(--border); }

/* ── Driver rows ── */
.driver-detail-row td { padding: 0 16px 14px; border-bottom: 1px solid var(--border); }
.driver-detail-inner {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px;
}
.driver-detail-label {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
}
.driver-item { display: flex; align-items: flex-start; gap: 10px; }
.driver-rank {
  font-family: 'DM Mono', monospace; font-size: 9px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 2px; padding: 2px 6px; flex-shrink: 0; margin-top: 1px;
}
.driver-text { font-size: 12px; color: var(--text); line-height: 1.4; }
.driver-expand-icon {
  font-family: 'DM Mono', monospace; font-size: 9px; color: var(--muted);
  flex-shrink: 0; transition: transform 0.2s;
  -webkit-user-select: none; user-select: none;
}
tr.expanded .driver-expand-icon { transform: rotate(90deg); color: var(--gold); }
.driver-impact { font-family: 'DM Mono', monospace; font-size: 10px; margin-left: auto; flex-shrink: 0; }
.driver-impact.pos { color: var(--red); }
.driver-impact.neg { color: var(--green); }

/* ── Sidebar ── */
.sidebar { display: flex; flex-direction: column; gap: 12px; }
.stat-block { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 18px; }
.stat-block-title {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.risk-breakdown { display: flex; flex-direction: column; gap: 10px; }
.risk-row { display: flex; align-items: center; gap: 10px; }
.risk-row-label { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.08em; width: 68px; flex-shrink: 0; }
.risk-row-label.CRITICAL { color: var(--red); }
.risk-row-label.HIGH     { color: var(--orange); }
.risk-row-label.ELEVATED { color: var(--amber); }
.risk-row-label.MONITOR  { color: var(--muted2); }
.risk-bar-track { flex: 1; height: 3px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.risk-bar-fill  { height: 100%; border-radius: 2px; }
.CRITICAL-fill { background: var(--red); }
.HIGH-fill     { background: var(--orange); }
.ELEVATED-fill { background: var(--amber); }
.MONITOR-fill  { background: var(--muted); }
.risk-row-count { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted2); width: 22px; text-align: right; flex-shrink: 0; }

.model-rows { display: flex; flex-direction: column; }
.model-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.model-row:last-child { border-bottom: none; }
.model-row-key { font-size: 11px; color: var(--muted2); }
.model-row-val { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text); }
.model-row-val.gold { color: var(--gold); }

.ltv-block {
  background: linear-gradient(135deg, rgba(74,158,255,0.06) 0%, transparent 60%);
  border: 1px solid rgba(74,158,255,0.2); border-radius: 4px; padding: 18px;
}
.ltv-block .stat-block-title { color: rgba(74,158,255,0.6); }
.ltv-rows { display: flex; flex-direction: column; }
.ltv-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.ltv-row:last-child { border-bottom: none; }
.ltv-row-key { font-size: 11px; color: var(--muted2); }
.ltv-row-val { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text); }
.ltv-row-val.blue { color: var(--blue); }
.ltv-row-val.red  { color: var(--red); }
.ltv-placeholder  { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); }

/* ── Footer ── */
footer {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.footer-brand {
  font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; -webkit-font-smoothing: antialiased;
}
.footer-brand span { color: var(--gold); }
.footer-note { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }

/* ── Animations ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.kpi-card  { animation: fadeUp 0.35s ease both; }
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }
.panel   { animation: fadeUp 0.35s ease 0.22s both; }
.sidebar { animation: fadeUp 0.35s ease 0.28s both; }
.auth-card { animation: fadeUp 0.4s ease 0.05s both; }

.state-msg {
  padding: 40px; text-align: center;
  font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted); letter-spacing: 0.1em;
}

/* ── Auth pages (login) ── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}
.auth-logo { text-align: center; }
.auth-logo .logo { font-size: 26px; }
.auth-card {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
}
.auth-card-header {
  padding: 24px 28px 20px; border-bottom: 1px solid var(--border);
}
.auth-card-title {
  font-family: 'Barlow', sans-serif; font-size: 18px; font-weight: 600;
  -webkit-font-smoothing: antialiased; margin-bottom: 4px;
}
.auth-card-sub { font-size: 12px; color: var(--muted2); }
.auth-error {
  margin: 16px 28px 0;
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--red); background: var(--red-dim);
  border: 1px solid rgba(224,82,82,0.3);
  padding: 10px 14px; border-radius: 3px;
}
.form-group { padding: 16px 28px 0; }
.form-group:last-of-type { padding-bottom: 0; }
.form-label {
  display: block; font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.form-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 3px; padding: 10px 12px; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  transition: border-color 0.15s; outline: none;
}
.form-input:focus { border-color: var(--gold); }
.form-submit {
  display: block; width: calc(100% - 56px); margin: 20px 28px 24px;
  background: var(--gold); color: var(--bg); border: none; border-radius: 3px;
  padding: 11px; font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 600;
  letter-spacing: 0.04em; cursor: pointer; transition: opacity 0.15s;
  -webkit-font-smoothing: antialiased;
}
.form-submit:hover { opacity: 0.88; }
.auth-footer .footer-brand { font-size: 11px; }

/* ── Home / client cards ── */
.client-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 48px; }
.client-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  padding: 24px; text-decoration: none; color: inherit;
  transition: border-color 0.2s, background 0.2s; display: flex; flex-direction: column; gap: 16px;
}
.client-card:hover { border-color: var(--gold); background: rgba(201,168,76,0.03); }
.client-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.client-card-name {
  font-family: 'Barlow', sans-serif; font-size: 16px; font-weight: 600;
  -webkit-font-smoothing: antialiased;
}
.client-card-arrow { font-size: 18px; color: var(--muted); transition: color 0.2s, transform 0.2s; }
.client-card:hover .client-card-arrow { color: var(--gold); transform: translateX(3px); }
.client-card-meta { display: flex; gap: 20px; }
.client-meta-item { display: flex; flex-direction: column; gap: 3px; }
.client-meta-label {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--muted);
}
.client-meta-val { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted2); }
.client-card-cta {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gold); margin-top: auto;
}
.empty-state {
  padding: 80px 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.empty-state-icon { font-size: 32px; color: var(--muted); }
.empty-state-text { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .wrapper { padding: 24px 20px 60px; }
  header { flex-direction: column; align-items: flex-start; margin-bottom: 32px; padding-bottom: 20px; gap: 10px; }
  .header-meta { text-align: left; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 28px; }
  .kpi-value { font-size: 22px; }
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { order: 2; } .panel { order: 1; }
  .client-grid { grid-template-columns: repeat(2, 1fr); }
  .section-label-annotation { display: none; }
  .overview-container { flex-direction: column; }
}
@media (max-width: 480px) {
  .wrapper { padding: 18px 14px 48px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 14px 12px 12px; }
  .kpi-value { font-size: 19px; }
  .kpi-label { font-size: 8px; letter-spacing: 0.12em; }
  .logo { font-size: 21px; }
  .panel-title { font-size: 12px; }
  .client-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}


.fade-in {
  animation: fadeUp 0.5s ease both;
  color: var(--gold); 
  font-weight: 
  bold; margin: 0;
}


/* Container styling */
.upload-page-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.upload-card {
    background: #1a1a1a; /* Dark professional background */
    border: 1px solid #333;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.upload-header h2 {
    color: #d4af37; /* Gold */
    margin-bottom: 5px;
}

.upload-header p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

label {
    color: #eee;
    margin-bottom: 8px;
    font-weight: 500;
}

select, .file-input {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%; /* Fixes the width error */
}

select:focus, .file-input:focus {
    outline: none;
    border-color: #d4af37;
}

/* The Button */
.btn-upload-gold {
    /* background: linear-gradient(45deg, #d4af37, #f9e29c); */
    background: var(--gold);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-upload-gold:hover {
    transform: translateY(-2px);
    /* box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3); */
    background: var(--blue);
}


.nav {
    display: flex;
    flex-direction: column; /* Stacks the Meta above the Links */
    align-items: flex-end;   /* Aligns everything to the right */
    gap: 10px;              /* Space between the name and the links */
}

.header-meta {
    font-size: 0.85rem;
    color: #d4af37;        /* Axiom Gold */
    font-weight: 500;
    margin-bottom: 5px;
}

.nav-links-group {
    display: flex;         /* Keeps the links in a horizontal row */
    align-items: center;
    gap: 20px;
}

/* Ensure the button still looks like a button */
.btn-login {
    background: #d4af37;
    color: #000 !important;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
}


.site-footer {
    padding: 80px 20px 40px; /* Lots of top padding to separate it from content */
    background: transparent;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Very subtle divider */
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Even spacing between elements */
}

.footer-brand {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.footer-brand span {
    color: var(--gold); 
}

.footer-tagline {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 0;
}

.footer-links {
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.7;
}

.footer-legal {
    margin-top: 20px;
    font-size: 0.75rem;
    opacity: 0.4;
    letter-spacing: 0.5px;
}



.admin-content {
    margin-top: 40px;
    overflow-x: auto; /* Handles mobile viewing */
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* Adds space between rows */
}

.admin-table th {
    text-align: left;
    padding: 12px;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #FFB800;
    opacity: 0.8;
}

.admin-table td {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    vertical-align: middle;
}

.admin-table tr td:first-child { border-radius: 8px 0 0 8px; }
.admin-table tr td:last-child { border-radius: 0 8px 8px 0; }

.client-name { font-weight: 600; color: #fff; }
.file-details { font-size: 0.75rem; opacity: 0.5; font-family: 'DM Mono', monospace; }

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-live { background: #28a745; color: #fff; }
.status-pending { background: #555; color: #fff; }

.action-cell {
    display: flex;
    gap: 10px;
}
.action-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
}


.recommendation-block { 
  
  background: var(--surface); 
  border: 1px solid var(--border); 
  border-radius: 4px; 
  padding: 18px; 
  align-items: center;
  text-align: center;
}




























.btn-primary {
    /* Pinning to the right - adjusted for better vertical balance */
    position: fixed;
    right: 40px;
    top: 40%;
    z-index: 100;

    /* Aesthetic Styling: The "Pro" look */
    background: var(--surface);
   /* Dark text on gold is much more readable/premium than white */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle "light-catch" edge */
    
    /* Typography: The Consultancy Feel */
    padding: 10px 20px;
    border-radius: 6px; /* Squaring it off slightly looks more "data-driven" than a pill */
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    
    /* Depth and Polish */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2); /* Inner highlight */
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hover State: Reactive but subtle */
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Icon tweak to match the weight */
.btn-primary i, .btn-primary span {
    display: inline-block;
    line-height: 1;
}






/* 1. The Main Sidebar Container */
.driver-sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    
    /* Using a solid hex matching your image */
    background-color: #080a0c; 
    
    overflow-x: hidden;
    transition: 0.4s;
    padding-top: 20px; /* Reduced to make room for solid header */
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

/* 2. The Solid, Centered Header */
.sidebar-header {
    background-color: #080a0c; /* Solid matching the image */
    color: var(--gold);
    padding: 20px 25px;
    border-bottom: 1px solid #1a1a1a;
    
    /* Centering Logic */
    display: flex;
    justify-content: center; /* Centers the title */
    align-items: center;
    position: relative; /* Allows button to be absolute */
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
    width: 100%;
}

/* 3. The Absolute Close Button (Doesn't affect centering) */
.close-btn {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    color: #666; /* Muted so it doesn't distract */
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

/* 4. The Opaque Driver Cards */
.driver-card {
    /* Slightly lighter than the background so it stands out, but 100% solid */
    background-color: #121417; 
    margin: 20px 25px;
    padding: 18px;
    border-radius: 10px;
    border-left: 4px solid var(--gold);
    
    /* Subtle shadow for a "lifted" look without transparency */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.driver-title {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold); /* Switched to gold for better contrast on rich black */
}

.suggestion-list {
    margin: 0;
    padding-left: 18px;
    color: #E0E6ED; /* That "Arctic Ice" color for readability */
    font-size: 0.9rem;
    list-style-type: disc;
}










.recommendation-block {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0d0f11; /* Match your card backgrounds */
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    height: 100%; /* Ensures it fills the space in your grid */
}

.action-label {
    color: var(--gold); /* Your specific gold hex */
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hover effect for the whole block */
.recommendation-block:hover {
    background-color: #141619;
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}




/* 1. Standard for Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gold) #080a0c;
}

/* 2. Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px; /* Slightly wider than the sidebar for easier grabbing */
}

/* The Background of the scrollbar */
::-webkit-scrollbar-track {
    background: #080a0c; 
}

/* The Movable Handle */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c9a84c 0%, #a3863a 100%);
    border-radius: 10px;
    border: 2px solid #080a0c; /* Creates a "floating" effect */
}

/* Hover effect on the handle */
::-webkit-scrollbar-thumb:hover {
    background: #e5c15e; 
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: var(--gold);
    border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #080a0c;
}

.sidebar-content {
    padding: 10px 25px 100px 25px;
    overflow-y: auto; 
    height: calc(100vh - 100px);
    
    /* Hide scrollbar for Firefox */
    scrollbar-width: none;
    
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;  
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar-content::-webkit-scrollbar {
    display: none;
}


/* ── Responsive Architecture ── */

@media (max-width: 900px) {
  .wrapper { padding: 24px 20px 60px; }
  
  /* Force header items to stack and align strictly to the left */
  header { 
    display: flex;
    flex-direction: column; 
    align-items: flex-start !important; /* Forces left alignment */
    text-align: left !important;
    margin-bottom: 32px; 
    padding-bottom: 20px; 
    gap: 15px; 
    width: 100%;
  }
  
  /* Align title text and subtitles to the left */
  .header-meta { 
    text-align: left !important; 
    align-items: flex-start !important; 
    width: 100%;
  }
  
  /* Align navigation link containers to the left */
  .nav { 
    align-items: flex-start !important; 
    width: 100%; 
  }
  
  .nav-links-group {
    justify-content: flex-start !important; /* Prevents center/right drifting */
    width: 100%;
    gap: 15px;
  }
  
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 28px; }
  .kpi-value { font-size: 24px; }
  
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { order: 2; } 
  .panel { order: 1; }
  .client-grid { grid-template-columns: repeat(2, 1fr); }
  .section-label-annotation { display: none; }
  .overview-container { flex-direction: column; }
}

@media (max-width: 768px) {
  .driver-sidebar[style*="width: 30%"] {
      width: 100% !important;
      border-left: none;
  }

  /* Ensure deep mobile targets continue to stay pinned to the left */
  header { 
    align-items: flex-start !important; 
    text-align: center !important; 
  }
  .header-meta { 
    align-items: flex-start !important; 
  }
  .nav { 
    align-items: flex-start !important; 
  }
  .nav-links-group { 
    flex-wrap: wrap; 
    justify-content: flex-start !important; 
    gap: 15px; 
  }

  tbody tr td {
      padding: 16px 12px; 
  }
}

@media (max-width: 768px) {
  /* 1. Fix the Action Plan Drawer for Mobile */
  /* This overrides the inline JS style of 30% to make it full screen */
  .driver-sidebar[style*="width: 30%"] {
      width: 100% !important;
      border-left: none;
  }

  /* 2. Fix the Navigation Collisions */
  header { align-items: center; text-align: center; }
  .header-meta { align-items: center; margin-bottom: 12px; }
  .nav { align-items: center; width: 100%; }
  .nav-links-group { 
      flex-wrap: wrap; 
      justify-content: center; 
      gap: 15px; 
  }

  /* 3. Increase Touch Targets for Fat Fingers */
  tbody tr td {
      padding: 16px 12px; /* Taller rows for easier tapping */
  }
}

@media (max-width: 480px) {
  .wrapper { padding: 18px 14px 48px; }

  /* 4. Stack KPIs to prevent text breaking on small screens */
  .kpi-grid { grid-template-columns: 1fr; gap: 10px; }
  .kpi-card { padding: 16px 14px; }
  .kpi-value { font-size: 26px; }
  .kpi-label { font-size: 10px; letter-spacing: 0.15em; }

  .logo { font-size: 24px; }
  .panel-title { font-size: 13px; margin-bottom: 8px; }
  
  /* Stack the table header so the member count doesn't overflow */
  .panel-header { 
      flex-direction: column; 
      align-items: flex-start; 
      gap: 8px;
  }

  /* 5. Visual cue that the table scrolls horizontally */
  .panel {
      box-shadow: inset -15px 0 15px -15px rgba(0,0,0,0.6);
  }

  .client-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  
  .btn-primary {
      top: auto;
      bottom: 20px;
      right: 20px;
      padding: 12px 24px;
  }
}