/* Dekanat App — mobil birinchi dizayn */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #18212f;
  --muted: #5d6b7e;
  --line: #e1e6ee;
  --brand: #1f5fbf;
  --brand-ink: #ffffff;
  --brand-soft: #e7effb;
  --green: #1b7f4b;  --green-soft: #e4f4ea;
  --red: #b42318;    --red-soft: #fdecea;
  --yellow: #8a5a00; --yellow-soft: #fff4d6;
  --blue: #1f5fbf;   --blue-soft: #e7effb;
  --gray: #4b5565;   --gray-soft: #eef0f3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-size: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151b23;
  --card: #212830;
  --ink: #f0f6fc;
  --muted: #b7bdc8;
  --line: #3d444d;
  --brand: #478be6;
  --brand-ink: #ffffff;
  --brand-soft: #2a313c;
  --green: #347d39; --green-soft: #1d3326;
  --red: #ff8279; --red-soft: #482522;
  --yellow: #f2c66d; --yellow-soft: #443719;
  --blue: #478be6; --blue-soft: #262c36;
  --gray: #b7bdc8; --gray-soft: #262c36;
  --shadow: 0 1px 3px rgba(0, 0, 0, .22);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* Header */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
:root[data-theme="dark"] .top { background: var(--card); border-bottom-color: var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto; }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
.nav { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.nav-group { position: relative; height: 56px; display: flex; align-items: center; }
.nav-trigger { position: relative; min-height: 44px; padding: 8px 14px; gap: 10px; justify-content: center; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--ink); font-size: .9rem; font-weight: 650; white-space: nowrap; }
.nav-trigger:hover { background: transparent; filter: none; }
.nav-group.open .nav-trigger, .nav-group.has-active .nav-trigger { background: transparent; color: var(--brand); }
.nav-group.has-active .nav-trigger::after, .nav-group.open .nav-trigger::after { content: ""; position: absolute; right: 8px; bottom: -9px; left: 8px; height: 2px; border-radius: 2px; background: var(--brand); }
.nav-chevron { display: inline-block; width: 7px; height: 7px; margin: -3px 0 0 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; color: var(--muted); transform: rotate(45deg); transition: transform .15s ease, color .15s ease; }
.nav-group.open .nav-chevron { transform: translateY(3px) rotate(225deg); color: var(--brand); }
.nav-group.has-active:not(.open) .nav-chevron { color: var(--brand); }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-dropdown { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 25; min-width: 220px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.nav-group.open .nav-dropdown { display: grid; gap: 2px; }
.nav-dropdown a { display: block; padding: 9px 10px; border-radius: 7px; color: var(--muted); font-size: .9rem; }
.nav-dropdown a:hover { background: var(--gray-soft); text-decoration: none; color: var(--ink); }
.nav-dropdown a.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.who { display: flex; align-items: center; gap: 8px; font-size: .9rem; white-space: nowrap; }
.who form { margin: 0; }
.profile-menu { position: relative; }
.profile-menu-toggle { display: inline-flex; min-height: 38px; width: 38px; padding: 3px; border-radius: 50%; }
.profile-avatar { width: 30px; height: 30px; padding: 4px; border: 1px solid var(--line); border-radius: 50%; background: var(--gray-soft); object-fit: contain; }
.profile-avatar-dark { display: none; }
:root[data-theme="dark"] .profile-avatar-light { display: none; }
:root[data-theme="dark"] .profile-avatar-dark { display: block; }
.profile-dropdown { display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; width: 220px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.profile-menu.open .profile-dropdown { display: block; }
.profile-name { margin: 2px 8px 8px; padding: 4px 0 10px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.profile-dropdown form { margin: 0; }
.profile-action { display: flex; width: 100%; min-height: 40px; justify-content: flex-start; gap: 10px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.profile-action:hover { background: var(--gray-soft); text-decoration: none; }
.profile-action svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch { min-height: 34px; padding: 4px 8px; gap: 7px; border-radius: 999px; font-size: .82rem; }
.theme-switch-track { width: 34px; height: 19px; padding: 2px; border-radius: 999px; background: #cbd5e1; display: inline-flex; align-items: center; transition: background .18s; }
.theme-switch-thumb { width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .18s; }
:root[data-theme="dark"] .theme-switch-track { background: var(--brand); }
:root[data-theme="dark"] .theme-switch-thumb { transform: translateX(15px); background: #151b23; }
.notification-button { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--card); }
.notification-button:hover { background: var(--gray-soft); text-decoration: none; }
.notification-bell { width: 18px; height: 18px; object-fit: contain; }
.notification-bell-dark { display: none; }
:root[data-theme="dark"] .notification-bell-light { display: none; }
:root[data-theme="dark"] .notification-bell-dark { display: block; }
.notification-count { position: absolute; top: -5px; right: -6px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--card); border-radius: 999px; background: var(--red); color: #fff; font-size: .65rem; font-weight: 750; line-height: 1; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; padding: 8px 16px; }
  .menu-btn { order: 0; display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; min-height: 38px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
  .brand { order: 1; }
  .menu-btn svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .who { order: 3; display: flex; flex: 0 0 auto; width: auto; margin-left: auto; }
  .nav { display: none; width: 100%; }
  .top.open .nav { order: 4; display: flex; flex: 0 0 100%; align-items: stretch; flex-direction: column; gap: 2px; width: 100%; padding: 8px 0 4px; border-top: 1px solid var(--line); }
  .top.open .who { order: 3; display: flex; flex: 0 0 auto; justify-content: flex-end; width: auto; margin-left: auto; padding: 0; border-top: 0; }
  .nav-group { width: 100%; height: auto; display: block; }
  .nav-trigger { width: 100%; justify-content: space-between; text-align: left; }
  .nav-group .nav-trigger::after { display: none; }
  .nav-dropdown { position: static; min-width: 0; margin: 2px 0 6px; box-shadow: none; }
  .nav-dropdown a { padding-left: 20px; }
}

main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat.green b { color: var(--green); } .stat.red b { color: var(--red); } .stat.blue b { color: var(--blue); } .stat.gray b { color: var(--gray); }

.profile-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.profile-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.profile-hero-avatar { display: grid; place-items: center; width: 62px; height: 62px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.profile-hero-avatar img { width: 38px; height: 38px; object-fit: contain; }
.profile-hero-avatar .profile-avatar-dark { display: none; }
:root[data-theme="dark"] .profile-hero-avatar .profile-avatar-light { display: none; }
:root[data-theme="dark"] .profile-hero-avatar .profile-avatar-dark { display: block; }
.profile-eyebrow { margin: 0 0 3px; color: var(--brand); font-size: .72rem; font-weight: 750; letter-spacing: .1em; }
.profile-identity h1 { margin: 0 0 6px; }
.profile-password-link { white-space: nowrap; }
.profile-password-link svg, .profile-contact-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: stretch; gap: 16px; }
.profile-info-card, .profile-contact-card { padding: 20px; }
.profile-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.profile-card-heading h2 { margin: 0; }
.profile-card-heading .profile-eyebrow { margin-bottom: 2px; }
.profile-details { display: grid; gap: 0; margin: 0; }
.profile-details > div { display: grid; grid-template-columns: minmax(110px, .65fr) minmax(0, 1.35fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.profile-details > div:first-child { padding-top: 4px; }
.profile-details > div:last-child { padding-bottom: 4px; border-bottom: 0; }
.profile-details dt { color: var(--muted); font-size: .9rem; }
.profile-details dd { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.profile-value-line { display: block; width: 100%; }
.profile-contact-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.profile-contact-card form { margin-top: 18px; }
.profile-contact-card .field { margin-bottom: 16px; }
.profile-contact-card .hint { margin-bottom: 0; }
.profile-schedule { margin-top: 18px; }
.profile-schedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.profile-schedule-heading h2 { margin: 0; }
.profile-schedule-heading .profile-eyebrow { margin-bottom: 3px; }
.notification-heading { align-items: center; max-width: 850px; margin: 0 auto 18px; }
.notification-heading h1 { margin-bottom: 4px; }
.notification-heading p:last-child { margin-bottom: 0; }
.notification-heading form { margin: 0; }
.notification-eyebrow { margin: 0 0 4px; color: var(--brand); font-size: .72rem; font-weight: 750; letter-spacing: .1em; }
.notification-tabs { display: flex; gap: 8px; max-width: 850px; margin: 0 auto 12px; border-bottom: 1px solid var(--line); }
.notification-tabs a { padding: 9px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: .9rem; }
.notification-tabs a.active { border-bottom-color: var(--brand); color: var(--brand); font-weight: 650; }
.notification-list { display: grid; gap: 10px; max-width: 850px; margin: 0 auto; }
.notification-item { display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px; }
.notification-item.unread { border-left: 3px solid var(--brand); }
.notification-item-icon, .notification-empty-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.notification-item-icon svg, .notification-empty-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-content { min-width: 0; flex: 1; }
.notification-content time { color: var(--muted); font-size: .78rem; }
.notification-content p { margin: 3px 0 0; overflow-wrap: anywhere; }
.notification-read { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.notification-item form { margin: 0; }
.notification-empty { padding: 38px 18px; text-align: center; }
.notification-empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; }
.notification-empty h2 { margin-bottom: 5px; }
.notification-empty p { margin: 0; }
@media (max-width: 760px) {
  .profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .profile-hero { align-items: flex-start; flex-direction: column; }
  .profile-password-link { align-self: stretch; }
  .profile-info-card, .profile-contact-card { padding: 16px; }
  .profile-details > div { grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); gap: 8px; }
  .notification-heading { align-items: flex-start; flex-direction: column; }
  .notification-item { align-items: flex-start; gap: 10px; padding: 12px; }
  .notification-item .btn { padding: 4px 8px; font-size: .8rem; }
}

dl.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Buttons */
.btn, button { font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.btn:hover, button:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-blue { background: var(--blue-soft); border-color: #c7d8f3; color: var(--blue); }
.btn-red { background: var(--card); border-color: #f0c2bd; color: var(--red); }
.btn-gray { background: var(--gray-soft); color: var(--gray); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .88rem; }
.btn-lg { min-height: 52px; padding: 12px 20px; font-size: 1.05rem; font-weight: 600; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; color: var(--brand); padding: 0; min-height: 0; }
button[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; margin: 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.field .err { color: var(--red); font-size: .85rem; margin-top: 4px; }
input:not([type]), input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input[type=tel], input[type=url], input[type=email], input[type=file], select, textarea {
  font: inherit; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #cdd5e0; border-radius: 8px; background: #fff; color: var(--ink);
}
:root[data-theme="dark"] input:not([type]),
:root[data-theme="dark"] input[type=text],
:root[data-theme="dark"] input[type=password],
:root[data-theme="dark"] input[type=date],
:root[data-theme="dark"] input[type=time],
:root[data-theme="dark"] input[type=number],
:root[data-theme="dark"] input[type=search],
:root[data-theme="dark"] input[type=tel],
:root[data-theme="dark"] input[type=url],
:root[data-theme="dark"] input[type=email],
:root[data-theme="dark"] input[type=file],
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: var(--card); border-color: var(--line); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid #9cc0f5; outline-offset: 1px; }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 48px; }
.password-toggle { position: absolute; z-index: 2; top: 50%; right: 5px; transform: translateY(-50%); width: 36px; min-height: 34px; padding: 6px; border: 0; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--gray-soft); color: var(--ink); }
.password-toggle svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle svg[hidden] { display: none; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: 20px; height: 20px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters > * { flex: 1 1 150px; }
.filters .field { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 600; padding: 0 6px; }
.multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert.ok { background: var(--green-soft); border-color: #b6dec4; color: #0f5132; }
.alert.err { background: var(--red-soft); border-color: #f3c0ba; color: #7a1a12; }
.alert.info { background: var(--blue-soft); border-color: #c7d8f3; color: #173f80; }
.alert.warn { background: var(--yellow-soft); border-color: #f1d98c; color: #5c3d00; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); background: #fafbfc; white-space: nowrap; }
.audit-card.card.flush { overflow: visible; }
.audit-table-wrap { overflow: visible; }
.audit-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.audit-table thead th { position: sticky; top: 56px; z-index: 8; background: var(--card); box-shadow: 0 1px 0 var(--line); }
.audit-table th:nth-child(1) { width: 155px; }
.audit-table th:nth-child(2) { width: 100px; }
.audit-table th:nth-child(3) { width: 135px; }
.audit-table th:nth-child(4) { width: 145px; }
.audit-table th:nth-child(5) { width: 115px; }
.audit-table td { overflow-wrap: anywhere; }
.audit-detail summary { color: var(--brand); cursor: pointer; font-size: .86rem; }
.audit-detail pre { max-height: 180px; overflow: auto; margin: 8px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--gray-soft); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; }
.audit-detail-cell { min-width: 180px; }
:root[data-theme="dark"] th, :root[data-theme="dark"] .week .col h3 { background: #262c36; }
:root[data-theme="dark"] .btn-blue, :root[data-theme="dark"] .btn-red { border-color: var(--line); }
:root[data-theme="dark"] .alert.ok { background: var(--green-soft); border-color: #285a43; color: #a3e6c2; }
:root[data-theme="dark"] .alert.err { background: var(--red-soft); border-color: #753a35; color: #ffb0aa; }
:root[data-theme="dark"] .alert.info { background: var(--blue-soft); border-color: #3b5e89; color: #b8d2ff; }
:root[data-theme="dark"] .alert.warn { background: var(--yellow-soft); border-color: #78632e; color: #f4d78d; }
:root[data-theme="dark"] .slot span { background: var(--card); border-color: var(--line); color: var(--ink); }
:root[data-theme="dark"] .ticket { background: #262c36; border-color: #3d444d; }
:root[data-theme="dark"] .day.off, :root[data-theme="dark"] .slot.busy span { background: #262c36; color: #9198a1; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
tr.off td { opacity: .55; }
@media (max-width: 700px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack td { display: flex; gap: 12px; border: 0; padding: 4px 14px; }
  table.stack td::before { content: attr(data-l); color: var(--muted); min-width: 92px; font-size: .85rem; }
  table.stack td.actions { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  table.stack td.actions::before { content: none; }
}

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.b-kutilmoqda { background: var(--yellow-soft); color: var(--yellow); border-color: #f1d98c; }
.b-tasdiqlandi { background: var(--blue-soft); color: var(--blue); border-color: #c7d8f3; }
.b-qabul_qilindi { background: var(--green-soft); color: var(--green); border-color: #b6dec4; }
.b-kelmadi { background: var(--gray-soft); color: var(--gray); border-color: #d6dbe3; }
.b-rad_etildi, .b-bekor_qilindi { background: var(--red-soft); color: var(--red); border-color: #f3c0ba; }
.b-on { background: var(--green-soft); color: var(--green); }
.b-off { background: var(--gray-soft); color: var(--gray); }
.b-role { background: var(--brand-soft); color: var(--brand); }

/* Wizard */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.done { background: #8fb3e8; }
.steps span.active { background: var(--brand); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: .9rem; }
.crumbs a, .crumbs span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.choice-list { display: grid; gap: 10px; }
.choice { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); box-shadow: var(--shadow); }
.choice:hover { border-color: var(--brand); text-decoration: none; }
.choice b { display: block; }
.choice small { display: block; }
.choice.mine { border-left: 4px solid var(--brand); }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.day { display: block; text-align: center; padding: 10px 6px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.day b { display: block; font-size: 1.15rem; }
.day small { display: block; font-size: .78rem; }
a.day:hover { border-color: var(--brand); text-decoration: none; }
.day.off { background: #f1f3f6; color: #98a2b3; }
.slot-group { margin-bottom: 18px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span { display: block; text-align: center; padding: 10px 4px; border: 1px solid #c7d8f3; border-radius: 8px; background: #fff; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.slot input:focus-visible + span { outline: 3px solid #9cc0f5; }
.slot.busy span { background: #f1f3f6; color: #a0a9b8; border-color: var(--line); text-decoration: line-through; cursor: not-allowed; font-weight: 400; }
.slot { position: relative; margin: 0; font-weight: 400; }

/* Ticket */
.ticket { border: 2px dashed #b9cdee; background: #fbfdff; text-align: center; }
.ticket .num { font-size: 3rem; font-weight: 800; color: var(--brand); line-height: 1; margin: 6px 0; }

/* Weekly grid */
.week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; }
.week .col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; }
.week .col h3 { font-size: .9rem; padding: 8px 10px; margin: 0; border-bottom: 1px solid var(--line); background: #fafbfc; border-radius: var(--radius) var(--radius) 0 0; }
.week .item { margin: 8px; padding: 8px; border-radius: 8px; background: var(--brand-soft); font-size: .85rem; }
.week .item b { display: block; }
@media (max-width: 860px) { .week { grid-template-columns: 1fr; } .week .col { min-height: 0; } }

/* Tree */
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tree li:last-child { border-bottom: 0; }
.tree .t-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.next-card { border-left: 4px solid var(--green); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
details summary { cursor: pointer; }
details.act { display: inline-block; position: relative; }
details.act[open] > form { position: absolute; right: 0; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 10px; width: 260px; text-align: left; margin-top: 4px; }
details.act summary { list-style: none; }
details.act summary::-webkit-details-marker { display: none; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #18212f; color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; }
.confirm-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: 0 24px 80px rgba(0, 0, 0, .35); }
.confirm-dialog::backdrop { background: rgba(5, 10, 18, .68); backdrop-filter: blur(3px); }
.confirm-dialog-content { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 18px; }
.confirm-dialog-mark { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 1.2rem; font-weight: 750; }
.confirm-dialog-copy { min-width: 0; }
.confirm-dialog-copy h2 { margin: 2px 0 6px; font-size: 1.05rem; }
.confirm-dialog-copy p { margin: 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.htmx-request { opacity: .6; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 24px; }
.auth .brand { justify-content: center; margin-bottom: 16px; font-size: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.auth input::placeholder { color: var(--muted); opacity: 1; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.big-cta { display: flex; flex-direction: column; gap: 4px; }
.center { text-align: center; }
.auth-title { font-size: 1.2rem; }
.auth-foot { margin: 14px 0 0; font-size: .88rem; }
.mt { margin-top: 12px; } .mb0 { margin-bottom: 0; } .nowrap { white-space: nowrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tree .lvl-1 { margin-left: 18px; } .tree .lvl-2 { margin-left: 36px; } .tree .lvl-3 { margin-left: 54px; } .tree .lvl-4, .tree .lvl-5 { margin-left: 72px; }
.tree .lvl-1::before, .tree .lvl-2::before, .tree .lvl-3::before, .tree .lvl-4::before { content: "└ "; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
