
:root{
  --bg:#0b0b10;
  --panel:#12121a;
  --panel2:#151522;
  --text:#f4f2ee;
  --muted:rgba(244,242,238,.72);
  --muted2:rgba(244,242,238,.55);
  --gold:#c8a86a;
  --gold2:#e0c48a;
  --line:rgba(255,255,255,.08);
  --danger:#ff5c73;
  --ok:#6df2b1;
  --warn:#ffcf66;
  --shadow:0 18px 60px rgba(0,0,0,.5);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 12% -10%, rgba(200,168,106,.20), transparent 55%),
              radial-gradient(900px 600px at 88% 0%, rgba(200,168,106,.14), transparent 55%),
              radial-gradient(900px 700px at 60% 110%, rgba(255,255,255,.06), transparent 55%),
              var(--bg);
  color:var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  letter-spacing:.1px;
}

.bg-grain{
  pointer-events:none;
  position:fixed; inset:0;
  opacity:.10;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode:overlay;
}

.topbar{
  position:sticky; top:0; z-index:10;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(11,11,16,.88), rgba(11,11,16,.55));
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
}

.brand{display:flex; gap:12px; align-items:center}
.monogram{
  width:44px; height:44px;
  border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(200,168,106,.25), rgba(255,255,255,.06));
  border:1px solid rgba(200,168,106,.22);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-family: Fraunces, serif;
  font-weight:600;
  letter-spacing:.8px;
}
.brandtext .title{
  font-family: Fraunces, serif;
  font-weight:520;
  font-size:16px;
}
.brandtext .subtitle{
  font-size:12px;
  color:var(--muted2);
  margin-top:2px;
}

.nav{display:flex; gap:10px; align-items:center}
.nav a{
  color:var(--muted);
  text-decoration:none;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid transparent;
}
.nav a:hover{
  color:var(--text);
  border-color:var(--line);
  background: rgba(255,255,255,.03);
}
button{
  border:none;
  cursor:pointer;
  font: inherit;
  color:var(--text);
  background: linear-gradient(135deg, rgba(200,168,106,.22), rgba(255,255,255,.06));
  border:1px solid rgba(200,168,106,.25);
  padding:10px 12px;
  border-radius:12px;
}
button:hover{border-color:rgba(200,168,106,.38)}
button.primary{
  background: linear-gradient(135deg, rgba(200,168,106,.95), rgba(224,196,138,.78));
  color:#15141a;
  border:1px solid rgba(255,255,255,.12);
}
button.primary:hover{filter:brightness(1.04)}
button.ghost{
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
}
button.danger{
  background: rgba(255,92,115,.12);
  border:1px solid rgba(255,92,115,.35);
}

.shell{max-width:1100px; margin:0 auto; padding:18px}
.view{padding:16px 0 28px 0}

.card{
  background: linear-gradient(180deg, rgba(18,18,26,.92), rgba(18,18,26,.70));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}
.grid{
  display:grid;
  gap:14px;
}
.grid.two{grid-template-columns: 1.2fr .8fr}
@media (max-width: 980px){ .grid.two{grid-template-columns:1fr} .nav{flex-wrap:wrap; justify-content:flex-end} }

.h1{
  font-family: Fraunces, serif;
  font-weight:520;
  font-size:30px;
  margin:0 0 6px 0;
}
.h2{
  font-family: Fraunces, serif;
  font-weight:520;
  font-size:20px;
  margin:0 0 8px 0;
}
.p{color:var(--muted); margin:0 0 10px 0; line-height:1.55}
.small{font-size:12px; color:var(--muted2)}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
hr.sep{border:none; border-top:1px solid var(--line); margin:14px 0}

input, textarea, select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  color: var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical}
label{display:block; color:var(--muted); font-size:12px; margin:0 0 6px 2px}
.field{margin:12px 0}
.kpi{
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
}
.kpi .n{font-family: Fraunces, serif; font-size:22px}
.kpi .t{color:var(--muted2); font-size:12px; margin-top:4px}
.table{width:100%; border-collapse:separate; border-spacing:0 8px}
.table td, .table th{padding:10px 10px; text-align:left; font-size:13px}
.table tr{
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
}
.table tr td:first-child, .table tr th:first-child{border-top-left-radius:14px; border-bottom-left-radius:14px}
.table tr td:last-child, .table tr th:last-child{border-top-right-radius:14px; border-bottom-right-radius:14px}
.badge{font-size:12px; padding:4px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted)}
.badge.ok{border-color:rgba(109,242,177,.35); color:rgba(109,242,177,.9); background: rgba(109,242,177,.08)}
.badge.warn{border-color:rgba(255,207,102,.35); color:rgba(255,207,102,.95); background: rgba(255,207,102,.08)}
.badge.danger{border-color:rgba(255,92,115,.35); color:rgba(255,92,115,.95); background: rgba(255,92,115,.08)}

.toast{
  position:fixed;
  top:78px;
  right:16px;
  width:min(360px, calc(100% - 32px));
  z-index:20;
}
.toast .t{
  background: rgba(18,18,26,.92);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px 14px;
  box-shadow: var(--shadow);
  margin-bottom:10px;
  display:flex; justify-content:space-between; gap:10px;
}
.toast .t .m{color:var(--muted); font-size:13px; line-height:1.35}
.toast .t .x{color:var(--muted2); cursor:pointer}

.footer{
  border-top:1px solid var(--line);
  padding:16px 0 8px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:var(--muted2);
  font-size:12px;
  gap:10px;
  flex-wrap:wrap;
}
.dot{opacity:.4; padding:0 6px}

a.link{color:var(--gold2); text-decoration:none}
a.link:hover{text-decoration:underline}

.ndaText{
  max-height: 520px;
  overflow:auto;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.ndaPre{
  white-space:pre-wrap;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin:0;
}
.sigpad{
  width:100%;
  height:auto;
  background: rgba(0,0,0,.35);
  border:1px solid rgba(200,168,106,.25);
  border-radius:16px;
}
