/* ============================================================================
   BIZUKI — dark design system
   ============================================================================ */
:root {
  --bg: #080b0f;
  --bg2: #0d1117;
  --surface: #111720;
  --surface2: #161e2c;
  --border: #1c2535;
  --border2: #253047;
  --amber: #e8b84b;
  --amber-dim: rgba(232,184,75,0.1);
  --cyan: #3dd8c8;
  --red: #e85555;
  --green: #3ecf8e;
  --violet: #9b7fe8;
  --text: #d8e2ef;
  --text2: #7a8fa8;
  --text3: #3d4f66;
  --sidebar-w: 220px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--text); font-weight: 700; margin: 0 0 12px; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 12px; color: var(--text); }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
::selection { background: var(--amber); color: #000; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 20;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 22px;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--amber); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.logo-text { font-weight: 700; font-size: 17px; color: var(--text); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 2px;
  color: var(--text2);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}
.sidebar-nav a:hover {
  background: var(--surface); color: var(--text);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--amber-dim); color: var(--amber);
}
.sidebar-nav .nav-section {
  margin: 18px 0 6px; padding: 0 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.3px;
  color: var(--text3); font-weight: 600;
}
.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-user .user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar-user .user-plan { font-size: 11px; color: var(--text2); }

/* Main content */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.content { padding: 24px; flex: 1; max-width: 1400px; width: 100%; }

/* Hamburger */
.hamburger {
  display: none;
  width: 36px; height: 36px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  cursor: pointer; align-items: center; justify-content: center;
}

/* ---------- Auth cards ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; }
.auth-title { text-align: center; font-size: 22px; margin: 0 0 6px; }
.auth-sub { text-align: center; color: var(--text2); font-size: 14px; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 18px; color: var(--text2); font-size: 13px; }

/* ---------- Cards / Panels ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card-head h2 { margin: 0; }

/* ---------- Stat cards ---------- */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.stat-card .stat-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text2); margin-bottom: 8px; font-weight: 600;
}
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--text); }
.stat-card .stat-sub { font-size: 12px; color: var(--text2); margin-top: 4px; }
.stat-card.amber { border-color: rgba(232,184,75,0.3); }
.stat-card.amber .stat-value { color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: all .15s; text-decoration: none;
  background: none; color: var(--text); font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--amber); color: #000; }
