/* QuoteQuilt — Deep Space UI (shared stylesheet) */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root{
  --bg:#030712;
  --surface:#111827;
  --surface-2:#0b1220;
  --surface-3:#0f172a;
  --border:rgba(148,163,184,.18);
  --border-2:rgba(148,163,184,.28);
  --text:#F9FAFB;
  --muted:#9CA3AF;
  --muted-2:#94a3b8;
  --primary:#6366F1;
  --secondary:#818CF8;
  --accent:#F472B6;
  --success:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;
  --info:#38bdf8;

  --radius:8px;
  --shadow: 0 18px 60px rgba(99,102,241,.10), 0 10px 30px rgba(0,0,0,.55);
  --shadow-soft: 0 10px 30px rgba(0,0,0,.45);

  --font-heading:"Exo 2", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-body: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --sidebar-w: 292px;
  --masthead-h: 64px;
  --actionbar-h: 68px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font-body);
  background: radial-gradient(1200px 800px at 15% 10%, rgba(99,102,241,.16), transparent 55%),
              radial-gradient(900px 650px at 92% 18%, rgba(244,114,182,.14), transparent 60%),
              radial-gradient(900px 650px at 55% 95%, rgba(56,189,248,.10), transparent 62%),
              var(--bg);
  color:var(--text);
}

a{color:inherit; text-decoration:none}

/* Layout */
.app-shell{min-height:100vh; display:flex; flex-direction:column}
.masthead{
  height:var(--masthead-h);
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; gap:16px;
  padding:12px 16px;
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(17,24,39,.78));
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.brand{display:flex; align-items:center; gap:10px; min-width:210px}
.logo-mark{
  width:34px; height:34px; border-radius:10px;
  background: radial-gradient(circle at 30% 30%, rgba(244,114,182,.9), rgba(99,102,241,.85));
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 18px 40px rgba(99,102,241,.25);
}
.brand h1{margin:0; font-family:var(--font-heading); font-weight:700; font-size:18px; letter-spacing:.2px}
.brand .tag{font-size:12px; color:var(--muted); margin-top:1px}

.masthead-center{flex:1; display:flex; align-items:center; gap:12px; justify-content:center}
.search{
  width:min(640px, 100%);
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(3,7,18,.55);
  border:1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.search input{
  width:100%; border:0; outline:0; background:transparent;
  color:var(--text); font-size:14px;
}
.search .kbd{font-size:12px; color:var(--muted); border:1px solid var(--border); padding:2px 6px; border-radius:8px}

.masthead-right{display:flex; align-items:center; gap:10px}
.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(3,7,18,.35);
  color:var(--muted-2);
  font-size:12px;
}
.chip .dot{width:8px; height:8px; border-radius:999px; background: var(--success); box-shadow:0 0 0 3px rgba(34,197,94,.15)}

.icon-btn{
  width:38px; height:38px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(3,7,18,.35);
  color:var(--text);
  display:grid; place-items:center;
  cursor:pointer;
}
.icon-btn:hover{border-color:var(--border-2); background: rgba(3,7,18,.48)}

.main{
  display:grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--masthead-h));
}
.sidebar{
  position:sticky; top:var(--masthead-h);
  height: calc(100vh - var(--masthead-h));
  border-right:1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,24,39,.88), rgba(17,24,39,.72));
  backdrop-filter: blur(10px);
  padding:16px 14px;
  overflow:auto;
}
.content{
  padding:18px 18px calc(var(--actionbar-h) + 22px);
}

