/* Lastsafe docs · Operations Console palette
   Matches /opt/lastsafe/app/static/css/lastsafe.css design tokens */

:root {
  --bg:        #0e1525;
  --panel:     #121b2e;
  --panel-2:   #172238;
  --border:    #1e2a45;
  --text:      #cfe1ff;
  --muted:     #8aa3c7;
  --dim:       #5d7393;
  --accent:    #38bdf8;
  --accent-2:  #22d3ee;
  --ok:        #34d399;
  --warn:      #f59e0b;
  --err:       #f87171;
  --radius:    6px;
  --radius-lg: 10px;
  --mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', 'Sukhumvit Set', 'IBM Plex Sans Thai', system-ui, -apple-system, Segoe UI,
          Roboto, Sarabun, 'Noto Sans Thai', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.muted { color: var(--muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,21,37,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border);
  padding-right: 22px;
}
.brand-name {
  font-size: 18px; font-weight: 700;
  color: var(--text); letter-spacing: 0.2px;
}
.brand-sub { font-size: 11px; color: var(--dim); }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.topnav a:hover { color: var(--text); text-decoration: none; }
.topnav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.topcta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: var(--accent);
  color: #061018; font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.topcta:hover { background: var(--accent-2); text-decoration: none; color: #061018; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  max-width: 1240px; margin: 0 auto;
  padding: 72px 28px 56px;
}
.hero-eyebrow {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(56,189,248,0.10);
  border: 1px solid rgba(56,189,248,0.30);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 48px; line-height: 1.1;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  max-width: 720px;
  font-size: 18px; color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.15s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent); color: #061018;
}
.btn-primary:hover { background: var(--accent-2); text-decoration: none; color: #061018; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Feature grid ───────────────────────────────────────────────────────── */
.section {
  max-width: 1240px; margin: 0 auto;
  padding: 56px 28px;
}
.section h2 {
  font-size: 28px; font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}
.section-sub {
  color: var(--muted); margin-bottom: 36px;
  max-width: 720px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all 0.18s;
  display: block;
  color: var(--text);
}
.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}
.feature-card-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: rgba(56,189,248,0.12);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-card-icon svg { width: 20px; height: 20px; }
.feature-card h3 {
  font-size: 16px; font-weight: 600;
  margin: 0 0 6px; color: var(--text);
}
.feature-card p {
  font-size: 13.5px; color: var(--muted);
  margin: 0; line-height: 1.55;
}
.feature-card .more {
  margin-top: 14px; font-size: 13px;
  color: var(--accent); font-weight: 500;
}

/* ── Docs page ──────────────────────────────────────────────────────────── */
.layout {
  max-width: 1240px; margin: 0 auto;
  padding: 36px 28px 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
}
.sidebar {
  position: sticky; top: 80px;
  align-self: start;
  border-right: 1px solid var(--border);
  padding-right: 18px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.sidebar-title {
  font-size: 11px; font-weight: 700;
  color: var(--dim); letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 6px 0 10px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  padding: 7px 12px;
  font-size: 14px;
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.sidebar-nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.sidebar-nav a.active {
  border-left-color: var(--accent);
  background: rgba(56,189,248,0.06);
  color: var(--accent);
  font-weight: 600;
}
.content { min-width: 0; }
.content .eyebrow {
  font-size: 12px; color: var(--accent);
  letter-spacing: 0.6px; text-transform: uppercase;
  font-weight: 600;
}
.content h1 {
  font-size: 36px; margin: 6px 0 8px;
  letter-spacing: -0.3px;
}
.content .lead {
  color: var(--muted); font-size: 16px;
  max-width: 720px; margin-bottom: 28px;
  line-height: 1.6;
}
.content h2 {
  font-size: 22px; margin: 40px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.content h3 {
  font-size: 17px; margin: 24px 0 10px;
}
.content p { color: var(--text); }
.content ul, .content ol { padding-left: 24px; color: var(--text); }
.content li { margin: 6px 0; }
.content strong { color: #e2eaff; font-weight: 600; }
.content .mono, .content code {
  font-family: var(--mono);
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent-2);
}
.content pre {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 13px;
  line-height: 1.6;
}
.content pre code { background: none; padding: 0; color: var(--text); }

.shot {
  margin: 18px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  display: block;
}
.shot img { display: block; width: 100%; height: auto; }
.shot.clip { max-height: 620px; overflow: hidden; }
.shot.clip img { width: 100%; height: auto; }
.shot-cap {
  font-size: 12px; color: var(--dim);
  margin: 0 0 24px;
  font-family: var(--mono);
}

.callout {
  margin: 20px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(56,189,248,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--muted);
}
.callout strong { color: var(--text); }
.callout.warn { border-left-color: var(--warn); background: rgba(245,158,11,0.06); }
.callout.ok   { border-left-color: var(--ok);   background: rgba(52,211,153,0.06); }

.steps {
  list-style: none; counter-reset: step;
  padding-left: 0;
}
.steps li {
  position: relative;
  padding: 10px 0 10px 44px;
  border-bottom: 1px dashed var(--border);
  counter-increment: step;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(56,189,248,0.12);
  color: var(--accent);
  font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(56,189,248,0.30);
}

.pager {
  display: flex; justify-content: space-between;
  gap: 12px; margin: 56px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pager a {
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1; max-width: 280px;
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .lbl { display: block; font-size: 11px; color: var(--dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.6px; }
.pager .ttl { color: var(--text); font-weight: 600; }
.pager .next { text-align: right; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  margin-top: 60px;
}
footer a { color: var(--muted); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; border-right: none; padding-right: 0; max-height: none; }
  .hero h1 { font-size: 34px; }
  .topbar-inner { padding: 12px 16px; gap: 14px; }
  .brand { padding-right: 14px; }
  .topnav { display: none; }
  .section, .hero, .layout { padding-left: 16px; padding-right: 16px; }
}
