/* Sakina hi-fi — warm calming wellness, shadcn baseline */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Meeting room */
.meeting-room { display: grid; grid-template-columns: 1fr; gap: 14px; height: calc(100vh - 180px); min-height: 600px; }
.meeting-room:has(.meeting-side) { grid-template-columns: 1fr 340px; }
.meeting-stage { position: relative; background: #0a0a14; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-tile { position: relative; }
.video-tile.remote { width: 100%; height: 100%; display: grid; place-items: center; color: white; }
.video-bg { position: absolute; inset: 0; background: radial-gradient(circle at 40% 35%, #1c2a4a, #0a0a14 70%); }
.video-tile.self { position: absolute; bottom: 100px; right: 18px; width: 180px; height: 110px; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,0.15); display: grid; place-items: center; background: #14122a; }
.self-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(139,26,168,0.35), #14122a 75%); }
.tile-name { position: absolute; bottom: 12px; left: 12px; padding: 4px 10px; background: rgba(0,0,0,0.55); color: white; border-radius: 999px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.self-name { bottom: 8px; left: 8px; font-size: 11px; padding: 3px 8px; }
.tile-mic { position: absolute; bottom: 12px; right: 12px; width: 28px; height: 28px; background: rgba(0,0,0,0.55); border-radius: 50%; display: grid; place-items: center; color: white; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; }
.hud-top { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; }
.hud-pill { padding: 4px 10px; background: rgba(0,0,0,0.55); color: white; border-radius: 999px; font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.hud-pill.rec { background: rgba(239,68,68,0.85); }
.rec-dot { width: 7px; height: 7px; background: white; border-radius: 50%; animation: rec-blink 1.4s ease-in-out infinite; }
@keyframes rec-blink { 0%,100% { opacity: 1 } 50% { opacity: 0.3 } }
.time-bar { position: absolute; left: 18px; right: 18px; bottom: 80px; height: 3px; background: rgba(255,255,255,0.12); border-radius: 999px; }
.time-bar-fill { height: 100%; border-radius: 999px; transition: width 1s linear; }
.time-bar-label { position: absolute; right: 0; top: 8px; font-size: 11px; color: rgba(255,255,255,0.6); }
.control-bar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: rgba(20,18,40,0.85); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 12px; background: rgba(255,255,255,0.06); border: none; border-radius: 10px; color: white; font-size: 10px; font-family: inherit; cursor: pointer; min-width: 60px; transition: all 120ms; }
.ctl:hover { background: rgba(255,255,255,0.12); }
.ctl svg { font-size: 18px; }
.ctl.off { background: rgba(239,68,68,0.85); }
.ctl.on { background: rgba(139,26,168,0.6); }
.ctl.end { background: #ef4444; padding: 9px 16px; }
.ctl.end:hover { background: #dc2626; }
.meeting-side { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.meeting-side-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.chat-feed { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; overflow-y: auto; }
.chat-msg { display: flex; flex-direction: column; gap: 2px; max-width: 85%; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-msg.them { align-self: flex-start; }
.chat-bubble { padding: 8px 12px; border-radius: 14px; font-size: 13px; background: var(--surface-2); }
.chat-msg.me .chat-bubble { background: linear-gradient(135deg, var(--grad-1), var(--grad-3)); color: white; }
.chat-time { font-size: 10px; color: var(--ink-3); }
.chat-input { display: flex; gap: 6px; }
.chat-input .input { flex: 1; }

:root {
  /* Gradient stops (tweakable via JS) */
  --grad-1: #8b1aa8;
  --grad-2: #5d1a9a;
  --grad-3: #2a2cb0;
  --grad-4: #0f1a6e;

  /* Warm neutrals */
  --bg: #faf7f5;
  --surface: #ffffff;
  --surface-2: #f6f1ed;
  --surface-3: #efe9e3;
  --border: #ece3db;
  --border-2: #e0d5cb;

  --ink: #1c1a26;
  --ink-2: #4a4555;
  --ink-3: #807988;
  --ink-4: #b3acba;

  /* Brand purple/blue tinted neutrals */
  --tint-50: #f8f4fb;
  --tint-100: #efe6f5;
  --tint-200: #ddc8eb;

  /* States */
  --success: #4f9b6e;
  --success-bg: #e8f4ee;
  --warn: #c98a2b;
  --warn-bg: #fbf2e0;
  --danger: #c64646;
  --danger-bg: #fbe8e8;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(31, 26, 40, 0.04);
  --shadow: 0 1px 3px rgba(31, 26, 40, 0.06), 0 4px 16px rgba(31, 26, 40, 0.04);
  --shadow-lg: 0 4px 12px rgba(31, 26, 40, 0.08), 0 16px 40px rgba(31, 26, 40, 0.06);
  --shadow-grad: 0 4px 16px rgba(93, 26, 154, 0.18), 0 12px 32px rgba(31, 45, 184, 0.12);

  --grad: linear-gradient(115deg, var(--grad-1) 0%, var(--grad-2) 35%, var(--grad-3) 70%, var(--grad-4) 100%);
  --grad-soft: linear-gradient(115deg, color-mix(in srgb, var(--grad-1) 14%, transparent), color-mix(in srgb, var(--grad-3) 14%, transparent));
  --grad-softer: linear-gradient(115deg, color-mix(in srgb, var(--grad-1) 6%, white), color-mix(in srgb, var(--grad-3) 6%, white));

  --font: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
input:focus, textarea:focus { outline: none; }

/* Custom scroll */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; border: 2px solid var(--bg); }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* Utility */
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-bg { background: var(--grad); color: white; }
.gradient-soft-bg { background: var(--grad-soft); }

/* Lucide icons — sized to current font */
.lucide { width: 1em; height: 1em; stroke-width: 1.75; flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  border-radius: 10px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--ink);
  cursor: pointer; transition: all .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn-primary {
  background: var(--grad);
  color: white;
  border: none;
  box-shadow: var(--shadow-grad);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-soft { background: var(--tint-100); border-color: transparent; color: var(--grad-2); }
.btn-soft:hover { background: var(--tint-200); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; gap: 4px; }
.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: 12px; gap: 8px; }
.btn-icon { padding: 8px; aspect-ratio: 1; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-lg { border-radius: var(--radius-lg); }

/* Inputs */
.input {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--grad-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--grad-2) 12%, transparent); }
.input::placeholder { color: var(--ink-4); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.55; }
.input-lg { padding: 11px 14px; font-size: 14px; border-radius: 12px; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; letter-spacing: 0.01em; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; font-size: 11px; font-weight: 600;
  border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-grad { background: var(--grad); color: white; border: none; }
.badge-soft { background: var(--tint-100); color: var(--grad-2); border-color: transparent; }
.badge-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

/* Avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad-soft);
  color: var(--grad-2);
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--surface);
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 24px; }

/* Headings */
h1.h1, .h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h2.h2, .h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.005em; margin: 0; }
.eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.muted { color: var(--ink-3); }

/* Sidebar */
.sidebar {
  width: 244px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 20px 14px;
  gap: 4px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 18px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
}
.sidebar-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-grad);
  position: relative;
}
.sidebar-mark::after {
  content: '';
  position: absolute; inset: 4px 4px auto auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: var(--grad-soft);
  color: var(--grad-2);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--grad);
}
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); padding: 14px 12px 6px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 16px;
}
.topbar-search {
  flex: 1; max-width: 360px;
  position: relative;
}
.topbar-search .lucide-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.topbar-search input { padding-left: 36px; background: var(--surface-2); border-color: transparent; }
.topbar-search input:focus { background: var(--surface); }

/* App shell */
.app-shell { display: flex; height: 100%; min-height: 100vh; }
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.app-content { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .25s ease both; }

/* Stat card */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat-num { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-trend { font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-top: 6px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.flat { color: var(--ink-3); }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: var(--ink-3); border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--grad-2); border-color: var(--grad-2); font-weight: 600; }
.tab-count { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); }
.tab.active .tab-count { background: var(--tint-100); color: var(--grad-2); }

/* Pinned note */
.note-pin {
  background: linear-gradient(135deg, #fff8e8, #fff1d4);
  border: 1px solid #f3dca0;
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(193, 144, 32, 0.08);
}

/* Scratchpad — paper feel */
.scratchpad {
  background:
    repeating-linear-gradient(transparent 0 27px, rgba(31,45,184,0.08) 27px 28px),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 56px;
  position: relative;
  font-size: 14px; line-height: 28px;
  min-height: 200px;
  white-space: pre-wrap;
  resize: vertical;
  width: 100%;
  border-left: 3px solid color-mix(in srgb, var(--grad-1) 30%, transparent);
}
.scratchpad::before {
  content: '';
  position: absolute; left: 36px; top: 0; bottom: 0;
  width: 1px; background: rgba(198, 70, 70, 0.25);
}

/* Mood pill */
.mood-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--grad-soft); color: var(--grad-2);
  font-weight: 600; font-size: 12px;
}

