/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

input.no-spinner::-webkit-outer-spin-button,
input.no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.no-spinner[type=number] { -moz-appearance: textfield; }

/* ===== TOKENS ===== */
:root {
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 60px;

  /* Т-Банк palette */
  --yellow:        #FFDD2D;
  --yellow-hover:  #F5D416;
  --yellow-light:  rgba(255, 221, 45, .14);
  --yellow-medium: rgba(255, 221, 45, .28);

  --bg:        #F6F7F8;
  --surface:   #FFFFFF;
  --surface-2: #F0F1F3;
  --surface-3: #E8E9EC;

  --border:       #E0E1E6;
  --border-focus: #1A1A1A;

  --text-primary:   #1A1A1A;
  --text-secondary: #8C8C96;
  --text-tertiary:  #C0C0C8;

  --success: #00B956;
  --success-bg: rgba(0, 185, 86, .12);
  --danger:  #F2383A;
  --danger-bg: rgba(242, 56, 58, .10);
  --warning: #FF8C00;

  /* Aliases for calc/episode */
  --accent:       var(--yellow);
  --accent-hover: var(--yellow-hover);
  --on-accent:    #1A1A1A;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.08), 0 16px 48px rgba(0,0,0,.10);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Arial", sans-serif;
  --transition: .15s ease;

  /* Переменные для тёмной темы */
  --surface-stripe:  rgba(0,0,0,.025);
  --overlay-bg:      rgba(0,0,0,.4);
  --tl-input-bg:     rgba(0,0,0,.25);
  --color-dot-ring:  rgba(0,0,0,.35);

  /* Таблица «Часы функционала» */
  --fh-header-bg:    #f8f9fa;
  --fh-today-bg:     #e8f0fe;
  --fh-today-hover:  #d2e3fc;
  --fh-today-color:  #1a73e8;
  --fh-weekend-bg:   #f8f9fa;
  --fh-border:       #c0c0c0;
  --fh-edit-hover:   #e8f0fe;
}

/* ===== ТЁМНАЯ ТЕМА ===== */
/* auto: срабатывает только когда явная тема не задана (режим «Как в системе») */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #131315;
    --surface:   #1E1E21;
    --surface-2: #28282D;
    --surface-3: #33333A;
    --border:       #3D3D45;
    --border-focus: #E8E8EC;
    --text-primary:   #E8E8EC;
    --text-secondary: #8C8C96;
    --text-tertiary:  #55555F;
    --surface-stripe:  rgba(255,255,255,.04);
    --overlay-bg:      rgba(0,0,0,.65);
    --tl-input-bg:     rgba(255,255,255,.12);
    --color-dot-ring:  rgba(255,255,255,.4);
    --shadow-sm: 0 1px 4px rgba(0,0,0,.25), 0 2px 10px rgba(0,0,0,.2);
    --shadow:    0 2px 8px rgba(0,0,0,.35), 0 6px 24px rgba(0,0,0,.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.5),  0 16px 48px rgba(0,0,0,.45);
    --fh-header-bg:   #2a2a2a;
    --fh-today-bg:    #1a2a3a;
    --fh-today-hover: #1e3250;
    --fh-today-color: #7ab3f5;
    --fh-weekend-bg:  #222;
    --fh-border:      #3a3a3a;
    --fh-edit-hover:  #1a2a3a;
  }
}
/* Явное переключение (перекрывает системные настройки) */
[data-theme="dark"] {
  --bg:        #131315;
  --surface:   #1E1E21;
  --surface-2: #28282D;
  --surface-3: #33333A;
  --border:       #3D3D45;
  --border-focus: #E8E8EC;
  --text-primary:   #E8E8EC;
  --text-secondary: #8C8C96;
  --text-tertiary:  #55555F;
  --surface-stripe:  rgba(255,255,255,.04);
  --overlay-bg:      rgba(0,0,0,.65);
  --tl-input-bg:     rgba(255,255,255,.12);
  --color-dot-ring:  rgba(255,255,255,.4);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.25), 0 2px 10px rgba(0,0,0,.2);
  --shadow:    0 2px 8px rgba(0,0,0,.35), 0 6px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.5),  0 16px 48px rgba(0,0,0,.45);
  --fh-header-bg:   #2a2a2a;
  --fh-today-bg:    #1a2a3a;
  --fh-today-hover: #1e3250;
  --fh-today-color: #7ab3f5;
  --fh-weekend-bg:  #222;
  --fh-border:      #3a3a3a;
  --fh-edit-hover:  #1a2a3a;
}
[data-theme="light"] {
  --bg:        #F6F7F8;
  --surface:   #FFFFFF;
  --surface-2: #F0F1F3;
  --surface-3: #E8E9EC;
  --border:       #E0E1E6;
  --border-focus: #1A1A1A;
  --text-primary:   #1A1A1A;
  --text-secondary: #8C8C96;
  --text-tertiary:  #C0C0C8;
  --surface-stripe:  rgba(0,0,0,.025);
  --overlay-bg:      rgba(0,0,0,.4);
  --tl-input-bg:     rgba(0,0,0,.25);
  --color-dot-ring:  rgba(0,0,0,.35);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.08), 0 16px 48px rgba(0,0,0,.10);
}

