/* =====================================================================
   Task Planner — liquid glass × retrowave
   ===================================================================== */

:root {
  --font-display: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  --cyan: #00e5ff;
  --cyan-soft: #7df9ff;
  --magenta: #ff2fd6;
  --magenta-soft: #ffa8ec;
  --purple: #8a2be2;
  --yellow: #ffd166;
  --green: #39ff14;
  --red: #ff3864;
  --orange: #ff6a00;

  --text: #ece9ff;
  --muted: rgba(236, 233, 255, 0.58);
  --line: rgba(255, 255, 255, 0.09);

  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  --glass-border: rgba(255, 255, 255, 0.17);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.05),
                  0 12px 40px rgba(0, 0, 0, 0.45);
  --solid: rgba(13, 7, 34, 0.96);

  --col-w: 172px;
  --col-narrow: 58px;
  --name-w: 196px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: #07031a;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* отступ сверху задаём body, а не margin у панели: иначе margin схлопывается с body */
body:not(.page-login) { padding-top: 12px; }

a { color: var(--cyan-soft); }

/* ---------- Retrowave backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(255, 47, 214, 0.22), transparent 60%),
    linear-gradient(180deg, #05020f 0%, #12083a 32%, #3a0f62 58%, #12073a 78%, #07031a 100%);
}

.bd-stars {
  position: absolute;
  inset: 0 0 45% 0;
  opacity: 0.7;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 8%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 30%, #cfe9ff 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 92% 40%, #ffd166 50%, transparent 51%),
    radial-gradient(1px 1px at 26% 48%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 55%, #ffa8ec 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 70%, #7df9ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 47% 76%, #fff 50%, transparent 51%);
  background-size: 640px 420px;
  mask-image: linear-gradient(180deg, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
}

.bd-sun {
  position: absolute;
  left: 50%;
  top: 13vh;
  width: 44vmin;
  height: 44vmin;
  border-radius: 50%;
  transform: translateX(-50%);
  opacity: 0.55;
  background: linear-gradient(180deg, #ffe38a 0%, #ff9a3c 42%, #ff2fd6 100%);
  box-shadow: 0 0 90px 20px rgba(255, 96, 190, 0.35), 0 0 200px 60px rgba(255, 47, 214, 0.15);
}

.bd-sun::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 48%;
  bottom: 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: repeating-linear-gradient(180deg, transparent 0 12px, #12083a 12px 17px);
  opacity: 0.9;
}

.bd-grid {
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: -12vh;
  height: 58vh;
  transform-origin: 50% 0;
  transform: perspective(520px) rotateX(63deg);
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.32) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 47, 214, 0.32) 2px, transparent 2px);
  background-size: 84px 84px;
  mask-image: linear-gradient(180deg, transparent 0, #000 35%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 35%);
  animation: grid-move 5s linear infinite;
}

@keyframes grid-move {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 84px, 0 0; }
}

.bd-glow {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(13vh + 44vmin);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--magenta) 30%, var(--cyan) 70%, transparent);
  box-shadow: 0 0 40px 8px rgba(255, 47, 214, 0.35);
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .bd-grid { animation: none; }
}

/* ---------- Liquid glass ---------- */

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-radius: 18px;
}

.glass:not(.board)::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 12% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
    radial-gradient(60% 40% at 100% 100%, rgba(0, 229, 255, 0.08), transparent 60%);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  margin: 0 20px;
  border-radius: 16px;
}

