/* Nuvyo UI: the shared design system for Nuvyo, Nuvyo Planner and Nuvyo CRM.
   Approved 28 Nov 2026 on /ui-kit.html. Needs tokens.css (brand + Geist).
   Everything is prefixed nv- so it can be introduced into each app gradually, screen by screen. */

/* ---------- tokens ---------- */
:root, [data-theme="light"] {
  color-scheme: light;
  --nv-bg: #FAFAFA;          /* app canvas */
  --nv-surface: #FFFFFF;     /* cards, panels, inputs */
  --nv-surface-2: #F5F5F6;   /* hover, subtle fills */
  --nv-surface-3: #EDEDEF;   /* pressed, selected fills */
  --nv-sidebar: #F7F7F8;
  --nv-border: #E6E6E9;
  --nv-border-strong: #D4D4D8;
  --nv-text: #111111;
  --nv-text-2: #3F3F46;
  --nv-text-3: #71717A;
  --nv-text-4: #A1A1AA;
  --nv-accent: #3478F6;
  --nv-accent-hover: #2563EB;
  --nv-accent-soft: #EBF2FE;
  --nv-accent-text: #1D5FD8;
  --nv-on-accent: #FFFFFF;
  --nv-success: #16A34A; --nv-success-soft: #E9F7EF; --nv-success-text: #15803D;
  --nv-warning: #D97706; --nv-warning-soft: #FEF4E3; --nv-warning-text: #B45309;
  --nv-danger:  #DC2626; --nv-danger-soft:  #FDEDED; --nv-danger-text:  #B91C1C;
  --nv-overlay: rgba(17, 17, 17, .32);
  --nv-shadow-sm: 0 1px 2px rgba(17, 17, 17, .05);
  --nv-shadow-md: 0 1px 2px rgba(17, 17, 17, .04), 0 6px 16px -6px rgba(17, 17, 17, .12);
  --nv-shadow-lg: 0 2px 4px rgba(17, 17, 17, .04), 0 24px 48px -12px rgba(17, 17, 17, .22);
}
[data-theme="dark"] {
  color-scheme: dark;
  --nv-bg: #0A0A0B;
  --nv-surface: #111113;
  --nv-surface-2: #18181B;
  --nv-surface-3: #222226;
  --nv-sidebar: #0D0D0F;
  --nv-border: #26262B;
  --nv-border-strong: #36363C;
  --nv-text: #F4F4F5;
  --nv-text-2: #D4D4D8;
  --nv-text-3: #8E8E97;
  --nv-text-4: #5B5B63;
  --nv-accent: #3478F6;
  --nv-accent-hover: #4C8BF8;
  --nv-accent-soft: rgba(52, 120, 246, .16);
  --nv-accent-text: #79A9FA;
  --nv-success: #22C55E; --nv-success-soft: rgba(34, 197, 94, .14);  --nv-success-text: #4ADE80;
  --nv-warning: #F59E0B; --nv-warning-soft: rgba(245, 158, 11, .14); --nv-warning-text: #FBBF24;
  --nv-danger:  #EF4444; --nv-danger-soft:  rgba(239, 68, 68, .15);  --nv-danger-text:  #F87171;
  --nv-overlay: rgba(0, 0, 0, .6);
  --nv-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --nv-shadow-md: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px -8px rgba(0, 0, 0, .7);
  --nv-shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 56px -12px rgba(0, 0, 0, .85);
}
:root {
  --nv-font: var(--nv-wordmark-font), ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nv-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  /* type scale */
  --nv-fs-xs: 12px; --nv-fs-sm: 13px; --nv-fs-md: 14px; --nv-fs-lg: 16px; --nv-fs-xl: 18px; --nv-fs-2xl: 24px; --nv-fs-3xl: 32px;
  /* spacing (4px grid) */
  --nv-1: 4px; --nv-2: 8px; --nv-3: 12px; --nv-4: 16px; --nv-5: 20px; --nv-6: 24px; --nv-8: 32px; --nv-10: 40px; --nv-12: 48px;
  /* radius */
  --nv-r-sm: 6px; --nv-r: 8px; --nv-r-lg: 12px; --nv-r-xl: 16px; --nv-r-full: 999px;
  /* control heights */
  --nv-h-sm: 28px; --nv-h: 34px; --nv-h-lg: 40px;
  --nv-focus: 0 0 0 3px color-mix(in srgb, var(--nv-accent) 28%, transparent);
  --nv-ease: cubic-bezier(.2, 0, 0, 1);
}