/* ===== BASE ===== */
html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0 16px;
  transition: width var(--transition);
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 18px;
  font-size: 20px;
  color: var(--text-secondary);
  align-self: flex-start;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--surface-2); }

.nav-list { list-style: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 2px 10px;
  transition: background var(--transition);
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item.active {
  background: var(--yellow-light);
  color: var(--text-primary);
  font-weight: 600;
}
.nav-item.active .nav-icon { filter: none; }

.nav-icon { font-size: 18px; flex-shrink: 0; }
.nav-label { transition: opacity var(--transition); }
.sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

.nav-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.nav-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  width: calc(100% - 16px);
  transition: background var(--transition), color var(--transition);
}
.nav-logout:hover { background: var(--danger-bg); color: var(--danger); }
.sidebar.collapsed .nav-logout .nav-label { opacity: 0; pointer-events: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}

/* ===== SCREENS ===== */
.screen { display: flex; flex-direction: column; gap: 16px; }
.screen.hidden { display: none; }

/* ===== TWO-COLUMN ===== */
.today-columns {
  display: grid;
  grid-template-columns: fit-content(540px) 600px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) { .today-columns { grid-template-columns: 1fr; } }

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.card-title-row .card-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.card-title-row .show-done-label { margin-bottom: 0; }

/* ===== SHIFT HEADER ===== */
.shift-header__time {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1;
}

.progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar__fill {
  height: 100%;
  background: var(--yellow);
  border-radius: var(--radius-pill);
  transition: width .6s ease;
}
.progress-bar__labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.shift-header__stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; }
.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 400;
}

/* ===== FORMS ===== */
.form-row { margin-bottom: 14px; }
.form-row--inline { display: flex; gap: 10px; }
.form-row--inline .form-group { flex: 1; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-input, .form-select {
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.form-select option {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  background: var(--surface);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C8C96' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform .1s;
  white-space: nowrap;
  letter-spacing: -.1px;
}
.btn:active { transform: scale(.98); }
.btn--wide { width: 100%; }

/* Primary = Tbank yellow */
.btn--primary { background: var(--yellow); color: var(--on-accent); }
.btn--primary:hover { background: var(--yellow-hover); box-shadow: 0 2px 12px rgba(255,221,45,.4); }

/* Success = green */
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: #009944; }

/* Secondary = outlined */
.btn--secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn--secondary:hover { border-color: var(--border-focus); background: var(--surface); }

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  font-size: 14px;
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text-primary); }