.menu-row {
  height: var(--topbar-h);
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Заголовок «окна» — виден только в теме 90s */
.win-title { display: none; }

/* ---------- Переключатель темы ---------- */

.theme-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-btn {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border: none;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.theme-btn:hover { color: #fff; }

.theme-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(255, 47, 214, 0.3));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 12px rgba(0, 229, 255, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe38a 0%, #ff9a3c 45%, #ff2fd6 100%);
  box-shadow: 0 0 14px rgba(255, 96, 190, 0.7);
  position: relative;
  overflow: hidden;
  flex: none;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 55% 0 0 0;
  background: repeating-linear-gradient(180deg, transparent 0 3px, #12083a 3px 5px);
}

.brand-mark.big { width: 64px; height: 64px; box-shadow: 0 0 34px rgba(255, 96, 190, 0.75); }
.brand-mark.big::after { background: repeating-linear-gradient(180deg, transparent 0 7px, #12083a 7px 11px); }

.brand-text {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.8), 0 0 18px rgba(0, 229, 255, 0.4);
}

.brand-text b {
  color: var(--magenta);
  text-shadow: 0 0 8px rgba(255, 47, 214, 0.9), 0 0 20px rgba(255, 47, 214, 0.5);
}

.menu {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.menu a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.menu a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.menu a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(255, 47, 214, 0.22));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 16px rgba(0, 229, 255, 0.2);
}

.user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user form { margin: 0; }

.user-name {
  font-size: 12.5px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s, filter 0.15s;
  white-space: nowrap;
}

.btn:hover {
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 16px rgba(0, 229, 255, 0.25);
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  border-color: rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 20px rgba(255, 47, 214, 0.4);
}

.btn-danger {
  color: #ffb3c3;
  background: linear-gradient(135deg, rgba(255, 56, 100, 0.35), rgba(255, 56, 100, 0.12));
  border-color: rgba(255, 56, 100, 0.5);
}

.btn-danger:hover { border-color: var(--red); box-shadow: 0 0 16px rgba(255, 56, 100, 0.35); }

.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.14);
}

.btn-block { width: 100%; padding: 12px; font-size: 14px; }

.btn-icon { padding: 9px 11px; font-size: 11px; }

.nav-days { display: inline-flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  color: var(--cyan-soft);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.35);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.icon-btn:hover { background: rgba(0, 229, 255, 0.22); box-shadow: 0 0 12px rgba(0, 229, 255, 0.4); }

/* ---------- Inputs ---------- */

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder, textarea::placeholder { color: rgba(236, 233, 255, 0.35); }

input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: rgba(0, 229, 255, 0.8);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(0, 229, 255, 0.2);
}

textarea { resize: vertical; line-height: 1.4; }

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-hint { font-size: 11.5px; color: var(--muted); }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

/* ---------- Layout ---------- */

.page {
  padding: 14px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-calendar .page { height: calc(100vh - var(--topbar-h) - 12px); }

.toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
}

.tb-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}

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

.month-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.6);
}