.btn-primary:hover { background: #f2c76a; }
.btn-outline { border-color: var(--border2); color: var(--text); }
.btn-outline:hover { background: var(--surface2); }
.btn-ghost { color: var(--text2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #ff6a6a; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label, .label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px;
  color: var(--text);
}
.form-group .help, .help { font-size: 12px; color: var(--text2); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="url"], input[type="date"], input[type="search"],
select, textarea {
  width: 100%; display: block;
  padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--amber);
}
textarea { resize: vertical; min-height: 90px; }
input[type="color"] { height: 40px; padding: 2px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--amber); width: auto; margin-right: 6px; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border2); border-radius: 999px;
  transition: background .2s; cursor: pointer;
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle-slider { background: var(--amber); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: var(--bg2); color: var(--text2);
  text-align: left; padding: 12px 14px;
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 14px; color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--surface2); color: var(--text2);
}
.b-green  { background: rgba(62,207,142,0.15); color: var(--green); }
.b-amber  { background: rgba(232,184,75,0.15); color: var(--amber); }
.b-red    { background: rgba(232,85,85,0.15);  color: var(--red); }
.b-cyan   { background: rgba(61,216,200,0.15); color: var(--cyan); }
.b-violet { background: rgba(155,127,232,0.15); color: var(--violet); }
.b-gray   { background: var(--surface2); color: var(--text2); }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 14px;
  border-left: 3px solid var(--amber);
  background: var(--surface); color: var(--text);
}
.alert-success { border-color: var(--green); background: rgba(62,207,142,0.08); }
.alert-error   { border-color: var(--red);   background: rgba(232,85,85,0.08); }
.alert-warn    { border-color: var(--amber); background: var(--amber-dim); }
.alert-info    { border-color: var(--cyan);  background: rgba(61,216,200,0.08); }
.alert-hidden { display: none; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 100; display: none;
  align-items: flex-start; justify-content: center;
  padding: 60px 20px 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 540px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-close {
  background: none; border: none; color: var(--text2);
  font-size: 22px; cursor: pointer; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ---------- Wizard steps ---------- */
.wizard-steps {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 28px;
  flex-wrap: wrap;
}
.wizard-step {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border2);
  color: var(--text2); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.wizard-step.done   { background: var(--green); border-color: var(--green); color: #000; }
.wizard-step.active { background: var(--amber); border-color: var(--amber); color: #000; }
.wizard-counter {
  text-align: center; color: var(--text2); font-size: 13px; margin-bottom: 20px;
}

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text2);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { color: var(--text); }

/* ---------- Progress bar ---------- */
.progress {
  width: 100%; height: 8px; background: var(--bg);
  border-radius: 999px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--amber);
  border-radius: 999px; transition: width .4s;
}
.progress-bar.low { background: var(--red); }
.progress-bar.mid { background: var(--amber); }
.progress-bar.ok  { background: var(--green); }

/* Credit bar block */
.credit-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
}
.credit-bar .ch {
  display: flex; justify-content: space-between; margin-bottom: 8px;
  font-size: 13px; color: var(--text2);
}
.credit-bar .ch strong { color: var(--text); font-size: 16px; }

/* ---------- Split panel (for conversations) ---------- */
.split {
  display: flex; gap: 16px; height: calc(100vh - 140px);
}
.split-list {
  width: 320px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow-y: auto;
}
.split-detail {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.split-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.split-item:hover { background: var(--surface2); }
.split-item.active { background: var(--amber-dim); border-left: 3px solid var(--amber); padding-left: 13px; }
.split-item .si-title { font-weight: 600; color: var(--text); }
.split-item .si-sub { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* Chat bubbles */
.chat-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.chat-body { flex: 1; overflow-y: auto; padding: 20px; }
.chat-bubble {
  max-width: 75%; padding: 10px 14px; border-radius: 14px;
  margin-bottom: 10px; font-size: 14px; line-height: 1.5;
  word-wrap: break-word;
}
.chat-bubble.user  { background: var(--amber); color: #000; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble.bot   { background: var(--surface2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble .ts   { display: block; font-size: 10px; opacity: 0.6; margin-top: 4px; }

/* ---------- Code blocks ---------- */
.code-block {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  font-family: 'Monaco', 'Courier New', monospace; font-size: 12px;
  color: var(--cyan); overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  margin: 8px 0;
}

/* ---------- Plan cards ---------- */
.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.plan-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; position: relative;
}
.plan-card.current { border-color: var(--amber); background: var(--amber-dim); }
.plan-card h3 { font-size: 18px; margin-bottom: 6px; }
.plan-card .price { font-size: 30px; font-weight: 800; color: var(--amber); margin: 8px 0; }
.plan-card .price small { font-size: 13px; color: var(--text2); font-weight: 500; }
.plan-card ul { list-style: none; padding: 0; margin: 16px 0; }
.plan-card li { padding: 4px 0; color: var(--text2); font-size: 13px; }
.plan-card li::before { content: '✓'; color: var(--green); margin-right: 8px; font-weight: 700; }

/* Addon cards */
.addons-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.addon-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.addon-card.active { border-color: var(--amber); }
.addon-card .addon-icon { font-size: 28px; }
.addon-card .addon-name { font-weight: 700; font-size: 15px; }
.addon-card .addon-desc { color: var(--text2); font-size: 13px; flex: 1; }
.addon-card .addon-price { color: var(--amber); font-weight: 700; font-size: 16px; }

/* Color swatches */
.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .15s;
}
.color-swatch.selected { border-color: #fff; transform: scale(1.1); }

/* Radio/check cards */
.card-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.card-option {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  text-align: center; transition: all .15s;
}
.card-option:hover { border-color: var(--amber); }
.card-option.selected { border-color: var(--amber); background: var(--amber-dim); }
.card-option .co-icon { font-size: 22px; margin-bottom: 6px; }
.card-option .co-title { font-weight: 600; font-size: 13px; }
.card-option .co-sub { font-size: 11px; color: var(--text2); }

/* FAQ list */
.faq-list .faq-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 8px;
}
.faq-list .faq-row button { align-self: start; }

/* Two-column dashboard grid */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

/* Preview widget */
.widget-preview {
  position: fixed; bottom: 20px; right: 20px;
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--amber); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer; box-shadow: var(--shadow); z-index: 50;
}

/* Pagination */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.pager button {
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; font-size: 13px;
}
.pager button.active { background: var(--amber); color: #000; border-color: var(--amber); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; width: 240px; --sidebar-w: 240px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .two-col { grid-template-columns: 1fr; }
  .split { flex-direction: column; height: auto; }
  .split-list { width: 100%; max-height: 300px; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* Utility */
.mt-0 { margin-top: 0 !important; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-muted { color: var(--text2); }
.text-amber { color: var(--amber); } .text-red { color: var(--red); } .text-green { color: var(--green); }
.flex { display: flex; } .flex-1 { flex: 1; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.align-center { align-items: center; } .justify-between { justify-content: space-between; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.hidden { display: none !important; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 280px; }
