/* ════════════════════════════════════════════════════
   DESIGN TOKENS — Dark Mode Defaults
   ════════════════════════════════════════════════════ */
:root {
  --bg: #0B0E14;
  --surface: #13171F;
  --surface-2: #0D1119;
  --surface-hover: #1A1F2C;
  --border: #1E2333;
  --border-strong: #2A3147;
  --text: #E8EDF8;
  --text-muted: #7A8CA8;
  --text-hint: #3D4D63;
  --primary: #2477E0;
  --primary-hover: #1A5FBF;
  --primary-alpha: rgba(36,119,224,0.1);
  --gold: #C9A84C;
  --gold-soft: #E8C97A;
  --gold-alpha: rgba(201,168,76,0.07);
  --green: #2ECC8A;
  --green-alpha: rgba(46,204,138,0.08);
  --danger: #FF4D4F;
  --danger-hover: #d9363e;
  --tbg: rgba(11,14,20,0.92);
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'Geist Mono', monospace;
  --font-display: 'DM Sans', -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --task-grid: 22px 1fr 140px 96px 90px;
  --transition: background-color 0.15s ease, border-color 0.15s ease, color 0.12s ease, opacity 0.12s ease;
  --sidebar-w: 204px;
  --sidebar-collapsed-w: 56px;

  /* Backward-compat aliases */
  --color-midnight: #0D1119;
  --color-cobalt: #1A5FBF;
  --color-ice: #7A8CA8;
  --surface-color: var(--surface);
  --border-color: var(--border);
  --bg-color: var(--bg);
  --text-main: var(--text);
  --primary-color: var(--primary);
  --color-gold-soft: #E8C97A;
  --color-royal: #3D4D63;
  --color-deep: #0D1119;
  --color-navy: #1A1F2C;
  --color-sapphire: #2477E0;
  --color-green: #2ECC8A;
  --color-danger: #FF4D4F;
  --color-danger-hover: #d9363e;
  --color-frost: #3D4D63;
  --color-white: #E8EDF8;
  --color-gold: #C9A84C;
}

/* ════════════════════════════════════════════════════
   LIGHT THEME TOKENS
   ════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F7;
  --surface-hover: #ECEEF3;
  --border: #E2E5ED;
  --border-strong: #C8CDD9;
  --text: #0F1520;
  --text-muted: #5C6880;
  --text-hint: #9DA8BC;
  --primary: #1E6FCC;
  --primary-hover: #1558A8;
  --primary-alpha: rgba(30,111,204,0.08);
  --gold: #B8903E;
  --gold-soft: #C9A84C;
  --gold-alpha: rgba(184,144,62,0.07);
  --green: #1DA86E;
  --green-alpha: rgba(29,168,110,0.08);
  --danger: #D93025;
  --danger-hover: #b91c1c;
  --tbg: rgba(247,248,250,0.92);
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-display: 'DM Sans', -apple-system, sans-serif;

  /* Backward-compat overrides */
  --color-midnight: #FFFFFF;
  --color-cobalt: #1E6FCC;
  --color-ice: #5C6880;
  --surface-color: #FFFFFF;
  --border-color: #E2E5ED;
  --bg-color: #F7F8FA;
  --text-main: #0F1520;
  --primary-color: #1E6FCC;
  --color-gold-soft: #C9A84C;
  --color-royal: #E2E5ED;
  --color-deep: #F1F3F7;
  --color-navy: #ECEEF3;
  --color-sapphire: #1E6FCC;
  --color-green: #1DA86E;
  --color-danger: #D93025;
  --color-danger-hover: #b91c1c;
  --color-frost: #9DA8BC;
  --color-white: #0F1520;
  --color-gold: #B8903E;
}

/* ════════════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════════════ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* ════════════════════════════════════════════════════
   BODY
   ════════════════════════════════════════════════════ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

/* ════════════════════════════════════════════════════
   MATERIAL SYMBOLS
   ════════════════════════════════════════════════════ */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100dvh;
  height: 100vh;
  z-index: 50;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Sidebar Brand ─────────────────────────────────── */
.sidebar-brand {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 9px;
}

.wordmark {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  padding: 0.3rem 0.9rem;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.wordmark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  display: block;
}

[data-theme="light"] .wordmark {
  border-color: var(--primary);
  border-radius: 999px;
}

[data-theme="light"] .wordmark-dot {
  display: none;
}

/* ── Sidebar Toggle Button ─────────────────────────── */
.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-hint);
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  margin-left: auto;
}

.sidebar-toggle-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-toggle-btn .material-symbols-outlined {
  font-size: 18px;
}

/* ── Sidebar Resize Handle ─────────────────────────── */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: ew-resize;
  z-index: 55;
  background: transparent;
  transition: background 0.15s;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.is-dragging {
  background: var(--primary);
  opacity: 0.5;
}

/* ════════════════════════════════════════════════════
   COLLAPSED SIDEBAR
   ════════════════════════════════════════════════════ */
.sidebar--collapsed {
  overflow: visible;
}

.sidebar--collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
  gap: 0;
}

.sidebar--collapsed .wordmark {
  display: none;
}

.sidebar--collapsed .sidebar-toggle-btn {
  margin-left: 0;
  width: 100%;
  height: 52px;
  border-radius: 0;
}

.sidebar--collapsed .nav-links {
  padding: 12px 6px;
}

.sidebar--collapsed .nav-links a {
  justify-content: center;
  padding: 0;
}

.sidebar--collapsed .nav-links a > span:not(.nav-icon) {
  display: none;
}

.sidebar--collapsed .nav-badge {
  display: none;
}