.jira-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.jira-field input {
  width: 230px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 10px;
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Board (calendar) ---------- */

.board {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

.board-inner {
  position: relative;
  width: max-content;
  min-width: 100%;
}

.hdr-row, .emp-row {
  display: flex;
  width: max-content;
  min-width: 100%;
}

.hdr-row {
  position: sticky;
  top: 0;
  z-index: 6;
}

.emp-row { position: relative; }

.corner, .emp-cell {
  position: sticky;
  left: 0;
  flex: 0 0 var(--name-w);
  width: var(--name-w);
  background: var(--solid);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 2px solid rgba(0, 229, 255, 0.35);
}

.corner {
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 16px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cfd3ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.day-head {
  position: relative;
  flex: 0 0 var(--col-w);
  width: var(--col-w);
  padding: 9px 4px 7px;
  text-align: center;
  background: var(--solid);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transition: flex-basis 0.2s, width 0.2s;
}

.day-head.weekend { color: var(--muted); background: rgba(6, 3, 18, 0.92); }
.day-head.narrow { flex-basis: var(--col-narrow); width: var(--col-narrow); }

.day-head.today {
  color: var(--cyan-soft);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
  box-shadow: inset 0 -3px 0 var(--cyan);
}

.dh-date { display: block; font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.dh-dow { display: block; font-size: 10.5px; opacity: 0.7; margin-top: 1px; }

.dh-month {
  position: absolute;
  left: 6px;
  top: -1px;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--magenta-soft);
  text-shadow: 0 0 8px rgba(255, 47, 214, 0.8);
  white-space: nowrap;
}

.emp-cell {
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 10px 10px 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: grab;
  border-bottom: 1px solid var(--line);
  user-select: none;
  transition: background 0.15s;
}

.emp-cell:hover { background: rgba(20, 12, 50, 0.95); }
.emp-cell:active { cursor: grabbing; }

.grip {
  flex: none;
  width: 9px;
  height: 16px;
  opacity: 0.45;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1.4px);
  background-size: 4.5px 5px;
}

.dot {
  flex: none;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.emp-cell .dot {
  background: var(--emp-color, var(--cyan));
  box-shadow: 0 0 10px var(--emp-color, var(--cyan));
}

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

.emp-total {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.emp-row.dragging { opacity: 0.4; }

.emp-row.drop-before::before, .emp-row.drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 8;
  pointer-events: none;
  background: var(--magenta);
  box-shadow: 0 0 12px var(--magenta);
}

.emp-row.drop-before::before { top: -1px; }
.emp-row.drop-after::after { bottom: -2px; }

.day-cell {
  flex: 0 0 var(--col-w);
  width: var(--col-w);
  min-height: 104px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.15s, box-shadow 0.15s, flex-basis 0.2s, width 0.2s;
}

.day-cell.weekend { background: rgba(0, 0, 0, 0.24); }
.day-cell.narrow { flex-basis: var(--col-narrow); width: var(--col-narrow); }
.day-cell.narrow .sum { display: none; }

.day-cell.today {
  background: rgba(0, 229, 255, 0.06);
  box-shadow: inset 1px 0 0 rgba(0, 229, 255, 0.25), inset -1px 0 0 rgba(0, 229, 255, 0.25);
}

.day-cell.drop-target {
  background: rgba(255, 47, 214, 0.14);
  box-shadow: inset 0 0 0 2px rgba(255, 47, 214, 0.75), inset 0 0 26px rgba(255, 47, 214, 0.3);
}

.tasks { flex: 1; padding: 3px; }

.cell-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 6px 6px;
  min-height: 30px;
}

.add-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: var(--cyan-soft);
  background: rgba(0, 229, 255, 0.08);
  border: 1px dashed rgba(0, 229, 255, 0.4);
  cursor: pointer;
  opacity: 0;
  margin-left: auto;
  transition: opacity 0.15s, background 0.15s, box-shadow 0.15s;
}

.day-cell:hover .add-btn, .add-btn:focus-visible { opacity: 1; }
.add-btn:hover { background: rgba(0, 229, 255, 0.22); box-shadow: 0 0 10px rgba(0, 229, 255, 0.4); border-style: solid; }

.sum {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sum.ok { color: var(--green); border-color: rgba(57, 255, 20, 0.4); background: rgba(57, 255, 20, 0.08); text-shadow: 0 0 8px rgba(57, 255, 20, 0.6); }
.sum.under { color: var(--yellow); border-color: rgba(255, 209, 102, 0.4); background: rgba(255, 209, 102, 0.08); text-shadow: 0 0 8px rgba(255, 209, 102, 0.6); }
.sum.over { color: var(--red); border-color: rgba(255, 56, 100, 0.5); background: rgba(255, 56, 100, 0.1); text-shadow: 0 0 8px rgba(255, 56, 100, 0.7); }
.sum.zero { visibility: hidden; }

/* Карточка задачи */

.task {
  position: relative;
  margin: 3px;
  padding: 7px 8px 7px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: grab;
  font-size: 12.5px;
  line-height: 1.35;
  word-break: break-word;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.task::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--emp-color, var(--cyan));
  box-shadow: 0 0 8px var(--emp-color, var(--cyan));
}

.task:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 18px rgba(0, 0, 0, 0.35),
              0 0 0 1px rgba(0, 229, 255, 0.4), 0 0 18px rgba(0, 229, 255, 0.2);
}

.task:active { cursor: grabbing; }
.task.dragging { opacity: 0.35; transform: scale(0.98); }

/* Шапка карточки с коротким номером и часами — только в теме 90s */
.task-head { display: none; }

.task a {
  color: var(--cyan-soft);
  text-decoration: none;
  border-bottom: 1px dotted rgba(125, 249, 255, 0.6);
  cursor: pointer;
}

.task a:hover { text-shadow: 0 0 8px rgba(0, 229, 255, 0.9); border-bottom-style: solid; }

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.badge.rel {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--magenta-soft);
  border: 1px solid rgba(255, 47, 214, 0.55);
  background: rgba(255, 47, 214, 0.12);
  text-shadow: 0 0 6px rgba(255, 47, 214, 0.6);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.est {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan-soft);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

.board-empty {
  position: sticky;
  left: 0;
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}

