/* ─── NEXUS — Dark Theme PIXELBLOOM ─────────────────────────────────────── */

:root {
  --bg: #080810;
  --surface: #0f0f1a;
  --surface-2: #161625;
  --surface-3: #1e1e30;
  --border: #1f1f35;
  --border-2: #2a2a45;
  --purple: #6B46C1;
  --purple-light: #8B5CF6;
  --purple-dim: #6B46C122;
  --orange: #F97316;
  --text: #e8e8f0;
  --text-muted: #6b6b8a;
  --text-dim: #404060;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sidebar-w: 220px;
}

/* ─── RESET ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--purple-light); text-decoration: none; }
a:hover { color: var(--purple-light); opacity: 0.85; }

input, textarea, select {
  font-family: var(--font);
  font-size: 14px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  width: 100%;
  transition: border-color 0.15s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-dim);
}

select option { background: var(--surface-3); }

label { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 4px; }

/* ─── LOGIN ──────────────────────────────────────────────────────────────── */

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }

.login-container {
  width: 100%;
  max-width: 380px;
  padding: 20px;
}

.login-brand { text-align: center; margin-bottom: 40px; }

.brand-hex-lg {
  display: inline-block;
  font-size: 56px;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.login-brand h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text);
}

.login-brand p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.login-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.login-form .form-group { margin-bottom: 16px; }

.login-footer { text-align: center; color: var(--text-dim); font-size: 12px; margin-top: 20px; }

/* ─── APP LAYOUT ─────────────────────────────────────────────────────────── */

.app { display: flex; height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.brand-hex {
  font-size: 24px;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text);
}

.sidebar-nav { flex: 1; padding: 4px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--purple-dim); color: var(--purple-light); }
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.nav-separator { height: 1px; background: var(--border); margin: 8px 4px; }

.claude-trigger { color: var(--orange) !important; }
.claude-trigger:hover { background: rgba(249,115,22,0.1) !important; }

.nav-item.logout { color: var(--danger) !important; margin-top: 4px; }
.nav-item.logout:hover { background: rgba(239,68,68,0.1) !important; }

.sidebar-footer { padding: 8px; border-top: 1px solid var(--border); }

/* ─── MAIN ───────────────────────────────────────────────────────────────── */

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-toggle { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; }

.page-title { font-size: 16px; font-weight: 600; flex: 1; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: var(--surface-3);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-light); color: #fff; }
.btn-ghost { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--purple); color: var(--text); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; }

.btn-icon-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
}
.btn-icon-sm:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

.btn-tag {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  color: var(--text-muted);
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
}
.btn-tag:hover { border-color: var(--purple); color: var(--purple-light); }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.toggle input { display: none; }
.toggle span {
  display: inline-block;
  width: 36px; height: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle span::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.2s;
}
.toggle input:checked + span { background: var(--purple); border-color: var(--purple); }
.toggle input:checked + span::after { left: 18px; background: white; }

/* ─── BADGES ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--purple-dim);
  color: var(--purple-light);
  white-space: nowrap;
}

/* ─── ALERTS ─────────────────────────────────────────────────────────────── */

.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }

/* ─── CARDS / SECTIONS ───────────────────────────────────────────────────── */

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.section-title { font-size: 14px; font-weight: 600; color: var(--text); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.link-small { font-size: 12px; color: var(--text-muted); }
.link-small:hover { color: var(--purple-light); }

.empty-msg { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.text-muted { color: var(--text-muted); }
.ml-auto { margin-left: auto; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state p { margin-bottom: 16px; }

/* ─── DASHBOARD ──────────────────────────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.kpi-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; }
.kpi-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.kpi-highlight { border-color: var(--orange); background: rgba(249,115,22,0.06); }
.kpi-highlight .kpi-value { color: var(--orange); }
.kpi-highlight .kpi-label { color: var(--orange); }

.pipeline-bar { display: flex; gap: 8px; }
.pipeline-step {
  flex: 1;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  border-top: 3px solid var(--c);
  transition: background 0.15s;
}
.pipeline-step:hover { background: var(--surface-2); }
.pipeline-count { font-size: 22px; font-weight: 700; color: var(--c); }
.pipeline-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.dashboard-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

/* Compact lists */
.client-list-compact, .notes-list-compact, .task-list-compact { list-style: none; }

.client-item-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.client-item-compact:last-child { border-bottom: none; }
.client-item-compact:hover { color: var(--purple-light); }

.client-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--purple-dim); color: var(--purple-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.client-info { flex: 1; }
.client-company { font-size: 13px; font-weight: 500; display: block; }
.client-contact { font-size: 12px; color: var(--text-muted); display: block; }

.note-item-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.note-item-compact:last-child { border-bottom: none; }
.note-item-compact:hover .note-title { color: var(--purple-light); }
.note-title { font-size: 13px; font-weight: 500; }
.note-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

.task-item-compact { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.task-item-compact:last-child { border-bottom: none; }
.task-check { width: 20px; height: 20px; border: 2px solid var(--border-2); border-radius: 50%; background: none; cursor: pointer; flex-shrink: 0; color: transparent; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.task-check:hover, .task-check.done { border-color: var(--success); background: rgba(34,197,94,0.15); color: var(--success); }
.task-title.done { text-decoration: line-through; color: var(--text-muted); }

/* ─── CRM ────────────────────────────────────────────────────────────────── */

.page-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.search-form { display: flex; gap: 8px; flex: 1; }
.search-input { max-width: 300px; }

.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tab {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.filter-tab:hover, .filter-tab.active { background: var(--purple-dim); color: var(--purple-light); border-color: var(--purple); }
.tab-count { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }

.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.client-card:hover { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-dim); }

.client-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.client-avatar-lg { width: 38px; height: 38px; border-radius: 50%; background: var(--purple-dim); color: var(--purple-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.client-card-company { font-size: 14px; font-weight: 600; display: block; }
.client-card-contact { font-size: 12px; color: var(--text-muted); display: block; }

.client-card-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-muted); }
.package-badge { background: rgba(249,115,22,0.1); color: var(--orange); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.reminder-badge { margin-top: 8px; font-size: 12px; color: var(--warning); }

/* Client detail */
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.back-link { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--purple-light); }
.detail-actions { display: flex; gap: 8px; }

.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.detail-card-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.client-avatar-xl { width: 52px; height: 52px; border-radius: 50%; background: var(--purple-dim); color: var(--purple-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; flex-shrink: 0; }
.detail-card-header h2 { font-size: 18px; font-weight: 600; }
.detail-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.detail-field { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.detail-field span:first-child { color: var(--text-muted); min-width: 70px; }
.detail-field a { color: var(--purple-light); }
.client-notes { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.client-notes h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.client-notes p { font-size: 14px; }

.interaction-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.interaction-item { padding: 10px; background: var(--surface-3); border-radius: var(--radius); border: 1px solid var(--border); }
.interaction-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.interaction-type { font-size: 12px; font-weight: 600; color: var(--purple-light); }
.interaction-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.interaction-item p { font-size: 13px; }

.import-section { margin-top: 24px; }
.import-toggle { font-size: 13px; color: var(--text-muted); cursor: pointer; padding: 8px 0; }
.import-body { padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }

/* ─── NOTES ──────────────────────────────────────────────────────────────── */

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
  color: var(--text);
  display: block;
  position: relative;
}
.note-card:hover { border-color: var(--purple); }
.note-card.pinned { border-color: var(--warning); }
.note-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.note-preview { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.note-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; }
.note-tags { color: var(--purple-light); font-size: 12px; }
.pin-icon { position: absolute; top: 10px; right: 10px; font-size: 14px; }

/* Note detail */
.note-content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.note-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

/* Markdown body */
.markdown-body { font-size: 15px; line-height: 1.75; color: var(--text); }
.markdown-body h1 { font-size: 22px; font-weight: 700; margin: 24px 0 12px; }
.markdown-body h2 { font-size: 18px; font-weight: 600; margin: 20px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h3 { font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.markdown-body p { margin-bottom: 12px; }
.markdown-body ul, .markdown-body ol { margin: 8px 0 12px 20px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body code { font-family: var(--font-mono); background: var(--surface-3); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--orange); }
.markdown-body pre { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; overflow-x: auto; margin: 12px 0; }
.markdown-body pre code { background: none; padding: 0; color: var(--text); }
.markdown-body blockquote { border-left: 3px solid var(--purple); padding-left: 14px; color: var(--text-muted); margin: 12px 0; }
.markdown-body a { color: var(--purple-light); }
.markdown-body strong { color: var(--text); font-weight: 600; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.markdown-body th { background: var(--surface-3); padding: 8px 12px; text-align: left; font-size: 13px; }
.markdown-body td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Note edit */
.note-edit-form { display: flex; flex-direction: column; gap: 12px; }
.note-title-input {
  font-size: 22px;
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 0;
  color: var(--text);
}
.note-title-input:focus { box-shadow: none; border-color: var(--purple); }
.note-editor { font-family: var(--font-mono); font-size: 14px; line-height: 1.7; resize: vertical; min-height: 300px; }
.note-edit-footer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }

/* ─── TASKS / KANBAN ─────────────────────────────────────────────────────── */

.kanban-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }

.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--col-color);
}

.kanban-count { background: var(--surface-3); padding: 2px 8px; border-radius: 20px; font-size: 12px; color: var(--text-muted); }
.kanban-cards { padding: 8px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }

.kanban-card {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: default;
}

.kanban-card-header { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 500; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.kanban-desc { font-size: 12px; color: var(--text-muted); margin: 4px 0 4px 16px; }
.kanban-due { font-size: 11px; color: var(--warning); margin: 4px 0 4px 16px; }
.kanban-actions { display: flex; gap: 4px; margin-top: 6px; margin-left: 16px; }

.kanban-add {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.kanban-add:hover { background: var(--surface-3); color: var(--purple-light); }

/* ─── INVOICES ───────────────────────────────────────────────────────────── */

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table tr:hover td { background: var(--surface-3); }

.invoice-lines h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.invoice-line { display: grid; grid-template-columns: 1fr 60px 120px 80px; gap: 8px; margin-bottom: 8px; align-items: center; }
.line-desc, .line-qty, .line-price { width: 100%; }
.line-total { font-size: 13px; color: var(--text-muted); text-align: right; }
.invoice-total { text-align: right; margin-top: 12px; font-size: 15px; }

/* ─── FOCUS ──────────────────────────────────────────────────────────────── */

.focus-intro { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }

.player-container {
  background: var(--surface);
  border: 1px solid var(--purple);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}
.player-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; font-weight: 600; }

.playlists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 32px; }

.playlist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--pc);
  transition: all 0.15s;
}
.playlist-card:hover { background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.playlist-icon { font-size: 18px; color: var(--pc); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--pc) 15%, transparent); border-radius: 50%; }
.playlist-name { font-size: 14px; font-weight: 600; }
.playlist-desc { font-size: 12px; color: var(--text-muted); }

.pomodoro-section h2 { margin-bottom: 16px; }
.pomodoro { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; text-align: center; max-width: 380px; }
.pomodoro-display { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: 2px; margin-bottom: 20px; font-family: var(--font-mono); }
.pomodoro-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ─── MODALS ─────────────────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-lg { max-width: 700px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 2px 8px; border-radius: 4px; }
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-form { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ─── CLAUDE PANEL ───────────────────────────────────────────────────────── */

.claude-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
}
.claude-overlay.open { display: block; }

.claude-panel {
  position: fixed;
  right: -440px;
  top: 0;
  bottom: 0;
  width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
}
.claude-panel.open { right: 0; }

.claude-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.claude-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--orange); }
.claude-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 4px; }
.claude-close:hover { background: var(--surface-3); }

