/* Vaqt rejasi — asosiy uslublar. Tokenlar: tokens.css */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
:where(ul[class], ol[class]) { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Typografiya ---------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { color: var(--text); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--fs-xl); line-height: 1.2; }
h2 { font-size: var(--fs-lg); line-height: 1.35; }
h3 { font-size: var(--fs-base); line-height: 1.4; overflow-wrap: anywhere; }
small { font-size: var(--fs-sm); }
time, .tabular { font-variant-numeric: tabular-nums; }

a { color: var(--accent-hover); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--text); }

/* ---------- Konteyner ---------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--sp-8)); margin-inline: auto; padding-inline: var(--sp-4); }
.page-content { flex: 1 0 auto; padding-block: var(--sp-6) 72px; }

/* ---------- Header (shell) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 21, .85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.header-inner { min-height: var(--header-h); display: flex; align-items: center; gap: var(--sp-4); }
.site-header .brand-name { display: none; }

.brand { display: inline-flex; align-items: center; gap: var(--sp-2); flex: 0 0 auto; color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

.main-nav { display: flex; align-items: center; gap: var(--sp-1); }
.nav-link { padding: 6px var(--sp-2); border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 500; transition: color var(--ease), background-color var(--ease); }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--accent-weak); }

.account-area { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.account-area form { margin: 0; }
.account-email { display: none; max-width: 240px; overflow: hidden; color: var(--text-2); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }

/* Ertangi muhim vazifalar eslatmasi */
.reminder-banner { margin-top: var(--sp-6); }
.reminder-banner .reminder-inner {
  padding: var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  border: 1px solid rgba(99, 102, 241, .35);
  border-radius: var(--r-md);
  background: var(--accent-weak);
}
.reminder-mark { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: var(--fs-sm); font-weight: 600; }
.reminder-banner h2 { margin-bottom: var(--sp-1); font-size: 14px; }
.reminder-banner ul { padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-6); color: var(--text-2); font-size: 14px; }
.reminder-banner li { display: flex; align-items: baseline; gap: var(--sp-2); }
.reminder-banner time { color: var(--accent-hover); font-size: var(--fs-xs); font-weight: 500; }

/* Footer (shell) */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-xs); }
.site-footer .container { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: var(--sp-4); }
.site-footer .footer-note { display: none; }