/* Легенда */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 6px;
}

.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.legend .hint { margin-left: auto; }

.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sw-under { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.sw-over { background: var(--red); box-shadow: 0 0 8px var(--red); }
.sw-weekend { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); }
.sw-today { background: rgba(0, 229, 255, 0.25); border: 1px solid var(--cyan); }

/* ---------- Modals ---------- */

dialog.modal {
  width: min(540px, 94vw);
  padding: 0;
  color: var(--text);
  border-radius: 20px;
  overflow: visible;
}

dialog.modal-sm { width: min(420px, 94vw); }

dialog.modal::backdrop {
  background: rgba(5, 2, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

dialog.modal[open] { animation: pop 0.18s ease-out; }

@keyframes pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 20px;
  margin: 0;
}

.modal-head { display: flex; flex-direction: column; gap: 3px; }

.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 47, 214, 0.6);
}

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

.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.spacer { flex: 1; }

.confirm-text { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

.palette { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}

.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: #fff; transform: scale(1.15); }

.custom-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.custom-color input[type="color"] {
  width: 34px;
  height: 26px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
  background: rgba(13, 7, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: 360px;
}

.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(255, 56, 100, 0.7); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 56, 100, 0.3); }
.toast.ok { border-color: rgba(57, 255, 20, 0.6); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(57, 255, 20, 0.25); }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  position: relative;
  width: min(440px, 92vw);
  padding: 38px 36px 34px;
  text-align: center;
  border-radius: 24px;
}

.login-logo { display: flex; justify-content: center; margin-bottom: 16px; }

.chrome-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #fff 0%, #d9ecff 42%, #6b8cff 50%, #ff2fd6 58%, #ffd166 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 47, 214, 0.55));
}

.login-sub { margin: 6px 0 22px; color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn-block { margin-top: 6px; }

.login-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-theme-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid;
}

.alert.error { color: #ffb3c3; border-color: rgba(255, 56, 100, 0.5); background: rgba(255, 56, 100, 0.1); }
.alert.info { color: var(--cyan-soft); border-color: rgba(0, 229, 255, 0.4); background: rgba(0, 229, 255, 0.08); }

/* ---------- Analytics ---------- */

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.seg-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border: none;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.seg-btn:hover { color: #fff; }

.seg-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(255, 47, 214, 0.3));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 12px rgba(0, 229, 255, 0.2);
}

.date-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.date-field input { padding: 7px 10px; font-size: 12.5px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px 14px;
}

.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.kpi-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
  line-height: 1.1;
}

.kpi-value.ok { color: var(--green); text-shadow: 0 0 12px rgba(57, 255, 20, 0.6); }
.kpi-value.under { color: var(--yellow); text-shadow: 0 0 12px rgba(255, 209, 102, 0.6); }
.kpi-value.over { color: var(--red); text-shadow: 0 0 12px rgba(255, 56, 100, 0.7); }

.kpi-sub { font-size: 12px; color: var(--muted); }

.charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card { position: relative; padding: 16px 18px 18px; }
.card-wide { grid-column: 1 / -1; }

.card-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.card-sub { font-size: 12px; color: var(--muted); }

.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }

.empty-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  white-space: nowrap;
}

.table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.table .num { text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
.table .muted { color: var(--muted); text-align: center; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
  font-weight: 600;
}

.pill.ok { color: var(--green); border-color: rgba(57, 255, 20, 0.45); background: rgba(57, 255, 20, 0.08); }
.pill.under { color: var(--yellow); border-color: rgba(255, 209, 102, 0.45); background: rgba(255, 209, 102, 0.08); }
.pill.over { color: var(--red); border-color: rgba(255, 56, 100, 0.5); background: rgba(255, 56, 100, 0.1); }

/* ---------- Scrollbars ---------- */

* { scrollbar-width: thin; scrollbar-color: rgba(0, 229, 255, 0.5) rgba(0, 0, 0, 0.25); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); border-radius: 999px; }
*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  background-clip: padding-box;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .charts { grid-template-columns: 1fr; }
  .topbar { margin: 0 12px; gap: 12px; }
  .page { padding: 12px; }
  .user-name { display: none; }
  .legend .hint { display: none; }
  :root { --name-w: 150px; --col-w: 150px; }
}