.sidebar--collapsed .sidebar-stats {
  display: none;
}

.sidebar--collapsed .sidebar-footer-links {
  padding: 10px 6px;
}

.sidebar--collapsed .sidebar-footer-link {
  justify-content: center;
  padding: 0;
}

.sidebar--collapsed .sidebar-footer-link > span:not(.material-symbols-outlined) {
  display: none;
}

/* ── Nav Links ─────────────────────────────────────── */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  padding: 12px 8px;
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 0 10px;
  height: 38px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-links a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-links a.active {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font-weight: 600;
}

[data-theme="light"] .nav-links a.active {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

.nav-icon {
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.nav-active-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse 1.8s ease-in-out infinite;
}

.nav-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ── Sidebar Footer Links ──────────────────────────── */
.sidebar-footer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0 10px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.sidebar-footer-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-footer-link .material-symbols-outlined {
  font-size: 15px;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ── Sidebar Stats ─────────────────────────────────── */
.sidebar-stats {
  padding: 16px 14px 10px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  flex-shrink: 0;
}

.sidebar-stats-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-date-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.sidebar-date-input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  color-scheme: dark;
  width: 0;
}

[data-theme="light"] .sidebar-date-input {
  color-scheme: light;
  background: #fff;
  border-color: var(--border);
}

.sidebar-date-sep {
  color: var(--text-muted);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.sidebar-apply-btn {
  width: 100%;
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

.sidebar-total-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  font-family: var(--font-mono);
}

.sidebar-client-totals {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-client-total-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-client-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-client-name {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-client-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* ════════════════════════════════════════════════════
   TOP BAR
   ════════════════════════════════════════════════════ */
.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 52px;
  z-index: 40;
  background: var(--tbg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 12px;
}

[data-theme="light"] .top-bar {
  background: var(--tbg);
}

.top-bar-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Search ─────────────────────────────────────────── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
  font-family: 'Material Symbols Outlined';
}

.search-input {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px 5px 30px;
  font-size: 13px;
  color: var(--text);
  width: 200px;
  font-family: var(--font-body);
  transition: var(--transition);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-hint);
  opacity: 0.5;
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--surface-hover);
}

[data-theme="light"] .search-input {
  background: #fff;
  border-color: var(--border);
}

/* ── Search clear button ────────────────────────────── */
.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.search-clear-btn .material-symbols-outlined {
  font-size: 16px;
}

.search-clear-btn:hover {
  color: var(--text);
}

.search-wrap:has(.search-clear-btn:not([hidden])) .search-input {
  padding-right: 2.25rem;
}

/* ── Quick-add hint ─────────────────────────────────── */
.quick-add-hint {
  font-size: 0.78rem;
  color: var(--text-hint);
  margin-bottom: 0.6rem;
  opacity: 0.65;
}

.quick-add-hint kbd {
  font-family: var(--font-mono);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.75rem;
}

/* ── Mobile Nav Btn (in top bar) ───────────────────── */
.mobile-nav-btn {
  background: transparent;
  border: none;
  padding: 0.4rem;
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.mobile-nav-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Theme Toggle ───────────────────────────────────── */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 30px;
  padding: 0 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.theme-toggle-btn .material-symbols-outlined {
  font-size: 14px;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.theme-toggle-label {
  font-size: 12px;
}


/* ════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ════════════════════════════════════════════════════ */
#app-root {
  margin-left: var(--sidebar-w);
  padding: 52px 0 5rem;
  min-height: 100vh;
  position: relative;
}

/* ════════════════════════════════════════════════════
   VIEWS
   ════════════════════════════════════════════════════ */
.view {
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  transform: translateY(5px);
  padding: 48px 44px 80px;
}

.view--active {
  opacity: 1;
  transform: translateY(0);
}

.view-hero {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 40px;
}

.view-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-family: var(--font-display);
}

/* ════════════════════════════════════════════════════
   GLOBAL BUTTONS
   ════════════════════════════════════════════════════ */
button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
  font-size: 13.5px;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  padding: 8px 18px;
}

.primary-btn:hover {
  background: var(--primary-hover);
}

.secondary-btn {
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 18px;
}

.secondary-btn:hover {
  background: var(--border);
  color: var(--text);
}

.danger-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 77, 79, 0.25);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
}

.danger-btn:hover {
  background: rgba(255, 77, 79, 0.08);
  border-color: var(--danger);
}

/* ════════════════════════════════════════════════════
   GLOBAL FORM ELEMENTS
   ════════════════════════════════════════════════════ */
input, textarea, select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
}

input::placeholder, textarea::placeholder {
  color: var(--text-hint);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

[data-theme="light"] input,
[data-theme="light"] textarea {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus {
  border-color: var(--primary);
}

input[type="date"] {
  color-scheme: dark;
}

[data-theme="light"] input[type="date"] {
  color-scheme: light;
}

/* ════════════════════════════════════════════════════
   TASK QUEUE / INBOX
   ════════════════════════════════════════════════════ */
#quick-add-area {
  margin-bottom: 32px;
}

#quick-add-input {
  border: none;
  border-bottom: 1.5px solid var(--border);
  border-radius: 0;
  padding: 10px 0;
  font-size: 1.05rem;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
}

#quick-add-input::placeholder {
  color: var(--text-hint);
  opacity: 0.7;
}

#quick-add-input:focus {
  border-bottom-color: var(--primary);
  background: transparent;
  outline: none;
}

/* Task table header */
.task-table-header {
  display: grid;
  grid-template-columns: var(--task-grid);
  padding: 10px 16px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.task-table-header > div {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-hint);
  padding: 0;
}

#task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