/* Calendar */
.cal-cell { 
  background: var(--surface); border: 1px solid var(--border); 
  border-radius: 10px; padding: 6px 8px; min-height: 84px;
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; transition: all .15s;
}
.cal-cell:hover { border-color: var(--grad-2); background: var(--tint-50); }
.cal-cell.today { border-color: var(--grad-2); border-width: 2px; padding: 5px 7px; }
.cal-cell.selected { background: var(--grad-soft); border-color: var(--grad-2); }
.cal-cell.muted { opacity: 0.4; }
.cal-num { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cal-cell.today .cal-num { color: var(--grad-2); }
.cal-evt {
  font-size: 10.5px; font-weight: 500;
  padding: 2px 6px; border-radius: 5px;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-evt.video { background: color-mix(in srgb, var(--grad-1) 12%, white); color: var(--grad-2); }
.cal-evt.chat  { background: color-mix(in srgb, var(--grad-3) 12%, white); color: var(--grad-3); }
.cal-evt.assess{ background: var(--warn-bg); color: var(--warn); }

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: white; font-size: 13px; font-weight: 500;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex; align-items: center; gap: 8px;
  animation: fadeIn .2s ease;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(31,26,40,0.4);
  z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; max-height: 85vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl tr { cursor: pointer; transition: background .1s; }

/* Note category dot */
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Switch / toggle pill */
.seg {
  display: inline-flex; padding: 3px; background: var(--surface-2);
  border-radius: 10px; gap: 2px;
}
.seg-btn {
  padding: 5px 12px; font-size: 12px; font-weight: 500;
  border-radius: 7px; border: none; background: transparent;
  color: var(--ink-3); cursor: pointer;
}
.seg-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Empty state */
.empty {
  padding: 32px; text-align: center; color: var(--ink-3);
  border: 1.5px dashed var(--border-2); border-radius: var(--radius);
}
