@import url('/public/css/main.css');
/* ═══════════════════════════════════════════════════════════
   meScribe — MODERN THEME
   Instagram-inspired gradient palette
   Purple #833ab4 → Coral #fd1d1d → Amber #fcb045
   Font: Plus Jakarta Sans
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ── */
:root {
  --grad:       linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  --grad-soft:  linear-gradient(135deg, rgba(131,58,180,.13) 0%, rgba(253,29,29,.09) 50%, rgba(252,176,69,.11) 100%);
  --accent:     #c13584;
  --accent-lt:  rgba(193,53,132,.12);
  --green:      #22c55e;
  --red:        #ef4444;
  --blue:       #3b82f6;
  --orange:     #f97316;
  --font:       'Plus Jakarta Sans', sans-serif;
  --font-mono:  'SF Mono','Fira Code','Consolas',monospace;
  --r:          10px;
  --r-lg:       16px;
  --r-xl:       22px;
  --transition: all 0.18s ease;
}

/* DARK MODE (default) */
[data-theme="dark"], :root {
  --bg:         #0d0d0d;
  --bg2:        #1a1a1a;
  --bg3:        #242424;
  --bg4:        #2e2e2e;
  --border:     rgba(255,255,255,.10);
  --border2:    rgba(255,255,255,.06);
  --text:       #f5f5f5;
  --text2:      #a8a8a8;
  --text3:      #555555;
  --card:       #111111;
  --card-h:     #161616;
  --inp:        #1a1a1a;
  --shadow:     0 4px 24px rgba(0,0,0,.55);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.70);
}

/* LIGHT MODE */
[data-theme="light"] {
  --bg:         #fafafa;
  --bg2:        #f2f2f2;
  --bg3:        #e8e8e8;
  --bg4:        #ffffff;
  --border:     rgba(0,0,0,.10);
  --border2:    rgba(0,0,0,.06);
  --text:       #0a0a0a;
  --text2:      #555555;
  --text3:      #999999;
  --card:       #ffffff;
  --card-h:     #f7f7f7;
  --inp:        #f5f5f5;
  --shadow:     0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.12);
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .28s, color .28s;
}
h1,h2,h3,h4,h5 { font-family: var(--font); font-weight: 700; line-height: 1.2; }
a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .8; }

/* ── GRADIENT UTILITIES ── */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.grad-bg { background: var(--grad); }
.grad-border-card {
  border: 1.5px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.grad-border-card::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: calc(var(--r-lg) + 1.5px);
  background: var(--grad);
  z-index: -1;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: var(--r); border: none;
  cursor: pointer; transition: var(--transition); text-decoration: none;
  white-space: nowrap; line-height: 1;
}
.btn-primary  { background: var(--grad); color: #fff; }
.btn-primary:hover { opacity: .87; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(193,53,132,.3); }
.btn-outline  { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }
.btn-ghost    { background: transparent; color: var(--text2); border: none; }
.btn-ghost:hover { color: var(--text); background: var(--bg3); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-success  { background: var(--green); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: var(--r-lg); }
.w-full { width: 100%; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; letter-spacing: .03em; }
.form-control {
  width: 100%; background: var(--inp); border: 1.5px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 14px;
  padding: 11px 14px; border-radius: var(--r); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(193,53,132,.12); }
.form-control::placeholder { color: var(--text3); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.badge-grad   { background: var(--grad); color: #fff; }
.badge-green  { background: rgba(34,197,94,.12); color: var(--green); }
.badge-red    { background: rgba(239,68,68,.12); color: var(--red); }
.badge-blue   { background: rgba(59,130,246,.12); color: var(--blue); }
.badge-muted  { background: var(--bg3); color: var(--text2); }
.badge-accent { background: rgba(193,53,132,.12); color: var(--accent); }
.badge-orange { background: rgba(249,115,22,.12); color: var(--orange); }

/* ── CARDS ── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--shadow); transition: background .18s;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title  { font-size: 14px; font-weight: 700; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: var(--r); font-size: 14px; margin-bottom: 18px; border-left: 3px solid; }
.alert-success { background: rgba(34,197,94,.08); border-color: var(--green); color: var(--green); }
.alert-error   { background: rgba(239,68,68,.08); border-color: var(--red); color: var(--red); }
.alert-warning { background: rgba(249,115,22,.08); border-color: var(--orange); color: var(--orange); }

/* ── TABLES ── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; color: var(--text3); letter-spacing: .06em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border2); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg2); }

/* ── TOGGLE ── */
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input[type=checkbox] { display: none; }
.toggle-track {
  width: 44px; height: 24px; background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 100px; position: relative; transition: all .2s; flex-shrink: 0;
}
.toggle input:checked ~ .toggle-track { background: var(--grad); border-color: transparent; }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--text2); }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(0,0,0,.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); height: 60px;
}
[data-theme="light"] .nav { background: rgba(250,250,250,.92); }
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-family: var(--font); font-weight: 800; font-size: 22px; text-decoration: none; }
.logo span { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { color: var(--text2); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--bg3); }

/* ── SIDEBAR ── */
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-logo { padding: 22px 20px 16px; border-bottom: 1px solid var(--border); font-size: 20px; font-weight: 800; }
.sidebar-logo a { text-decoration: none; }
.sidebar-logo .logo-text { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-section { padding: 14px 20px 4px; font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: .1em; text-transform: uppercase; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px;
  color: var(--text2); font-size: 13px; font-weight: 500;
  border-left: 2px solid transparent; transition: var(--transition); text-decoration: none;
}
.sidebar-nav a:hover { color: var(--text); background: var(--bg3); }
.sidebar-nav a.active { color: var(--text); background: var(--accent-lt); border-left-color: var(--accent); font-weight: 600; }
.sidebar-nav a .icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav a .pill { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; }
.sidebar-footer { margin-top: auto; padding: 16px 18px; border-top: 1px solid var(--border); }
.sidebar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }

/* ── APP LAYOUT ── */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: 230px; display: flex; flex-direction: column; }
.topbar { height: 56px; background: var(--bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 40; }
.topbar-title { font-size: 15px; font-weight: 700; }
.page-body { padding: 26px; flex: 1; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; }
.stat-card-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px; }
.stat-card-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.5px; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card-sub { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ── GRID UTILS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 14px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.text-muted { color: var(--text2); } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }

/* ── AUTH PAGES ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--bg); }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 44px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.auth-logo { display: block; text-align: center; font-size: 24px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; }
.auth-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-sub   { text-align: center; color: var(--text2); font-size: 14px; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text2); }
.auth-footer a { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 12px; color: var(--text3); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── HERO (landing) ── */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 100px 0 80px; position: relative; overflow: hidden; }
.hero-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 55% at 50% -5%, rgba(131,58,180,.18) 0%, transparent 65%), radial-gradient(ellipse 40% 30% at 85% 85%, rgba(252,176,69,.1) 0%, transparent 55%); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; background: var(--bg3); border: 1px solid var(--border); color: var(--text2); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 5px 14px; border-radius: 100px; margin-bottom: 22px; }
.hero-eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: var(--grad); flex-shrink: 0; }
.hero-title { font-size: clamp(2.8rem,7vw,5.2rem); font-weight: 800; letter-spacing: -1.5px; line-height: 1.07; margin-bottom: 16px; }
.hero-title .accent { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.1rem; color: var(--text2); max-width: 540px; margin: 0 auto 32px; line-height: 1.7; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 52px; }
.hero-stats { display: flex; justify-content: center; gap: 52px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 2.2rem; font-weight: 800; letter-spacing: -.5px; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-stat span { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; }

/* ── FEATURE CARDS ── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 50px; }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; transition: transform .2s, border-color .2s; }
.feature-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature-icon { font-size: 2rem; margin-bottom: 14px; }

/* ── PRICING ── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.pricing-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; position: relative; transition: transform .2s; }
.pricing-card:hover { transform: translateY(-3px); }
.pricing-card.featured { border: 1.5px solid transparent; }
.pricing-card.featured::before { content: ''; position: absolute; inset: -1.5px; border-radius: calc(var(--r-lg) + 1.5px); background: var(--grad); z-index: -1; }
.plan-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 13px; border-radius: 100px; white-space: nowrap; }
.plan-price { font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; margin: 8px 0 4px; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.plan-price span { font-size: 1rem; font-weight: 400; color: var(--text3); -webkit-text-fill-color: var(--text3); }
.plan-features { list-style: none; margin-bottom: 20px; }
.plan-features li { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border2); display: flex; align-items: center; gap: 8px; color: var(--text2); }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.plan-features li.disabled { color: var(--text3); }
.plan-features li.disabled::before { content: '—'; color: var(--text3); }

/* ── CHAT ── */
.chat-skillset { display: flex; flex-direction: column; height: calc(100vh - 200px); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { max-width: 78%; padding: 11px 16px; border-radius: 14px; font-size: 14px; line-height: 1.55; }
.chat-bubble.user  { align-self: flex-end; background: var(--grad); color: #fff; border-radius: 14px 14px 4px 14px; }
.chat-bubble.agent { align-self: flex-start; background: var(--bg3); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; }
.chat-bubble.escalation { align-self: flex-start; background: rgba(193,53,132,.07); border: 1px solid rgba(193,53,132,.2); border-radius: 14px 14px 14px 4px; }
.chat-input-row { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--border); background: var(--bg2); }
.typing-dots span { display: inline-block; width: 6px; height: 6px; background: var(--text3); border-radius: 50%; margin: 0 2px; animation: bounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

/* ── AI STATUS ── */
.ai-status { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 18px; }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 9px rgba(193,53,132,.6); animation: pulse-glow 2s ease-in-out infinite; flex-shrink: 0; }
.ai-dot.off { background: var(--text3); box-shadow: none; animation: none; }

/* ── MINI CHART ── */
.mini-chart { display: flex; align-items: flex-end; gap: 3px; height: 80px; }
.mini-bar { flex: 1; border-radius: 3px 3px 0 0; background: var(--grad); opacity: .65; min-height: 4px; transition: opacity .15s; }
.mini-bar:hover { opacity: 1; }

/* ── PROGRESS ── */
.prog-bar { background: var(--bg3); height: 5px; border-radius: 3px; overflow: hidden; flex: 1; }
.prog-fill { height: 100%; background: var(--grad); border-radius: 3px; }

/* ── GRAD DIVIDER ── */
.grad-line { height: 2px; background: var(--grad); border-radius: 2px; margin-bottom: 18px; }

/* ── THEME SWITCHER ── */
.theme-switcher { display: flex; align-items: center; gap: 8px; }
.theme-option { padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); background: transparent; color: var(--text2); transition: var(--transition); font-family: var(--font); }
.theme-option:hover { border-color: var(--accent); color: var(--accent); }
.theme-option.active { background: var(--grad); color: #fff; border-color: transparent; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes bounce { 0%,80%,100% { transform:translateY(0); } 40% { transform:translateY(-6px); } }
@keyframes pulse-glow { 0%,100% { box-shadow:0 0 6px rgba(193,53,132,.5); } 50% { box-shadow:0 0 14px rgba(193,53,132,.9); } }
@keyframes spin { to { transform:rotate(360deg); } }

.animate-up { animation: fadeUp .6s ease both; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* ── FOOTER ── */
.footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .hero-title { font-size: 2.6rem; }
}