.btn--danger { background: var(--danger); color: #fff; border: none; }
.btn--danger:hover { opacity: .85; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }

/* ===== SHIFT HEADER TOP ROW ===== */
.shift-header__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.shift-header__time { margin-bottom: 0; }
.shift-header__add-btn {
  height: 36px;
  font-size: 13px;
  padding: 0 14px;
  flex-shrink: 0;
  margin-top: 6px;
}


/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 400px;
  max-width: 96vw;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal--wide { width: 540px; }
.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -.3px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

.modal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.modal-info-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.modal-coeff-preview {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: -6px;
  margin-bottom: 10px;
  min-height: 0;
}
.modal-coeff-preview.good  { background: var(--success-bg); color: var(--success); }
.modal-coeff-preview.low   { background: var(--danger-bg);  color: var(--danger);  }
.modal-coeff-preview.error { background: var(--danger-bg);  color: var(--danger);  }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--text-primary);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  animation: toast-in .15s ease, toast-out .3s ease 1.7s forwards;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.toast--error { background: var(--danger); }
@keyframes toast-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }

/* ===== SETTINGS ===== */
.settings-hint { font-size: 14px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.5; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-2);
}
.settings-row:last-child { border-bottom: none; }
.settings-row__name { font-size: 15px; font-weight: 500; flex: 1; }
.settings-row__meta { font-size: 12px; color: var(--text-secondary); margin-right: 12px; }
.settings-row__norm { display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.settings-row__norm .form-input { width: 72px; text-align: right; height: 32px; font-size: 13px; }
.settings-row__unit { font-size: 13px; color: var(--text-secondary); }

/* ===== UTILS ===== */
.hidden { display: none !important; }
.placeholder-text { color: var(--text-tertiary); font-size: 14px; line-height: 1.6; }

/* ===== SETTINGS COLOR ===== */
.settings-row__color-wrap { margin-right: 10px; }

/* ===== INPUT ERROR ===== */
.input--error { border-color: var(--danger) !important; }

/* ===== ТЕКУЩИЙ ТРЕК ===== */
.task-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 8px 0 0;
}
.task-group-header:first-of-type { margin-top: 0; }
.task-group-header__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-group-toggle {
  display: flex; align-items: center; justify-content: center;
  padding: 2px 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); line-height: 1;
}
.task-group-toggle:hover { color: var(--text-secondary); }
.task-group-chevron {
  display: block;
  transition: transform .15s ease;
}
.task-group-chevron--collapsed { transform: rotate(-90deg); }

.task-bubble {
  padding: 8px 10px;
  border: none;
  border-left: 3px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  min-width: 110px;
  max-width: 200px;
}
.show-done-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
}
.show-done-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--yellow-hover);
  flex-shrink: 0;
}

.task-bubble:hover:not(.selected) { background: var(--surface-3); }
.task-bubble.selected { background: color-mix(in srgb, var(--bubble-color, var(--yellow)) 15%, var(--surface-2)); }
.task-bubble__name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.task-bubble__progress { font-size: 12px; font-weight: 600; margin-top: 2px; }
.task-bubble__norm { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.task-bubble__week { font-size: 11px; font-weight: 400; color: var(--text-secondary); }

/* ── Countdown inline (внутри чипа темпа) ───────────────────────────── */
@keyframes cdFlash {
  0%, 100% { color: #fff; }
  50%       { color: var(--yellow-hover); }
}

.countdown-display {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Consolas', 'Roboto Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--text-primary);
  transition: color .15s;
  margin: 0 6px;
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
  padding: 1px 3px;
}
.countdown-display--flash   { animation: cdFlash .4s ease-in-out 4; }
.countdown-display--done    { color: var(--success); }
.countdown-display--running { opacity: .95; }
.countdown-display:hover { background: rgba(255,255,255,.12); }

.cd-inline-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}

.cd-btn {
  background: none;
  border: none;
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: var(--text-primary);
  font-family: inherit;
  transition: background .12s;
}
.cd-btn:hover { background: rgba(0,0,0,.08); }
.cd-btn--reset { font-weight: 700; font-size: 14px; }
[data-theme="dark"] .cd-btn:hover { background: rgba(255,255,255,.12); }

/* ── Вертикальный тайм-лайн трека ───────────────────────────────────── */
.track-vtl { margin-top: 0; }

