/* Reja — yagona uslublar fayli.
   Tartib: ranglar va oʻlchamlar → asos → boshqaruv elementlari → qobiq → mayda qismlar → sahifalar → tor ekran.
   Ranglar Samarqand koshinlaridan: lojuvard (asosiy), feruza (bajarildi), zaʼfaron (ogohlantirish), anor (kechikdi). */

:root {
  color-scheme: light dark;

  --paper: light-dark(#f1f3f7, #0e1524);
  --surface: light-dark(#ffffff, #161f33);
  --sunken: light-dark(#e6eaf1, #111a2c);
  --ink: light-dark(#17223b, #e8ecf5);
  --ink-2: light-dark(#46526c, #b5bed2);
  --ink-3: light-dark(#626d87, #8d99b3);
  --line: light-dark(#d9dee8, #27324b);
  --line-strong: light-dark(#b7c0d1, #3d4a6a);
  --hover: light-dark(rgb(23 34 59 / 0.07), rgb(232 236 245 / 0.09));

  --accent: light-dark(#2545b8, #8fa6ff);
  --accent-bg: light-dark(#2545b8, #3a59d9);
  --accent-bg-hover: light-dark(#1c3797, #4a69e8);
  --accent-wash: light-dark(#e3e9fb, #1b2850);
  --done: light-dark(#0a7c82, #45c8cb);
  --done-wash: light-dark(#dcf2f2, #12373d);
  --warn: light-dark(#9a6003, #e6b450);
  --late: light-dark(#b72a38, #f27a86);
  --late-wash: light-dark(#fbe5e7, #402029);
  --anor: #b72a38;

  --shadow: 0 1px 2px light-dark(rgb(23 34 59 / 0.08), rgb(0 0 0 / 0.4)),
    0 12px 32px light-dark(rgb(23 34 59 / 0.14), rgb(0 0 0 / 0.5));
  --r: 7px;
  --r-l: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, Arial, sans-serif;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Loyiha ranglari — ikkala mavzuda ham oʻqiladigan oʻrta toʻqlikda. */
.c-cobalt { --pc: #3558d4; }
.c-turquoise { --pc: #12a3a8; }
.c-ochre { --pc: #d99a1c; }
.c-anor { --pc: #cf3f4d; }
.c-violet { --pc: #7e57c2; }
.c-green { --pc: #3f9a55; }
.c-pink { --pc: #cc5596; }
.c-slate { --pc: #68748f; }

/* --- Asos ---------------------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
h2 { font-size: 15px; font-weight: 650; }
a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--r);
  background: var(--surface);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* --- Boshqaruv elementlari ------------------------------------------------------------------------------- */

:where(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
  width: 100%;
  min-width: 0; /* sana maydoni tor katakda oʻz ichki enini talab qilib, tashqariga chiqib ketmasin */
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
:where(input, textarea)::placeholder { color: var(--ink-3); opacity: 1; }
textarea { resize: vertical; line-height: 1.45; }
select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a869f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  text-overflow: ellipsis;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: var(--sunken); }
.btn-primary { border-color: transparent; background: var(--accent-bg); color: #fff; }
.btn-primary:hover { background: var(--accent-bg-hover); }
.btn-danger { border-color: transparent; background: transparent; color: var(--late); }
.btn-danger:hover { background: var(--late-wash); }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-wide { width: 100%; }

.icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--ink-3);
  text-decoration: none;
  cursor: pointer;
}
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn.is-on { background: var(--accent-wash); color: var(--accent); }

.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }

.field { display: grid; gap: 5px; align-content: start; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.hint { color: var(--ink-3); font-size: 12.5px; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--late); font-size: 13px; }
.form-error { padding: 8px 12px; border-radius: var(--r); background: var(--late-wash); color: var(--late); font-size: 13.5px; }
.stack { display: grid; gap: 14px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.empty { padding: 20px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-l); color: var(--ink-2); list-style: none; }

/* --- Qobiq: yon panel, asosiy qism, pastki tablar -------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100dvh;
  padding: 18px 14px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.side-new { justify-content: flex-start; }
.side-new kbd {
  margin-left: auto;
  padding: 0 6px;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 4px;
  font: 600 11px/1.6 var(--font);
}

.side-search { position: relative; }
.side-search .icon { position: absolute; top: 9px; left: 9px; color: var(--ink-3); pointer-events: none; }
.side-search input { padding-left: 34px; background: var(--paper); border-color: var(--line); }

.nav, .side-projects { display: grid; gap: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--r);
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
}
.nav-link > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link.is-active { background: var(--accent-wash); color: var(--accent); font-weight: 650; }
.nav-count {
  min-width: 22px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--sunken);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav-link.is-active .nav-count { background: var(--surface); color: var(--accent); }
.side-projects h2 { margin: 4px 0 4px; padding: 0 10px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.side-projects .tile { margin: 0 4px; }

.side-foot {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: auto;
  padding: 10px 0 0 10px;
  border-top: 1px solid var(--line);
}
.side-user { flex: 1; overflow: hidden; color: var(--ink-2); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.side-foot form { display: contents; }

.main { min-width: 0; padding: 30px 36px 72px; outline: none; }

.tabs { display: none; }

.pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.pagehead h1 { display: flex; align-items: center; gap: 10px; }
.pagehead-sub { max-width: 70ch; margin-top: 4px; color: var(--ink-2); }
.pagehead-actions { display: flex; align-items: center; gap: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters select, .filters input { width: auto; min-width: 150px; }
.filters-wide { margin-bottom: 16px; }
.filters-wide input[type="search"] { flex: 1 1 240px; }

.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 60;
  display: grid;
  gap: 8px;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  animation: toast 5s forwards;
}
.toast.is-error { background: var(--anor); color: #fff; }
@keyframes toast {
  0% { opacity: 0; transform: translateY(8px); }
  4%, 90% { opacity: 1; transform: none; }
  100% { opacity: 0; visibility: hidden; }
}

.modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.modal[open] { animation: modal-in 0.14s ease-out; }
.modal::backdrop { background: rgb(10 16 30 / 0.55); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
}

/* --- Mayda qismlar --------------------------------------------------------------------------------------- */

.tile {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  background: var(--pc, var(--ink-3));
}
.tile-big { width: 14px; height: 14px; border-radius: 4px; }

.key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.key-big { color: var(--ink-2); font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.chip .icon { width: 13px; height: 13px; }
.chip.is-late { color: var(--late); font-weight: 600; }
.chip.is-warn { color: var(--warn); font-weight: 600; }

.count { color: var(--ink-3); font-size: 0.87em; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Muhimlik: toʻrtta ustuncha, daraja oshgani sayin toʻladi. */
.prio { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 12px; }
.prio i { width: 3px; border-radius: 1px; background: var(--line-strong); }
.prio i:nth-child(1) { height: 4px; }
.prio i:nth-child(2) { height: 6.5px; }
.prio i:nth-child(3) { height: 9px; }
.prio i:nth-child(4) { height: 12px; }
.prio-1 i:nth-child(-n + 1), .prio-2 i:nth-child(-n + 2) { background: var(--ink-3); }
.prio-3 i:nth-child(-n + 3) { background: var(--warn); }
.prio-4 i:nth-child(n) { background: var(--late); }

/* Belgilash katagi holatni ham koʻrsatadi: boʻsh — rejada, ichida kvadrat — jarayonda, toʻla — bajarildi. */
.check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: transparent;
  cursor: pointer;
}
.check .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.check.is-in_progress { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); }
.check:hover { border-color: var(--done); background: var(--surface); box-shadow: none; color: var(--done); }
.check.is-done { border-color: var(--done); background: var(--done); color: var(--surface); }
.check.is-done:hover { background: var(--done-wash); color: var(--done); }

.state { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--line-strong); }
.state.is-todo::before { background: var(--ink-3); }
.state.is-in_progress::before { background: var(--accent); }
.state.is-done::before { background: var(--done); }

/* Kun tasmasi: har bir boʻlak — vazifa, eni — taxminiy vaqti (flex-grow shablondan keladi). */
.band { display: flex; gap: 3px; height: 8px; }
.band-seg { flex: 1 0 5px; border-radius: 2px; background: var(--line-strong); }
.band-seg.is-in_progress { background: var(--accent); }
.band-seg.is-done { background: var(--done); }

/* Sudrab koʻchirish */
[draggable="true"] { cursor: grab; }
.is-dragging { opacity: 0.45; outline: 2px dashed var(--accent); outline-offset: -2px; }
[data-drop].is-over { box-shadow: inset 0 0 0 2px var(--accent); }

/* --- Bugun ----------------------------------------------------------------------------------------------- */

.today { max-width: 780px; }
.today.has-rail {
  display: grid;
  grid-template-columns: minmax(0, 780px) minmax(260px, 330px);
  gap: 40px;
  align-items: start;
  max-width: none;
}
.rail .section:first-child { margin-top: 0; }

.dayhead { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.dayhead-sum { margin-top: 4px; color: var(--ink-2); }

/* Yirtma kalendar varagʻi: tepada oy, pastda sana. Yakshanba — qizil, devor kalendaridagidek. */
.leaf {
  display: grid;
  grid-template-rows: auto 1fr;
  flex: none;
  width: 64px;
  height: 70px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: 0 3px 0 -1px var(--surface), 0 3px 0 0 var(--line-strong);
  text-align: center;
}
.leaf-month { padding: 3px 0; background: var(--accent-bg); color: #fff; font-size: 11.5px; font-weight: 600; }
.leaf-day {
  align-self: center;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.leaf.is-sunday .leaf-month { background: var(--anor); }
.leaf.is-sunday .leaf-day { color: var(--late); }

.quick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 170px) auto; gap: 8px; margin-top: 18px; }
.quick input[type="text"] { min-height: 42px; font-size: 16px; }
.quick select, .quick .btn { min-height: 42px; }

.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  margin-bottom: 8px;
}

.rows {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  list-style: none;
}
.rows.is-late { border-color: color-mix(in srgb, var(--late) 40%, var(--line)); }
.rows[data-empty]:not(:has(.row))::after {
  content: attr(data-empty);
  display: block;
  padding: 18px 16px;
  color: var(--ink-3);
}

.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
}
.row + .row { border-top: 1px solid var(--line); }
.row > form { display: grid; }
.row-main { display: grid; gap: 3px; min-width: 0; color: inherit; text-decoration: none; }
.row-title { font-weight: 500; overflow-wrap: anywhere; }
.row-main:hover .row-title { color: var(--accent); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.row.is-done .row-title { color: var(--ink-3); text-decoration: line-through; }
.row-actions { display: flex; align-items: center; gap: 2px; opacity: 0; }
.row:hover .row-actions, .row:focus-within .row-actions, .row-actions.is-visible { opacity: 1; }

/* --- Hafta ----------------------------------------------------------------------------------------------- */

/* 4×2 katak: yetti kun va sakkizinchi katakda rejasiz vazifalar — hammasi bir ekranda, yon aylantirishsiz. */
.weekgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.day {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 230px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--r-l);
  background: var(--sunken);
}
.day.is-today { border-color: var(--accent); background: var(--accent-wash); }
.day.is-today .day-head h2 { color: var(--accent); }
.day.is-sunday .day-head h2 { color: var(--late); }
.day.is-pool { border-style: dashed; border-color: var(--line-strong); background: transparent; }

.day-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.day-head h2 { flex: 1; min-width: 0; }
.day-date { margin-left: 4px; color: var(--ink-3); font-size: 13px; font-weight: 500; }
.day-load { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

.cards { display: flex; flex: 1; flex-direction: column; gap: 6px; min-height: 44px; }
.cards[data-empty]:not(:has(.card))::after {
  content: attr(data-empty);
  padding: 14px 6px;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
}
.cards-done { flex: none; min-height: 0; }
.day:has(.cards-done) .cards[data-empty]::after { content: none; }
.cards-scroll { max-height: 440px; overflow-y: auto; }

.card {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.card:hover { border-color: var(--line-strong); }
.card-title { color: var(--ink); font-weight: 500; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.card-title:hover { color: var(--accent); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.card.is-done .card-title { color: var(--ink-3); text-decoration: line-through; }
.day .card.is-in_progress { box-shadow: inset 3px 0 0 var(--accent); }

/* --- Doska ----------------------------------------------------------------------------------------------- */

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 12px;
  padding-bottom: 8px;
  overflow-x: auto;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 260px;
  padding: 10px;
  border-radius: var(--r-l);
  background: var(--sunken);
}
.col-head { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding-left: 4px; }
.col.is-in_progress .col-head h2 { color: var(--accent); }
.col.is-done .col-head h2 { color: var(--done); }

/* --- Vazifalar roʻyxati ---------------------------------------------------------------------------------- */

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.table td { padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table-title { display: block; color: var(--ink); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.table-title:hover { color: var(--accent); }
.table .is-done .table-title { color: var(--ink-3); text-decoration: line-through; }
.table .col-prio, .table .col-date, .table .col-time { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.table td.is-late { color: var(--late); font-weight: 600; }
.prio-label { margin-left: 8px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; color: var(--ink-2); }

/* --- Loyihalar ------------------------------------------------------------------------------------------- */

.projects { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.projectlist { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); list-style: none; }
.projectlist .empty { border: 0; }
.project { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 16px; }
.project + .project { border-top: 1px solid var(--line); }
.project.is-archived { opacity: 0.62; }
.project-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.project-name { color: var(--ink); font-weight: 600; text-decoration: none; }
.project-name:hover { color: var(--accent); }
.project-desc { flex-basis: 100%; color: var(--ink-2); font-size: 13.5px; }
.project-stats { display: grid; gap: 5px; justify-items: end; color: var(--ink-3); font-size: 12.5px; }

progress { appearance: none; width: 140px; height: 6px; overflow: hidden; border: 0; border-radius: 3px; background: var(--sunken); }
progress::-webkit-progress-bar { background: var(--sunken); }
progress::-webkit-progress-value { background: var(--done); }
progress::-moz-progress-bar { background: var(--done); }

.formgrid { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; padding: 3px; }
.swatch { position: relative; width: 26px; height: 26px; border-radius: 7px; background: var(--pc); }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 5px; }
.checkline { display: flex; align-items: flex-start; gap: 10px; }
.checkline input { margin-top: 3px; accent-color: var(--accent-bg); }
.checkline small { color: var(--ink-3); font-size: 13px; }
.formactions { display: flex; gap: 8px; }
.narrow { display: grid; gap: 18px; max-width: 560px; }
.dangerzone { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dangerzone h2 { margin-bottom: 4px; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.account > span { flex: 1; color: var(--ink-2); }

/* --- Vazifa oynasi --------------------------------------------------------------------------------------- */

.task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 256px;
  grid-template-areas: "head head" "body side" "extra side" "foot foot";
  grid-template-rows: auto auto 1fr auto;
}
.task-plain { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body" "foot"; grid-template-rows: auto; }
.task-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 12px 14px 0 20px; }
.task-head h2 { font-size: 17px; }
.task-body { grid-area: body; display: grid; gap: 14px; align-content: start; padding: 10px 20px 12px; }
.task-body input[type="text"] { min-height: 44px; font-size: 19px; font-weight: 600; }
.task-side { grid-area: side; display: grid; gap: 12px; align-content: start; padding: 10px 20px 18px 18px; border-left: 1px solid var(--line); }
.task-extra { grid-area: extra; display: grid; gap: 22px; align-content: start; padding: 8px 20px 22px; }
.task-foot {
  position: sticky;
  bottom: 0;
  grid-area: foot;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.task-foot-gap { flex: 1; }
.task-dates { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; line-height: 1.6; }
.quickdates { display: flex; gap: 12px; }

.taskpage { max-width: 920px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.taskpage .task-foot { position: static; border-radius: 0 0 var(--r-l) var(--r-l); }

.sub h3 { margin-bottom: 8px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.steps { margin: 0 0 8px; padding: 0; list-style: none; }
.step { display: flex; align-items: center; gap: 6px; }
.step > form:first-child { flex: 1; min-width: 0; }
.step label { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; cursor: pointer; }
.step input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--done); }
.step span { overflow-wrap: anywhere; }
.step.is-done span { color: var(--ink-3); text-decoration: line-through; }
.step .iconbtn { opacity: 0; }
.step:hover .iconbtn, .step .iconbtn:focus-visible { opacity: 1; }
.inline-add { display: flex; align-items: flex-start; gap: 8px; }
.inline-add .btn { min-height: 36px; }
.notes { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.note { padding: 10px 12px; border-radius: var(--r); background: var(--sunken); }
.note-body { overflow-wrap: anywhere; }
.note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--ink-3); font-size: 12.5px; }

/* --- Kirish va boshlash ---------------------------------------------------------------------------------- */

.auth { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.auth-card {
  width: min(380px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-card .brand { padding: 0; }
.auth-card h1 { margin-top: 20px; font-size: 22px; }
.auth-lead { margin-top: 8px; color: var(--ink-2); }
.auth-card .stack { margin-top: 18px; }

/* --- Tor ekranlar ---------------------------------------------------------------------------------------- */

@media (hover: none) {
  .row-actions, .step .iconbtn { opacity: 1; }
}

/* Yon panel koʻrinib turganda uning tor ekrandagi oʻrinbosarlari kerak emas. */
@media (min-width: 861px) {
  .only-mobile { display: none; }
}

@media (max-width: 1240px) {
  .today.has-rail { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 780px; }
  .rail .section:first-child { margin-top: 26px; }
}

@media (max-width: 1160px) {
  .weekgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 20px 16px 100px; }
  h1 { font-size: 23px; }

  .tabs {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .tab { display: grid; gap: 2px; justify-items: center; padding: 8px 0 7px; color: var(--ink-3); font-size: 11.5px; text-decoration: none; }
  .tab.is-active { color: var(--accent); font-weight: 650; }
  .tab-new { place-items: center; justify-self: center; width: 46px; height: 42px; padding: 0; border-radius: 12px; background: var(--accent-bg); color: #fff; }
  .toasts { bottom: 86px; width: calc(100vw - 32px); }

  .filters, .filters select, .filters input { width: 100%; }
  .table .col-time, .prio-label { display: none; }
  .table th, .table td { padding: 9px 10px; }
  .project { grid-template-columns: auto minmax(0, 1fr) auto; }
  .project-stats { grid-column: 2 / -1; justify-items: start; }
  .project > .iconbtn { grid-area: 1 / 3; }
}

@media (max-width: 720px) {
  .modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .task { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body" "side" "extra" "foot"; grid-template-rows: auto; min-height: 100%; }
  .task-side { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px 20px 14px; border-left: 0; }
  .task-dates { grid-column: 1 / -1; }
  .task-foot .btn-danger { padding: 0 8px; }
  .dangerzone { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .weekgrid { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; }
  .quick { grid-template-columns: minmax(0, 1fr) auto; }
  .quick input[type="text"] { grid-column: 1 / -1; }
  .dayhead { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
  .toast { animation-timing-function: step-end; }
}