/* Sidebar nav */
.nav-section{margin-top:6px}
.nav-title{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.12em; margin:14px 10px 8px}
.nav a{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid transparent;
  color: var(--muted-2);
}
.nav a .left{display:flex; align-items:center; gap:10px; min-width:0}
.nav a .ico{
  width:30px; height:30px; border-radius:10px;
  background: rgba(99,102,241,.12);
  border:1px solid rgba(99,102,241,.22);
  display:grid; place-items:center;
  flex:0 0 auto;
}
.nav a .label{white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.nav a:hover{background: rgba(3,7,18,.35); border-color:var(--border)}
.nav a.active{
  background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(244,114,182,.10));
  border-color: rgba(99,102,241,.40);
  color: var(--text);
}
.badge{
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--muted);
  background: rgba(3,7,18,.35);
}
.badge.success{color:#b7f7c7; border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12)}
.badge.warn{color:#ffe4b5; border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12)}
.badge.danger{color:#ffd1d1; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12)}
.badge.info{color:#cbefff; border-color: rgba(56,189,248,.35); background: rgba(56,189,248,.12)}

/* Stepper */
.stepper{display:flex; flex-direction:column; gap:10px; margin-top:8px}
.step{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(3,7,18,.25);
}
.step.active{border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.10)}
.step .top{display:flex; align-items:center; justify-content:space-between; gap:10px}
.step .name{font-weight:600}
.step .meta{margin-top:6px; display:flex; gap:8px; align-items:center; color:var(--muted); font-size:12px}
.step .pill{padding:2px 8px; border-radius:999px; border:1px solid var(--border); background: rgba(3,7,18,.25)}

/* Cards, panels */
.card{
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,24,39,.80), rgba(17,24,39,.60));
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card-header{padding:14px 14px 0}
.card-title{margin:0; font-family:var(--font-heading); font-weight:700; font-size:14px; letter-spacing:.2px}
.card-sub{margin:6px 0 0; color:var(--muted); font-size:12px}
.card-body{padding:14px}

.grid{display:grid; gap:14px}
.grid.cols-3{grid-template-columns: 1.15fr 1.15fr .9fr}
.grid.cols-2{grid-template-columns: 1.25fr .75fr}
.grid.cols-4{grid-template-columns: repeat(4, 1fr)}

/* Tabs */
.tabs{display:flex; gap:8px; padding:6px; border:1px solid var(--border); border-radius:14px; background: rgba(3,7,18,.28); width:fit-content}
.tab{padding:8px 10px; border-radius:12px; color:var(--muted-2); font-size:13px; border:1px solid transparent}
.tab.active{color:var(--text); background: rgba(99,102,241,.18); border-color: rgba(99,102,241,.35)}
.tab:hover{border-color: var(--border)}

/* Tables */
.table-wrap{overflow:auto; border-radius: var(--radius); border:1px solid var(--border)}
.table{width:100%; border-collapse:separate; border-spacing:0; min-width: 860px; background: rgba(3,7,18,.18)}
.table th, .table td{padding:12px 12px; border-bottom:1px solid rgba(148,163,184,.14); font-size:13px; vertical-align:top}
.table th{position:sticky; top:0; background: rgba(17,24,39,.92); backdrop-filter: blur(8px); text-align:left; color:var(--muted-2); font-weight:600}
.table tr:hover td{background: rgba(99,102,241,.06)}
.table .row-title{font-weight:600}
.table .muted{color:var(--muted); font-size:12px}
.table tfoot td{background: rgba(17,24,39,.62); font-weight:600}

/* Forms */
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
.label{font-size:12px; color:var(--muted); letter-spacing:.02em}
.input, select, textarea{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(3,7,18,.40);
  color: var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical}
.input:focus, select:focus, textarea:focus{border-color: rgba(99,102,241,.55); box-shadow: 0 0 0 4px rgba(99,102,241,.18)}
.help{color:var(--muted); font-size:12px}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(3,7,18,.35);
  color: var(--text);
  cursor:pointer;
  font-weight:600;
  font-size:13px;
}
.btn:hover{border-color: var(--border-2); background: rgba(3,7,18,.52)}
.btn.primary{background: linear-gradient(135deg, rgba(99,102,241,.92), rgba(129,140,248,.72)); border-color: rgba(99,102,241,.55)}
.btn.primary:hover{filter:brightness(1.03)}
.btn.accent{background: linear-gradient(135deg, rgba(244,114,182,.92), rgba(99,102,241,.45)); border-color: rgba(244,114,182,.55)}
.btn.ghost{background: transparent}
.btn:disabled{opacity:.5; cursor:not-allowed}
.btn.small{padding:7px 10px; border-radius:10px; font-size:12px}

/* Action bar */
.actionbar{
  position:fixed; left: var(--sidebar-w); right:0; bottom:0; z-index:45;
  height:var(--actionbar-h);
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 18px;
  border-top:1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,24,39,.68), rgba(17,24,39,.90));
  backdrop-filter: blur(10px);
}
.actionbar .left, .actionbar .right{display:flex; align-items:center; gap:10px}