.claude-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.claude-msg { display: flex; flex-direction: column; max-width: 88%; }
.claude-msg.user { align-self: flex-end; }
.claude-msg.assistant { align-self: flex-start; }

.msg-content {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.claude-msg.user .msg-content { background: var(--purple); color: white; border-bottom-right-radius: 3px; }
.claude-msg.assistant .msg-content { background: var(--surface-3); color: var(--text); border-bottom-left-radius: 3px; border: 1px solid var(--border); }

.msg-thinking { display: flex; gap: 4px; padding: 10px 14px; }
.msg-thinking span { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: bounce 1.2s infinite; }
.msg-thinking span:nth-child(2) { animation-delay: 0.2s; }
.msg-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

.claude-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--surface-2);
}
.claude-input-area textarea { flex: 1; resize: none; font-size: 13px; min-height: 40px; max-height: 120px; }
.claude-send { width: 36px; height: 36px; border-radius: 50%; background: var(--orange); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.claude-send:hover { background: #ea6d10; }
.claude-send:disabled { background: var(--surface-3); color: var(--text-muted); cursor: not-allowed; }
.claude-hint { padding: 6px 16px; font-size: 11px; color: var(--text-dim); background: var(--surface-2); border-top: 1px solid var(--border); }

/* ─── SCROLLBAR ──────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -var(--sidebar-w); transition: left 0.3s; }
  .sidebar.open { left: 0; box-shadow: var(--shadow); }
  .sidebar-toggle { display: block; }
  .detail-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .dashboard-cols { grid-template-columns: 1fr; }
  .invoice-line { grid-template-columns: 1fr; }
  .claude-panel { width: 100%; right: -100%; }
}
