:root{
  --bg: #090d12;
  --sidebar: #0d121a;
  --card: #111822;
  --card-2: #0d141d;
  --border: #1d2733;
  --border-strong: #2b3a4d;
  --text: #f4f7fb;
  --muted: #7f8b9b;
  --muted-2: #9aa6b5;
  --accent: #4da3ff;
  --accent-soft: rgba(77,163,255,0.12);
  --green: #36d399;
  --red: #ff5c6c;
  --yellow: #f5c451;
  --radius: 16px;
  --shadow: 0 16px 38px rgba(0,0,0,0.22);
}

*{ box-sizing:border-box; }
html{ background:var(--bg); }
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(77,163,255,0.07), transparent 30%),
    var(--bg);
  color:var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a{ color:inherit; }

.container{
  width:min(1460px, calc(100% - 56px));
  margin:0 auto;
  padding:32px 0 48px;
}
.container-wide{
  width:calc(100% - 56px);
  max-width:none;
  margin:0 auto;
  padding:32px 0 48px;
}

/* Header */
.topbar{
  position:sticky;
  top:0;
  z-index:40;
  background:rgba(9,13,18,0.92);
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(16px);
}
.topbar-inner{
  width:min(1460px, calc(100% - 56px));
  margin:0 auto;
  min-height:74px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
.brand-lockup{
  display:flex;
  align-items:center;
  gap:11px;
  text-decoration:none;
  flex:0 0 auto;
}
.brand-mark{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:white;
  font-weight:850;
  font-size:16px;
  background:linear-gradient(145deg, #5da9ff, #3479e6);
  box-shadow:0 8px 24px rgba(77,163,255,0.22);
}
.brand{
  display:block;
  color:var(--text);
  font-size:15px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:0.1px;
}
.brand-subtitle{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:9px;
  line-height:1;
  letter-spacing:.65px;
  text-transform:uppercase;
}
.nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}
.nav-pill{
  text-decoration:none;
  color:#a9b3c0;
  border:1px solid transparent;
  padding:8px 12px;
  border-radius:10px;
  font-size:11px;
  font-weight:700;
  transition:background .14s ease, color .14s ease, border-color .14s ease, transform .14s ease;
}
.nav-pill:hover{
  color:var(--text);
  background:#121a25;
  border-color:var(--border);
  transform:translateY(-1px);
}
.nav-pill.active{
  color:#eaf3ff;
  background:rgba(77,163,255,0.13);
  border-color:rgba(77,163,255,0.35);
  box-shadow:inset 0 0 0 1px rgba(77,163,255,0.04);
}

/* Generic page language */
.page-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  margin:0 0 24px;
}
.page-eyebrow{
  color:var(--accent);
  font-size:10px;
  font-weight:800;
  letter-spacing:1.05px;
  text-transform:uppercase;
  margin-bottom:8px;
}
.page-title{
  margin:0;
  color:var(--text);
  font-size:27px;
  line-height:1.08;
  font-weight:750;
}
.page-subtitle{
  margin-top:7px;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.card{
  background:linear-gradient(145deg, var(--card) 0%, #0f1620 100%);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  box-shadow:var(--shadow);
  color:var(--text);
}
.card + .card{ margin-top:16px; }
.card h1,.card h2,.card h3{ color:var(--text); }
.card h2{ font-size:23px; font-weight:750; }
.card h3{ font-size:16px; font-weight:700; }

.section-card{
  background:linear-gradient(145deg, var(--card) 0%, #0e151e 100%);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
}
.section-title{ margin:0; font-size:16px; font-weight:700; }
.section-subtitle{ color:var(--muted); font-size:11px; line-height:1.5; margin-top:5px; }

.grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.row{ display:grid; grid-template-columns:1.2fr .7fr 1fr; gap:10px; margin:8px 0; }
.hint,.muted{ color:var(--muted)!important; }
.hint{ font-size:11px; line-height:1.5; }

/* Forms */
input,select,textarea{
  border:1px solid var(--border-strong);
  background:#0d141d;
  color:var(--text);
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
  outline:none;
  transition:border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
input:focus,select:focus,textarea:focus{
  border-color:rgba(77,163,255,0.65);
  box-shadow:0 0 0 3px rgba(77,163,255,0.10);
}
select option{ color:#10151d; background:#fff; }
label{ color:var(--muted-2); }
button,.button{
  appearance:none;
  border:1px solid rgba(77,163,255,0.35);
  border-radius:10px;
  padding:10px 15px;
  background:linear-gradient(145deg,#5aa8ff,#438ce8);
  color:white;
  font:inherit;
  font-size:11px;
  font-weight:750;
  cursor:pointer;
  text-decoration:none;
  transition:transform .14s ease, filter .14s ease, box-shadow .14s ease;
  box-shadow:0 8px 20px rgba(77,163,255,0.12);
}
button:hover,.button:hover{ transform:translateY(-1px); filter:brightness(1.04); }
button.secondary,.button.secondary{
  background:#121a25;
  color:var(--text);
  border-color:var(--border-strong);
  box-shadow:none;
}

/* Tables */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:13px;
  overflow:hidden;
  background:#0d141d;
}
th{
  text-align:left;
  color:var(--muted);
  background:#101823;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.7px;
  font-weight:800;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}
td{
  font-size:11px;
  padding:10px 12px;
  border-bottom:1px solid rgba(29,39,51,0.72);
  vertical-align:top;
}
tr:last-child td{ border-bottom:0; }
tbody tr:hover td{ background:rgba(77,163,255,0.025); }

/* Import */
.upload-shell{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);
  gap:16px;
}
.upload-zone{
  position:relative;
  min-height:190px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  border:1px dashed rgba(77,163,255,0.52);
  border-radius:14px;
  background:rgba(77,163,255,0.035);
  padding:28px;
}
.upload-zone input[type=file]{
  width:min(520px,100%);
  background:#0b1119;
  margin:16px 0 12px;
}
.upload-icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:var(--accent-soft);
  color:var(--accent);
  font-weight:900;
  font-size:19px;
  margin-bottom:12px;
}
.mini-stack{ display:grid; gap:10px; }
.mini-card{
  background:#0d141d;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
}
.mini-label{
  color:var(--muted);
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.8px;
  font-weight:800;
}
.mini-value{ color:var(--text); font-size:14px; font-weight:700; margin-top:6px; }

/* Flash messages */
.flashes{ display:grid; gap:9px; margin:0 0 16px; }
.flash{
  display:flex;
  align-items:flex-start;
  gap:10px;
  border:1px solid var(--border);
  background:#111822;
  color:var(--text);
  border-radius:12px;
  padding:11px 13px;
  font-size:11px;
  line-height:1.45;
  box-shadow:0 10px 24px rgba(0,0,0,.14);
}
.flash-dot{ width:7px; height:7px; margin-top:5px; border-radius:50%; background:var(--accent); flex:0 0 auto; }
.flash.success{ border-color:rgba(54,211,153,.28); background:rgba(54,211,153,.065); }
.flash.success .flash-dot{ background:var(--green); }
.flash.error,.flash.danger{ border-color:rgba(255,92,108,.30); background:rgba(255,92,108,.065); }
.flash.error .flash-dot,.flash.danger .flash-dot{ background:var(--red); }
.flash.warning{ border-color:rgba(245,196,81,.30); background:rgba(245,196,81,.065); }
.flash.warning .flash-dot{ background:var(--yellow); }

hr{ border:0; border-top:1px solid var(--border); margin:16px 0; }

/* Simple snapshot fields */
.form-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:10px; font-weight:700; }

@media (max-width:980px){
  .topbar-inner{ align-items:flex-start; padding:14px 0; }
  .nav{ justify-content:flex-start; }
  .upload-shell{ grid-template-columns:1fr; }
  .row{ grid-template-columns:1fr; }
}
@media (max-width:720px){
  .container,.container-wide,.topbar-inner{ width:calc(100% - 28px); }
  .container,.container-wide{ padding-top:22px; }
  .topbar-inner{ flex-direction:column; gap:12px; }
  .nav{ width:100%; overflow:auto; flex-wrap:nowrap; padding-bottom:2px; }
  .nav-pill{ white-space:nowrap; }
  .page-title{ font-size:23px; }
}

@media print{
  .topbar{ display:none!important; }
  body{ background:#fff!important; color:#111!important; }
  .container,.container-wide{ width:100%!important; padding:0!important; }
  .card,.section-card{ box-shadow:none!important; border:1px solid #ddd!important; background:#fff!important; color:#111!important; }
}