/* Utilities */
.row{display:flex; align-items:center; justify-content:space-between; gap:12px}
.hstack{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.vstack{display:flex; flex-direction:column; gap:10px}
.divider{height:1px; background: rgba(148,163,184,.16); margin:12px 0}
.kpi{display:flex; flex-direction:column; gap:4px; padding:12px; border:1px solid var(--border); border-radius:14px; background: rgba(3,7,18,.25)}
.kpi .val{font-family: var(--font-heading); font-size:18px; font-weight:700}
.kpi .cap{font-size:12px; color:var(--muted)}

.filters{display:flex; gap:8px; flex-wrap:wrap}
.filter-chip{padding:7px 10px; border-radius:999px; border:1px solid var(--border); background: rgba(3,7,18,.28); font-size:12px; color:var(--muted-2)}
.filter-chip.active{border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.14); color:var(--text)}

/* Modal (static demo: use :target) */
.modal{
  position:fixed; inset:0; display:none; z-index:60;
  background: rgba(0,0,0,.62);
}
.modal:target{display:grid; place-items:center}
.modal .dialog{
  width:min(920px, 92vw);
  border-radius: 16px;
  border:1px solid rgba(148,163,184,.22);
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(17,24,39,.78));
  box-shadow: var(--shadow);
}
.modal .dialog .head{padding:14px 14px 10px; border-bottom:1px solid rgba(148,163,184,.16); display:flex; align-items:center; justify-content:space-between; gap:10px}
.modal .dialog .body{padding:14px}
.modal .dialog .foot{padding:12px 14px; border-top:1px solid rgba(148,163,184,.16); display:flex; justify-content:flex-end; gap:10px}

/* Page helpers */
.page-title{margin:0; font-family:var(--font-heading); font-weight:700; font-size:18px}
.page-sub{margin:6px 0 0; color:var(--muted); font-size:13px}

.quote-context{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}
.quote-context .ctx-left{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.ctx-item{display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:12px; border:1px solid var(--border); background: rgba(3,7,18,.28); font-size:12px; color:var(--muted-2)}
.ctx-item strong{color:var(--text); font-weight:700}

/* Right rail list */
.feed{display:flex; flex-direction:column; gap:10px}
.feed-item{padding:12px; border:1px solid var(--border); border-radius:14px; background: rgba(3,7,18,.22)}
.feed-item .top{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.feed-item .title{font-weight:600; font-size:13px}
.feed-item .meta{color:var(--muted); font-size:12px; margin-top:4px}
.feed-item .actions{margin-top:10px; display:flex; gap:8px}

.notice{
  padding:12px; border-radius:14px;
  border:1px solid rgba(245,158,11,.30);
  background: rgba(245,158,11,.10);
  color: #ffe9c7;
}
.notice.danger{border-color: rgba(239,68,68,.34); background: rgba(239,68,68,.10); color:#ffd6d6}

.small{font-size:12px; color:var(--muted)}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

@media (max-width: 1100px){
  :root{--sidebar-w: 260px}
  .grid.cols-3{grid-template-columns: 1fr}
  .grid.cols-2{grid-template-columns: 1fr}
  .actionbar{left:0}
  .main{grid-template-columns: 1fr}
  .sidebar{position:relative; height:auto; top:auto}
}