/* Task row */
.task-item {
  display: grid;
  grid-template-columns: var(--task-grid);
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.1s ease;
  position: relative;
}

.task-item:hover {
  background: var(--surface-hover);
}

.task-item.active-task {
  background: linear-gradient(90deg, var(--green-alpha) 0%, var(--surface) 60%);
}

[data-theme="light"] .task-item.active-task {
  background: linear-gradient(90deg, var(--green-alpha) 0%, var(--surface) 60%);
}

.task-item.dragging {
  opacity: 0.35;
}

.task-item.drag-over {
  border-top: 2px solid var(--primary);
  background: rgba(36, 119, 224, 0.06);
}

/* Grid cells */
.task-cell {
  padding: 14px 8px;
  min-width: 0;
  overflow: hidden;
}

.task-cell-drag {
  padding: 14px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-cell-actions {
  padding: 14px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.drag-handle {
  color: var(--text-hint);
  font-size: 11px;
  cursor: grab;
  opacity: 0.4;
  user-select: none;
  transition: opacity 0.15s;
  line-height: 1;
  letter-spacing: 3px;
}

.task-item:hover .drag-handle {
  opacity: 1;
  color: var(--text-muted);
}

.drag-handle:active {
  cursor: grabbing;
}

.task-name {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.task-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.task-desc-area {
  margin-top: 3px;
  min-height: 0;
}

.task-desc-text {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.create-desc-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-hint);
  font-size: 11.5px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
  white-space: nowrap;
}

.create-desc-btn:hover {
  color: var(--primary);
  background: var(--primary-alpha);
}

.task-item:hover .create-desc-btn {
  color: var(--text-muted);
}

.task-item:hover .create-desc-btn:hover {
  color: var(--primary);
  background: var(--primary-alpha);
}

.task-ts {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

.task-ts--null {
  color: var(--text-hint);
  font-style: italic;
}

.active-task-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}

.edit-task-btn, .delete-task-btn, .move-top-btn {
  background: none;
  border: none;
  color: var(--text-hint);
  opacity: 0.35;
  padding: 5px;
  font-size: 14px;
  line-height: 0;
  transition: opacity 0.15s, color 0.12s, background 0.12s;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.task-item:hover .edit-task-btn,
.task-item:hover .delete-task-btn,
.task-item:hover .move-top-btn {
  opacity: 1;
}

.delete-task-btn:hover {
  opacity: 1;
  color: var(--danger);
  background: rgba(255,77,79,0.08);
}

.edit-task-btn:hover {
  opacity: 1;
  color: var(--primary);
  background: var(--primary-alpha);
}

.move-top-btn:hover {
  opacity: 1;
  color: var(--gold);
  background: var(--gold-alpha);
}

/* ── Polish name AI button ── */
.polish-name-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-hint);
  padding: 2px 3px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}

.task-item:hover .polish-name-btn {
  display: inline-flex;
  align-items: center;
}

.polish-name-btn:hover {
  color: var(--primary);
  background: var(--primary-alpha);
}

#queue-empty-state {
  text-align: center;
  color: var(--text-hint);
  padding: 3rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

/* Batch Add */
#batch-add-area {
  margin-bottom: 1.5rem;
}

#batch-panel {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

[data-theme="light"] #batch-panel {
  background: #fff;
}

/* ── AI generate panel ── */
#toggle-ai-btn {
  margin-left: 0.5rem;
}

#ai-panel {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

[data-theme="light"] #ai-panel {
  background: #fff;
}

.ai-upload-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

#ai-panel {
  transition: border-color 0.15s ease, background 0.15s ease;
}

#ai-panel.ai-drag-over {
  border-color: var(--accent, #6e56cf);
  border-style: dashed;
  background: color-mix(in srgb, var(--accent, #6e56cf) 8%, var(--surface));
}

.ai-file-name {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.7rem;
}

.ai-field-label,
.ai-count-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

#ai-goal-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
}

.ai-controls-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.ai-count-label { margin: 0; }

.ai-count-input {
  width: 70px;
}

.ai-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ai-status--error {
  color: var(--danger, #e5484d);
}

#ai-preview {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.ai-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ai-linkbtn {
  background: none;
  border: none;
  color: var(--accent, #6e56cf);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}

#ai-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ai-preview-item {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  padding: 0.6rem 0.75rem;
}

.ai-preview-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.ai-preview-check input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.ai-preview-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ai-preview-name {
  font-weight: 600;
  color: var(--text);
}

.ai-preview-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ai-preview-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════
   CALENDAR FILTERS
   ════════════════════════════════════════════════════ */
.calendar-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-group label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.calendar-group input[type="date"],
.calendar-group select {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  width: auto;
  cursor: pointer;
}

[data-theme="light"] .calendar-group input[type="date"],
[data-theme="light"] .calendar-group select {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

/* ════════════════════════════════════════════════════
   HISTORY — CALENDAR VIEW
   ════════════════════════════════════════════════════ */
.history-mode-toggle {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.history-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.history-mode-btn:hover {
  color: var(--text);
}

.history-mode-btn.active {
  background: var(--color-sapphire);
  color: #fff;
}

.cal-wrap {
  margin-bottom: 2rem;
}

.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cal-nav-btn {
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
}

.cal-month-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  min-width: 10rem;
}

.cal-today-btn {
  margin-left: auto;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.cal-dow-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 0.25rem;
}

.cal-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  cursor: pointer;
  background: var(--surface);
  transition: outline-color 0.15s;
}

.cal-cell:hover {
  outline: 2px solid var(--color-sapphire);
}

.cal-cell--pad {
  border: none;
  background: transparent;
  cursor: default;
}

.cal-cell--pad:hover {
  outline: none;
}

.cal-cell--today {
  outline: 2px solid var(--color-gold);
}

.cal-cell--selected {
  outline: 2px solid var(--color-sapphire);
  outline-offset: 1px;
}

.cal-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.cal-day-hours {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ════════════════════════════════════════════════════
   HISTORY
   ════════════════════════════════════════════════════ */
#history-summary {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 28px;
  color: var(--text);
  background: var(--surface);
  padding: 22px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0;
}

[data-theme="light"] #history-summary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.session-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.12s;
}

.session-row:hover {
  border-color: var(--border-strong);
}

/* ── Active / in-progress session row ──────────────── */
.session-row--active {
  border-color: var(--primary);
  background: rgba(36, 119, 224, 0.04);
}

.session-row--active:hover {
  background: rgba(36, 119, 224, 0.08);
}

[data-theme="light"] .session-row--active {
  background: rgba(0, 71, 255, 0.03);
  border-color: var(--primary);
}

/* ── Session header layout ─────────────────────────── */
.session-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.session-header:hover {
  background: var(--surface-hover);
}

[data-theme="light"] .session-header:hover {
  background: #f7f3f2;
}

.session-header-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.session-metrics {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* ── Status icons ──────────────────────────────────── */
.session-status-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  display: block;
  padding-top: 2px;
}

.session-status-icon--done {
  color: var(--green);
}

.session-status-icon-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.session-status-icon--active {
  color: var(--primary);
}

.session-active-pulse {
  position: absolute;
  top: 0;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--surface);
  animation: session-pulse 1.5s ease-in-out infinite;
}