/* ---------- Tugmalar ---------- */
.btn {
  min-height: 40px;
  padding: 0 var(--sp-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }

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

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

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

.btn-sm { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-lg { min-height: 46px; padding: 0 var(--sp-6); font-size: var(--fs-base); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn .icon { flex: none; }
.btn-ghost-danger:hover { background: rgba(239, 68, 68, .12); color: var(--danger); }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ---------- Inputlar ---------- */
.input,
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  width: 100%;
  min-height: 40px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
}
:where(input, select, textarea)::placeholder { color: var(--muted); }
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):hover { border-color: #3A4050; }
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
:where(textarea) { min-height: 88px; resize: vertical; line-height: 1.5; }
:where(select) { cursor: pointer; }
:where(input[type="date"], input[type="time"])::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
label { color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }

/* ---------- Komponentlar ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.field-label { color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }
.field-optional { color: var(--muted); font-weight: 400; }
.field-hint { color: var(--muted); font-size: var(--fs-xs); }
.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-addon { position: absolute; top: 50%; right: 4px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); transform: translateY(-50%); transition: color var(--ease), background-color var(--ease); }
.input-addon:hover { background: var(--surface-2); color: var(--text); }
.input-addon:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.password-toggle .icon-hide, .password-toggle[aria-pressed="true"] .icon-show { display: none; }
.password-toggle[aria-pressed="true"] .icon-hide { display: block; }

.alert { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid; border-radius: var(--r-md); font-size: 14px; animation: rise .25s ease-out both; }
.alert .icon { flex: none; margin-top: 2px; }
.alert p + p { margin-top: var(--sp-1); }
.alert-success { border-color: rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .08); color: #86EFAC; }
.alert-danger { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08); color: #FCA5A5; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.segmented-item { flex: 1; min-width: 84px; padding: 7px var(--sp-3); border-radius: 7px; color: var(--text-2); font-size: 14px; font-weight: 500; text-align: center; white-space: nowrap; transition: color var(--ease), background-color var(--ease); }
.segmented-item:hover { background: var(--surface-2); color: var(--text); }
.segmented-item[aria-current="page"] { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Card ---------- */
.card { padding: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.card-raised { box-shadow: var(--shadow-2); }

/* ---------- Utility ---------- */
.text-2 { color: var(--text-2); }
.text-muted { color: var(--muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.spacer { flex: 1; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Sahifa sarlavhasi ---------- */
.eyebrow { color: var(--accent-hover); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.page-head { margin-bottom: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.page-head h1 { margin-top: var(--sp-1); }
.page-sub { margin-top: var(--sp-1); color: var(--text-2); font-variant-numeric: tabular-nums; }
.dot-sep { margin: 0 var(--sp-2); color: var(--muted); }

/* ---------- Ustuvorlik ranglari (karta, chip, nuqta, tanlagich uchun umumiy) ---------- */
.priority-high, .chip-high { --p: var(--high); --p-weak: rgba(239, 68, 68, .12); --p-text: #FCA5A5; }
.priority-medium, .chip-medium { --p: var(--medium); --p-weak: rgba(245, 158, 11, .12); --p-text: #FCD34D; }
.priority-low, .chip-low { --p: var(--low); --p-weak: rgba(59, 130, 246, .12); --p-text: #93C5FD; }
.priority-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--p, var(--muted)); }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; }
.chip-high, .chip-medium, .chip-low { background: var(--p-weak); color: var(--p-text); }

/* ---------- Forma qismlari ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.form-grid-end { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }

.priority-picker { min-width: 0; margin: 0; padding: 0; border: 0; display: block; }
.priority-picker legend { float: none; margin-bottom: var(--sp-2); padding: 0; }
.priority-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.priority-option { position: relative; }
.priority-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.priority-option .flag { color: var(--p); }
.priority-option input:checked + span .flag { fill: currentColor; }
.priority-option > span { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); color: var(--text-2); font-size: 14px; font-weight: 500; transition: border-color var(--ease), background-color var(--ease), color var(--ease), box-shadow var(--ease); }
.priority-option:hover > span { border-color: #3A4050; color: var(--text); }
.priority-option input:checked + span { border-color: var(--p); background: var(--p-weak); color: var(--text); }
.priority-option input:focus-visible + span { box-shadow: var(--focus-ring); }

.switch { position: relative; min-height: 40px; display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; user-select: none; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border); transition: background-color var(--ease); }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); box-shadow: var(--shadow-1); content: ""; transition: transform .22s cubic-bezier(.3, 1.5, .5, 1), background-color var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { background: #fff; transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus-ring); }
.switch-label { display: inline-flex; align-items: center; gap: 6px; }
.switch-label .icon { color: var(--muted); transition: color var(--ease), fill var(--ease); }
.switch input:checked ~ .switch-label .icon { color: var(--medium); fill: currentColor; }

/* ---------- Kunlik ko‘rinish ---------- */
.day-layout { display: flex; flex-direction: column; }
.day-main { min-width: 0; display: contents; }
/* Mobilda filtr tasmasi vazifalar ro‘yxati ustida turadi */
.day-main > * { order: 6; }
.day-main > .page-head { order: 1; }
.day-main > .day-nav { order: 2; }
.day-main > .summary { order: 3; }
.day-main > .quick-add { order: 4; }
.sidebar { order: 5; }
.day-main > .task-section { order: 6; }
.side-filters { margin-bottom: var(--sp-4); }
.day-main > .page-head { flex-direction: row; align-items: flex-start; justify-content: space-between; }

/* Sidebar: mobilda gorizontal tasma, desktopda chap ustun */
.sidebar { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.side-views { display: none; }
.side-title { display: none; margin: 0 0 var(--sp-2) var(--sp-3); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.side-list { display: flex; gap: var(--sp-2); }
.side-views .side-list { padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.side-views .side-list > li { flex: 1; }
.side-filters .side-list { margin-inline: calc(-1 * var(--sp-4)); padding: 2px var(--sp-4); overflow-x: auto; scrollbar-width: none; }
.side-filters .side-list::-webkit-scrollbar { display: none; }
.side-filters[hidden] { display: none; }
.side-item { position: relative; width: 100%; min-height: 36px; padding: 0 var(--sp-3); display: flex; align-items: center; justify-content: center; gap: var(--sp-2); border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap; transition: background-color var(--ease), color var(--ease), border-color var(--ease); }
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.side-item .icon { flex: none; color: var(--muted); transition: color var(--ease); }
.side-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-item.is-static { cursor: default; }
.side-item.is-static:hover { background: transparent; color: var(--text-2); }
.side-filters .side-item.is-static:hover { background: var(--surface); }
.side-hint { display: none; margin: var(--sp-2) var(--sp-3) 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.side-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.side-item[aria-current="page"] { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.side-item[aria-current="page"] .icon, .side-item[aria-current="page"] .side-count { color: var(--on-accent); }
.side-item[aria-current="page"] .side-count { background: rgba(255, 255, 255, .18); }
.side-filters .side-item { border-color: var(--border); background: var(--surface); }
.side-filters .side-item[aria-pressed="true"] { border-color: rgba(99, 102, 241, .5); background: var(--accent-weak); color: var(--text); }
.side-filters .side-item[aria-pressed="true"] .icon { color: var(--accent-hover); }
.side-filters .side-item[aria-pressed="true"] .side-count { background: var(--accent); color: var(--on-accent); }

/* Jonli soat */
.clock-pill { flex: none; min-height: 34px; padding: 0 var(--sp-3); display: inline-flex; align-items: center; gap: var(--sp-2); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--success); box-shadow: var(--shadow-1); }
.clock-time { color: var(--text); font-size: 15px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* Xulosa (summary) */
.summary { margin-bottom: var(--sp-6); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.stat { min-width: 0; padding: var(--sp-3); display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); animation: rise .3s ease-out both; }
.stat:nth-child(2) { animation-delay: .04s; }
.stat:nth-child(3) { animation-delay: .08s; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.stat-label .icon { flex: none; color: var(--muted); }
.stat-value { color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-of { color: var(--muted); font-size: 15px; font-weight: 500; }
.stat-note { display: none; color: var(--muted); font-size: var(--fs-xs); }
.stat .progress { width: 100%; margin-top: var(--sp-1); }
.stat-success .stat-label .icon, .stat-success .stat-value { color: var(--success); }
.stat-accent .stat-label .icon { color: var(--accent-hover); }

.day-nav { margin-bottom: var(--sp-6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.date-jump { order: -1; flex: 1 0 100%; min-width: 0; margin: 0; display: flex; gap: var(--sp-2); }
.date-jump .input { flex: 1; min-width: 0; }
.today-btn { flex: 1; }
.day-next { order: 1; }
.today-btn.is-current { border-color: transparent; background: var(--accent-weak); color: var(--accent-hover); }

.quick-add { margin-bottom: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); transition: border-color var(--ease), box-shadow var(--ease); }
.quick-add:focus-within { border-color: rgba(99, 102, 241, .6); box-shadow: var(--focus-ring); }
.quick-add form { margin: 0; }
.quick-add-row { padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); display: flex; align-items: center; gap: var(--sp-2); }
.quick-add-icon { flex: none; display: grid; color: var(--accent-hover); }
.quick-add-input { flex: 1; min-width: 0; min-height: 40px; padding: 0; border: 0; background: transparent; font-size: var(--fs-base); }
.quick-add-input:hover, .quick-add-input:focus { border: 0; box-shadow: none; }
.quick-add-more-btn { width: 32px; padding: 0; }
.quick-add-more-btn [data-expand-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.quick-add-more-btn .chevron { transition: transform .2s ease; }
.quick-add-more-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.quick-add-more { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); border-top: 1px solid var(--border); animation: rise .2s ease-out both; }
.quick-add-more[hidden] { display: none; }

.list-filter-note { color: var(--text-2); font-size: var(--fs-sm); }
.list-head { margin-bottom: var(--sp-3); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.count-badge { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; vertical-align: middle; }
.progress-wrap { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.progress { width: 120px; height: 6px; overflow: hidden; border: 0; border-radius: 999px; background: var(--surface-2); -webkit-appearance: none; appearance: none; }
.progress::-webkit-progress-bar { border-radius: 999px; background: var(--surface-2); }
.progress::-webkit-progress-value { border-radius: 999px; background: var(--success); }
.progress::-moz-progress-bar { border-radius: 999px; background: var(--success); }

.task-list { display: flex; flex-direction: column; gap: 6px; }
.task-card { position: relative; padding: 14px var(--sp-2) 14px var(--sp-4); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--sp-3); overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); transition: border-color var(--ease), background-color .25s ease; animation: rise .3s ease-out both; }
.task-card:nth-child(2) { animation-delay: .03s; }
.task-card:nth-child(3) { animation-delay: .06s; }
.task-card:nth-child(4) { animation-delay: .09s; }
.task-card:nth-child(n + 5) { animation-delay: .12s; }
.task-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--p); content: ""; transition: opacity .25s ease; }
.task-card:hover { border-color: #363C49; background: #1A1D25; }
.task-card[hidden] { display: none; }

.task-check-form { margin: 0; }
.task-check { position: relative; width: 22px; height: 22px; margin-top: 1px; display: grid; place-items: center; padding: 0; border: 2px solid var(--p, var(--muted)); border-radius: 50%; background: transparent; color: transparent; transition: border-color var(--ease), background-color .2s ease, color .2s ease, transform .15s ease; }
.task-check .icon path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s ease .05s; }
.task-check::after { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--success); opacity: 0; content: ""; pointer-events: none; }
.task-check:hover { border-color: var(--success); background: rgba(34, 197, 94, .1); color: rgba(34, 197, 94, .8); }
.task-check:hover .icon path { stroke-dashoffset: 0; }
.task-check:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.task-check:active { transform: scale(.85); }

.task-body { min-width: 0; }
.task-time { flex: none; color: var(--accent-hover); font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; transition: color .25s ease; }
.task-title { min-width: 0; font-size: var(--fs-base); font-weight: 500; transition: color .25s ease; }
.task-title > span { background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 0 1.5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size .3s ease; }
.task-star { display: inline-block; margin-left: 2px; color: var(--medium); vertical-align: -2px; }
.task-star .icon { fill: currentColor; }
.task-desc { margin-top: var(--sp-1); color: var(--text-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; transition: color .25s ease; }
.task-meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-3); }
.task-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--p-text); font-size: var(--fs-xs); font-weight: 500; }
.task-flag .flag, .priority-option .flag { fill: var(--p-weak); }
.task-flag .flag { color: var(--p); fill: currentColor; }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.task-side .task-time { padding-right: var(--sp-2); line-height: 22px; }
.task-actions { display: flex; gap: 2px; transition: opacity var(--ease); }
.task-actions form { margin: 0; }

.task-card.is-done { background: transparent; }
.task-card.is-done::before { opacity: .3; }
.is-done .task-flag { opacity: .5; }
.is-done .task-check { border-color: var(--success); background: var(--success); color: var(--bg); }
.is-done .task-check .icon path { stroke-dashoffset: 0; }
.is-done .task-check:hover { border-color: var(--success); color: var(--bg); }
.is-done .task-title { color: var(--muted); }
.is-done .task-title > span { background-size: 100% 1.5px; }
.is-done .task-time, .is-done .task-desc { color: var(--muted); }
.is-toggling .task-check { animation: pop .32s ease; }
.is-toggling.is-done .task-check::after { animation: ripple .45s ease-out; }

@keyframes ripple {
  from { opacity: .7; transform: scale(.6); }
  to { opacity: 0; transform: scale(1.35); }
}

@keyframes pop {
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.empty-state { padding: var(--sp-8) var(--sp-6); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); border: 1px dashed var(--border); border-radius: var(--r-lg); color: var(--text-2); text-align: center; animation: rise .3s ease-out both; }
.empty-icon { width: 56px; height: 56px; margin-bottom: var(--sp-2); display: grid; place-items: center; border-radius: 50%; background: var(--accent-weak); color: var(--accent-hover); }
.empty-title { color: var(--text); font-weight: 500; }
.empty-text { max-width: 320px; font-size: 14px; }
.empty-state .btn { margin-top: var(--sp-3); }

@media (min-width: 480px) {
  .quick-add-more-btn { width: auto; padding: 0 var(--sp-3); }
  .quick-add-more-btn [data-expand-label] { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

@media (min-width: 640px) {
  .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .day-nav { flex-wrap: nowrap; }
  .date-jump, .day-next { order: 0; flex: 0 1 auto; }
  .stat { padding: var(--sp-4); }
  .stat-value { font-size: 26px; }
  .stat-note { display: block; }
  .task-side { flex-direction: row; align-items: center; gap: var(--sp-2); }
  .day-main > .page-head { align-items: flex-end; }
  .date-jump .input { width: 180px; }
  .today-btn { flex: none; margin-left: auto; }
  .task-card { padding-right: var(--sp-3); }
}

@media (min-width: 960px) {
  .day-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; gap: var(--sp-8); }
  .day-main { order: 1; display: flex; flex-direction: column; }
  .day-layout > .sidebar { order: 0; }
  .side-filters { margin-bottom: 0; }
  .sidebar { position: sticky; top: calc(var(--header-h) + var(--sp-6)); gap: var(--sp-6); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
  .side-title { display: block; }
  .side-hint { display: block; }
  .sidebar .side-filters .side-item.is-static:hover { background: transparent; }
  .side-views { display: block; }
  .side-list, .sidebar .side-views .side-list, .sidebar .side-filters .side-list { margin: 0; padding: 0; flex-direction: column; gap: 2px; overflow: visible; border: 0; background: none; }
  .side-item, .side-filters .side-item { justify-content: flex-start; border-color: transparent; background: transparent; }
  .side-label { flex: 1; }
  .side-filters .side-item[aria-pressed="true"] { border-color: transparent; }
  .side-filters .side-item[aria-pressed="true"]::before { position: absolute; inset: 8px auto 8px -12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); content: ""; }
}

@media (hover: hover) {
  .task-actions { opacity: .45; }
  .task-card:hover .task-actions, .task-card:focus-within .task-actions { opacity: 1; }
}

/* ---------- Vazifa formasi ---------- */
.form-view { max-width: 620px; margin-inline: auto; }
.back-link { margin-bottom: var(--sp-6); display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.back-link .icon { transition: transform var(--ease); }
.back-link:hover { color: var(--text); }
.back-link:hover .icon { transform: translateX(-3px); }
.form-view-head { margin-bottom: var(--sp-6); }
.form-view-head h1 { margin-top: var(--sp-1); }
.form-card { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); animation: rise .3s ease-out both; }
.form-actions { padding-top: var(--sp-4); display: flex; gap: var(--sp-2); border-top: 1px solid var(--border); }
.form-actions .btn { flex: 1; }

@media (min-width: 480px) {
  .form-card { padding: var(--sp-6); }
  .form-actions { justify-content: flex-end; }
  .form-actions .btn { flex: none; min-width: 120px; }
}

/* ---------- Oylik ko‘rinish ---------- */
.calendar { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); animation: rise .3s ease-out both; }
.calendar-head { padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); border-bottom: 1px solid var(--border); }
.calendar-title { font-size: var(--fs-base); }
.calendar-nav { display: flex; gap: var(--sp-1); }
.calendar-nav .is-current { border-color: transparent; background: var(--accent-weak); color: var(--accent-hover); }

.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--border); }
.calendar-weekdays > span { padding: var(--sp-2) 0; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.wd-long { display: none; }

.calendar-grid > li { min-width: 0; display: flex; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar-grid > li:nth-child(7n) { border-right: 0; }
.calendar-grid > li:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day { flex: 1; min-width: 0; min-height: 64px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); transition: background-color var(--ease); }
.cal-day:hover { background: var(--surface-2); color: var(--text); }
.cal-day:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.cal-head { width: 100%; display: flex; align-items: center; justify-content: center; }
.cal-num { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; transition: background-color var(--ease), box-shadow var(--ease); }
.cal-day.is-outside { background: rgba(0, 0, 0, .18); }
.cal-day.is-outside .cal-num { color: var(--muted); }
.cal-day.is-today { background: linear-gradient(var(--accent-weak), var(--accent-weak)), var(--surface); }
.cal-day.is-today .cal-num { color: var(--text); font-weight: 600; box-shadow: 0 0 0 2px var(--accent); }
.cal-day:hover .cal-num { background: var(--border); }
.cal-count { display: none; }
.cal-dots { max-width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.cal-dots .priority-dot { width: 6px; height: 6px; }
.priority-dot.is-done { opacity: .35; }
.cal-tasks { display: none; }

.month-foot { margin-top: var(--sp-4); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); color: var(--text-2); font-size: var(--fs-sm); }
.legend { display: flex; gap: var(--sp-4); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }

@media (min-width: 760px) {
  .wd-long { display: inline; }
  .wd-short { display: none; }
  .cal-day { min-height: 116px; padding: var(--sp-2); align-items: stretch; }
  .cal-head { justify-content: space-between; }
  .cal-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; }
  .cal-dots { display: none; }
  .cal-tasks { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .cal-task { min-width: 0; padding: 2px 6px; display: flex; gap: 6px; border-radius: 5px; background: var(--p-weak); box-shadow: inset 2px 0 0 var(--p); font-size: 11px; line-height: 1.5; }
  .cal-task-time { flex: none; color: var(--text-2); font-variant-numeric: tabular-nums; }
  .cal-task-title { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
  .cal-task.is-done { background: var(--surface-2); box-shadow: none; }
  .cal-task.is-done .cal-task-title { color: var(--muted); text-decoration: line-through; }
  .cal-more { padding-left: 6px; color: var(--muted); font-size: 11px; }
}

/* ---------- Xato / holat sahifasi ---------- */
.status-view { min-height: 55vh; display: grid; place-items: center; padding-block: var(--sp-6); }
.status-card { width: 100%; max-width: 480px; padding: var(--sp-8) var(--sp-4); display: flex; flex-direction: column; align-items: center; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); text-align: center; animation: rise .3s ease-out both; }
.status-code { margin-bottom: var(--sp-4); background: linear-gradient(180deg, var(--accent-hover), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 64px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.status-icon { width: 56px; height: 56px; margin-bottom: var(--sp-4); display: grid; place-items: center; border-radius: 50%; background: var(--accent-weak); color: var(--accent-hover); }
.is-validation .status-icon { background: rgba(239, 68, 68, .12); color: var(--danger); }
.status-card h1 { margin-top: var(--sp-2); font-size: var(--fs-xl); }
.status-message { max-width: 360px; margin-top: var(--sp-2); color: var(--text-2); }
.status-errors { width: 100%; margin-top: var(--sp-6); padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); border: 1px solid rgba(239, 68, 68, .35); border-radius: var(--r-md); background: rgba(239, 68, 68, .08); color: #FCA5A5; font-size: 14px; text-align: left; }
.status-errors li { display: flex; align-items: flex-start; gap: var(--sp-2); }
.status-errors .icon { flex: none; margin-top: 3px; }
.status-actions { width: 100%; margin-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-2); }

@media (min-width: 480px) {
  .status-card { padding: var(--sp-8); }
  .status-actions { width: auto; flex-direction: row; justify-content: center; }
}

/* ---------- Kirish / ro‘yxatdan o‘tish ---------- */
.auth-page { background: radial-gradient(ellipse 90% 55% at 50% -12%, rgba(99, 102, 241, .2), transparent 70%), var(--bg); }
.auth-shell { width: 100%; max-width: 440px; margin: auto; padding: var(--sp-8) var(--sp-4); display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); }
.auth-brand { font-size: 20px; }
.auth-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
.auth-card { width: 100%; padding: var(--sp-6) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); animation: rise .35s ease-out both; }
.auth-tabs { display: flex; width: 100%; }
.auth-header h1 { font-size: var(--fs-xl); }
.auth-lead { margin-top: var(--sp-1); color: var(--text-2); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-form .btn { margin-top: var(--sp-2); }
.auth-switch { color: var(--text-2); font-size: 14px; text-align: center; }
.auth-switch a { margin-left: var(--sp-1); font-weight: 500; }
.auth-foot { color: var(--muted); font-size: var(--fs-xs); }
@media (min-width: 480px) {
  .auth-card { padding: var(--sp-8); }
}

/* ---------- Shell: kattaroq ekranlar ---------- */
@media (min-width: 480px) {
  h1 { font-size: var(--fs-2xl); }
  .site-header .brand-name { display: inline; }
  .nav-link { padding-inline: var(--sp-3); }
}

@media (min-width: 760px) {
  .container { padding-inline: var(--sp-8); }
  .header-inner { gap: var(--sp-8); }
  .account-email { display: block; }
  .side-filters .side-list { margin-inline: calc(-1 * var(--sp-8)); padding-inline: var(--sp-8); }
  .page-content { padding-top: var(--sp-8); }
  .site-footer .container { justify-content: space-between; }
  .site-footer .footer-note { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
