:root {
  --bg: #fafafa;
  --bg2: #f4f4f5;
  --bg3: #e4e4e7;
  --surface: #ffffff;
  --surface2: #f4f4f5;
  --border: #e4e4e7;
  --border2: #d4d4d8;
  --teal: #0d9488;
  --teal-lt: #f0fdfa;
  --teal-b: #5eead4;
  --green: #16a34a;
  --green-lt: #f0fdf4;
  --green-lo: #dcfce7;
  --green-hi: #22c55e;
  --green-b: #86efac;
  --ink: #18181b;
  --ink2: #3f3f46;
  --ink3: #71717a;
  --ink4: #a1a1aa;
  --ink5: #d4d4d8;
  --red: #dc2626;
  --red-lo: #fef2f2;
  --blue: #2563eb;
  --blue-lt: #eff6ff;
  --blue-b: #93c5fd;
  --cyan: #0d9488;
  --cyan-lo: #f0fdfa;
  --orange: #f97316;
  --orange-lt: #fff7ed;
  --gold: #f59e0b;
  --gold-lt: #fffbeb;
  --amber: #f59e0b;
  --white: #ffffff;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', 'JetBrains Mono', monospace;
  --border-hi: #d4d4d8;
  --shadow-premium: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 12px;
  --inner-radius: 8px;
  --sh1: 0 1px 2px rgba(24,24,27,.05);
  --sh2: 0 4px 12px rgba(24,24,27,.08);
  --sh3: 0 8px 24px rgba(24,24,27,.12);
}

html.dark {
  --bg: #09090b;
  --bg2: #18181b;
  --bg3: #27272a;
  --surface: #18181b;
  --surface2: #1f1f23;
  --border: #27272a;
  --border2: #3f3f46;
  --teal: #2dd4bf;
  --teal-lt: #0d2f2c;
  --teal-b: #0d9488;
  --green: #4ade80;
  --green-lt: #0d2f1a;
  --green-lo: #14532d;
  --green-hi: #22c55e;
  --green-b: #16a34a;
  --ink: #fafafa;
  --ink2: #d4d4d8;
  --ink3: #a1a1aa;
  --ink4: #71717a;
  --ink5: #3f3f46;
  --red: #f87171;
  --red-lo: #2a0f0f;
  --blue: #60a5fa;
  --blue-lt: #0f1a2f;
  --blue-b: #2563eb;
  --cyan: #2dd4bf;
  --cyan-lo: #0d2f2c;
  --orange: #fb923c;
  --orange-lt: #1c0f05;
  --gold: #fbbf24;
  --gold-lt: #1c1405;
  --amber: #fbbf24;
  --white: #fafafa;
  --border-hi: #3f3f46;
  --sh1: 0 1px 2px rgba(0,0,0,.3);
  --sh2: 0 4px 12px rgba(0,0,0,.35);
  --sh3: 0 8px 24px rgba(0,0,0,.45);
  --shadow-premium: 0 4px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: white; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .table-title, .logo { font-family: var(--sans); font-weight: 700; letter-spacing: -0.03em; }

input, select, textarea, button { font-family: var(--sans); }

/* ── SHELL ── */
.shell { display: flex; height: 100vh; width: 100vw; overflow: hidden; background: var(--bg); }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100%;
  z-index: 10;
}
.sidebar-header { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); }
.logo { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.sidebar-nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav-section { margin-bottom: 20px; }
.nav-label { font-size: 11px; font-weight: 500; color: var(--ink4); letter-spacing: .04em; text-transform: uppercase; padding: 0 8px; margin-bottom: 4px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: var(--ink3); cursor: pointer; text-decoration: none; transition: all 0.15s; margin-bottom: 1px; font-weight: 400; }
.nav-item:hover { background: var(--surface2); color: var(--ink); }
.nav-item.active { background: var(--teal-lt) !important; color: var(--teal) !important; font-weight: 500; }
.nav-item .icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left:auto; background:var(--teal-lt); color:var(--teal); font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; font-family:var(--mono); line-height:1.4; }
.copy-btn { background:var(--surface2); border:1px solid var(--border); border-radius:4px; padding:2px 8px; font-size:11px; cursor:pointer; color:var(--ink3); margin-left:8px; font-family:var(--sans); }
.copy-btn:hover { background:var(--surface); color:var(--ink); }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.user-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink3); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--teal-lt); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }

/* ── TOP BAR ── */
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; z-index: 9; }
.topbar-left { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink3); }
.topbar-left span { color: var(--ink); font-weight: 500; }
.breadcrumb-sep { color: var(--ink4); font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.theme-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 14px; cursor: pointer; color: var(--ink3); transition: all 0.15s; }
.theme-btn:hover { background: var(--surface); border-color: var(--border2); color: var(--ink); }

/* ── VIEW ── */
#view-container { perspective: 1000px; }
.view {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}
.view.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* ── PAGE ── */
.page { padding: 24px; flex: 1; overflow-y: auto; max-width: 1200px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; font-family: var(--sans); cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid transparent; letter-spacing: -0.01em; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--sh1); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--sh2); }
.btn-ghost { background: transparent; color: var(--ink2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--ink); border-color: var(--border2); }
.btn-green { background: var(--green-lo); color: var(--green); border-color: transparent; }
.btn-green:hover { background: var(--green); color: white; }
.btn-outline { background: transparent; color: var(--ink2); border-color: var(--border2); }
.btn-outline:hover { background: var(--surface2); color: var(--ink); border-color: var(--border2); }
.btn-red { background: var(--red-lo); color: var(--red); border-color: transparent; }
.btn-red:hover { background: var(--red); color: white; }

/* ── STATS ROW ── */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--sh1);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover { border-color: var(--teal); box-shadow: var(--sh2); }
.stat-card::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--teal); opacity: 0; transition: opacity 0.2s; }
.stat-card:hover::after { opacity: 1; }
.stat-label { font-size: 11px; color: var(--ink4); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--ink); font-family: var(--mono); letter-spacing: -1px; }

/* ── TABLE ── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--sh1);
}
.table-header { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.table-title { font-size: 15px; font-weight: 700; color: var(--ink); }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 14px 24px; font-size: 11px; font-weight: 600; color: var(--ink4); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); background: var(--surface2); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 14px 24px; font-size: 13.5px; color: var(--ink2); word-break: break-all; max-width: 200px; }
.table-count { font-size: 11px; font-family: var(--mono); color: var(--ink4); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; font-family: var(--mono); border: 1px solid transparent; }
.badge-active { background: var(--green-lo); color: var(--green); border-color: transparent; }
.badge-provisioning { background: var(--teal-lt); color: var(--teal); border-color: transparent; }
.badge-error { background: var(--red-lo); color: var(--red); border-color: transparent; }
.badge-inactive { background: var(--surface2); color: var(--ink4); border-color: var(--border); }

/* ── MODAL & DRAWER ── */
.modal-overlay, .drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .15s; }
.modal-overlay.open, .drawer-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; box-shadow: var(--sh3); overflow: hidden; }
.drawer { width: 440px; height: 100%; background: var(--surface); border-left: 1px solid var(--border); position: fixed; right: 0; top: 0; transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; z-index: 60; }
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { padding: 20px; flex: 1; overflow-y: auto; }

/* ── NOTIFICATION ── */
.notif { position: fixed; bottom: 32px; right: 32px; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: var(--inner-radius); font-size: 13.5px; font-weight: 600; transform: translateY(100px); opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 100; box-shadow: var(--sh3); }
.notif.show { transform: translateY(0); opacity: 1; }
.notif.error { background: var(--red); color: white; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--ink3); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--inner-radius); font-size: 13px; font-family: var(--sans); background: var(--surface); color: var(--ink); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-lt); }
.form-textarea { min-height: 80px; resize: vertical; font-family: var(--mono); }

/* ── PIPELINE ── */
.pipeline { display: flex; align-items: center; gap: 0; margin: 20px 0; }
.p-node { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; position: relative; }
.p-line { flex: 1; height: 2px; background: var(--border); }
.p-node.done { border-color: var(--green); background: var(--green-lo); color: var(--green); }
.p-line.done { background: var(--green); }
.p-node.active { border-color: var(--teal); background: var(--teal-lt); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 var(--teal-lt)} 100%{box-shadow:0 0 0 8px transparent} }

/* ── MASCOT ── */
.mascot-box { display: flex; gap: 12px; background: var(--surface2); padding: 16px; border-radius: var(--inner-radius); margin-bottom: 20px; }
.mascot-img { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); padding: 4px; }
.mascot-bubble { flex: 1; font-size: 13px; line-height: 1.5; color: var(--ink2); }

/* ── INFO / WARNING / SUCCESS BOXES ── */
.info-box { background: var(--blue-lt); border-left: 3px solid var(--blue); padding: 12px; border-radius: var(--inner-radius); margin-bottom: 12px; font-size: 12px; }
.warning-box { background: var(--red-lo); border-left: 3px solid var(--red); padding: 12px; border-radius: var(--inner-radius); margin-bottom: 12px; font-size: 12px; }
.success-box { background: var(--green-lo); border-left: 3px solid var(--green); padding: 12px; border-radius: var(--inner-radius); margin-bottom: 12px; font-size: 12px; }