.session-row--active .session-active-pulse {
  border-color: var(--bg);
}

@keyframes session-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ── Session info text ─────────────────────────────── */
.session-task-name {
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.session-time-val {
  color: var(--gold);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  white-space: nowrap;
}

.session-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.25rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.session-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}

.meta-completed {
  color: var(--green);
}

.meta-inprogress {
  color: var(--primary);
  font-weight: 600;
}

/* ── History action buttons ────────────────────────── */
.history-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.history-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.history-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border);
}

.history-icon-btn--danger {
  color: var(--danger);
}

.history-icon-btn--danger:hover {
  background: rgba(255, 77, 79, 0.08);
  border-color: rgba(255, 77, 79, 0.3);
  color: var(--danger);
}

.history-icon-btn .material-symbols-outlined {
  font-size: 18px;
}

.stop-session-btn {
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stop-session-btn .material-symbols-outlined {
  font-size: 16px;
}

/* ── Expand toggle ─────────────────────────────────── */
.expand-toggle {
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
  font-family: 'Material Symbols Outlined';
}

.expand-toggle:hover {
  color: var(--text);
}

/* ── Interruption log ──────────────────────────────── */
.interruption-log {
  padding: 1rem 1.5rem;
  background: var(--surface-hover);
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.interruption-row {
  padding: 0.35rem 0;
  color: var(--text-hint);
}

.int-time {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.5rem;
}

.view-badge {
  background: var(--surface-hover);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

[data-theme="light"] .view-badge {
  background: rgba(0, 71, 255, 0.08);
  color: #0047FF;
}

#history-empty-state {
  text-align: center;
  color: var(--text-hint);
  padding: 3rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

/* ════════════════════════════════════════════════════
   DASHBOARD / ANALYTICS
   ════════════════════════════════════════════════════ */
#kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 24px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-hint);
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.kpi-value {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  letter-spacing: -0.04em;
  line-height: 1;
}

#dash-val-streak {
  color: var(--gold);
}

[data-theme="light"] .kpi-value {
  color: var(--text);
}

/* Streak Hero */
.streak-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  margin-bottom: 28px;
  background: var(--gold-alpha);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: var(--radius-lg);
}

.streak-hero-value {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--gold-soft);
  letter-spacing: -0.05em;
  line-height: 1;
  font-family: var(--font-mono);
}

.streak-hero-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gold);
}

/* KPI variants */
.kpi-card--primary {
  grid-column: span 2;
}

.kpi-card--primary .kpi-value {
  font-size: 3.2rem;
}

.kpi-substats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.kpi-substat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.kpi-substat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-hint);
}

.kpi-substat span:last-child {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-substat-accent {
  color: var(--gold-soft) !important;
}

.kpi-substat-divider {
  color: var(--border);
  font-size: 1rem;
  align-self: center;
  padding-bottom: 0.25rem;
}

.kpi-card--insight {
  border-color: rgba(201, 168, 76, 0.35);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.06) 0%, var(--surface) 100%);
}

.kpi-card--insight .kpi-label {
  color: var(--gold);
}

.kpi-card--insight .kpi-value {
  font-size: 1.4rem;
  color: var(--gold-soft);
}

/* Quality bar */
.quality-bar-wrap {
  margin-top: 0.75rem;
  height: 4px;
  background: var(--surface-hover);
  border-radius: 2px;
  overflow: hidden;
}

.quality-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease, background 0.5s ease;
}

/* Charts */
.chart-card {
  border: 1px solid var(--border);
  padding: 1.5rem 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  background: var(--surface);
}

[data-theme="light"] .chart-card {
  background: #fff;
  border-color: var(--border);
}