.pace-block { margin-bottom: 10px; }
.pace-title {
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px;
}
.vtl-track-start {
  position: absolute; right: 6px;
  font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums;
  color: var(--text-secondary); white-space: nowrap;
  transform: translateY(-50%); line-height: 1;
}
.pace-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pace-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 72px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--yellow-light);
  font-size: 12px;
  color: var(--text-secondary);
  border: 1.5px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pace-chip:hover:not(:disabled):not(.pace-chip--selected) { background: var(--yellow-medium); }
.pace-chip--selected {
  background: #2c3e50;
  border-color: #2c3e50;
  color: #fff;
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.pace-chip--selected .countdown-display { color: #fff; }
.pace-chip--selected .cd-btn { color: rgba(255,255,255,.85); }
.pace-chip--selected .cd-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.pace-chip:disabled { cursor: default; opacity: .5; }
.pace-chip:not(.pace-chip--selected) strong { color: var(--text-primary); font-weight: 700; }
.pace-chip--selected strong { color: #fff; font-weight: 700; }
.pace-chip--muted { background: #7a1515; border-color: #7a1515; }
.pace-chip--muted:hover { background: #7a1515; }
.pace-chip--muted .countdown-display:hover { background: rgba(255,255,255,.1); }

.track-vtl-container {
  display: flex;
  position: relative;
  border-radius: var(--radius-sm);
}

.vtl-time-labels {
  position: relative;
  width: 38px;
  flex-shrink: 0;
}
.vtl-time-label {
  position: absolute;
  right: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  transform: translateY(-50%);
  line-height: 1;
}
.vtl-time-label--hour {
  font-weight: 800;
  color: var(--text-primary);
}

.vtl-data-wrap {
  position: relative;
  flex: 1;
  overflow-x: auto;
}

.track-vtl-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.track-vtl-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 5px 4px;
  text-align: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}

/* Чипы темпа в заголовках таблицы */
.vtl-head-chip { cursor: pointer; user-select: none; }
.vtl-head-chip--disabled { cursor: default; }

/* Пилюля внутри th */
.vtl-chip-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--yellow-light);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.vtl-head-chip:hover:not(.vtl-head-chip--sel):not(.vtl-head-chip--disabled) .vtl-chip-inner {
  background: var(--yellow-medium);
}
.vtl-head-chip--sel .vtl-chip-inner {
  background: #2c3e50;
  color: #fff;
}
.vtl-head-chip--sel .vtl-chip-inner strong { color: #fff; }
.vtl-head-chip--disabled .vtl-chip-inner { opacity: .5; }
.vtl-head-chip--muted .vtl-chip-inner { background: #7a1515; }

/* Разделитель · между коэффициентом и нормой/таймером */
.vtl-chip-sep {
  color: rgba(255,255,255,.35);
  font-weight: 400;
  font-size: 10px;
  margin: 0 1px;
}
.vtl-head-chip:not(.vtl-head-chip--sel) .vtl-chip-sep {
  color: var(--text-tertiary);
}

/* Норма и таймер — одинаковый стиль */
.vtl-chip-norm,
.vtl-head-chip--sel .countdown-display {
  font-size: 9px;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: .3px;
  margin: 0;
  padding: 0;
  background: none;
  cursor: default;
}
.vtl-chip-norm { color: var(--text-secondary); }
.vtl-head-chip--sel .countdown-display {
  color: rgba(255,255,255,.85);
}
.vtl-head-chip--sel .countdown-display:hover { background: none; }
.vtl-head-chip--sel .countdown-display--done { color: var(--success); }

/* Клик на ×N.N снимает фокус, двойной — мьют */
.vtl-head-chip--sel .vtl-chip-inner strong {
  cursor: pointer;
  color: #fff;
}
.vtl-head-chip--sel .vtl-chip-inner strong:hover { opacity: .8; }
.vtl-head-chip--muted .vtl-chip-inner { background: #e53030; }

.vtl-row td { padding: 5px 6px; text-align: center; border-bottom: 1px solid var(--surface-3); height: 34px; box-sizing: border-box; }
.vtl-cell { color: var(--text-primary); }

.vtl-row--alt td { background: var(--surface-2); }
.vtl-row--hour td { border-top: 2px solid var(--border); }

.track-vtl-redline {
  display: none;
  position: absolute;
  left: 38px; right: 35px;
  height: 2px;
  background: var(--danger);
  pointer-events: none;
  z-index: 1;
}
.vtl-time-now {
  position: relative;
  width: 40px;
  flex-shrink: 0;
}
.vtl-now-label {
  position: absolute;
  left: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  white-space: nowrap;
  transform: translateY(-50%);
  line-height: 1;
  z-index: 2;
  padding: 3px 5px;
  border-radius: 20px;
}
.shift-redline-label {
  position: absolute;
  right: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  white-space: nowrap;
  transform: translateY(-50%);
  line-height: 1;
  padding: 3px 5px;
  border-radius: 20px;
  z-index: 21;
}

/* Поле выполнено + кнопка */
.track-save-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}
.track-done-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  height: 40px;
}
.track-save-row .btn--success {
  flex-shrink: 0;
}

/* Кликабельные числа в таблице */
.vtl-num {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .1s, color .1s;
  display: inline-block;
}
.vtl-num:hover {
  background: var(--yellow);
  color: var(--on-accent);
  font-weight: 700;
}

/* ===== ТАЙМ-ЛАЙН СМЕНЫ (Сегодня) ===== */
.shift-tl-card { display: flex; flex-direction: column; }
.shift-tl-card .card-title { margin-bottom: 14px; }

.shift-tl-wrap {
  display: flex;
  gap: 0;
  flex: 1;
  padding-bottom: 8px;
}

.shift-tl-labels {
  width: 46px;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}
.shift-tl-hour-lbl {
  position: absolute;
  right: 8px;
  font-size: 10px;
  color: var(--text-secondary);
  transform: translateY(-50%);
  white-space: nowrap;
}

.shift-tl-grid {
  flex: 1;
  position: relative;
  border-left: 1px solid var(--border);
}
.shift-tl-hourline {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--surface-2);
}
.shift-tl-hourline--boundary {
  height: 1px;
  background: var(--border);
}
.shift-tl-redline {
  position: absolute;
  left: -10px; right: 0;
  height: 2px;
  background: var(--danger);
  pointer-events: none;
  z-index: 20;
}

/* Блок эпизода */
.tl-block {
  position: absolute;
  left: 0; right: 0;
  border-left: 3px solid currentColor;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 11px;
  user-select: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tl-block--activity {
  border-left-style: dashed;
  opacity: .7;
}
.tl-block__handle {
  position: absolute;
  left: 0; right: 0;
  height: 7px;
  cursor: ns-resize;
  z-index: 5;
}
.tl-block__handle--top  { top: 0;    border-radius: 4px 4px 0 0; }
.tl-block__handle--bottom { bottom: 0; border-radius: 0 0 4px 4px; }
.tl-block__handle:hover { background: rgba(255,255,255,.2); }

.tl-block__body {
  flex: 1;
  padding: 4px 5px 3px 7px;
  cursor: grab;
  overflow: hidden;
  min-height: 0;
}
.tl-block__body:active { cursor: grabbing; }
.tl-block__body--compact { padding: 1px 4px 1px 7px; }
.tl-block__label {
  font-weight: 600;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-block__meta {
  font-size: 10px;
  opacity: .75;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.tl-block__coeff { opacity: .75; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.tl-block__time-inline { font-weight: 400; opacity: .75; font-size: 0.9em; }

/* Inline редактирование */
.tl-inline-input {
  width: 70px;
  height: 28px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  background: var(--tl-input-bg);
  border: 1px solid currentColor;
  border-radius: 4px;
  color: inherit;
  padding: 0 4px;
}

/* ===== ЧЕРЕДОВАНИЕ ФОНОВ ЧАСОВ В ТАЙМ-ЛАЙНЕ ===== */
.shift-tl-hour-bg {
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
  background: transparent;
}
.shift-tl-hour-bg--alt { background: var(--surface-stripe); }

/* ===== КНОПКИ-ДЕЙСТВИЯ под списком типов ===== */
.settings-action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-2);
}
/* Архив прижат вправо */
.settings-action-row .btn { font-size: 14px; }
.settings-archive-btn { margin-left: auto; }

/* ===== НАСТРОЙКИ: Группы ===== */
.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
}
.group-row__name { font-size: 14px; font-weight: 500; flex: 1; }
.color-bar {
  width: 5px; height: 28px;
  border-radius: 3px;
  flex-shrink: 0;
}
.group-edit-form {
  padding: 4px 0 8px 15px;
  border-bottom: 1px solid var(--surface-2);
}
.groups-add-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.archived-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-tertiary);
  margin: 14px 0 6px;
}

/* ===== АРХИВНЫЙ МОДАЛ ===== */
.archive-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.archive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
}
.archive-row:last-child { border-bottom: none; }
.archive-row__info { flex: 1; min-width: 0; }
.archive-row__name { font-size: 14px; font-weight: 500; }
.archive-row__meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.group-row .group-archive-btn,
.archive-type-btn {
  opacity: .5;
  transition: opacity var(--transition);
}
.group-row:hover .group-archive-btn,
.settings-type-row:hover .archive-type-btn {
  opacity: 1;
}

/* Контейнер пузырей в настройках */
#settingsTaskList {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}

/* Заголовок группы кликабелен */
.settings-group-header {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
  width: 100%;
  margin-top: 12px;
}
.settings-group-header:first-child { margin-top: 0; }
.settings-group-header:hover { color: var(--text-primary); }

/* Drop-зона группы */
.task-group-dropzone {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 8px;
  min-height: 42px;
  border-radius: 8px;
  transition: background var(--transition), outline var(--transition);
}
.settings-hint--dropzone {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  align-self: center;
}

/* ===== НАСТРОЙКИ: Строка типа задания ===== */
.settings-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
}
.settings-type-row:last-child { border-bottom: none; }
.settings-type-row .color-bar { margin-right: 2px; }
.settings-type-info { flex: 1; min-width: 0; }
.settings-type-name { font-size: 14px; font-weight: 600; }
.settings-type-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.settings-type-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Раскрываемая форма редактирования */
.settings-type-edit {
  padding: 12px 0 16px;
  border-top: 1px solid var(--surface-2);
}

