/* ============================================================
   AiBizit Client Portal — Core Styles
   Dark theme, brand colors, responsive layout
   ============================================================ */

:root {
  --navy:    #0c0a1d;
  --navy-light: #1a1035;
  --navy-mid: #2d1b69;
  --cyan:    #A855F7;
  --cyan-dim: rgba(168,85,247,0.12);
  --orange:  #D946EF;
  --orange-dim: rgba(217,70,239,0.12);
  --white:   #FFFFFF;
  --text:    #CBD5E1;
  --text-dim: #94A3B8;
  --text-muted: #64748B;
  --border:  #2d1b69;
  --border-dim: rgba(255,255,255,0.08);
  --card-bg: rgba(255,255,255,0.04);
  --input-bg: #110d1f;
  --green:   #22C55E;
  --red:     #EF4444;
  --radius:  16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --sidebar-w: 230px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { opacity: 0.85; }

/* ── LAYOUT ─────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  max-width: 1200px;
}

/* ── SIDEBAR ────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid var(--border-dim);
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-dim);
}
.sidebar-logo .brand { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 34px; height: 34px;
  background: var(--cyan);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: var(--navy);
  font-size: 14px; letter-spacing: -1px;
}
.brand-name { font-size: 15px; font-weight: 700; color: white; letter-spacing: 0.3px; }
.brand-sub { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.sidebar-client {
  margin: 14px 12px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border-dim);
}
.client-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.client-name { font-size: 13px; font-weight: 600; color: white; margin-top: 3px; }
.client-plan {
  display: inline-block; margin-top: 5px;
  font-size: 9.5px; background: var(--cyan); color: var(--navy);
  padding: 2px 8px; border-radius: 20px; font-weight: 700;
}

.sidebar-nav { padding: 10px; flex: 1; overflow-y: auto; }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--cyan); padding: 14px 10px 6px; margin-top: 6px;
  font-weight: 700; border-left: 2px solid var(--cyan); margin-left: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; color: rgba(255,255,255,0.85);
  cursor: pointer; transition: all 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-item.active { background: rgba(0,194,203,0.1); color: var(--cyan); font-weight: 600; }
.nav-item .icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--orange);
  color: white; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-dim);
  font-size: 11px; color: var(--text-muted);
}
.sidebar-footer a { color: var(--cyan); font-size: 11px; }

/* ── TOP BAR ────────────────────────────── */
.top-bar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
}
.greeting h1 {
  font-size: 28px; font-weight: 800; color: white;
  margin-bottom: 4px;
}
.greeting p { font-size: 14px; color: var(--text-dim); }
.top-right { display: flex; gap: 10px; align-items: center; }
.month-badge {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: white; font-size: 13px; font-weight: 600;
  padding: 8px 18px; border-radius: 20px;
}

/* ── BUTTONS ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--orange); color: white; }
.btn-secondary { background: rgba(255,255,255,0.06); color: white; border: 1px solid var(--border); }
.btn-cyan { background: var(--cyan); color: var(--navy); }
.btn-green { background: var(--green); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ── CARDS ──────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 22px;
}
.card-title { font-size: 16px; font-weight: 700; color: white; }
.card-subtitle { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ── STAT CARDS ─────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-label {
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: white; margin-bottom: 8px;
}
.stat-number { font-size: 36px; font-weight: 800; color: white; }
.stat-change {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px; margin-top: 8px;
}
.stat-change.green { background: rgba(34,197,94,0.12); color: var(--green); }

/* ── CARD ROWS ──────────────────────────── */
.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.bottom-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── APPROVAL BANNER ────────────────────── */
.approval-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 14px 22px; margin-bottom: 20px;
}
.approval-banner .text { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-dim); }
.approval-btns { display: flex; gap: 10px; }

/* ── FORMS ──────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: white; font-size: 14px;
  font-family: var(--font);
}
.form-input:focus { outline: none; border-color: var(--cyan); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { min-height: 120px; resize: vertical; }
select.form-input { cursor: pointer; }

/* ── SCORE RING ─────────────────────────── */
.ring-container { position: relative; width: 140px; height: 140px; margin: 0 auto 12px; }
.score-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.score-number { font-size: 38px; font-weight: 900; color: white; }
.score-label { font-size: 13px; color: var(--text-muted); }
.score-change {
  display: inline-block; font-size: 12px; font-weight: 600;
  background: var(--cyan-dim); color: var(--cyan);
  padding: 3px 10px; border-radius: 20px; margin-top: 6px;
}