.chart-card h3 {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

[data-theme="light"] .chart-card h3 {
  color: var(--text);
}

.chart-subtitle {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.chart-card--wide {
  grid-column: 1 / -1;
}

/* Heatmap */
.heatmap-container {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 40px repeat(24, 26px);
  grid-template-rows: 20px repeat(7, 22px);
  gap: 2px;
  min-width: max-content;
}

.heatmap-corner { }

.heatmap-hour-label {
  font-size: 0.6rem;
  color: var(--text-hint);
  text-align: center;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2px;
  white-space: nowrap;
}

.heatmap-day-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
}

.heatmap-cell {
  border-radius: 3px;
  cursor: default;
  transition: opacity 0.15s;
}

.heatmap-cell:hover {
  opacity: 1 !important;
  outline: 1px solid var(--primary);
}

.heatmap-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.heatmap-card-header h3 {
  margin: 0;
}

.heatmap-view-tabs {
  display: flex;
  gap: 0.2rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  flex-shrink: 0;
}

.heatmap-view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.28rem 0.65rem;
  border-radius: calc(var(--radius-sm) - 1px);
  cursor: pointer;
  transition: var(--transition);
}

.heatmap-view-btn:hover {
  color: var(--text);
}

.heatmap-view-btn.active {
  background: var(--primary);
  color: #fff;
}

[data-theme="light"] .heatmap-view-btn.active {
  color: #fff;
}

.heatmap-strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0.25rem 0 0.5rem;
}

.heatmap-strip-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.55rem 0.5rem;
  border-radius: 4px;
  min-width: 58px;
  cursor: default;
  transition: opacity 0.15s;
}

.heatmap-strip-cell--lg {
  min-width: 96px;
}

.heatmap-strip-cell:hover {
  opacity: 1 !important;
  outline: 1px solid var(--primary);
}

.heatmap-strip-label {
  font-size: 0.63rem;
  color: var(--text-hint);
  text-align: center;
  white-space: nowrap;
}

.heatmap-strip-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

/* Export buttons */
.export-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.export-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
}

.export-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.export-btn--pdf {
  border-color: var(--primary);
  color: var(--primary);
}

.export-btn--pdf:hover {
  background: var(--primary);
  color: #fff;
}

[data-theme="light"] .export-btn {
  background: #fff;
  border-color: var(--border);
  color: #555;
}

[data-theme="light"] .export-btn:hover {
  background: #f7f3f2;
}

/* Daily goal input */
.dash-goal-group input {
  width: 72px;
  padding: 0.4rem 0.5rem;
  font-size: 0.88rem;
  text-align: center;
}

/* ════════════════════════════════════════════════════
   TIMER
   ════════════════════════════════════════════════════ */
#view-timer {
  max-width: none;
  min-height: calc(100dvh - 52px);
}

#timer-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timer-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  transition: var(--transition);
}

.timer-card--running {
  border-color: var(--primary);
}

.timer-card--paused {
  border-color: var(--gold-soft);
}

[data-theme="light"] .timer-card {
  background: #fff;
  border-color: var(--border);
}

[data-theme="light"] .timer-card--running {
  border-color: var(--primary);
}

[data-theme="light"] .timer-card--paused {
  border-color: var(--gold);
}

.timer-card-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
}

.timer-card-close:hover {
  opacity: 1;
  background: rgba(255, 77, 79, 0.12);
  border-color: var(--danger);
  color: var(--danger);
}

.timer-card-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timer-card-paused-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-bottom: -0.5rem;
}

.timer-card-display {
  font-size: 6.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-family: var(--font-mono);
}

.timer-card--pending .timer-card-display {
  color: var(--border);
}

.timer-card--paused .timer-card-display {
  color: var(--gold-soft);
}

[data-theme="light"] .timer-card-display {
  color: var(--gold);
}

.timer-card-controls {
  display: flex;
  gap: 1rem;
}

.timer-btn {
  padding: 0.65rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.resume-btn {
  background: var(--primary-hover);
}

.resume-btn:hover {
  background: var(--primary);
}

.done-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.done-btn:hover {
  background: var(--surface);
  color: var(--text);
}

[data-theme="light"] .done-btn {
  background: #f7f3f2;
  border-color: var(--border);
  color: #555;
}

#timer-empty-state {
  text-align: center;
  color: var(--text-hint);
  padding: 4rem 3rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 2rem;
  opacity: 0.7;
}

/* Accumulated Focus */
.accumulated-focus {
  background: linear-gradient(135deg, rgba(46, 204, 138, 0.08) 0%, rgba(36, 119, 224, 0.08) 100%);
  border: 1px solid rgba(46, 204, 138, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

[data-theme="light"] .accumulated-focus {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.05) 0%, rgba(0, 71, 255, 0.04) 100%);
  border-color: rgba(0, 200, 83, 0.3);
}

.accumulated-focus-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.35rem;
}

[data-theme="light"] .accumulated-focus-label {
  color: #1a8a5a;
}

.accumulated-focus-time {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}

[data-theme="light"] .accumulated-focus-time {
  color: #1a8a5a;
}

.accumulated-focus-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timer-view-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.25rem;
}

.timer-kbd-help-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
  flex-shrink: 0;
}

.timer-kbd-help-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  color: var(--text);
}

.timer-kbd-toast {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(36, 119, 224, 0.88);
  color: #fff;
  padding: 0.3rem 1.1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

.timer-kbd-toast--visible {
  opacity: 1;
}

/* ════════════════════════════════════════════════════
   CLIENTS VIEW
   ════════════════════════════════════════════════════ */
.clients-view-header {
  margin-bottom: 24px;
}

.clients-view-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  font-family: var(--font-display);
}

.clients-view-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

.clients-view-add-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.clients-add-heading {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-hint);
  margin-bottom: 16px;
}

.clients-add-input {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border);
  border-radius: 0;
  padding: 8px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-display);
  width: 100%;
  max-width: 440px;
}