/* ===== НАСТРОЙКИ ИНТЕРФЕЙСА ===== */
.ui-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.ui-settings-label {
  font-size: 14px;
  color: var(--text-primary);
}
.seg-control {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  flex: 1;
  height: 32px;
  border: none;
  border-radius: calc(var(--radius-sm) - 3px);
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  padding: 0 12px;
}
.seg-btn--active {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 10 точек в ряд (дефолт для модалки) */
.color-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}
/* Вариант в 2 ряда (если нет класса --row) внутри узких форм */
.color-presets:not(.color-presets--row) {
  flex-wrap: wrap;
}
.color-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform .1s;
  flex-shrink: 0;
}
.color-dot:hover { transform: scale(1.2); }
.color-dot--selected {
  border-color: #fff;
  outline: 2px solid var(--color-dot-ring);
  outline-offset: 1px;
  transform: scale(1.15);
}

/* ===== GOLD CARD ===== */
.gold-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.gold-table thead th {
  padding: 0 8px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.gold-group-row td { padding: 12px 8px 4px; }
.gold-type-row td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--surface-2);
  vertical-align: middle;
}
.gold-type-row:last-child td { border-bottom: none; }
.gold-type-row--done { opacity: .6; }

.gold-progress-bar {
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.gold-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
  min-width: 0;
}
.gold-quota-input {
  width: 70px;
  height: 32px;
  padding: 0 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-primary);
  outline: none;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
