/* Ristoword Demo – Premium Dark Theme */
:root {
  --bg: #050712;
  --bg-alt: #121425;
  --bg-soft: #181a2b;
  --border-soft: #2a3040;
  --accent: #f5b800;
  --accent-soft: #f5b8001f;
  --accent-danger: #ff4b4b;
  --accent-success: #12b981;
  --text: #f8f8fb;
  --text-soft: #a4a7bd;
  --text-muted: #7c8195;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top left, #272a3b 0, #050712 55%);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100vh;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #121321 0, #090814 60%, #050712 100%);
  border-right: 1px solid #272a38;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 12px;
  background: radial-gradient(circle at 20% 0, #fff 0, #f5b800 32%, #f97316 70%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #111;
}
.brand-title { font-size: 16px; letter-spacing: 0.16em; text-transform: uppercase; }
.brand-subtitle { font-size: 11px; color: var(--text-soft); }

.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.side-nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, transform 0.08s;
}
.side-nav a:hover { background: #191b2c; color: var(--accent); transform: translateX(2px); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }

.side-footer { margin-top: auto; font-size: 11px; color: var(--text-muted); }
.side-footer-sub { font-size: 10px; color: var(--text-soft); }

/* Main */
.main { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }

.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.topbar-left h1 { margin: 0; font-size: 24px; }
.subtitle { margin: 4px 0 0; font-size: 13px; color: var(--text-soft); }

/* Cards */
.card {
  background: #131627;
  border-radius: var(--radius-lg);
  border: 1px solid #262a3e;
}
.card-header { padding: 12px 14px; border-bottom: 1px solid #262a3e; }
.card-header h2 { margin: 0; font-size: 15px; }
.card-header p { margin: 4px 0 0; font-size: 12px; color: var(--text-soft); }
.card-body { padding: 12px 14px; }

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi-card {
  background: #131627;
  border-radius: var(--radius-lg);
  border: 1px solid #262a3e;
  padding: 12px 14px;
}
.kpi-card.warning { border-color: var(--accent-danger); }
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.kpi-note { font-size: 11px; color: var(--text-soft); margin-top: 2px; }

/* Buttons */
.btn {
  border-radius: 999px;
  border: none;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.12s;
}
.btn.primary { background: var(--accent); color: #000; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text-soft); border: 1px solid #343848; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.sm { padding: 4px 10px; font-size: 11px; }

/* Tables */
.demo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.demo-table th, .demo-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #262a3e; }
.demo-table th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
.demo-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Status badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.success { background: rgba(18,185,129,0.2); color: #12b981; }
.badge.warning { background: rgba(245,184,0,0.2); color: #f5b800; }
.badge.danger { background: rgba(255,75,75,0.2); color: #ff4b4b; }
.badge.soft { background: rgba(255,255,255,0.08); color: var(--text-soft); }

/* Grid modules */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.module-card {
  background: #131627;
  border-radius: var(--radius-lg);
  border: 1px solid #262a3e;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.08s;
}
.module-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.module-icon { font-size: 24px; margin-bottom: 6px; }
.module-title { font-weight: 700; font-size: 14px; }
.module-desc { font-size: 11px; color: var(--text-soft); margin-top: 4px; }

/* Demo banner */
.demo-banner {
  background: linear-gradient(90deg, var(--accent-soft) 0, transparent 100%);
  border: 1px solid rgba(245,184,0,0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.demo-banner::before { content: "DEMO"; font-weight: 800; font-size: 10px; letter-spacing: 0.2em; }

/* Responsive */
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