/* ── DETAIL / CRED ROWS ── */
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-val { color: var(--ink); font-weight: 500; }
.cred-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cred-label { font-size: 12px; color: var(--ink3); margin-bottom: 2px; }
.cred-actions { display: flex; gap: 6px; }
.cred-btn { background: none; border: none; cursor: pointer; color: var(--ink4); padding: 4px; font-size: 14px; transition: color 0.15s; }
.cred-btn:hover { color: var(--ink); }

/* ── LOGS ── */
.logs-area { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--inner-radius); padding: 12px; font-family: var(--mono); font-size: 12px; max-height: 200px; overflow-y: auto; }
.log-line { padding: 3px 0; color: var(--ink3); }

/* ── PROGRESS BAR ── */
.progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--teal); width: 0%; transition: width 0.3s; }

/* ── SKELETON LOADING ── */
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: calc(200px + 100%) 0; } }
.skeleton { background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%); background-size: 200px 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: 4px; color: transparent !important; user-select: none; pointer-events: none; }
.skeleton-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr 1fr 40px; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.skeleton-cell { height: 16px; border-radius: 4px; }

/* ── EMPTY STATE ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; gap: 16px; }
.empty-state svg { width: 64px; height: 64px; color: var(--ink4); opacity: 0.4; }
.empty-state p { font-size: 14px; color: var(--ink4); text-align: center; margin: 0; line-height: 1.5; }
.empty-state p:first-of-type { color: var(--ink3); font-weight: 500; }
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ── FORM VALIDATION ── */
.form-error { color: var(--red); font-size: 11px; margin-top: 4px; display: none; font-weight: 500; }
.form-input.error { border-color: var(--red) !important; box-shadow: 0 0 0 2px var(--red-lo); }
.form-input.success { border-color: var(--green) !important; }

/* ── ACCESSIBILITY ── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.nav-item, .stat-card, [onclick]:not(.btn):not(.nav-item) { cursor: pointer; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ── DROPZONE ── */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s; margin-bottom: 12px; background: var(--bg); }
.dropzone:hover, .dropzone.dragover { border-color: var(--teal); background: var(--teal-lt); }
.dropzone-text { font-size: 12px; color: var(--ink4); }
.dropzone-text strong { color: var(--ink2); }

/* ── GUIDE MODAL ── */
.guide-step { display: flex; gap: 16px; margin-bottom: 24px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--teal-lt); color: var(--teal); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.step-content { flex: 1; }
.step-title { font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.step-desc { font-size: 13px; color: var(--ink3); line-height: 1.5; }

/* ── COMMAND PALETTE ── */
.palette-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.palette-overlay.open { opacity: 1; pointer-events: all; }
.palette { width: 560px; max-width: 90vw; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--sh3); overflow: hidden; transform: translateY(-20px) scale(0.97); transition: transform 0.25s cubic-bezier(0.16,1,0.3,1); }
.palette-overlay.open .palette { transform: translateY(0) scale(1); }
.palette-input { width: 100%; padding: 16px 20px; border: none; background: transparent; color: var(--ink); font-size: 16px; font-family: var(--sans); outline: none; border-bottom: 1px solid var(--border); }
.palette-input::placeholder { color: var(--ink4); }
.palette-results { max-height: 320px; overflow-y: auto; padding: 8px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; cursor: pointer; color: var(--ink2); font-size: 14px; transition: background 0.1s; }
.palette-item:hover, .palette-item.active { background: var(--surface2); color: var(--ink); }
.palette-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.palette-item .shortcut { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--ink4); background: var(--bg); padding: 2px 8px; border-radius: 4px; }
.palette-empty { padding: 24px; text-align: center; color: var(--ink4); font-size: 13px; }
.palette-footer { padding: 8px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--ink4); display: flex; gap: 16px; }
.palette-footer kbd { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 10px; border: 1px solid var(--border); }

/* ── AGI WIDGET ── */
.agi-widget {
  position: fixed;
  top: 16px;
  right: -440px;
  width: 420px;
  height: calc(100vh - 32px);
  background: var(--surface);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-premium);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.agi-widget.open { transform: translateX(-456px); }