/* ---------- base ---------- */
.nv-ui { font-family: var(--nv-font); font-size: var(--nv-fs-md); line-height: 1.5; color: var(--nv-text); background: var(--nv-bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01" off; }
.nv-ui *, .nv-ui *::before, .nv-ui *::after { box-sizing: border-box; }
.nv-ui button, .nv-ui input, .nv-ui select, .nv-ui textarea { font: inherit; color: inherit; }
.nv-ui :focus-visible { outline: none; box-shadow: var(--nv-focus); }
.nv-ui .nv-ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nv-ico.sm { width: 14px; height: 14px; }
.nv-ico.lg { width: 20px; height: 20px; }
.nv-mono { font-family: var(--nv-mono); font-variant-numeric: tabular-nums; font-size: .94em; letter-spacing: -.01em; }
.nv-muted { color: var(--nv-text-3); }

/* type */
.nv-h1 { font-size: var(--nv-fs-2xl); font-weight: 600; letter-spacing: -.025em; line-height: 1.25; margin: 0; }
.nv-h2 { font-size: var(--nv-fs-xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.3; margin: 0; }
.nv-h3 { font-size: var(--nv-fs-md); font-weight: 600; letter-spacing: -.01em; margin: 0; }
.nv-label { font-size: var(--nv-fs-xs); font-weight: 500; color: var(--nv-text-3); letter-spacing: .01em; }
.nv-overline { font: 500 11px/1 var(--nv-font); letter-spacing: .06em; text-transform: uppercase; color: var(--nv-text-4); }

/* ---------- buttons ---------- */
.nv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--nv-h); padding: 0 12px;
  border-radius: var(--nv-r); border: 1px solid var(--nv-border); background: var(--nv-surface); color: var(--nv-text);
  font-size: var(--nv-fs-sm); font-weight: 500; white-space: nowrap; cursor: pointer; box-shadow: var(--nv-shadow-sm);
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s; text-decoration: none; }
.nv-btn:hover { background: var(--nv-surface-2); border-color: var(--nv-border-strong); }
.nv-btn:active { background: var(--nv-surface-3); }
.nv-btn.primary { background: var(--nv-accent); border-color: var(--nv-accent); color: var(--nv-on-accent);
  box-shadow: 0 1px 2px rgba(17, 17, 17, .12), inset 0 1px 0 rgba(255, 255, 255, .12); }
.nv-btn.primary:hover { background: var(--nv-accent-hover); border-color: var(--nv-accent-hover); }
.nv-btn.strong { background: var(--nv-text); border-color: var(--nv-text); color: var(--nv-bg); }
.nv-btn.strong:hover { opacity: .88; }
.nv-btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--nv-text-2); }
.nv-btn.ghost:hover { background: var(--nv-surface-2); color: var(--nv-text); }
.nv-btn.danger { color: var(--nv-danger-text); }
.nv-btn.danger:hover { background: var(--nv-danger-soft); border-color: color-mix(in srgb, var(--nv-danger) 35%, var(--nv-border)); }
.nv-btn.danger.solid { background: var(--nv-danger); border-color: var(--nv-danger); color: #fff; }
.nv-btn.sm { height: var(--nv-h-sm); padding: 0 10px; font-size: var(--nv-fs-xs); border-radius: var(--nv-r-sm); }
.nv-btn.lg { height: var(--nv-h-lg); padding: 0 16px; font-size: var(--nv-fs-md); }
.nv-btn.icon { width: var(--nv-h); padding: 0; }
.nv-btn.icon.sm { width: var(--nv-h-sm); }
.nv-btn:disabled, .nv-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.nv-btn .nv-kbd { margin-left: 2px; }
.nv-btn.primary .nv-kbd { background: rgba(255, 255, 255, .18); border-color: transparent; color: #fff; }
.nv-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: nv-spin .7s linear infinite; }
@keyframes nv-spin { to { transform: rotate(360deg); } }

/* ---------- form controls ---------- */
.nv-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nv-field > label { font-size: var(--nv-fs-sm); font-weight: 500; color: var(--nv-text-2); }
.nv-help { font-size: var(--nv-fs-xs); color: var(--nv-text-3); }
.nv-err { font-size: var(--nv-fs-xs); color: var(--nv-danger-text); display: flex; align-items: center; gap: 5px; }
.nv-input, .nv-select, .nv-textarea { width: 100%; height: var(--nv-h); padding: 0 10px; border-radius: var(--nv-r);
  border: 1px solid var(--nv-border); background: var(--nv-surface); color: var(--nv-text); font-size: var(--nv-fs-sm);
  transition: border-color .12s, box-shadow .12s; box-shadow: var(--nv-shadow-sm); }
.nv-input::placeholder, .nv-textarea::placeholder { color: var(--nv-text-4); }
.nv-input:hover, .nv-select:hover, .nv-textarea:hover { border-color: var(--nv-border-strong); }
.nv-input:focus, .nv-select:focus, .nv-textarea:focus { outline: none; border-color: var(--nv-accent); box-shadow: var(--nv-focus); }
.nv-input.invalid { border-color: var(--nv-danger); }
.nv-input.invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--nv-danger) 22%, transparent); }
.nv-textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.nv-select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; }
.nv-input-wrap { position: relative; display: flex; align-items: center; }
.nv-input-wrap > .nv-ico { position: absolute; left: 10px; color: var(--nv-text-4); pointer-events: none; }
.nv-input-wrap > .nv-input { padding-left: 32px; }
.nv-input-wrap > .nv-kbd { position: absolute; right: 8px; }
.nv-prefix { display: flex; align-items: stretch; }
.nv-prefix > span { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--nv-border); border-right: 0;
  border-radius: var(--nv-r) 0 0 var(--nv-r); background: var(--nv-surface-2); color: var(--nv-text-3); font-size: var(--nv-fs-sm); }
