
:root{
  --bg:#0b0b0e;
  --panel:#111116;
  --card:#14141b;
  --line:rgba(255,255,255,.08);
  --line2:rgba(255,255,255,.12);
  --text:#F3F3F6;
  --muted:#A7A7B5;
  --accent:#F5C84B;
  --accent2:#FFD980;
  --good:#66f0b1;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --shadow2: 0 10px 28px rgba(0,0,0,.35);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, -apple-system, Segoe UI, Arial, sans-serif;
  background: linear-gradient(180deg, #0b0b0e 0%, #07070a 100%);
  color:var(--text);
}

.bg{
  position:fixed; inset:0; pointer-events:none; overflow:hidden;
}
.bg-orb{
  position:absolute;
  width:860px; height:860px;
  border-radius:999px;
  filter: blur(60px);
  opacity:.22;
}
.orb1{ left:-280px; top:-360px; background: radial-gradient(circle at 30% 30%, rgba(245,200,75,.95), rgba(245,200,75,0) 60%); }
.orb2{ right:-340px; top:-260px; background: radial-gradient(circle at 30% 30%, rgba(180,130,255,.75), rgba(180,130,255,0) 60%); opacity:.16;}
.bg-grid{
  position:absolute; inset:0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity:.06;
  transform: translateZ(0);
}

.layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  min-height:100vh;
}
@media (max-width: 980px){
  .layout{grid-template-columns:1fr}
  .sidebar{display:none}
}

.sidebar{
  padding:18px 14px;
  border-right:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  backdrop-filter: blur(10px);
}
.brand{
  display:flex; gap:12px; align-items:center;
  padding:12px;
  border:1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow2);
}
.logo{
  width:42px; height:42px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  color:var(--accent2);
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.10), rgba(255,255,255,.02));
  border:1px solid var(--line);
}
.brand-top{font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted)}
.brand-name{font-size:18px; font-weight:800; margin-top:2px}

.nav{margin-top:14px; display:flex; flex-direction:column; gap:8px}
.nav-item{
  display:flex; gap:10px; align-items:center;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid transparent;
  color: var(--text);
  text-decoration:none;
  font-weight:700;
  background: rgba(255,255,255,.02);
}
.nav-item:hover{ border-color: var(--line); background: rgba(255,255,255,.03); }
.nav-item.active{
  border-color: rgba(245,200,75,.35);
  background: linear-gradient(180deg, rgba(245,200,75,.18), rgba(245,200,75,.06));
}
.nav-dot{
  width:10px; height:10px; border-radius:99px;
  background: rgba(245,200,75,.65);
  box-shadow: 0 0 0 4px rgba(245,200,75,.12);
}

.sidebar-foot{
  margin-top:16px;
  padding:12px;
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}
.pill{
  display:flex; gap:10px; align-items:center;
  font-weight:800; font-size:12px;
}
.pill-dot{
  width:8px; height:8px; border-radius:99px;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(102,240,177,.10);
}
.micro{margin-top:10px; color:var(--muted); font-size:12px; line-height:1.4}

.main{
  padding:22px 22px 50px;
  max-width: 1200px;
}
@media (min-width: 980px){
  .main{ padding-left: 26px; }
}

.topbar{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
  margin-bottom: 12px;
}
h1{
  margin:0;
  font-size:30px;
  letter-spacing:-.02em;
}
.sub{margin:6px 0 0; color:var(--muted); max-width: 70ch}
.topbar-actions{display:flex; gap:10px; align-items:center}