.gold-quota-input:focus { border-color: var(--border-focus); background: var(--surface); }
.gold-quota-input::placeholder { color: var(--text-tertiary); }

/* ===== QUOTA BANNER ===== */
.quota-banner {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  padding: 8px 12px;
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  text-align: center;
}

/* Blocked timeline cell (quota exceeded) */
.vtl-cell--dim { color: var(--text-tertiary); }

.vtl-cell--blocked {
  color: var(--text-tertiary) !important;
  cursor: not-allowed;
}
.vtl-cell--limit .vtl-num {
  color: var(--text-primary);
  font-weight: 700;
}
.vtl-exact-time {
  font-weight: 700;
}

/* ── Часы функционала ──────────────────────────────────────────────────── */
.fh-wrap {
  overflow-x: auto;
  margin-top: 4px;
  border: 1px solid var(--fh-border);
  border-radius: 2px;
}

.fh-table {
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
  min-width: 100%;
}
/* Все ячейки — сплошная сетка */
.fh-table th,
.fh-table td {
  border: 1px solid var(--fh-border);
}

.fh-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.fh-name-col {
  position: sticky !important;
  left: 0;
  z-index: 2 !important;
  min-width: 120px;
  text-align: left;
  padding: 4px 10px;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--fh-header-bg) !important;
}