.nv-prefix > .nv-input { border-radius: 0 var(--nv-r) var(--nv-r) 0; }

.nv-check, .nv-radio { display: inline-flex; align-items: center; gap: 8px; font-size: var(--nv-fs-sm); color: var(--nv-text-2); cursor: pointer; }
.nv-check input, .nv-radio input { appearance: none; margin: 0; width: 16px; height: 16px; flex: none; border: 1.5px solid var(--nv-border-strong);
  background: var(--nv-surface); cursor: pointer; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.nv-check input { border-radius: 5px; }
.nv-radio input { border-radius: 50%; }
.nv-check input:checked { background: var(--nv-accent); border-color: var(--nv-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px; background-position: center; background-repeat: no-repeat; }
.nv-check input:indeterminate { background: var(--nv-accent); border-color: var(--nv-accent);
  background-image: linear-gradient(#fff, #fff); background-size: 8px 2px; background-position: center; background-repeat: no-repeat; }
.nv-radio input:checked { border: 5px solid var(--nv-accent); }
.nv-check input:focus-visible, .nv-radio input:focus-visible { box-shadow: var(--nv-focus); }
.nv-switch { display: inline-flex; align-items: center; gap: 10px; font-size: var(--nv-fs-sm); color: var(--nv-text-2); cursor: pointer; }
.nv-switch input { appearance: none; margin: 0; width: 32px; height: 18px; border-radius: 999px; background: var(--nv-surface-3);
  border: 1px solid var(--nv-border-strong); position: relative; cursor: pointer; transition: background .15s, border-color .15s; flex: none; }
.nv-switch input::after { content: ""; position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s var(--nv-ease); }
.nv-switch input:checked { background: var(--nv-accent); border-color: var(--nv-accent); }
.nv-switch input:checked::after { transform: translateX(14px); }
.nv-switch input:focus-visible { box-shadow: var(--nv-focus); }

/* segmented + tabs */
.nv-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--nv-r); background: var(--nv-surface-2); border: 1px solid var(--nv-border); }
.nv-seg button { border: 0; background: none; height: 26px; padding: 0 10px; border-radius: var(--nv-r-sm); font-size: var(--nv-fs-xs); font-weight: 500;
  color: var(--nv-text-3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nv-seg button:hover { color: var(--nv-text); }
.nv-seg button.on { background: var(--nv-surface); color: var(--nv-text); box-shadow: var(--nv-shadow-sm), 0 0 0 1px var(--nv-border); }
.nv-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--nv-border); overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nv-tabs::-webkit-scrollbar { display: none; }
.nv-tabs button { border: 0; background: none; padding: 0 0 10px; margin-bottom: -1px; font-size: var(--nv-fs-sm); font-weight: 500; color: var(--nv-text-3);
  border-bottom: 2px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nv-tabs button:hover { color: var(--nv-text); }
.nv-tabs button.on { color: var(--nv-text); border-bottom-color: var(--nv-text); }
.nv-count { font: 500 11px/1 var(--nv-font); padding: 2px 6px; border-radius: 999px; background: var(--nv-surface-3); color: var(--nv-text-3); }
.on > .nv-count { background: var(--nv-accent-soft); color: var(--nv-accent-text); }

/* ---------- badges, chips, avatars, kbd ---------- */
.nv-badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: var(--nv-r-sm);
  font-size: 11.5px; font-weight: 500; background: var(--nv-surface-2); color: var(--nv-text-2); white-space: nowrap; border: 1px solid var(--nv-border); }
.nv-badge::before { content: none; }
.nv-badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nv-badge.blue { background: var(--nv-accent-soft); color: var(--nv-accent-text); border-color: transparent; }
.nv-badge.green { background: var(--nv-success-soft); color: var(--nv-success-text); border-color: transparent; }
.nv-badge.amber { background: var(--nv-warning-soft); color: var(--nv-warning-text); border-color: transparent; }
.nv-badge.red { background: var(--nv-danger-soft); color: var(--nv-danger-text); border-color: transparent; }
.nv-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: var(--nv-r-full);
  border: 1px solid var(--nv-border); background: var(--nv-surface); font-size: var(--nv-fs-xs); color: var(--nv-text-2); white-space: nowrap; }
.nv-chip button { border: 0; background: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--nv-text-4); cursor: pointer; padding: 0; }
.nv-chip button:hover { background: var(--nv-surface-3); color: var(--nv-text); }
.nv-link-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--nv-r-sm);
  background: var(--nv-surface-2); color: var(--nv-text-2); font-size: 11.5px; border: 1px solid var(--nv-border); white-space: nowrap; cursor: pointer; max-width: 100%; }
