/* ============================================================
   PM-учёт · Theme: LINEAR
   Тёмный, плотный, монохромный с холодным indigo-акцентом.
   Inter + Geist Mono. Тонкие линии 1px. Линиальная плотность.
   ============================================================ */

:root {
  /* === Color tokens === */
  --bg:               #0b0c0f;
  --bg-elev-1:        #111216;
  --bg-elev-2:        #16181d;
  --bg-elev-3:        #1c1f25;
  --bg-sidebar:       #0e0f13;
  --bg-hover:         #1a1d23;
  --bg-active:        #20232b;

  --line:             #20232a;
  --line-strong:      #2a2e37;

  --fg:               #e6e7ea;
  --fg-muted:         #8b8f99;
  --fg-dim:           #5d6068;
  --fg-bright:        #ffffff;

  --accent:           #7c7df0;
  --accent-hover:     #9091f7;
  --accent-soft:      #1d1d36;
  --accent-fg:        #ffffff;

  /* Semantic */
  --c-todo:           #8b8f99;
  --c-progress:       #5b8bf6;
  --c-done:           #4cc38a;
  --c-blocked:        #f06770;
  --c-meeting:        #b794f4;

  --c-progress-bg:    #14213d;
  --c-done-bg:        #0e2a1f;
  --c-blocked-bg:     #2d1416;
  --c-meeting-bg:     #1f1830;

  /* Priorities (Linear-like) */
  --p-urgent:         #f06770;
  --p-high:           #f59e0b;
  --p-med:            #8b8f99;
  --p-low:            #5d6068;

  /* === Shape === */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 999px;

  /* === Type === */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* === Sizing === */
  --sidebar-w: 240px;
  --content-pad-x: 32px;
  --content-pad-y: 24px;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss03';
  letter-spacing: -0.005em;
}

a {
  color: var(--fg);
  text-decoration: none;
}
a:hover { color: var(--fg-bright); }

h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-bright);
  margin-bottom: 4px;
}
h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
  letter-spacing: -0.005em;
}
h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.muted { color: var(--fg-muted); font-size: 12.5px; }

/* ============ APP LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-bright);
}
.logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #4c4dd0);
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--bg-sidebar);
  border-radius: 3px;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 30% 30%, 30% 100%, 0 100%);
}

.quick-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin: 0 4px 10px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.quick-search:hover {
  border-color: var(--line-strong);
  background: var(--bg-elev-2);
}
.qs-icon { font-family: var(--font-mono); color: var(--fg-dim); }
.qs-text { flex: 1; }
.qs-kbd {
  padding: 1px 5px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  background: var(--bg-elev-3);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--fg-muted);
}

.nav-primary, .nav-projects {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 4px;
}
.nav-primary a, .nav-projects a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 500;
  transition: background .1s, color .1s;
}
.nav-primary a:hover, .nav-projects a:hover {
  background: var(--bg-hover);
  color: var(--fg);
}
.nav-primary a.active {
  background: var(--bg-active);
  color: var(--fg-bright);
}

.navicon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.7;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}
/* icons via mask */
.navicon[data-icon="grid"]     { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="black"><rect x="2" y="2" width="5" height="5" rx="1"/><rect x="9" y="2" width="5" height="5" rx="1"/><rect x="2" y="9" width="5" height="5" rx="1"/><rect x="9" y="9" width="5" height="5" rx="1"/></svg>'); }
.navicon[data-icon="folder"]   { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.5"><path d="M2 5a1 1 0 0 1 1-1h3l1.5 1.5h5.5a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5z"/></svg>'); }
.navicon[data-icon="columns"]  { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.5"><rect x="2" y="3" width="3.5" height="10" rx="1"/><rect x="6.25" y="3" width="3.5" height="10" rx="1"/><rect x="10.5" y="3" width="3.5" height="10" rx="1"/></svg>'); }
.navicon[data-icon="calendar"] { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.5"><rect x="2" y="3.5" width="12" height="10" rx="1.5"/><path d="M2 6.5h12M5.5 2v3M10.5 2v3"/></svg>'); }
.navicon[data-icon="chart"]    { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.5"><path d="M2 13h12M4.5 13V8M8 13V4M11.5 13v-3"/></svg>'); }
.navicon[data-icon="route"]    { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.5"><circle cx="4" cy="4" r="1.5"/><circle cx="12" cy="12" r="1.5"/><path d="M4 5.5v3.5a2 2 0 0 0 2 2h4a2 2 0 0 1 2 2"/></svg>'); }

.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg-dim);
}
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-full);
  font-weight: 600;
}

.nav-section-label {
  margin: 16px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.proj-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  flex-shrink: 0;
}

.sidebar-spacer { flex: 1; }

/* Timer mini */
.timer-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 8px 4px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px;
  overflow: visible;
  flex-shrink: 0;
}
.timer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-done);
  box-shadow: 0 0 0 0 rgba(76, 195, 138, .6);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 195, 138, .6); }
  70% { box-shadow: 0 0 0 8px rgba(76, 195, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0); }
}
.timer-info { flex: 1; min-width: 0; }
.timer-task {
  font-size: 12px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timer-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--c-done);
  font-variant-numeric: tabular-nums;
}
.timer-stop {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-elev-3);
  color: var(--fg-muted);
  font-size: 9px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, color .12s;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.timer-stop:hover { background: var(--c-blocked); color: var(--fg-bright); }

.userbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin: 0 4px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .12s;
}
.userbox:hover { background: var(--bg-hover); }
.userbox-info { flex: 1; min-width: 0; }
.userbox-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
}
.userbox-role {
  font-size: 11px;
  color: var(--fg-dim);
}
.userbox-menu {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.userbox-menu:hover { background: var(--bg-elev-2); color: var(--fg); }

/* ============ CONTENT ============ */
.content {
  padding: var(--content-pad-y) var(--content-pad-x);
  max-width: 1280px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 24px;
  flex-wrap: wrap;
}
.page-head h1 { margin-bottom: 4px; }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.page-sub {
  font-size: 13px;
  color: var(--fg-muted);
}
.page-sub b { color: var(--fg); font-weight: 600; }

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ BUTTONS ============ */
.btn, button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--bg-elev-2);
  color: var(--fg);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover, button:hover {
  background: var(--bg-elev-3);
  border-color: var(--fg-dim);
}
.btn.primary, button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn.primary:hover, button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.ghost, button.ghost {
  background: transparent;
  border-color: var(--line);
}
.btn.ghost:hover, button.ghost:hover {
  background: var(--bg-elev-1);
  border-color: var(--line-strong);
}
.btn.icon { padding: 6px 8px; min-width: 28px; justify-content: center; }
.btn.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: var(--c-blocked); border-color: var(--c-blocked); color: white; }

[data-icon] {
  display: inline-block;
  width: 13px;
  height: 13px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}