.fh-th {
  min-width: 36px;
  padding: 3px 2px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--fh-header-bg);
  font-weight: 600;
}

.fh-dow {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-tertiary);
  background: var(--fh-header-bg);
}

.fh-th.fh-weekend,
.fh-dow.fh-weekend { color: var(--text-tertiary); }
.fh-th.fh-today    { color: var(--fh-today-color); font-weight: 700; background: var(--fh-today-bg); }
.fh-dow.fh-today   { color: var(--fh-today-color); background: var(--fh-today-bg); }

.fh-name {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--fh-header-bg);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fh-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fh-cell {
  text-align: center;
  padding: 5px 4px;
  color: var(--text-primary);
  background: var(--surface);
  transition: background .08s;
  min-width: 36px;
}
.fh-toolbar {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}
/* В режиме просмотра ячейки не кликабельны */
.fh-cell { cursor: default; }
.fh-table--editing .fh-cell { cursor: pointer; }
.fh-table--editing .fh-cell:hover { background: var(--fh-edit-hover); }
.fh-cell.fh-weekend { background: var(--fh-weekend-bg); color: var(--text-tertiary); }
.fh-cell.fh-today { background: var(--fh-today-bg); font-weight: 600; }
.fh-cell.fh-today:hover { background: var(--fh-today-hover); }
.fh-input {
  width: 32px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  -moz-appearance: textfield;
}
.fh-input::-webkit-inner-spin-button,
.fh-input::-webkit-outer-spin-button { -webkit-appearance: none; }


/* ── Login Screen ─────────────────────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 400px;
  margin: 16px;
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 22px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: -14px 0 18px;
}

.login-field {
  position: relative;
  margin-bottom: 10px;
}

.login-input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 15px 16px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition), background var(--transition);
}

.login-input--pwd {
  padding-right: 48px;
}

.login-input:focus {
  border-color: var(--border-focus);
  background: var(--surface);
}

.login-input.error {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.login-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  border-radius: var(--radius-xs);
  transition: color var(--transition);
}

.login-eye:hover { color: var(--text-primary); }

.login-error {
  font-size: 13px;
  color: var(--danger);
  margin: 2px 0 10px 2px;
}

.login-btn {
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-pill);
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 6px;
  transition: background var(--transition), opacity var(--transition);
}

.login-btn:hover    { background: var(--accent-hover); }
.login-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.login-link {
  display: block;
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color var(--transition);
}

.login-link:hover { color: var(--text-primary); }


/* ── Profile Screen ───────────────────────────────────────────────────────── */

.nav-item--profile { margin: 4px 8px; }
.nav-label--bold { font-weight: 700; }
.sidebar.collapsed .nav-item--profile .nav-label { opacity: 0; pointer-events: none; }

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.profile-row:last-of-type { border-bottom: none; }

.profile-label {
  width: 80px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-value { font-size: 15px; color: var(--text-primary); }
.profile-value--mono { font-family: monospace; font-size: 14px; }

.profile-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 6px;
}