.nv-link-chip:hover { border-color: var(--nv-border-strong); color: var(--nv-text); }
.nv-link-chip .src { color: var(--nv-text-3); }
.nv-task-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--nv-r-full);
  background: var(--nv-accent-soft); color: var(--nv-accent-text); font-size: 11.5px; font-weight: 500; white-space: nowrap; border: 0; cursor: pointer; }
.nv-task-chip.done { background: var(--nv-success-soft); color: var(--nv-success-text); }
.nv-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #3478F6, #1E3A8A); letter-spacing: 0; }
.nv-avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.nv-avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.nv-avatar.square { border-radius: 7px; background: var(--nv-text); color: var(--nv-bg); }
.nv-avatars { display: flex; }
.nv-avatars .nv-avatar { box-shadow: 0 0 0 2px var(--nv-surface); margin-left: -6px; }
.nv-avatars .nv-avatar:first-child { margin-left: 0; }
.nv-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px;
  border: 1px solid var(--nv-border); background: var(--nv-surface-2); color: var(--nv-text-3); font: 500 10.5px/1 var(--nv-font); }

/* ---------- cards, stats ---------- */
.nv-card { background: var(--nv-surface); border: 1px solid var(--nv-border); border-radius: var(--nv-r-lg); box-shadow: var(--nv-shadow-sm); }
.nv-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--nv-border); }
.nv-card-b { padding: 16px; }
.nv-stat { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.nv-stat .v { font-size: var(--nv-fs-2xl); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.nv-stat .d { font-size: var(--nv-fs-xs); display: inline-flex; align-items: center; gap: 4px; }
.up { color: var(--nv-success-text); } .down { color: var(--nv-danger-text); }

/* ---------- table ---------- */
.nv-table-wrap { border: 1px solid var(--nv-border); border-radius: var(--nv-r-lg); background: var(--nv-surface); overflow: auto; box-shadow: var(--nv-shadow-sm); }
.nv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--nv-fs-sm); }
.nv-table th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: var(--nv-fs-xs); font-weight: 500; color: var(--nv-text-3);
  padding: 0 12px; height: 34px; background: var(--nv-surface); border-bottom: 1px solid var(--nv-border); white-space: nowrap; }