.clients-add-input:focus {
  border-bottom-color: var(--primary);
  outline: none;
}

.clients-add-submit {
  margin-top: 16px;
}

.clients-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.5rem;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
  outline: none;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.selected,
.color-swatch--selected {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
  transform: scale(1.1);
}

[data-theme="light"] .color-swatch.selected,
[data-theme="light"] .color-swatch--selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0047FF;
}

.clients-view-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.client-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.client-list-item:hover {
  border-color: var(--border-strong);
}

.client-list-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.client-list-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-display);
}

.client-list-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.client-list-item:hover .client-list-actions {
  opacity: 1;
}

.client-rename-btn,
.client-delete-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.client-delete-btn:hover {
  background: rgba(255, 77, 79, 0.08);
  color: var(--danger);
  border-color: var(--danger);
}

.client-rename-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.clients-empty {
  text-align: center;
  color: var(--text-hint);
  padding: 2rem;
  font-size: 0.9rem;
}

/* ════════════════════════════════════════════════════
   TRASH VIEW
   ════════════════════════════════════════════════════ */
.trash-section {
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.trash-section-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.trash-icon {
  font-size: 1.1rem;
}

.trash-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.trash-section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trash-section--sessions {
  border-color: var(--primary);
}

.trash-sessions-header {
  background: linear-gradient(90deg, rgba(36, 119, 224, 0.06) 0%, var(--surface) 100%);
  border-bottom-color: rgba(36, 119, 224, 0.3);
}

.trash-section--danger {
  border-color: rgba(255, 77, 79, 0.18);
  background: rgba(255, 77, 79, 0.02);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trash-danger-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trash-danger-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 560px;
}

.trash-item {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 1rem;
  transition: background 0.15s;
}

.trash-item:last-child {
  border-bottom: none;
}

.trash-item:hover {
  background: var(--surface-hover);
}

.trash-item-info {
  flex: 1;
  min-width: 0;
}

.trash-item-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trash-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.trash-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.trash-restore-btn {
  background: var(--surface-hover);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.trash-restore-btn:hover {
  background: var(--primary);
  color: #fff;
}

.trash-perm-btn {
  background: transparent;
  border: 1px solid rgba(255, 77, 79, 0.2);
  color: var(--danger);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.trash-perm-btn:hover {
  background: rgba(255, 77, 79, 0.08);
  border-color: var(--danger);
}

[data-theme="light"] .trash-item {
  background: #fff;
}

[data-theme="light"] .trash-section-header {
  background: #f7f3f2;
}

[data-theme="light"] .trash-tasks-header {
  background: #f7f3f2;
}

[data-theme="light"] .trash-item:hover {
  background: #f7f3f2;
}

#trash-empty-state,
#deleted-sessions-empty-state {
  text-align: center;
  color: var(--text-hint);
  padding: 2rem;
  font-size: 0.88rem;
}

/* ════════════════════════════════════════════════════
   MODALS
   ════════════════════════════════════════════════════ */
[id$="modal"]:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

[id$="backdrop"] {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 15, 0.85);
}

[id$="card"] {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] [id$="card"] {
  background: #fff;
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

[id$="card"] h2 {
  margin-bottom: 1.5rem;
  font-weight: 700;
  color: var(--text);
  font-size: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.modal-actions button {
  flex: 1;
}

/* Keyboard shortcuts modal */
.shortcuts-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5600;
}

.shortcuts-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 15, 0.88);
}

.shortcuts-modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  width: 90%;
  max-width: 400px;
  z-index: 1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .shortcuts-modal-card {
  background: #fff;
  border-color: var(--primary);
}

.shortcuts-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.shortcut-row dt {
  flex-shrink: 0;
  width: 4.5rem;
  display: flex;
  justify-content: flex-end;
}

.shortcut-row dd {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

[data-theme="light"] .shortcut-row dd {
  color: #555;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.2em 0.55em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 2rem;
  line-height: 1.4;
}

[data-theme="light"] kbd {
  background: #f0f0f0;
  border-color: #ccc;
  color: #333;
}

.shortcuts-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Typed confirm modal */
.typed-confirm-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255, 77, 79, 0.3);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.typed-confirm-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.typed-confirm-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.typed-confirm-instruction {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-align: left;
  font-weight: 500;
}

.typed-confirm-input {
  width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.typed-confirm-input:focus {
  border-color: rgba(255, 77, 79, 0.55);
}

.confirm-ok-danger {
  background: var(--danger) !important;
}

.confirm-ok-danger:hover {
  background: var(--danger-hover) !important;
}

.typed-confirm-ok-btn {
  background: var(--danger);
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.typed-confirm-ok-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.typed-confirm-ok-btn:not(:disabled):hover {
  background: var(--danger-hover);
}

/* ════════════════════════════════════════════════════
   ACTIVE TIMER BANNER
   ════════════════════════════════════════════════════ */
#active-timer-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  margin-bottom: 1.5rem;
}

[data-theme="light"] #active-timer-banner {
  background: rgba(0, 71, 255, 0.04);
  border-color: var(--primary);
}

.banner-state {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 80px;
}

.banner-task {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.banner-time {
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 90px;
  text-align: right;
  font-family: var(--font-mono);
}

.banner-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.banner-btn:hover {
  background: var(--primary-hover);
}

/* ════════════════════════════════════════════════════
   APP GUIDE
   ════════════════════════════════════════════════════ */
.app-guide-wrap {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 4500;
}

.app-guide-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(36, 119, 224, 0.4);
  transition: var(--transition);
}

.app-guide-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.08);
}