[data-icon="plus"]   { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"><path d="M8 3v10M3 8h10"/></svg>'); }
[data-icon="filter"] { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.5"><path d="M2 4h12l-4.5 5.5V13l-3 1V9.5L2 4z"/></svg>'); }

/* Segmented control */
.seg {
  display: inline-flex;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.seg-btn {
  padding: 4px 12px;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.seg-btn:hover { color: var(--fg); }
.seg-btn.active {
  background: var(--bg-elev-3);
  color: var(--fg-bright);
}
.seg.seg-sm .seg-btn { padding: 3px 9px; font-size: 11.5px; }

/* ============ CARDS ============ */
.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.card-head h3 { margin: 0; }
.link-more {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
}
.link-more:hover { color: var(--accent); }

/* ============ STATS GRID ============ */
.cards.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.card.stat {
  text-align: left;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin-bottom: 0;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, background .12s;
  position: relative;
  overflow: hidden;
}
.card.stat.clickable:hover {
  border-color: var(--line-strong);
  background: var(--bg-elev-2);
  transform: none;
}
.stat-label {
  font-size: 11.5px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 8px;
}
.stat .num {
  font-size: 34px;
  font-weight: 600;
  font-feature-settings: 'tnum';
  letter-spacing: -0.03em;
  color: var(--fg-bright);
  line-height: 1.1;
  margin-bottom: 6px;
}
.stat-delta {
  font-size: 11.5px;
  color: var(--fg-muted);
}
.stat-delta.up { color: var(--c-done); }
.stat-delta.up::before { content: '↗ '; }

/* ============ GRID2 ============ */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* ============ CHART MOCK ============ */
.chart-mock {
  height: 140px;
  padding: 8px 0;
  display: flex;
  align-items: flex-end;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  height: 100%;
}
.cbar {
  flex: 1;
  height: var(--h);
  background: linear-gradient(to top, var(--c-progress), transparent 110%);
  background-color: var(--accent-soft);
  border-radius: 3px 3px 0 0;
  position: relative;
  border: 1px solid var(--line);
  border-bottom: none;
  transition: background .15s;
}
.cbar:hover { background-color: var(--bg-elev-3); }
.cbar span {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}
.cbar.today { background: var(--accent); }

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.chart-legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.chart-legend .lg i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ============ DEADLINES / LIST ============ */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.list li:last-child { border-bottom: none; }

.deadlines .task-link { flex: 1; color: var(--fg); }
.deadlines .task-link:hover { color: var(--accent); }
.task-meta {
  font-size: 11.5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* Priorities */
.prio {
  display: inline-flex;
  width: 14px;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.prio-urgent { color: var(--p-urgent); }
.prio-high   { color: var(--p-high); }
.prio-med    { color: var(--p-med); }
.prio-low    { color: var(--p-low); }

.prio-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
}
.prio-pill.prio-urgent { background: rgba(240, 103, 112, .12); border-color: rgba(240, 103, 112, .3); color: var(--p-urgent); }
.prio-pill.prio-high { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); color: var(--p-high); }

/* ============ TIMELINE-DAY ============ */
.timeline-day { font-size: 12px; }
.td-hours {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  font-family: var(--font-mono);
  color: var(--fg-dim);
  font-size: 10.5px;
  margin-bottom: 4px;
  padding: 0 2px;
}
.td-hours span:nth-child(even) { opacity: 0.5; }
.td-track {
  height: 36px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
}
.td-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: var(--s);
  width: var(--w);
  background: var(--c);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: white;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  opacity: 0.85;
}
.td-block.running {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(124, 125, 240, .25);
  animation: pulse-block 2s infinite;
}
@keyframes pulse-block {
  0%, 100% { box-shadow: 0 0 0 2px rgba(124, 125, 240, .25); }
  50% { box-shadow: 0 0 0 4px rgba(124, 125, 240, .15); }
}

/* ============ MEETINGS ============ */
.meetings li {
  align-items: flex-start;
  padding: 10px 0;
}
.meet-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
  padding: 4px 0;
  background: var(--bg-elev-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.meet-date b {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-bright);
  font-variant-numeric: tabular-nums;
}
.meet-date span {
  font-size: 9.5px;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.meet-info { flex: 1; min-width: 0; }
.meet-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 2px;
}

/* ============ PROJECT LIST ============ */
.filters {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dirfilter, .filter-extras { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { background: var(--bg-elev-2); color: var(--fg); border-color: var(--line-strong); }
.chip.active {
  background: var(--bg-active);
  color: var(--fg-bright);
  border-color: var(--line-strong);
}
.chip-cnt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  padding: 0 4px;
  background: var(--bg-elev-2);
  border-radius: 3px;
}
.chip.active .chip-cnt { color: var(--fg); background: var(--bg-elev-3); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  display: inline-block;
}

.filterrow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.flabel {
  font-size: 11.5px;
  color: var(--fg-dim);
  font-weight: 500;
  white-space: nowrap;
  margin-right: 2px;
}

.filter-extras select {
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.proj-list { display: flex; flex-direction: column; gap: 1px; }
.projrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-bottom: none;
  text-decoration: none;
  color: var(--fg);
  transition: background .1s;
  font-size: 13px;
}
.projrow:first-child { border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); }
.projrow:last-child { border-bottom: 1px solid var(--line); border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-md); }
.projrow:hover { background: var(--bg-elev-2); color: var(--fg-bright); }
.projrow-prio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  padding: 3px 0;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
}
.projrow-prio.prio-urgent { color: var(--p-urgent); border-color: rgba(240,103,112,.25); }
.projrow-prio.prio-high { color: var(--p-high); border-color: rgba(245,158,11,.25); }
.projrow-prio.prio-med { color: var(--fg-muted); }
.projrow-prio.prio-low { color: var(--fg-dim); }

.projrow-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.projrow-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-bright);
  white-space: normal;
  word-break: break-word;
}
.projrow-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.dirtag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 500;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
}
.rstbadge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  color: var(--fg-muted);
}