.nv-table td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--nv-border); color: var(--nv-text-2); white-space: nowrap; }
.nv-table tr:last-child td { border-bottom: 0; }
.nv-table tbody tr { transition: background .1s; }
.nv-table tbody tr:hover { background: var(--nv-surface-2); }
.nv-table tbody tr.sel { background: var(--nv-accent-soft); }
.nv-table .num { text-align: right; font-family: var(--nv-mono); font-variant-numeric: tabular-nums; color: var(--nv-text); }
.nv-table .num.neg { color: var(--nv-text); }
.nv-table .num.pos { color: var(--nv-success-text); }
.nv-table .w-check { width: 40px; padding-right: 0; }
.nv-table .w-act { width: 44px; padding: 0 6px; text-align: right; }
.nv-table .row-act { opacity: 0; transition: opacity .1s; }
.nv-table tr:hover .row-act, .nv-table tr.sel .row-act, .nv-table .row-act[aria-expanded="true"] { opacity: 1; }
.nv-cell-main { color: var(--nv-text); font-weight: 500; }
.nv-cell-sub { color: var(--nv-text-3); font-size: var(--nv-fs-xs); }
.nv-bulk { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--nv-r-lg); background: var(--nv-text); color: var(--nv-bg);
  box-shadow: var(--nv-shadow-lg); font-size: var(--nv-fs-sm); }
.nv-bulk .nv-btn { background: transparent; border-color: color-mix(in srgb, var(--nv-bg) 22%, transparent); color: var(--nv-bg); box-shadow: none; }
.nv-bulk .nv-btn:hover { background: color-mix(in srgb, var(--nv-bg) 12%, transparent); }

/* ---------- menus, popovers, tooltips ---------- */
.nv-menu { min-width: 220px; padding: 4px; border-radius: var(--nv-r-lg); background: var(--nv-surface); border: 1px solid var(--nv-border);
  box-shadow: var(--nv-shadow-lg); font-size: var(--nv-fs-sm); }
.nv-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 8px; border: 0; background: none; border-radius: var(--nv-r-sm);
  color: var(--nv-text-2); cursor: pointer; text-align: left; white-space: nowrap; }
.nv-menu-item:hover, .nv-menu-item:focus-visible { background: var(--nv-surface-2); color: var(--nv-text); box-shadow: none; }
.nv-menu-item .nv-ico { color: var(--nv-text-3); }
.nv-menu-item .nv-kbd { margin-left: auto; }
.nv-menu-item .hint { margin-left: auto; color: var(--nv-text-4); font-size: var(--nv-fs-xs); }
.nv-menu-item.danger, .nv-menu-item.danger .nv-ico { color: var(--nv-danger-text); }
.nv-menu-item.danger:hover { background: var(--nv-danger-soft); }
.nv-menu-sep { height: 1px; background: var(--nv-border); margin: 4px -4px; }
.nv-menu-label { padding: 8px 8px 4px; font: 500 11px/1 var(--nv-font); letter-spacing: .05em; text-transform: uppercase; color: var(--nv-text-4); }
.nv-popover { width: 360px; max-width: calc(100vw - 32px); border-radius: var(--nv-r-lg); background: var(--nv-surface); border: 1px solid var(--nv-border);
  box-shadow: var(--nv-shadow-lg); }