.kpis{
  display:grid;
  grid-template-columns: 1.1fr .9fr .9fr;
  gap:12px;
  margin: 14px 0;
}
@media (max-width: 980px){
  .kpis{grid-template-columns:1fr}
}
.kpi{
  padding:14px;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow2);
}
.kpi-label{color:var(--muted); font-size:12px; font-weight:700}
.kpi-value{font-size:22px; font-weight:900; margin-top:8px; color: var(--accent2)}
.kpi-sub{margin-top:8px; color:var(--muted); font-size:12px}
.kpi-primary .kpi-value{font-size:28px; font-weight:900; letter-spacing:-.02em}
.kpi-secondary .kpi-value{opacity:.72}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  align-items:start;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom: 10px;
}
h2{margin:0; font-size:16px}
.muted{margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.45}
.badge{
  padding:7px 10px;
  border-radius: 999px;
  font-weight:900;
  font-size:12px;
  color:#14141b;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}
.badge.status-ok{
  background: linear-gradient(180deg, #C6F2D8, #6FD9AE);
  color:#0b1a13;
}
.badge.status-warn{
  background: linear-gradient(180deg, #FFE1B3, #F5B562);
  color:#2b1600;
}
.badge.status-bad{
  background: linear-gradient(180deg, #FFC2C2, #F07C7C);
  color:#2d0b0b;
}
.badge.status-neutral{
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  color: var(--text);
}

label{display:block; margin:10px 0; font-size:12px; font-weight:700; color:#E7E7EC}
input, select, textarea{
  width:100%;
  padding:11px 12px;
  border-radius: 14px;
  border:1px solid var(--line2);
  background: rgba(10,10,14,.8);
  color: var(--text);
  outline:none;
  font: inherit;
  margin-top:6px;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(245,200,75,.5);
  box-shadow: 0 0 0 4px rgba(245,200,75,.12);
}
textarea{min-height:96px; resize:vertical}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.grid3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px}
@media (max-width: 720px){
  .grid2,.grid3{grid-template-columns:1fr}
}

.actions{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  margin-top: 10px;
}
.right{margin-left:auto}
.hint{color:var(--muted); font-size:12px}

.btn{
  padding:10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight:900;
  cursor:pointer;
  transition: transform .06s ease, filter .06s ease;
}
.btn:active{transform: translateY(1px)}
.btn:hover{filter:brightness(1.03)}
.btn[disabled]{opacity:.55; cursor:not-allowed}
.btn.accent{
  border: none;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color:#14141b;
}
.btn.ghost{
  background: transparent;
  border:1px solid var(--line);
}

.priceBox{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  min-width: 170px;
}
.price-label{color:var(--muted); font-size:12px; font-weight:700}
.price{font-size:18px; font-weight:900; color: var(--accent2); margin-top:4px}

.output-wrap{
  position:relative;
}
.output{min-height:210px; padding-bottom: 46px}
.output-actions{
  position:absolute;
  right:10px;
  bottom:10px;
  display:flex;
  gap:8px;
}
.status-row{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.status{
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}
.fineprint{color:var(--muted); font-size:12px}

.callout{
  margin-top: 10px;
  padding:12px;
  border-radius: 16px;
  border:1px solid rgba(245,200,75,.22);
  background: linear-gradient(180deg, rgba(245,200,75,.12), rgba(245,200,75,.04));
}
.callout-title{font-weight:900; font-size:12px; color:#fff}
.callout-text{margin-top:6px; color:var(--muted); font-size:12px; line-height:1.5}
.error-message{
  margin-top: 12px;
  color: rgba(255,150,150,.95);
  font-size: 12px;
  font-weight: 700;
}

.footer{
  margin-top: 16px;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  color:var(--muted);
  font-size:12px;
}
.sep{opacity:.6}

.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  min-width: 220px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(20,20,27,.88);
  color: var(--text);
  box-shadow: var(--shadow2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events:none;
  font-size: 12px;
  font-weight: 700;
}
.toast.show{
  opacity: 1;
  transform: translateY(0);
}

/* Fix: mobile navigation when sidebar hidden */
.mobile-tabs{
  position: sticky;
  top: 0;
  z-index: 50;
  display:none;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  background: rgba(10,10,14,.88);
  backdrop-filter: blur(10px);
}
.m-tab{
  flex:1;
  text-align:center;
  text-decoration:none;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  color: var(--text);
  font-weight:900;
  font-size:12px;
  background: rgba(255,255,255,.02);
}
.m-tab.active{
  border-color: rgba(245,200,75,.35);
  background: linear-gradient(180deg, rgba(245,200,75,.18), rgba(245,200,75,.06));
}
@media (max-width: 980px){
  .mobile-tabs{display:flex}
}

/* inline action row */
.inline-actions{
  display:flex;
  gap:10px;
  align-items:flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}
.field-hint{
  margin-top:6px;
  color: var(--muted);
  font-size:11px;
  font-weight:600;
  line-height:1.35;
}

/* Quotes table */
.table-wrap{overflow:auto; border:1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.02); }
.qtable{width:100%; border-collapse: collapse; font-size:12px;}
.qtable th, .qtable td{padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap;}
.qtable th{color: var(--muted); font-weight:900; position: sticky; top:0; background: rgba(20,20,27,.92); backdrop-filter: blur(8px);}
.qtable tbody tr{cursor:pointer;}
.qtable tbody tr:hover{background: rgba(245,200,75,.06);}
.qtable tbody tr.active{background: rgba(245,200,75,.12);}
.qtable td.muted{white-space:normal;}
.qtable .empty-state{text-align:center; padding:32px 12px;}
.qtable .empty-state .empty-title{font-weight:800; font-size:14px; color:var(--text); margin:0;}
.qtable .empty-state .empty-sub{margin-top:6px; color:var(--muted); font-size:12px;}
.qtable .empty-state .btn{display:inline-block; margin-top:14px; text-decoration:none;}

/* Generic tables (Builder breakdown + labour) */
.tableWrap{overflow:auto; border:1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.02); }
.table{width:100%; border-collapse: collapse; font-size:12px;}
.table th, .table td{padding:10px 12px; border-bottom:1px solid var(--line); text-align:left;}
.table th{color: var(--muted); font-weight:900; position: sticky; top:0; background: rgba(20,20,27,.92); backdrop-filter: blur(8px);}
.table td input, .table td select{width:100%;}
.tRight{text-align:right;}
.rowStrong td{font-weight:900;}

/* Segmented control */
.segmented{display:flex; gap:8px;}
.seg{flex:1; padding:10px 12px; border-radius: 14px; border:1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); font-weight:800; cursor:pointer;}
.seg:hover{border-color: rgba(245,200,75,.55); background: rgba(245,200,75,.06);}
.seg.active{border-color: rgba(245,200,75,.9); background: rgba(245,200,75,.12);}

/* Stack helper */
.stack{display:flex; flex-direction:column; gap:10px;}
/* Output actions wrap nicely when more buttons */
.output-actions{flex-wrap: wrap;}
/* Print styles for printable quote window */
@media print{
  body{background:white !important; color:black !important;}
}



.collapse{border:1px dashed rgba(255,255,255,.18); border-radius:16px; padding:14px}
.collapse summary{cursor:pointer; font-weight:900}
.collapse[open]{background:rgba(255,255,255,.02)}
.hr{height:1px;background:var(--line);border:0;margin:14px 0}
.sum{margin-top:6px}
.sum-row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.06)}
.sum-row:last-child{border-bottom:0}
.sum-total{font-size:16px}

/* ---------- Builder wizard (guided workflow) ---------- */
.wizard{margin:0 0 14px; padding:12px; border-radius:18px; border:1px solid rgba(255,255,255,.10); background:rgba(12,12,12,.45); backdrop-filter: blur(10px)}
.wizard-steps{display:flex; gap:8px; flex-wrap:wrap}
.wstep{appearance:none; border:1px solid rgba(255,255,255,.12); background:rgba(0,0,0,.25); color:rgba(255,255,255,.88); padding:8px 10px; border-radius:999px; font-weight:800; font-size:12px; letter-spacing:.2px; cursor:pointer; transition:transform .08s ease, background .12s ease, border-color .12s ease}
.wstep:hover{transform:translateY(-1px); border-color:rgba(255,255,255,.18)}
.wstep.active{background:rgba(245,200,75,.14); border-color:rgba(245,200,75,.50); color:#fff}
.wizard-note{margin-top:10px; color:rgba(255,255,255,.72); font-size:13px}
.wizard-nav{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 0 6px}
.wizard-nav-mid{flex:1; display:flex; justify-content:center}
.step-card{display:none}
.step-card.active{display:block}

@media (max-width: 980px){
  .wizard-nav{position:sticky; bottom:10px; background:rgba(10,10,10,.55); border:1px solid rgba(255,255,255,.10); border-radius:16px; padding:10px; backdrop-filter: blur(10px)}
}



/* ---------- QuoteSmith Premium Workflow Additions ---------- */
.start-gate{
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
}
.start-gate.hidden{ display:none; }
.start-card{
  width: min(860px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(18,18,18,.98), rgba(12,12,12,.98));
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  padding: 22px;
}
.start-head h2{ margin: 6px 0 10px; font-size: 26px; letter-spacing: -.02em; }
.kicker{
  display:inline-block;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,215,0,.9);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,215,0,.35);
  background: rgba(255,215,0,.08);
}
.start-actions{ display:flex; gap:12px; flex-wrap: wrap; margin-top: 14px; }
.split{ display:grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
@media (max-width: 860px){ .split{ grid-template-columns: 1fr; } }
.card-sub{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 14px;
}
.h3{ margin:0 0 6px; font-size: 14px; letter-spacing: .01em; }

#simResult.warn{ color: rgba(255,120,120,.95); }

.cardSub{ margin-top:14px; padding:14px; border-radius:16px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.03);}
.cardSub.hidden{ display:none; }
.card-head.mini{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px;}
.card-head.mini h3{ margin:0;} 