/* ── PLATFORM BARS ──────────────────────── */
.platform-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-dim);
}
.platform-row:last-child { border-bottom: none; }
.platform-name { font-size: 13px; color: var(--text); width: 80px; }
.platform-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; }
.platform-fill { height: 100%; border-radius: 3px; }
.platform-fill.cyan { background: var(--cyan); }
.platform-fill.orange { background: var(--orange); }
.platform-fill.green { background: var(--green); }
.platform-score { font-size: 13px; font-weight: 600; color: var(--text-dim); width: 40px; text-align: right; }

/* ── POST ITEMS ─────────────────────────── */
.post-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
}
.post-item:last-child { border-bottom: none; }
.post-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.post-dot.pink { background: #EC4899; }
.post-dot.blue { background: #3B82F6; }
.post-dot.green { background: var(--green); }
.post-dot.purple { background: #8B5CF6; }
.post-dot.orange { background: var(--orange); }
.post-time { font-size: 12px; color: var(--text-muted); min-width: 70px; }
.post-text { font-size: 13px; color: var(--text); flex: 1; }
.post-date { font-size: 11px; color: var(--text-muted); }

/* ── MINI STATS (bottom row) ────────────── */
.mini-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-dim);
}
.mini-stat:last-child { border-bottom: none; }
.mini-stat .label { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.mini-stat .value { font-size: 14px; font-weight: 700; color: white; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── LOGIN PAGE ─────────────────────────── */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--navy);
}
.login-box {
  width: 100%; max-width: 400px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}
.login-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 32px;
}
.login-logo .logo-icon { width: 44px; height: 44px; font-size: 18px; }
.login-logo .brand-name { font-size: 22px; }
.login-title {
  font-size: 20px; font-weight: 700; color: white;
  text-align: center; margin-bottom: 6px;
}
.login-subtitle {
  font-size: 14px; color: var(--text-dim);
  text-align: center; margin-bottom: 28px;
}
.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red); font-size: 13px;
  padding: 10px 14px; border-radius: var(--radius-xs);
  margin-bottom: 16px; display: none;
}
.login-footer {
  text-align: center; margin-top: 20px;
  font-size: 13px; color: var(--text-muted);
}

/* ── PAGE HEADERS ───────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 800; color: white; margin-bottom: 4px; }
.page-header p { font-size: 14px; color: var(--text-dim); }

/* ── AI TOOLS ───────────────────────────── */
.tool-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 24px;
}
.tool-tab {
  padding: 10px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text-dim); cursor: pointer;
  transition: all 0.15s; border: none;
  background: transparent;
  font-family: var(--font);
}
.tool-tab:hover { color: white; }
.tool-tab.active { background: var(--cyan); color: var(--navy); font-weight: 700; }

.tool-output {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px; min-height: 150px;
  font-size: 14px; line-height: 1.6;
  color: var(--text); white-space: pre-wrap;
}
.tool-output.empty { color: var(--text-muted); font-style: italic; }

/* ── LOADING SPINNER ────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .cards-row { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
}
/* ── MOBILE HAMBURGER ──────────────────── */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--navy);
  border-bottom: 1px solid var(--border-dim);
  padding: 12px 16px;
  align-items: center; justify-content: space-between;
}
.mobile-header .brand { display: flex; align-items: center; gap: 8px; }
.mobile-header .brand-name { font-size: 15px; font-weight: 700; color: white; }
.hamburger {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.hamburger:hover { background: rgba(255,255,255,0.06); }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: white; position: relative;
}
.hamburger span::before, .hamburger span::after {
  content: ''; position: absolute; left: 0;
  width: 20px; height: 2px; background: white;
}
.hamburger span::before { top: -6px; }
.hamburger span::after { top: 6px; }
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 150;
}
.mobile-overlay.open { display: block; }

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; padding-top: 68px; }
  .stats-row { grid-template-columns: 1fr; }
  .top-bar { flex-direction: column; gap: 12px; }
  .greeting h1 { font-size: 22px; }
}