.projrow-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prog {
  flex: 1;
  height: 4px;
  background: var(--bg-elev-3);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.prog span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width .3s;
}
.prog.mini { width: 80px; }
.prog-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  min-width: 30px;
  text-align: right;
}

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--bg); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar.sm { width: 18px; height: 18px; font-size: 9px; }
.avatar.avatar-self {
  background: var(--accent);
  color: white;
  width: 26px;
  height: 26px;
  font-size: 11px;
}
.avatar-more {
  background: var(--bg-elev-3) !important;
  color: var(--fg-muted) !important;
  font-size: 9px !important;
}

.projrow-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
}
.projrow-meta .prog { width: 70px; flex-shrink: 0; }
.projrow-meta .upd {
  font-size: 11.5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.projrow-arrow {
  color: var(--fg-dim);
  font-size: 16px;
  line-height: 1;
}

/* ============ PROJECT DETAIL ============ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.breadcrumb a { color: var(--fg-muted); }
.breadcrumb a:hover { color: var(--fg); }
.crumb-sep { color: var(--fg-dim); }
.crumb-current { color: var(--fg-bright); font-weight: 500; }

.project-head { margin-bottom: 20px; }
.project-meta {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.meta-item { display: inline-flex; align-items: center; gap: 5px; }

.project-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--fg-muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.tab:hover { color: var(--fg); }
.tab.active {
  color: var(--fg-bright);
  border-bottom-color: var(--accent);
}
.tab-cnt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  margin-left: 4px;
}

.grid-project {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.project-progress .prog-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.prog-big-num {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.prog-big-label {
  font-size: 12px;
  color: var(--fg-muted);
}
.prog-bar-big {
  height: 6px;
  background: var(--bg-elev-3);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 14px;
}
.prog-bar-big span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.prog-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.prog-breakdown div { text-align: center; }
.prog-breakdown b {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-bright);
  font-variant-numeric: tabular-nums;
}
.prog-breakdown span {
  font-size: 11px;
  color: var(--fg-muted);
}

.team-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.team-list li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.team-list li > div:last-child { display: flex; flex-direction: column; }
.team-list b { font-weight: 500; color: var(--fg); font-size: 13px; }

.hour-summary { text-align: center; padding: 4px 0; }
.hour-big {
  font-size: 38px;
  font-weight: 600;
  color: var(--fg-bright);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hour-big small { font-size: 14px; font-weight: 500; color: var(--fg-muted); margin-left: 2px; }
.hour-summary .prog { margin-top: 12px; }

.task-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.task-section-head h3 { margin: 0; font-size: 14px; }
.rowbtns { display: flex; gap: 8px; }

/* ============ TABLE ============ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 12.5px;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl th {
  font-size: 10.5px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  background: transparent;
}
.tbl tr:hover td { background: var(--bg-elev-2); }
.tbl .task-link { color: var(--fg-bright); font-weight: 500; }
.tbl .task-link:hover { color: var(--accent); }
.num-cell { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.due {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.due.over { color: var(--p-urgent); font-weight: 600; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  color: var(--fg-muted);
}
.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.badge.todo::before        { background: var(--c-todo); }
.badge.in_progress::before { background: var(--c-progress); }
.badge.done::before        { background: var(--c-done); }
.badge.blocked::before     { background: var(--c-blocked); }
.badge.todo        { color: var(--c-todo); }
.badge.in_progress { color: var(--c-progress); background: var(--c-progress-bg); border-color: rgba(91, 139, 246, .2); }
.badge.done        { color: var(--c-done);     background: var(--c-done-bg);     border-color: rgba(76, 195, 138, .2); }
.badge.blocked     { color: var(--c-blocked);  background: var(--c-blocked-bg);  border-color: rgba(240, 103, 112, .2); }
.badge.sm { padding: 0 5px; font-size: 10px; }
.badge.error { background: rgba(240, 103, 112, .12); color: var(--p-urgent); border-color: transparent; }

/* ============ TASK DETAIL ============ */
.task-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.task-main { min-width: 0; }
.task-head { margin-bottom: 18px; }
.task-head-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.task-id {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-muted);
  padding: 2px 7px;
  background: var(--bg-elev-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.task-head h1 { font-size: 24px; line-height: 1.3; }

.task-section-block {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.task-section-block:last-child { border-bottom: none; }
.task-section-block h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.md p { margin: 6px 0; font-size: 13.5px; line-height: 1.6; }
.md ul { margin-left: 20px; font-size: 13.5px; line-height: 1.8; }
.md code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 5px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 3px;
}

.tracker-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-done);
  box-shadow: 0 0 0 0 rgba(76, 195, 138, .6);
  animation: pulse 1.6s infinite;
}