.nv-pop-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0; min-width: 0; }
.nv-pop-h .nv-overline { white-space: nowrap; }
.nv-pop-h .nv-link-chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nv-pop-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.nv-pop-f { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--nv-border); background: var(--nv-surface-2);
  border-radius: 0 0 var(--nv-r-lg) var(--nv-r-lg); }
.nv-title-input { border: 0; background: none; font-size: var(--nv-fs-lg); font-weight: 500; letter-spacing: -.01em; width: 100%; padding: 0; color: var(--nv-text); }
.nv-title-input:focus { outline: none; box-shadow: none; }
.nv-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.nv-quick button { height: 26px; padding: 0 9px; border-radius: var(--nv-r-full); border: 1px solid var(--nv-border); background: var(--nv-surface);
  font-size: var(--nv-fs-xs); color: var(--nv-text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.nv-quick button:hover { border-color: var(--nv-border-strong); color: var(--nv-text); }
.nv-quick button.on { background: var(--nv-accent-soft); border-color: transparent; color: var(--nv-accent-text); font-weight: 500; }
.nv-tooltip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: var(--nv-r-sm); background: var(--nv-text); color: var(--nv-bg);
  font-size: var(--nv-fs-xs); font-weight: 500; box-shadow: var(--nv-shadow-md); white-space: nowrap; }
.nv-tooltip .nv-kbd { background: transparent; border-color: color-mix(in srgb, var(--nv-bg) 30%, transparent); color: inherit; }

/* ---------- overlays ---------- */
.nv-scrim { position: fixed; inset: 0; z-index: 60; background: var(--nv-overlay); display: grid; place-items: center; padding: 16px;
  animation: nv-fade .15s var(--nv-ease); }
.nv-dialog { width: 420px; max-width: 100%; border-radius: var(--nv-r-xl); background: var(--nv-surface); border: 1px solid var(--nv-border);
  box-shadow: var(--nv-shadow-lg); animation: nv-pop .18s var(--nv-ease); }
.nv-dialog-b { padding: 20px 20px 4px; display: flex; flex-direction: column; gap: 6px; }
.nv-dialog-b p { margin: 0; color: var(--nv-text-3); font-size: var(--nv-fs-sm); }
.nv-dialog-f { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }
.nv-sheet-scrim { position: fixed; inset: 0; z-index: 60; background: var(--nv-overlay); animation: nv-fade .15s var(--nv-ease); }
.nv-sheet { position: fixed; top: 8px; right: 8px; bottom: 8px; z-index: 61; width: 440px; max-width: calc(100vw - 16px); display: flex; flex-direction: column;
  border-radius: var(--nv-r-xl); background: var(--nv-surface); border: 1px solid var(--nv-border); box-shadow: var(--nv-shadow-lg);
  animation: nv-slide .22s var(--nv-ease); }
.nv-sheet-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--nv-border); }
.nv-sheet-b { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.nv-toasts { position: fixed; bottom: 20px; right: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.nv-toast { display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 380px; padding: 10px 10px 10px 14px; border-radius: var(--nv-r-lg);
  background: var(--nv-text); color: var(--nv-bg); box-shadow: var(--nv-shadow-lg); font-size: var(--nv-fs-sm); animation: nv-up .2s var(--nv-ease); }
.nv-toast .nv-ico { color: var(--nv-success); }
.nv-toast .act { margin-left: auto; border: 0; background: none; color: inherit; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.nv-toast .act:hover { background: color-mix(in srgb, var(--nv-bg) 14%, transparent); }
@keyframes nv-fade { from { opacity: 0; } }
@keyframes nv-pop { from { opacity: 0; transform: scale(.97) translateY(4px); } }
@keyframes nv-slide { from { opacity: 0; transform: translateX(24px); } }
@keyframes nv-up { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .nv-scrim, .nv-dialog, .nv-sheet, .nv-sheet-scrim, .nv-toast { animation: none; } }

/* ---------- feedback ---------- */
.nv-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--nv-r-lg); border: 1px solid var(--nv-border);
  background: var(--nv-surface); font-size: var(--nv-fs-sm); color: var(--nv-text-2); }
.nv-alert .nv-ico { margin-top: 2px; color: var(--nv-text-3); }
.nv-alert b { color: var(--nv-text); font-weight: 600; }
.nv-alert.info { background: var(--nv-accent-soft); border-color: transparent; } .nv-alert.info .nv-ico { color: var(--nv-accent-text); }
.nv-alert.warn { background: var(--nv-warning-soft); border-color: transparent; } .nv-alert.warn .nv-ico { color: var(--nv-warning-text); }
.nv-alert.error { background: var(--nv-danger-soft); border-color: transparent; } .nv-alert.error .nv-ico { color: var(--nv-danger-text); }
.nv-alert.ok { background: var(--nv-success-soft); border-color: transparent; } .nv-alert.ok .nv-ico { color: var(--nv-success-text); }
.nv-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; }
.nv-empty .art { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--nv-surface-2);
  border: 1px solid var(--nv-border); color: var(--nv-text-3); margin-bottom: 4px; }
