/* ── StoryBot Global Styles ── */

:root {
  --bg: #06060e;
  --surface: #0d0d1c;
  --surface2: #141428;
  --surface3: #1c1c35;
  --border: #252540;
  --border2: #353560;
  --accent: #7b61ff;
  --accent2: #ff6b9d;
  --accent3: #00e5a0;
  --accent-dim: rgba(123,97,255,0.12);
  --green: #00e5a0;
  --green-dim: rgba(0,229,160,0.10);
  --red: #ff4d6d;
  --red-dim: rgba(255,77,109,0.10);
  --yellow: #ffd166;
  --yellow-dim: rgba(255,209,102,0.10);
  --blue: #4da6ff;
  --blue-dim: rgba(77,166,255,0.10);
  --orange: #ff9040;
  --orange-dim: rgba(255,144,64,0.12);
  --text: #eeeeff;
  --muted: #6666a0;
  --muted2: #4a4a7a;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 14px;
  --sidebar-w: 220px;
  --topbar-h: 54px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans Thai', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 30;
}
.sidebar-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sub { font-size: 10px; color: var(--muted); letter-spacing: 1px; margin-top: 2px; }

.nav-section { padding: 16px 12px 8px; }
.nav-label {
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  text-decoration: none;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(123,97,255,0.25);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  font-family: var(--font-mono);
}
.nav-badge.green { background: var(--green); color: #000; }
.nav-badge.orange { background: var(--orange, #ff9040); color: #000; }

.sidebar-bottom {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface2);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }

/* ── Main Layout ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; }
.topbar-spacer { flex: 1; }
.topbar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  font-family: 'Noto Sans Thai', sans-serif;
  transition: all 0.15s;
  text-decoration: none;
}
.topbar-btn:hover { background: var(--surface2); color: var(--text); }
.topbar-btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.topbar-btn.primary:hover { background: #6a52e6; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent2);
}

/* ── Content ── */
.content {
  flex: 1;
  padding: 28px 28px;
  overflow-y: auto;
}

/* ── Card (base) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; }
.card-spacer { flex: 1; }
.card-action {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.card-body { padding: 16px 20px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