.time-log { font-size: 13px; }
.time-summary { margin-bottom: 16px; }
.time-big {
  font-size: 30px;
  font-weight: 600;
  color: var(--fg-bright);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.time-big small { font-size: 13px; color: var(--fg-muted); margin-left: 3px; }
.time-summary .prog { margin-top: 8px; max-width: 320px; }

.time-entries { list-style: none; }
.time-entries li {
  display: grid;
  grid-template-columns: 110px 80px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.te-when { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.te-dur { font-family: var(--font-mono); color: var(--fg); }
.te-desc { color: var(--fg-muted); }

.meeting-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.meetitem {
  padding: 12px 14px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.meethdr {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.meethdr b { color: var(--fg-bright); font-weight: 600; }
.meetitem p { font-size: 12.5px; color: var(--fg-muted); line-height: 1.5; }

/* Files */
.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: background .12s, border-color .12s;
}
.file-item:hover {
  background: var(--bg-elev-2);
  border-color: var(--line-strong);
}
.file-ico {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--bg-elev-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--fg-bright);
}
.file-ico[data-ext="pdf"] { background: rgba(240, 103, 112, .15); color: var(--p-urgent); }
.file-ico[data-ext="sql"] { background: rgba(91, 139, 246, .15); color: var(--c-progress); }
.file-ico[data-ext="md"]  { background: rgba(76, 195, 138, .15); color: var(--c-done); }
.file-info { min-width: 0; }
.file-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta { font-size: 11px; color: var(--fg-muted); }

/* Task aside */
.task-aside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 24px; }
.task-aside-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.task-aside-card h4 {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.props { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 12.5px; }
.props dt { color: var(--fg-muted); }
.props dd { color: var(--fg); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.activity { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.activity li {
  display: flex;
  gap: 8px;
  font-size: 12px;
  align-items: flex-start;
}
.activity li > div:last-child b { font-weight: 600; color: var(--fg); }
.activity .muted { font-size: 11px; }

/* ============ KANBAN ============ */
.kboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: start;
}
.kboard.kboard5 { grid-template-columns: repeat(5, 1fr); }

.kcol {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
  min-height: 200px;
}
.kcol.meetcol {
  background: var(--c-meeting-bg);
  border-color: rgba(183, 148, 244, .2);
}

.kcolhdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.kcoltitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.kcolhdr .cnt {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  padding: 0 6px;
  background: var(--bg-elev-2);
  border-radius: var(--r-sm);
}

.kdrop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
}
.kdrop.over {
  outline: 1px dashed var(--accent);
  outline-offset: 1px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}

.jcard {
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  position: relative;
}
.jcard:hover {
  background: var(--bg-elev-3);
  border-color: var(--line-strong);
}
.jcard.dragging { opacity: .4; }

.jbar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}
.jbody {
  padding-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jtitle {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-bright);
  line-height: 1.4;
}
.jproj {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-muted);
}
.jtimer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--c-done);
  padding: 3px 7px;
  background: var(--c-done-bg);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  align-self: flex-start;
}
.jfoot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 2px;
}
.jkey {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}
.jprio { font-family: var(--font-mono); font-weight: 600; }
.jspace { flex: 1; }
.jdue {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-muted);
  padding: 1px 6px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.jdue.over { color: var(--p-urgent); background: rgba(240,103,112,.1); border-color: rgba(240,103,112,.25); }