.nv-empty p { margin: 0 0 8px; color: var(--nv-text-3); font-size: var(--nv-fs-sm); max-width: 36ch; }
.nv-skel { border-radius: 6px; background: linear-gradient(90deg, var(--nv-surface-2) 25%, var(--nv-surface-3) 50%, var(--nv-surface-2) 75%);
  background-size: 200% 100%; animation: nv-shimmer 1.4s ease-in-out infinite; }
@keyframes nv-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .nv-skel { animation: none; } }
.nv-progress { height: 4px; border-radius: 999px; background: var(--nv-surface-3); overflow: hidden; }
.nv-progress > i { display: block; height: 100%; border-radius: inherit; background: var(--nv-accent); }

/* ---------- app shell ---------- */
.nv-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); background: var(--nv-bg); }
.nv-shell.rail { grid-template-columns: 56px minmax(0, 1fr); }
.nv-side { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; background: var(--nv-sidebar); border-right: 1px solid var(--nv-border); min-width: 0; }
.nv-side-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.nv-side-brand .nv-wordmark { font-size: 20px; }
.nv-ws { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: var(--nv-r); border: 0; background: none;
  width: 100%; text-align: left; cursor: pointer; color: var(--nv-text); font-weight: 500; font-size: var(--nv-fs-sm); }
.nv-ws:hover { background: var(--nv-surface-3); }
.nv-ws .nv-ico:last-child { margin-left: auto; color: var(--nv-text-4); }
.nv-side-search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; margin: 4px 0 8px; border-radius: var(--nv-r);
  border: 1px solid var(--nv-border); background: var(--nv-surface); color: var(--nv-text-4); font-size: var(--nv-fs-sm); cursor: pointer; width: 100%; }
.nv-side-search .nv-kbd { margin-left: auto; }
.nv-nav-sect { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; font: 500 11px/1 var(--nv-font);
  letter-spacing: .05em; text-transform: uppercase; color: var(--nv-text-4); }
.nv-nav-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: var(--nv-r); color: var(--nv-text-2);
  font-size: var(--nv-fs-sm); text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; white-space: nowrap; }