.brandTag{ font-size:11px; color: rgba(255,215,0,.85); margin-top:2px; letter-spacing:.06em; text-transform:uppercase; }


/* Banner */
.banner{margin:12px 0 18px; border:1px solid rgba(255,255,255,0.10); background:rgba(244,196,48,0.08); border-radius:16px; padding:12px 14px;}
.banner.hidden{display:none;}
.banner-inner{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.banner-title{font-weight:800; letter-spacing:.2px;}
.banner-sub{color:rgba(255,255,255,0.78); font-size:13px; margin-top:2px;}
.banner-actions{display:flex; gap:10px; align-items:center;}

/* ---------- Login page (scoped to .page-login) ---------- */
.page-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-login .auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}

.page-login .card {
  width: 100%;
  max-width: 460px;
}

.page-login h1 {
  font-size: 28px;
  margin-top: 8px;
}

.page-login .sub {
  margin-bottom: 18px;
}

.page-login .grid2 {
  display: grid;
  gap: 16px;
}

.page-login input {
  width: 100%;
  margin-top: 6px;
}

.page-login .actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page-login .confirm-panel {
  margin-top: 16px;
}

.page-login .confirm-panel.hidden {
  display: none;
}

.page-login .confirm-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page-login .btn.accent {
  flex: 1;
}

.page-login .btn.ghost {
  flex: 1;
}

/* ---------- Billing status (used on billing page) ---------- */
.billing-status{
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.billing-status .status-title{
  font-weight: 900;
  font-size: 12px;
}

/* AI badge in quotes table */
.ai-badge{
  display:inline-block;
  font-size:10px;
  font-weight:700;
  letter-spacing:.04em;
  padding:2px 6px;
  border-radius:6px;
  background:var(--accent);
  color:#111;
  vertical-align:middle;
  margin-left:6px;
}

/* AI output tabs on quotes detail */
.ai-tabs-label{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
}
.ai-tab-btn.active{
  background:var(--accent)!important;
  color:#111!important;
}