.jdue.meetsoon { color: var(--c-meeting); background: var(--c-meeting-bg); border-color: rgba(183, 148, 244, .25); }

/* ============ PLANNER ============ */
.pweek {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pday {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pday.ptoday {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-elev-1) 60%);
}
.pdayhdr {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.pdaynum {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.pday.ptoday .pdaynum { color: var(--accent); }
.pdaytag {
  margin-left: auto;
  font-size: 9.5px;
  padding: 1px 6px;
  background: var(--accent);
  color: white;
  border-radius: var(--r-full);
  text-transform: none;
}

.pdrop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.pchip {
  background: var(--bg-elev-2);
  border-left: 3px solid var(--c-todo);
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 12px;
  cursor: grab;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.pchip:hover { background: var(--bg-elev-3); }
.pchip.in_progress { border-left-color: var(--c-progress); }
.pchip.done { border-left-color: var(--c-done); opacity: 0.7; }
.pchip.blocked { border-left-color: var(--c-blocked); }
.pchip.todo { border-left-color: var(--c-todo); }
.pchip.running {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px rgba(124, 125, 240, .15);
}
.pchip > span:first-of-type { display: inline-block; }
.pchip span:last-child {
  font-size: 10.5px;
  color: var(--fg-muted);
}

.pday-empty {
  font-size: 11px;
  color: var(--fg-dim);
  text-align: center;
  padding: 24px 0;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  margin: auto 0;
}

.pweek-summary { margin-top: 0; }

/* ============ CHECKLIST ============ */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  min-height: 32px;
}
.checklist-item:last-child { border-bottom: none; }
.cl-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-elev-2);
  color: var(--c-done);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.cl-checkbox.cl-checked {
  background: var(--c-done-bg, #0e2a1f);
  border-color: var(--c-done);
}
.cl-checkbox:hover { border-color: var(--accent); }
.cl-text {
  flex: 1;
  font-size: 13px;
  color: var(--fg);
  word-break: break-word;
}
.cl-striked {
  color: var(--fg-dim);
  text-decoration: line-through;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .grid-project { grid-template-columns: 1fr 1fr; }
  .grid-project .card:last-child { grid-column: span 2; }
  .task-layout { grid-template-columns: 1fr; }
  .task-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .task-aside-card { flex: 1; min-width: 240px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 64px; --content-pad-x: 20px; }
  .sidebar { padding: 12px 6px; }
  .logo-text, .qs-text, .qs-kbd, .nav-count, .nav-badge,
  .nav-primary a span:not(.navicon), .nav-projects a span:not(.proj-dot),
  .nav-section-label, .timer-info, .timer-stop, .userbox-info, .userbox-menu,
  .quick-search { display: none; }
  .quick-search { display: flex; justify-content: center; }
  .nav-primary a, .nav-projects a { justify-content: center; padding: 8px; }
  .proj-dot { width: 10px; height: 10px; }
  .timer-mini { justify-content: center; padding: 6px; }
  .userbox { justify-content: center; }
  .cards.stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .kboard.kboard5 { grid-template-columns: repeat(2, 1fr); }
  .pweek { grid-template-columns: repeat(2, 1fr); }
  .projrow-meta .upd { display: none; }
  .projrow-progress, .projrow-people { display: none; }
  .filters { flex-direction: column; align-items: stretch; }
  .filter-extras { width: 100%; }
}

@media (max-width: 600px) {
  /* NOTE: --sidebar-w and .sidebar{display:none} intentionally removed.
     Mobile drawer behaviour (fixed sidebar + hamburger toggle) is owned
     entirely by styles-shared.css @media(max-width:900px).
     Setting --sidebar-w:0px or display:none here broke the drawer. */
  :root { --content-pad-x: 16px; --content-pad-y: 16px; }
  /* Keep mobile-bar row in the grid; shared CSS sets grid-template-rows:56px 1fr */
  .mobile-bar { display: flex; }
  /* Ensure hamburger has a comfortable tap target */
  .hamburger { min-width: 44px; min-height: 44px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .cards.stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat .num { font-size: 26px; }
  .grid-project { grid-template-columns: 1fr; }
  .kboard.kboard5 { grid-template-columns: 1fr; }
  .pweek { grid-template-columns: 1fr; }
  .pday { min-height: auto; }
  h1 { font-size: 20px; }
  .task-head h1 { font-size: 20px; }

  /* Project list: stack title+tags on top, meta row below — prevents overlap at 390px */
  .projrow {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .projrow-main {
    width: 100%;
  }
  .projrow-meta {
    width: 100%;
    flex-wrap: wrap;
    white-space: normal;
    gap: 6px;
  }
  .projrow-arrow {
    margin-left: auto;
  }
}

/* Auth page (compat for /login /register) */
.authpage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.authcard {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.authcard h1 { font-size: 20px; }
.authcard input { width: 100%; }
.authcard button { width: 100%; justify-content: center; padding: 9px; }
input, select, textarea {
  font: inherit;
  padding: 7px 10px;
  background: var(--bg-elev-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.err {
  background: rgba(240,103,112,.12);
  border: 1px solid rgba(240,103,112,.3);
  color: var(--p-urgent);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
}
.ok {
  background: rgba(76,195,138,.12);
  border: 1px solid rgba(76,195,138,.3);
  color: var(--c-done);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg-elev-3);
  border: 2px solid var(--bg);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* ============================================================
   LIGHT MODE OVERRIDE
   ============================================================ */
[data-mode="light"] {
  --bg:               #fafafb;
  --bg-elev-1:        #ffffff;
  --bg-elev-2:        #f5f5f7;
  --bg-elev-3:        #ececef;
  --bg-sidebar:       #f5f5f7;
  --bg-hover:         #ececef;
  --bg-active:        #e3e3e8;

  --line:             #e8e8ec;
  --line-strong:      #d4d4da;

  --fg:               #1c1c20;
  --fg-muted:         #6b6b76;
  --fg-dim:           #95959e;
  --fg-bright:        #08080a;

  --accent:           #5b5cd6;
  --accent-hover:     #4a4bc2;
  --accent-soft:      #ecedfb;
  --accent-fg:        #ffffff;

  --c-todo:           #95959e;
  --c-progress:       #2563eb;
  --c-done:           #16a34a;
  --c-blocked:        #dc2626;
  --c-meeting:        #8b5cf6;

  --c-progress-bg:    #dbeafe;
  --c-done-bg:        #dcfce7;
  --c-blocked-bg:     #fee2e2;
  --c-meeting-bg:     #f3e8ff;

  --p-urgent:         #dc2626;
  --p-high:           #d97706;
  --p-med:            #6b6b76;
  --p-low:            #95959e;

  color-scheme: light;
}
[data-mode="light"] ::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid var(--bg);
}
[data-mode="light"] .timer-mini { box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
[data-mode="light"] .quick-search { box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
[data-mode="light"] .card,
[data-mode="light"] .task-aside-card,
[data-mode="light"] .file-item,
[data-mode="light"] .meetitem,
[data-mode="light"] .pday {
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