.nv-nav-item:hover { background: var(--nv-surface-3); color: var(--nv-text); }
.nv-nav-item .nv-ico { color: var(--nv-text-3); }
.nv-nav-item.on { background: var(--nv-surface); color: var(--nv-text); font-weight: 500; box-shadow: var(--nv-shadow-sm), 0 0 0 1px var(--nv-border); }
.nv-nav-item.on .nv-ico { color: var(--nv-accent); }
.nv-nav-item .n { margin-left: auto; font-size: 11.5px; color: var(--nv-text-4); font-variant-numeric: tabular-nums; }
.nv-nav-item.on .n { color: var(--nv-accent-text); }
.nv-side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--nv-border); display: flex; align-items: center; gap: 9px; padding-left: 6px; }
.nv-side-foot .who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nv-side-foot .who b { font-size: var(--nv-fs-sm); font-weight: 500; }
.nv-side-foot .who span { font-size: var(--nv-fs-xs); color: var(--nv-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-shell.rail .nv-side { align-items: center; padding: 12px 8px; }
.nv-shell.rail .nv-side :is(.lbl, .n, .nv-nav-sect, .nv-kbd, .who, .full, .nv-ws > :not(.nv-avatar)) { display: none; }
.nv-shell.rail .nv-nav-item, .nv-shell.rail .nv-side-search, .nv-shell.rail .nv-ws { width: 36px; justify-content: center; padding: 0; }
.nv-shell.rail .nv-side-brand { flex-direction: column; gap: 8px; padding: 4px 0 10px; }
.nv-shell.rail .nv-side-foot { padding-left: 0; justify-content: center; }
.nv-shell .mark { display: none; }
.nv-shell.rail .mark { display: inline-flex; }
.nv-top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px; border-bottom: 1px solid var(--nv-border);
  background: color-mix(in srgb, var(--nv-bg) 88%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.nv-crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--nv-fs-sm); color: var(--nv-text-3); min-width: 0; }
.nv-crumbs b { color: var(--nv-text); font-weight: 500; }
.nv-crumbs .nv-ico { color: var(--nv-text-4); }
.nv-page { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nv-page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nv-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- tasks & notes ---------- */
.nv-tasks { display: flex; flex-direction: column; }
.nv-task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--nv-border); }
.nv-task:last-child { border-bottom: 0; }
.nv-task:hover { background: var(--nv-surface-2); }
.nv-task .box { appearance: none; margin: 1px 0 0; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--nv-border-strong); flex: none;
  cursor: pointer; background: var(--nv-surface); transition: background .12s, border-color .12s; }
.nv-task .box:hover { border-color: var(--nv-accent); }
.nv-task .box:checked { background: var(--nv-accent); border-color: var(--nv-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px; background-position: center; background-repeat: no-repeat; }
.nv-task .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nv-task .t { color: var(--nv-text); font-size: var(--nv-fs-sm); }
.nv-task .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--nv-fs-xs); color: var(--nv-text-3); }
.nv-task .meta .due { display: inline-flex; align-items: center; gap: 4px; }
.nv-task .meta .due.late { color: var(--nv-danger-text); }
.nv-task.done .t { color: var(--nv-text-4); text-decoration: line-through; }
.nv-prio { width: 8px; height: 8px; border-radius: 2px; flex: none; margin-top: 6px; }
.nv-prio.high { background: var(--nv-danger); } .nv-prio.normal { background: var(--nv-border-strong); }

/* editor toolbar */
.nv-editor { border: 1px solid var(--nv-border); border-radius: var(--nv-r-lg); background: var(--nv-surface); overflow: hidden; box-shadow: var(--nv-shadow-sm); }
.nv-editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--nv-border); background: var(--nv-surface); }
.nv-editor-bar .sep { width: 1px; margin: 4px 4px; background: var(--nv-border); }
.nv-editor-bar button { width: 30px; height: 30px; border: 0; background: none; border-radius: var(--nv-r-sm); display: grid; place-items: center;
  color: var(--nv-text-3); cursor: pointer; }
.nv-editor-bar button:hover { background: var(--nv-surface-2); color: var(--nv-text); }
.nv-editor-bar button.on { background: var(--nv-accent-soft); color: var(--nv-accent-text); }
.nv-editor-b { padding: 16px 18px; font-size: var(--nv-fs-md); line-height: 1.65; color: var(--nv-text-2); }
.nv-editor-b h3 { margin: 0 0 6px; font-size: var(--nv-fs-lg); color: var(--nv-text); letter-spacing: -.015em; }
.nv-editor-b ul { margin: 6px 0; padding-left: 4px; list-style: none; }
.nv-editor-b li { display: flex; gap: 8px; align-items: flex-start; }
.nv-editor-b li input { margin-top: 5px; }
.nv-editor-b mark { background: color-mix(in srgb, #FACC15 38%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.nv-editor-b code { font-family: var(--nv-mono); font-size: .9em; background: var(--nv-surface-2); border: 1px solid var(--nv-border); border-radius: 4px; padding: 1px 4px; }
