/* ==========================================================================
   W-TECH Flow — Design System
   Tokens · base · layout · componentes · páginas
   ========================================================================== */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --brand: #6d5efc;
  --brand-600: #5b4ce8;
  --brand-700: #4a3cd0;
  --brand-soft: #efedff;
  --brand-ring: rgba(109, 94, 252, .28);
  --accent: #14b8d4;

  --bg: #f7f7fb;
  --bg-subtle: #f1f1f7;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --surface-hover: #f4f4f9;
  --border: #e7e7ef;
  --border-strong: #d6d6e2;
  --text: #16161f;
  --text-muted: #5d5d72;
  --text-subtle: #8e8ea3;
  --overlay: rgba(17, 17, 28, .42);

  --success: #10b981;
  --success-soft: #e7f8f1;
  --warning: #f59e0b;
  --warning-soft: #fff5e1;
  --danger: #ef4444;
  --danger-soft: #fdecec;
  --info: #0ea5e9;
  --info-soft: #e6f5fd;

  --p-urgent: #ef4444;
  --p-high: #f97316;
  --p-medium: #6d5efc;
  --p-low: #94a3b8;

  --shadow-xs: 0 1px 2px rgba(16, 16, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 16, 40, .06), 0 1px 2px rgba(16, 16, 40, .04);
  --shadow-md: 0 6px 16px -4px rgba(16, 16, 40, .10), 0 2px 6px -2px rgba(16, 16, 40, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 16, 40, .22);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --sidebar-w: 256px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #8b7dff;
  --brand-600: #7a6bff;
  --brand-700: #6a5af5;
  --brand-soft: rgba(139, 125, 255, .14);
  --brand-ring: rgba(139, 125, 255, .35);

  --bg: #0d0d14;
  --bg-subtle: #12121b;
  --surface: #16161f;
  --surface-2: #1a1a25;
  --surface-hover: #20202c;
  --border: #262634;
  --border-strong: #33334a;
  --text: #ececf4;
  --text-muted: #a3a3b8;
  --text-subtle: #6f6f86;
  --overlay: rgba(0, 0, 0, .6);

  --success-soft: rgba(16, 185, 129, .14);
  --warning-soft: rgba(245, 158, 11, .14);
  --danger-soft: rgba(239, 68, 68, .14);
  --info-soft: rgba(14, 165, 233, .14);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 56px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand-ring); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.bi { line-height: 1; vertical-align: -.125em; }

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; transition: grid-template-columns .25s var(--ease); }
html.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; z-index: 40;
  scrollbar-width: thin;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: conic-gradient(from 210deg, var(--brand), var(--accent), var(--brand));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.04em;
  box-shadow: 0 6px 16px -6px var(--brand);
}
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 15px; white-space: nowrap; }
.brand-name span { color: var(--brand); }
.sidebar-toggle { margin-left: auto; }
.ws-switch {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; margin-bottom: 8px; width: 100%; text-align: left;
}
.ws-switch:hover { background: var(--surface-hover); }
.ws-logo { width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; overflow: hidden; }
.ws-logo img { width: 100%; height: 100%; object-fit: cover; }
.nav-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); padding: 14px 10px 6px; display: flex; align-items: center; justify-content: space-between; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; white-space: nowrap; position: relative; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item .bi { font-size: 16px; width: 18px; text-align: center; flex: none; }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--text-subtle); font-weight: 600; }
.nav-dot { width: 10px; height: 10px; border-radius: 4px; flex: none; margin: 0 4px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 6px; }
.sidebar-footer { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.user-chip:hover { background: var(--surface-hover); }
html.sidebar-collapsed .app-shell .sidebar .label,
html.sidebar-collapsed .app-shell .sidebar .nav-section span,
html.sidebar-collapsed .app-shell .sidebar .count,
html.sidebar-collapsed .app-shell .brand-name,
html.sidebar-collapsed .app-shell .ws-switch .label { display: none; }
html.sidebar-collapsed .app-shell .nav-item { justify-content: center; }
html.sidebar-collapsed .app-shell .nav-section { justify-content: center; padding: 10px 0 4px; }
html.sidebar-collapsed .app-shell .sidebar-toggle .bi { transform: rotate(180deg); }
html.sidebar-collapsed .app-shell .sidebar-brand { flex-direction: column; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.breadcrumbs { display: flex; align-items: center; gap: 6px; color: var(--text-subtle); font-size: 13px; min-width: 0; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs .current { color: var(--text); font-weight: 600; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; min-width: 260px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); color: var(--text-subtle); cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-left: auto; }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.content { padding: 28px 32px 64px; width: 100%; max-width: 1480px; margin: 0 auto; flex: 1; animation: fadeUp .35s var(--ease); }
.content.full { max-width: none; padding: 20px 24px 24px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header p { margin-top: 6px; }
.mobile-only { display: none !important; }
.bottom-nav { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; box-shadow: var(--shadow-xs); text-decoration: none !important;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px var(--brand-ring); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; box-shadow: none; }
.btn-soft:hover { background: var(--brand-soft); filter: brightness(.97); border-color: transparent; }
.btn-ai { background: linear-gradient(135deg, var(--brand), #b15cff 60%, var(--accent)); color: #fff; border: none; box-shadow: 0 6px 18px -6px #8b5cf6; }
.btn-ai:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand), #b15cff 60%, var(--accent)); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn .spinner { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: none; color: var(--text-subtle); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--surface-hover); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label-sm { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input-sm { height: 32px; font-size: 13px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='%238e8ea3'%3E%3Cpath d='M8 11 3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.input-group { position: relative; }
.input-group .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); }
.input-group .input { padding-left: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }
.color-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px var(--surface); }
.color-dot.active { border-color: var(--text); }
.error-text { color: var(--danger); font-size: 12.5px; }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px 20px; }
.card-hover { transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { color: var(--text-muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-info { background: var(--info-soft); color: var(--info); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg-subtle); color: var(--text-muted); white-space: nowrap; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: #b45309; }
:root[data-theme="dark"] .badge-warning { color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; }
.prio i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.prio-URGENT { color: var(--p-urgent); } .prio-URGENT i { background: var(--p-urgent); }
.prio-HIGH { color: var(--p-high); } .prio-HIGH i { background: var(--p-high); }
.prio-MEDIUM { color: var(--p-medium); } .prio-MEDIUM i { background: var(--p-medium); }
.prio-LOW { color: var(--p-low); } .prio-LOW i { background: var(--p-low); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--tag-color, var(--brand)); background: color-mix(in srgb, var(--tag-color, var(--brand)) 14%, transparent); white-space: nowrap; }
kbd { display: inline-flex; align-items: center; height: 20px; min-width: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface-2); font-family: var(--font); font-size: 11px; color: var(--text-muted); justify-content: center; }

/* ---------- Avatars ---------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; overflow: hidden; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -7px; }

/* ---------- Progress ---------- */
.progress { height: 6px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .6s var(--ease); }
.progress.lg { height: 10px; }
.progress.success > span { background: var(--success); }
.ring { --v: 0; --size: 120px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring-color, var(--brand)) calc(var(--v) * 1%), var(--bg-subtle) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; }