/* Help modal — full overlay */
#app-guide-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5800;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 15, 0.88);
  backdrop-filter: blur(4px);
}

[data-theme="light"] .help-modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.help-modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

[data-theme="light"] .help-modal-card {
  background: #fff;
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.help-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.help-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.help-modal-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.help-modal-close .material-symbols-outlined {
  font-size: 20px;
}

.help-modal-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.help-shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.help-shortcut-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.help-shortcut-row kbd {
  font-family: var(--font-mono);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.8rem;
  color: var(--text);
  min-width: 56px;
  text-align: center;
  flex-shrink: 0;
}

.app-guide-heading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.app-guide-section {
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.app-guide-section--last {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.app-guide-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.app-guide-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.app-guide-section p + p {
  margin-top: 0.4rem;
}

.app-guide-section strong {
  color: var(--text);
  font-weight: 600;
}

.app-guide-keys {
  margin-top: 0.4rem;
  color: var(--text-hint);
}

/* ════════════════════════════════════════════════════
   CHECK-INS — SIDEBAR
   ════════════════════════════════════════════════════ */
.sidebar-checkin {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.sidebar-checkin-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.checkin-quick-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 19px;
  flex-shrink: 0;
  cursor: pointer;
}

.checkin-quick-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.checkin-quick-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: var(--transition);
}

.checkin-quick-toggle-slider::before {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.checkin-quick-toggle input:checked + .checkin-quick-toggle-slider {
  background: rgba(46, 204, 138, 0.2);
  border-color: rgba(46, 204, 138, 0.4);
}

.checkin-quick-toggle input:checked + .checkin-quick-toggle-slider::before {
  left: calc(100% - 15px);
  background: var(--green);
}

.checkin-timer-display {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
}

.checkin-settings-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.checkin-settings-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--primary);
}

.checkin-enable-banner {
  margin-top: 0.6rem;
  background: rgba(36, 119, 224, 0.08);
  border: 1px solid rgba(36, 119, 224, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.checkin-enable-banner p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.checkin-banner-btns {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.checkin-banner-btns .primary-btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
}

.checkin-dismiss-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkin-dismiss-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.checkin-number-input {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}

[data-theme="light"] .checkin-number-input {
  background: #fff;
}

/* ════════════════════════════════════════════════════
   CHECK-IN MODAL
   ════════════════════════════════════════════════════ */
.checkin-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  background: rgba(4, 9, 15, 0.85);
  backdrop-filter: blur(10px);
}

.checkin-modal-card {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  max-width: 380px;
  text-align: center;
  animation: checkin-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .checkin-modal-card {
  background: #fff;
}

.checkin-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.checkin-modal-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.checkin-grace-countdown {
  font-size: 3.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-soft);
  margin: 0.5rem 0 0.25rem;
  line-height: 1;
}

.checkin-modal-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.checkin-continue-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
}

/* ════════════════════════════════════════════════════
   CHECK-IN SETTINGS MODAL
   ════════════════════════════════════════════════════ */
.checkin-settings-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.checkin-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 15, 0.88);
}

.checkin-settings-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

[data-theme="light"] .checkin-settings-card {
  background: #fff;
}

.checkin-settings-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: var(--text);
}

.checkin-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.checkin-checkbox {
  width: auto;
  accent-color: var(--primary);
  cursor: pointer;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.checkin-toggle-label {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.checkin-notif-status {
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  display: none;
}

.checkin-notif-status:not(:empty) {
  display: block;
}

.checkin-notif-status[data-state="ok"]   { background: rgba(46, 204, 138, 0.1); color: var(--green); }
.checkin-notif-status[data-state="warn"] { background: rgba(232, 201, 122, 0.1); color: var(--gold-soft); }
.checkin-notif-status[data-state="idle"] { background: var(--surface-hover); color: var(--text-muted); }

.checkin-field {
  margin-bottom: 1.25rem;
}

.checkin-field-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.checkin-hms-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.checkin-hms-unit {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
}

.checkin-hms-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════
   CLIENT TAGGING SYSTEM
   ════════════════════════════════════════════════════ */
.client-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  line-height: 1.6;
}

.task-pill-row {
  margin-top: 0.2rem;
}

.client-select-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.client-select-input {
  flex: 1;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  width: auto;
}

.client-select-input:focus {
  outline: none;
  border-color: var(--primary);
}

[data-theme="light"] .client-select-input {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.client-manage-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  transition: var(--transition);
}

/* ════════════════════════════════════════════════════
   CLIENTS MANAGEMENT MODAL
   ════════════════════════════════════════════════════ */
.clients-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5500;
}

.clients-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 15, 0.88);
}

.clients-modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .clients-modal-card {
  background: #fff;
}

.clients-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.clients-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  min-height: 2rem;
}

.clients-add-section {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.client-rename-input {
  flex: 1;
  padding: 0.15rem 0.4rem;
  font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  width: auto;
  min-width: 0;
}

[data-theme="light"] .client-rename-input {
  background: #fff;
  color: var(--text);
}

/* ════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ════════════════════════════════════════════════════
   SIDEBAR OVERLAY
   ════════════════════════════════════════════════════ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 15, 0.6);
  z-index: 49;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .sidebar-overlay {
  background: rgba(0, 0, 0, 0.4);
}

/* ════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════ */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.4); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 138, 0.6); }
  70%       { box-shadow: 0 0 0 7px rgba(46, 204, 138, 0); }
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes checkin-pop {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ════════════════════════════════════════════════════
   RESPONSIVE / MOBILE
   ════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .top-bar {
    left: 0;
  }

  #app-root {
    margin-left: 0;
    padding: 52px 0 3rem;
  }

  .view {
    padding: 24px 16px 48px;
  }

  .mobile-nav-btn {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar-overlay--visible {
    opacity: 1;
    pointer-events: auto;
  }

  #kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-card--primary {
    grid-column: span 2;
  }

  .timer-card-display {
    font-size: 3.75rem;
  }
}