.totp-setup {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.totp-hint { font-size: 14px; color: var(--text-secondary); margin: 0; }

.totp-qr {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  align-self: flex-start;
}

.totp-secret {
  font-family: monospace;
  font-size: 14px;
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  color: var(--text-primary);
}

.totp-confirm {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.totp-confirm .form-input {
  width: 160px;
  flex-shrink: 0;
}

#totpActions { display: flex; gap: 8px; margin-top: 12px; }

.btn--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
}
.btn--danger:hover { background: var(--danger); color: #fff; }

/* ===== SCHEDULE CALENDAR ===== */

.sched-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px !important;
  margin-bottom: 8px;
}
.sched-month-label {
  font-size: 16px;
  font-weight: 600;
}
.sched-nav-btn {
  font-size: 20px;
  line-height: 1;
  padding: 4px 12px;
}

.sched-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  padding: 0 4px;
}
.sched-dow-row > div {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
}
.sched-dow--weekend { color: var(--danger) !important; }

.sched-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 4px;
}

.sched-cell {
  min-height: 64px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  padding: 6px 6px 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.sched-cell:hover { border-color: var(--text-secondary); }

.sched-cell--work {
  background: var(--yellow-light);
  border-color: var(--yellow-hover);
}
.sched-cell--off {
  background: var(--surface);
  opacity: 0.6;
}
.sched-cell--weekend.sched-cell--off {
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}
.sched-cell--today .sched-cell__num {
  background: var(--yellow);
  color: #1a1a1a;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.sched-cell--override {
  border-style: dashed;
}

.sched-cell__num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.sched-cell--off .sched-cell__num { color: var(--text-secondary); }

.sched-cell__time {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Edit panel */
.sched-edit-panel {
  margin-top: 12px;
}
.sched-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sched-edit-body { margin-bottom: 16px; }
.sched-edit-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
}
.sched-edit-toggle input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--yellow-hover);
  cursor: pointer;
}
.sched-edit-times { margin-top: 4px; }
.sched-time-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sched-time-input { width: 110px; }
.sched-edit-actions {
  display: flex;
  gap: 8px;
}

/* ── Context menu (таймлайн) ───────────────────────────────────────────────── */

.tl-ctx-menu {
  position: fixed;
  z-index: 900;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  min-width: 170px;
}
.tl-ctx-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
}
.tl-ctx-item:hover { background: var(--surface-3); }
.tl-ctx-item--danger { color: var(--danger); }
.tl-ctx-item--danger:hover { background: var(--danger-bg); }

/* ── Debug mode ────────────────────────────────────────────────────────────── */

.debug-badge {
  background: var(--yellow-hover);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 10px;
  margin: 4px 12px;
  text-align: center;
  cursor: default;
}

.debug-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.debug-toggle-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.debug-toggle-label--on {
  color: var(--yellow-hover);
  font-weight: 600;
}

.debug-settings {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debug-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.debug-num-input  { width: 100px; }
.debug-time-input { width: 110px; }

.debug-stat {
  font-size: 13px;
  color: var(--text-secondary);
  padding-top: 4px;
}

body.debug-mode-active .sidebar {
  border-right: 2px solid var(--yellow-hover);
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── Модал "Добавить активность" — список бабблов ──────────────────────────── */
.activity-bubble-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.activity-bubble-list .task-group-header {
  margin-top: 6px;
}
.activity-bubble-list .task-group-header:first-child {
  margin-top: 0;
}

/* Модал "Добавить активность" — увеличенный размер */
#addModal .modal { width: 520px; }
#addModal .activity-bubble-list { max-height: 360px; }

/* Кнопка "Другая активность" */
.act-other-btn {
  width: 100%;
  padding: 7px 12px;
  margin-top: 4px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.act-other-btn:hover { background: var(--surface-2); border-color: var(--text-muted); color: var(--text-primary); }
.act-other-btn--sel  { background: var(--surface-2); border-color: var(--yellow-hover); border-style: solid; color: var(--text-primary); }