/* ---------- Skeleton / empty / spinner ---------- */
.skeleton { background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--surface-hover) 37%, var(--bg-subtle) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
.sk-line { height: 12px; margin: 8px 0; }
.sk-card { height: 84px; margin-bottom: 10px; border-radius: var(--radius); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-illus { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 28px; color: var(--brand); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--brand) 22%, transparent), var(--brand-soft)); margin-bottom: 4px; }
.empty-state h3 { color: var(--text); }
.empty-state p { max-width: 360px; font-size: 13.5px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
.page-loader { display: grid; place-items: center; padding: 60px; color: var(--brand); }

/* ---------- Tabs / segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 12px; color: var(--text-muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--brand); }
.segmented { display: inline-flex; padding: 3px; background: var(--bg-subtle); border-radius: 10px; gap: 2px; }
.segmented button { border: none; background: none; padding: 5px 12px; border-radius: 8px; font-weight: 550; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-subtle); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-hover); }
.table .group-row td { background: var(--bg-subtle); font-weight: 650; font-size: 12.5px; color: var(--text-muted); }
.inline-select { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 6px; cursor: pointer; font-size: 12.5px; max-width: 150px; }
.inline-select:hover { border-color: var(--border); background: var(--surface); }
.inline-input { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 6px; width: 100%; }
.inline-input:hover, .inline-input:focus { border-color: var(--border); background: var(--surface); outline: none; }

/* ---------- Dropdown / menus ---------- */
.dropdown { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; animation: pop .16s var(--ease); max-height: 70vh; overflow: auto;
}
.menu.left { left: 0; right: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); cursor: pointer; width: 100%; background: none; border: none; text-align: left; font-size: 13.5px; }
.menu-item:hover { background: var(--surface-hover); text-decoration: none; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-label { font-size: 11px; color: var(--text-subtle); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* ---------- Modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 80; animation: fade .18s ease; backdrop-filter: blur(2px); }
.modal {
  position: fixed; z-index: 90; left: 50%; top: 8vh; transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px)); max-height: 84vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: modalIn .22s var(--ease);
}
.modal.lg { width: min(860px, calc(100vw - 24px)); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-body { padding: 10px 22px 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); position: sticky; bottom: 0; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(760px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slideIn .26s var(--ease);
}
.drawer.narrow { width: min(440px, 100vw); }
.drawer-header { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow: auto; }
.drawer.closing, .modal.closing { animation: slideOut .2s var(--ease) forwards; }
.modal.closing { animation: fadeOut .15s ease forwards; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: var(--radius); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease); font-size: 13.5px; }
.toast .bi { font-size: 16px; margin-top: 1px; }
.toast.success .bi { color: #34d399; } .toast.error .bi { color: #f87171; } .toast.info .bi { color: #a5b4fc; }
.toast.hide { animation: toastOut .25s var(--ease) forwards; }
.toast button { margin-left: auto; background: none; border: none; color: inherit; opacity: .7; cursor: pointer; }

/* ---------- Tooltip ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: 11.5px; font-weight: 500; padding: 5px 8px; border-radius: 6px; white-space: nowrap; z-index: 100;
  pointer-events: none; animation: fade .12s ease;
}
[data-tip-pos="bottom"]:hover::after { bottom: auto; top: calc(100% + 6px); }
[data-tip-pos="right"]:hover::after { bottom: auto; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }

/* ---------- Command palette ---------- */
.palette { position: fixed; z-index: 120; left: 50%; top: 12vh; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .18s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette-input input { flex: 1; border: none; outline: none; background: none; font-size: 16px; }
.palette-list { max-height: 56vh; overflow: auto; padding: 6px; }
.palette-group { font-size: 11px; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; padding: 10px 12px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.palette-item.active { background: var(--brand-soft); }
.palette-item .bi { color: var(--text-subtle); font-size: 16px; }
.palette-item.active .bi { color: var(--brand); }
.palette-footer { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--text-subtle); font-size: 12px; background: var(--surface-2); }

/* ---------- Kanban ---------- */
.board-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; min-height: calc(100vh - 250px); scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.kanban-col { width: 300px; flex: none; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); scroll-snap-align: start; }
.kanban-col.over-limit { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.col-header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; cursor: grab; }
.col-header .col-color { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.col-header h3 { font-size: 13.5px; }
.col-count { font-size: 12px; color: var(--text-subtle); font-weight: 600; }
.col-count.full { color: var(--danger); }
.col-body { flex: 1; overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col-add { margin: 0 10px 10px; }
.add-col { width: 280px; flex: none; }
.task-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s, transform .15s; position: relative; display: flex; flex-direction: column; gap: 8px;
}
.task-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.task-card.completed .task-title { text-decoration: line-through; color: var(--text-subtle); }
.task-card .task-title { font-weight: 550; font-size: 13.5px; line-height: 1.4; word-break: break-word; }
.task-card .project-line { font-size: 11.5px; color: var(--text-subtle); display: flex; align-items: center; gap: 6px; }
.task-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-subtle); font-size: 11.5px; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .overdue { color: var(--danger); font-weight: 600; }
.task-meta .soon { color: #d97706; font-weight: 600; }
.task-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.task-card .blocked { color: var(--danger); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.task-card .card-progress { height: 3px; }
.task-card.flash { animation: flash 1.2s ease; }
.task-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-grid; place-items: center; flex: none; cursor: pointer; background: var(--surface); color: transparent; transition: .15s; font-size: 11px; padding: 0; }
.task-check:hover { border-color: var(--success); color: var(--success); }
.task-check.done { background: var(--success); border-color: var(--success); color: #fff; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow-lg) !important; }
.sortable-drag { transform: rotate(2deg); }
.quick-card { background: var(--surface); border: 1px solid var(--brand); border-radius: 10px; padding: 8px; box-shadow: 0 0 0 3px var(--brand-ring); }
.quick-card textarea { width: 100%; border: none; outline: none; resize: none; background: none; min-height: 44px; }

/* ---------- Task list rows ---------- */
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface-hover); }
.task-row .title { font-weight: 550; }
.task-row.completed .title { text-decoration: line-through; color: var(--text-subtle); }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ---------- Task drawer ---------- */
.td-head { padding: 18px 24px 8px; }
.td-title { font-size: 21px; font-weight: 700; letter-spacing: -.02em; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin-left: -7px; width: calc(100% + 7px); background: transparent; resize: none; overflow: hidden; line-height: 1.3; }
.td-title:hover { border-color: var(--border); }
.td-title:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.td-grid { display: grid; grid-template-columns: 1fr 260px; gap: 0; min-height: 100%; }
.td-main { padding: 8px 24px 32px; min-width: 0; }
.td-side { border-left: 1px solid var(--border); padding: 16px 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 14px; }
.prop { display: flex; flex-direction: column; gap: 5px; }
.prop > label { font-size: 11.5px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .04em; }
.td-section { margin-top: 22px; }
.td-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.td-section-title h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.check-item:hover { background: var(--surface-hover); }
.check-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--success); }
.check-item.done span { text-decoration: line-through; color: var(--text-subtle); }
.check-item .icon-btn { opacity: 0; }
.check-item:hover .icon-btn { opacity: 1; }
.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment-bubble { background: var(--bg-subtle); border-radius: 4px 12px 12px 12px; padding: 9px 12px; flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.mention { color: var(--brand); font-weight: 600; background: var(--brand-soft); border-radius: 4px; padding: 0 3px; }
.mention-list { position: absolute; bottom: 100%; left: 0; }
.activity-item { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-muted); padding: 6px 0; }
.activity-item b { color: var(--text); font-weight: 600; }
.attachment { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.file-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 16px; flex: none; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 14px; text-align: center; color: var(--text-subtle); cursor: pointer; font-size: 13px; transition: .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* Rich text editor */
.rte { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rte:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.rte-toolbar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-toolbar button { background: none; border: none; width: 28px; height: 28px; border-radius: 6px; color: var(--text-muted); cursor: pointer; }
.rte-toolbar button:hover { background: var(--surface-hover); color: var(--text); }
.rte-content { min-height: 110px; padding: 10px 12px; outline: none; }
.rte-content:empty::before { content: attr(data-placeholder); color: var(--text-subtle); }
.rich-text p { margin: 0 0 8px; } .rich-text ul, .rich-text ol { margin: 0 0 8px; padding-left: 22px; }
.rich-text pre, .rich-text code { font-family: var(--mono); background: var(--bg-subtle); border-radius: 6px; font-size: 12.5px; }
.rich-text code { padding: 1px 5px; } .rich-text pre { padding: 10px; overflow-x: auto; }
.rich-text blockquote { border-left: 3px solid var(--border-strong); margin: 0 0 8px; padding-left: 12px; color: var(--text-muted); }
.rich-text h2, .rich-text h3 { margin: 8px 0; }

/* ---------- Notifications ---------- */
.bell-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-panel { width: 380px; padding: 0; }
.notif-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.notif-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }

/* ---------- Timer pill ---------- */
.timer-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; border-radius: 99px; background: var(--danger-soft); color: var(--danger); font-weight: 650; font-variant-numeric: tabular-nums; border: none; cursor: pointer; max-width: 280px; }
.timer-pill .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; flex: none; }