.agi-widget-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg2); z-index: 10; }
.agi-header-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.messages-agi { flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.messages-agi::-webkit-scrollbar { width: 4px; }
.messages-agi::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.msg-agi { max-width: 85%; animation: agiPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes agiPop { from { opacity: 0; transform: translateY(10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.msg-content-agi p { margin-bottom: 12px; }
.msg-content-agi p:last-child { margin-bottom: 0; }
.msg-content-agi code { background: var(--bg2); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 0.9em; color: var(--teal); }
.msg-content-agi pre { background: var(--bg2); margin: 12px 0; padding: 16px; border-radius: var(--inner-radius); overflow-x: auto; border: 1px solid var(--border); }
.msg-content-agi pre code { background: transparent; padding: 0; color: var(--ink); font-size: 13px; }
.msg-content-agi ul, .msg-content-agi ol { margin-left: 20px; margin-bottom: 12px; }
.msg-content-agi li { margin-bottom: 6px; }
.msg-agi.agi { align-self: flex-start; }
.msg-agi.user { align-self: flex-end; }
.msg-content-agi { padding: 14px 18px; border-radius: 18px; font-size: 14.5px; line-height: 1.6; position: relative; }
.agi .msg-content-agi { background: var(--surface); border: 1px solid var(--border); color: var(--ink2); border-bottom-left-radius: 4px; }
.user .msg-content-agi { background: var(--ink); color: var(--bg); box-shadow: var(--sh1); border-bottom-right-radius: 4px; }
.input-area-agi { padding: 20px 24px; background: var(--bg2); border-top: 1px solid var(--border); }
.input-wrap-agi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; transition: all 0.3s; }
.input-wrap-agi:focus-within { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-lt); }
.agi-textarea { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-family: var(--sans); font-size: 14px; resize: none; max-height: 120px; }
.send-btn-agi { width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; transition: all 0.15s; }
.send-btn-agi:hover { transform: scale(1.1); }
.send-btn-agi:disabled { opacity: 0.5; cursor: not-allowed; transform: scale(1); }

/* ── MOBILE ── */
.hamburger { display: none; position: fixed; top: 14px; left: 14px; z-index: 100; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-size: 18px; cursor: pointer; align-items: center; justify-content: center; transition: all 0.15s; }
.hamburger:hover { background: var(--surface2); border-color: var(--border2); }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 50; opacity: 0; transition: opacity 0.3s; }
.mobile-overlay.open { opacity: 1; }
.mobile-nav { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: 260px; background: var(--surface); border-right: 1px solid var(--border); z-index: 60; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); overflow-y: auto; padding: 0; }
.mobile-nav.open { transform: translateX(0); }
.mobile-nav .sidebar-header { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.mobile-nav .sidebar-nav { padding: 10px 8px; }
.mobile-nav .nav-item { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 8px; font-size: 14px; color: var(--ink3); cursor: pointer; text-decoration: none; }
.mobile-nav .nav-item:hover { background: var(--surface2); color: var(--ink); }
.mobile-nav .nav-item.active { background: var(--surface2); color: var(--ink); font-weight: 500; }
.mobile-nav .nav-item .icon { font-size: 16px; width: 18px; text-align: center; }
.mobile-close { width: 32px; height: 32px; border: none; background: var(--surface2); border-radius: 8px; color: var(--ink3); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .mobile-overlay { display: block; }
  .mobile-nav { display: flex; flex-direction: column; }
  .topbar { padding-left: 56px; }
  .stats-row { grid-template-columns: 1fr; }
  .table-wrap { border-radius: 0; border-left: none; border-right: none; }
  .page { padding: 16px !important; }
  .table-header { flex-direction: column; align-items: flex-start !important; gap: 8px; }
  #clientSearch { width: 100% !important; }
  table { font-size: 12px; }
  thead th, tbody td { padding: 10px 12px !important; }
  .stat-card { padding: 16px !important; }
  .stat-value { font-size: 22px !important; }
  .modal { width: 100% !important; max-height: 100vh !important; border-radius: 0 !important; }
  .modal-overlay { align-items: flex-end !important; }
  .drawer { width: 100% !important; }
  .topbar { padding-left: 56px; padding-right: 12px; }
  .topbar-title { font-size: 12px; }
}

@media (max-width: 600px) {
  .stats-row { gap: 12px; }
  .table-header { padding: 12px 16px !important; }
  thead th, tbody td { padding: 8px 10px !important; font-size: 11px; }
  .stat-card .stat-label { font-size: 10px; }
  .stat-value { font-size: 18px !important; }
  .form-group { margin-bottom: 12px; }
  .btn { padding: 8px 14px; font-size: 12px; }
}