@media (max-width: 480px) {
  #kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card--primary {
    grid-column: span 1;
  }

  .timer-card-display {
    font-size: 3rem;
  }
}

/* ════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════ */

/* Hide print header on screen */
.dash-print-header { display: none; }

@media print {
  @page {
    margin: 1.5cm 2cm;
    size: A4 portrait;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #fff !important;
    color: #111 !important;
  }

  /* ── Hide everything except the dashboard ── */
  .sidebar,
  .sidebar-overlay,
  .top-bar,
  .export-actions,
  .calendar-filters,
  .streak-hero,
  .view-hero,
  #active-timer-banner,
  #view-queue,
  #view-history,
  #view-timer,
  #view-trash,
  #view-clients,
  #interruption-modal,
  #edit-task-modal,
  #confirm-modal,
  #typed-confirm-modal,
  #checkin-modal,
  #checkin-settings-modal,
  #shortcuts-modal,
  .help-modal-overlay,
  .settings-modal-overlay,
  #onboarding-modal,
  .heatmap-view-tabs,
  #heatmap-container,
  #dash-empty-state {
    display: none !important;
  }

  #app-root {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  #view-dashboard {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    padding: 0 !important;
  }

  #view-dashboard::before,
  #view-dashboard::after { content: none; display: none; }

  /* ── Print header ── */
  .dash-print-header {
    display: block !important;
    border-bottom: 2px solid #2477E0;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
  }

.dash-print-meta {
    font-size: 0.78rem;
    color: #666;
  }

  /* ── KPI Grid ── */
  #kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.55rem !important;
    margin-bottom: 1.5rem !important;
  }

  .kpi-card {
    background: #f5f7fa !important;
    border: 1px solid #d0d7de !important;
    border-radius: 6px !important;
    padding: 0.7rem 0.9rem !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .kpi-card--primary {
    grid-column: span 2 !important;
  }

  .kpi-label {
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    color: #555 !important;
    margin-bottom: 0.15rem !important;
  }

  .kpi-value {
    font-size: 1.55rem !important;
    font-weight: 700 !important;
    color: #111 !important;
  }

  .kpi-substats {
    font-size: 0.72rem !important;
    color: #555 !important;
    margin-top: 0.2rem !important;
  }

  .kpi-substat-accent { color: #b45309 !important; }

  .quality-bar-wrap {
    background: #e5e7eb !important;
    height: 4px !important;
    border-radius: 2px !important;
    margin-top: 0.4rem !important;
  }

  .quality-bar {
    background: #2477E0 !important;
    height: 4px !important;
    border-radius: 2px !important;
  }

  /* ── Charts ── */
  #charts-area {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.9rem !important;
  }

  .chart-card {
    background: #fafafa !important;
    border: 1px solid #d0d7de !important;
    border-radius: 6px !important;
    padding: 0.85rem !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .chart-card--wide {
    grid-column: span 2 !important;
  }

  .chart-card h3 {
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    color: #555 !important;
    margin-bottom: 0.5rem !important;
  }

  .canvas-wrapper {
    position: static !important;
    height: auto !important;
  }

  canvas {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ════════════════════════════════════════════════════
   SETTINGS MODAL
   ════════════════════════════════════════════════════ */
.settings-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6000;
}

.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 15, 0.88);
  backdrop-filter: blur(4px);
}

[data-theme="light"] .settings-modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.settings-modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

[data-theme="light"] .settings-modal-card {
  background: #fff;
}

.settings-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: var(--text);
}

.settings-section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.settings-section--last {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.settings-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.settings-theme-row {
  display: flex;
  gap: 0.75rem;
}

.settings-radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
  flex: 1;
  justify-content: center;
  user-select: none;
}

.settings-radio-label input {
  display: none;
}

.settings-radio-label:has(input:checked) {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(36, 119, 224, 0.1);
}

[data-theme="light"] .settings-radio-label:has(input:checked) {
  background: rgba(0, 71, 255, 0.07);
}

.settings-radio-label .material-symbols-outlined {
  font-size: 18px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.settings-toggle-label {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.settings-toggle-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.settings-field-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.settings-field-row {
  display: flex;
  flex-direction: column;
}

/* ════════════════════════════════════════════════════
   ONBOARDING WIZARD
   ════════════════════════════════════════════════════ */
.onboard-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 9, 15, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 7000;
}

.onboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem 2rem;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: checkin-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .onboard-card {
  background: #fff;
}

.onboard-logo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.onboard-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.onboard-body {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.onboard-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.onboard-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, width 0.2s, border-radius 0.2s;
}

.onboard-dot--active {
  background: var(--primary);
  width: 18px;
  border-radius: 3px;
}

.onboard-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ════════════════════════════════════════════════════
   ENHANCED EMPTY STATES
   ════════════════════════════════════════════════════ */
.empty-state-block {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

.empty-state-icon {
  font-size: 2.5rem;
  color: var(--border);
  display: block;
  margin-bottom: 1rem;
  font-family: 'Material Symbols Outlined';
  line-height: 1;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.empty-state-sub {
  font-size: 0.88rem;
  color: var(--text-hint);
  line-height: 1.55;
}

.empty-state-sub kbd {
  font-family: var(--font-mono);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