/* ---------- Ask Flow panel ---------- */
.ai-panel .chat { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; line-height: 1.55; font-size: 13.5px; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--bg-subtle); border-bottom-left-radius: 4px; }
.msg.assistant ul { margin: 6px 0; padding-left: 18px; }
.msg.assistant p + p { margin-top: 6px; }
.ai-suggestions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-chip { border: 1px solid var(--border); background: var(--surface); padding: 6px 10px; border-radius: 99px; font-size: 12.5px; cursor: pointer; color: var(--text-muted); }
.ai-chip:hover { border-color: var(--brand); color: var(--brand); }
.ai-composer { border-top: 1px solid var(--border); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.ai-composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 40px; height: 40px; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-subtle); animation: bounce 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.ai-gradient-text { background: linear-gradient(135deg, var(--brand), #b15cff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-block { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.plan-block.break { opacity: .7; }
.plan-time { font-family: var(--mono); font-size: 13px; color: var(--brand); font-weight: 600; }

/* ---------- Today / week ---------- */
.hero-greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.hero-greeting h1 { font-size: 30px; }
.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.day-col { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 420px; }
.day-col.today { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.day-head { padding: 12px 12px 6px; }
.day-head .date { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.day-body { flex: 1; padding: 6px 8px 10px; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.load-bar { height: 4px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 6px; }
.load-bar span { display: block; height: 100%; background: var(--success); }
.load-bar.warn span { background: var(--warning); } .load-bar.over span { background: var(--danger); }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; box-shadow: var(--shadow-xs); }
.mini-card:hover { border-color: var(--border-strong); }
.mini-card.completed .t { text-decoration: line-through; color: var(--text-subtle); }
.mini-card .prio-bar { width: 3px; align-self: stretch; border-radius: 3px; flex: none; }

/* Quick capture */
.capture { display: flex; gap: 8px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.capture input { flex: 1; border: none; outline: none; font-size: 15px; background: none; padding: 6px 8px; }
.capture-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; min-height: 24px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: calc(100vh - 260px); }
.tl-grid { position: relative; }
.tl-header { position: sticky; top: 0; z-index: 3; display: flex; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tl-label-col { position: sticky; left: 0; z-index: 4; width: 260px; flex: none; background: var(--surface-2); border-right: 1px solid var(--border); }
.tl-day { flex: none; text-align: center; font-size: 11px; color: var(--text-subtle); padding: 6px 0; border-right: 1px solid var(--border); }
.tl-day.weekend { background: var(--bg-subtle); }
.tl-day.today { color: var(--brand); font-weight: 700; }
.tl-row { display: flex; height: 40px; border-bottom: 1px solid var(--border); position: relative; }
.tl-row .tl-label-col { background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 13px; cursor: pointer; }
.tl-row .tl-label-col:hover { background: var(--surface-hover); }
.tl-track { position: relative; flex: none; }
.tl-bar { position: absolute; top: 8px; height: 24px; border-radius: 7px; background: var(--bar-color, var(--brand)); color: #fff; font-size: 11.5px; font-weight: 600; padding: 0 8px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; cursor: grab; box-shadow: var(--shadow-sm); user-select: none; }
.tl-bar.completed { opacity: .55; }
.tl-bar .handle { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.tl-bar .handle.left { left: 0; right: auto; }
.tl-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); z-index: 2; opacity: .6; pointer-events: none; }
.tl-arrows { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; overflow: visible; }

/* ---------- Calendar (FullCalendar theming) ---------- */
.fc { --fc-border-color: var(--border); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--bg-subtle); --fc-today-bg-color: var(--brand-soft); --fc-event-border-color: transparent; font-size: 13px; }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.fc .fc-button { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 550; box-shadow: none; text-transform: capitalize; }
.fc .fc-button:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--brand); border-color: var(--brand); color: #fff; }
.fc .fc-event { border-radius: 6px; padding: 1px 4px; font-weight: 550; cursor: pointer; }
.fc .fc-daygrid-day-number, .fc .fc-col-header-cell-cushion { color: var(--text-muted); }
.fc-theme-standard .fc-scrollgrid { border-radius: var(--radius); overflow: hidden; }

/* ---------- Focus mode ---------- */
.focus-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 20px; background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent), var(--bg); }
.focus-card { width: min(720px, 100%); }
.focus-timer { font-size: 72px; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.focus-ring { --size: 260px; }
.focus-ring::before { inset: 12px; }

/* ---------- Automations ---------- */
.rule { display: flex; flex-direction: column; gap: 10px; }
.rule-step { display: flex; gap: 12px; align-items: flex-start; }
.rule-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 4px 8px; border-radius: 6px; flex: none; min-width: 64px; text-align: center; }
.rule-badge.when { background: var(--info-soft); color: var(--info); }
.rule-badge.if { background: var(--warning-soft); color: #b45309; }
.rule-badge.then { background: var(--success-soft); color: var(--success); }
.builder-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.builder-row > * { flex: 1; min-width: 120px; }
.builder-row > .icon-btn { flex: none; min-width: 0; }

/* ---------- Onboarding / auth ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(900px 500px at 20% 10%, rgba(139, 125, 255, .55), transparent), radial-gradient(700px 500px at 90% 90%, rgba(20, 184, 212, .45), transparent), #0e0d1b; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; max-width: 440px; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-subtle); font-size: 12px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn { background: var(--surface); }
.google-btn img { width: 18px; height: 18px; }
.onboard-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(900px 500px at 50% -20%, color-mix(in srgb, var(--brand) 18%, transparent), transparent), var(--bg); }
.onboard-card { width: min(620px, 100%); padding: 32px; }
.steps { display: flex; gap: 6px; margin-bottom: 24px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--border); transition: background .3s; }
.steps span.on { background: var(--brand); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; display: flex; gap: 12px; align-items: center; background: var(--surface); transition: .15s; text-align: left; }
.choice:hover { border-color: var(--border-strong); }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice .bi { font-size: 20px; color: var(--brand); }

/* ---------- Misc pages ---------- */
.project-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.project-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; color: #fff; flex: none; }
.project-head { padding: 4px 0 0; margin-bottom: 14px; }
.project-head .title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-card { padding: 18px 20px; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.score-components { display: flex; flex-direction: column; gap: 12px; }
.member-row { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(6, minmax(80px, 1fr)); gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; align-self: start; }
.plan-card { padding: 20px; border-radius: var(--radius); border: 1.5px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.plan-card ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 13px; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.upgrade { text-align: center; padding: 48px 24px; }
.setup-list li { padding: 10px 0; border-bottom: 1px solid var(--border); list-style: none; display: flex; gap: 10px; align-items: center; }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOut { to { transform: translateX(40px); opacity: 0; } }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(20px); opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); } 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px); } }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--brand-ring); } 100% { box-shadow: var(--shadow-xs); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .td-grid { grid-template-columns: 1fr; }
  .td-side { border-left: none; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
  .app-shell .sidebar .label, .app-shell .sidebar .nav-section span, .app-shell .sidebar .count, .app-shell .brand-name, .app-shell .ws-switch .label { display: none; }
  .app-shell .nav-item { justify-content: center; }
  .app-shell.expanded { grid-template-columns: var(--sidebar-w) 1fr; }
  .app-shell.expanded .sidebar .label, .app-shell.expanded .sidebar .nav-section span, .app-shell.expanded .sidebar .count, .app-shell.expanded .brand-name, .app-shell.expanded .ws-switch .label { display: revert; }
  .app-shell.expanded .nav-item { justify-content: flex-start; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-trigger { min-width: 0; }
  .search-trigger .label { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .member-row { grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(70px, 1fr)); }
  .member-row .hide-md { display: none; }
}
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .app-shell, html.sidebar-collapsed .app-shell, .app-shell.expanded { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .app-shell.mobile-open .sidebar { transform: none; }
  .app-shell .sidebar .label, .app-shell .sidebar .nav-section span, .app-shell .sidebar .count, .app-shell .brand-name, .app-shell .ws-switch .label { display: revert !important; }
  .app-shell .nav-item { justify-content: flex-start !important; }
  .sidebar-toggle { display: none; }
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .topbar { padding: 0 12px; }
  .content { padding: 18px 16px 96px; }
  .content.full { padding: 12px 12px 96px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: auto; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .kanban-col { width: 86vw; }
  .kanban { min-height: calc(100vh - 220px); }
  .week-grid { grid-template-columns: repeat(7, 78vw); scroll-snap-type: x mandatory; }
  .day-col { scroll-snap-align: start; }
  .drawer { width: 100vw; }
  .td-side { grid-template-columns: 1fr; }
  .modal { top: auto; bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .choice-grid { grid-template-columns: 1fr; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: 64px; padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); justify-content: space-around; align-items: center; }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-subtle); font-size: 10.5px; font-weight: 600; background: none; border: none; text-decoration: none; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav .bi { font-size: 20px; }
  .toasts { bottom: 76px; left: 12px; right: 12px; }
  .toast { min-width: 0; max-width: none; }
  .page-header { margin-bottom: 16px; }
  h1 { font-size: 22px; }
  .hero-greeting h1 { font-size: 24px; }
  .member-row { grid-template-columns: 1fr 1fr; }
  .notif-panel { width: calc(100vw - 24px); position: fixed; left: 12px; right: 12px; top: 64px; }
  .plan-block { grid-template-columns: 80px 1fr; }
  .focus-timer { font-size: 54px; }
  .focus-ring { --size: 220px; }
}
