:root {
    /* ---- Material-inspired цветовые токены (сохраняем зелёный бренд) ---- */
    --primary: #1f7a45;
    --primary-dark: #145c34;
    --primary-container: #d9f2e2;
    --on-primary-container: #0d3d21;
    --success: #16a34a;
    --error: #ba1a1a;
    --error-container: #ffdad4;
    --on-error-container: #6f0009;

    --bg: #f3f6f4;              /* surface */
    --surface: #ffffff;
    --surface-variant: #eef2ee; /* нейтральный фон для чипов/полей */
    --card: #ffffff;
    --inverse-surface: #2e352f; /* для snackbar */

    --text: #1a1c1a;            /* on-surface */
    --muted: #5f6b62;           /* on-surface-variant */
    --border: #dfe4e0;          /* outline-variant */
    --outline: #8a9690;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;

    --elevation-1: 0 1px 2px rgba(15,40,25,.10), 0 1px 4px rgba(15,40,25,.08);
    --elevation-2: 0 2px 6px rgba(15,40,25,.12), 0 4px 14px rgba(15,40,25,.10);
    --elevation-3: 0 8px 24px rgba(15,40,25,.18);
    --shadow: var(--elevation-1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: .01em;
}

h1, h2, h3 { letter-spacing: 0; }

/* ---------- App bar (Material Top App Bar) ---------- */
.app-bar {
    position: sticky; top: 0; z-index: 100;
    background: var(--primary);
    color: #fff;
    padding: 14px 18px;
    box-shadow: var(--elevation-2);
}
/* Основная строка (бренд + ФИО/должность + выход) — всегда одна строка, ничего в ней не
   переносится и не обрезается. Значок push-уведомлений вынесен из неё отдельным элементом
   ниже (см. .push-status-chip) — на телефоне вместе они физически не помещаются в одну строку
   с полным ФИО и должностью, а обрезать/убирать ФИО и должность нельзя. */
.app-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: 0; white-space: nowrap; flex: 0 0 auto; }
.brand-logo { width: 26px; height: 26px; }
.app-bar-right { display: flex; align-items: center; gap: 8px 10px; flex: 0 0 auto; margin-left: auto; }
.user-chip { font-size: .6rem; opacity: .92; flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 340px) {
    .user-chip { font-size: .46rem; }  /* совсем узкие экраны (напр. 320px) — иначе строка не помещается */
}
.logout-form { display: inline; }
.btn-icon {
    background: rgba(255,255,255,.16); border: none; color: #fff; width: 38px; height: 38px;
    border-radius: 50%; font-size: 1.1rem; cursor: pointer; transition: background .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.28); }

/* Значок статуса push-уведомлений — отдельной строкой под основной шапкой (см. комментарий выше) */
.push-status-chip {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
    margin-top: 8px;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff;
    padding: 5px 10px; border-radius: var(--radius-pill); font-size: .68rem; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background .15s; font-family: inherit;
}
.push-status-chip:hover { background: rgba(255,255,255,.26); }
.push-status-chip.on { background: rgba(255,255,255,.94); color: var(--primary-dark); border-color: transparent; }
.push-status-chip.blocked { opacity: .75; }
.push-status-chip[hidden] { display: none; }

/* ---------- Container ---------- */
.container { max-width: 760px; margin: 0 auto; padding: 18px 16px 96px; }
.page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 18px; letter-spacing: 0; }

/* ---------- Toast (Material Snackbar) ---------- */
.toast {
    background: var(--inverse-surface); color: #fff;
    padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .88rem;
    box-shadow: var(--elevation-3);
    animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.toast.fade-out { opacity: 0; transition: opacity .35s ease; }

/* ---------- Cards ---------- */
.cards { display: flex; flex-direction: column; gap: 14px; }
.card {
    background: var(--card); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--elevation-1); border: 1px solid var(--border);
    transition: box-shadow .15s, transform .15s;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.card-head h3 { font-size: 1.05rem; font-weight: 700; }
.card-desc { color: var(--text); font-size: .92rem; margin-bottom: 10px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .8rem; margin-bottom: 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-actions form { display: inline; }

/* ---------- Badges / chips ---------- */
.badge { font-size: .72rem; padding: 5px 12px; border-radius: var(--radius-pill); white-space: nowrap; font-weight: 600; }
.badge-new { background: #fdead0; color: #8a4a0a; }
.badge-assigned { background: var(--primary-container); color: var(--on-primary-container); }
.badge-progress { background: #dff2e5; color: #146134; }
.badge-done { background: #dcefe1; color: #12592f; }
.badge-cancelled { background: var(--error-container); color: var(--on-error-container); }
.badge-priority-low { background: var(--surface-variant); color: var(--muted); }
.badge-priority-medium { background: var(--primary-container); color: var(--on-primary-container); }
.badge-priority-high { background: #fdead0; color: #8a4a0a; }
.badge-priority-critical { background: var(--error-container); color: var(--on-error-container); }

/* ---------- Buttons (Material 3: filled / tonal / outlined / text — pill shape) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 20px; border-radius: var(--radius-pill); font-size: .9rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer; transition: box-shadow .15s, background .15s, transform .1s;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--elevation-1); }
.btn-primary:hover { box-shadow: var(--elevation-2); }
.btn-primary:active { background: var(--primary-dark); transform: scale(.98); }
.btn-success { background: var(--success); color: #fff; box-shadow: var(--elevation-1); }
.btn-success:hover { box-shadow: var(--elevation-2); }
.btn-ghost { background: var(--primary-container); color: var(--on-primary-container); }
.btn-ghost:hover { filter: brightness(.97); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:active { background: #93000a; }
.btn-block { width: 100%; margin-top: 8px; }
.btn.disabled { opacity: .4; pointer-events: none; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.pagination-info { font-size: .88rem; color: var(--muted); }

/* ---------- Forms (Material outlined text fields) ---------- */
.form-card {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--elevation-1); border: 1px solid var(--border);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input {
    width: 100%; padding: 12px 14px; font-size: 1rem;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    font-family: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-container); }
textarea.input { resize: vertical; }
.field-error, .validation { color: var(--error); font-size: .82rem; margin-top: 4px; }
.validation { margin-bottom: 10px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin-bottom: 14px; }
.info-row { margin-bottom: 6px; }
.muted { color: var(--muted); font-size: .85rem; }
.detail-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; font-size: .92rem; }
.detail-list > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.detail-list .muted { display: inline-block; min-width: 90px; }

/* ---------- Chip-picker (мультивыбор домов и т.п.) ---------- */
.chip-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-option {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 8px 16px; border-radius: var(--radius-pill); border: 1.5px solid var(--border);
    background: var(--surface); font-size: .86rem; font-weight: 600; color: var(--text);
    transition: background .15s, border-color .15s, color .15s; user-select: none;
}
.chip-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-option:has(input:checked) {
    background: var(--primary-container); border-color: var(--primary); color: var(--on-primary-container);
}
.chip-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-ico { font-size: 3rem; margin-bottom: 12px; }
.empty p { margin-bottom: 16px; }

/* ---------- Bottom nav (Material 3 Navigation Bar, с активным индикатором) ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    display: flex; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 10px 0 calc(8px + env(safe-area-inset-bottom));
    box-shadow: var(--elevation-2);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600;
    flex: 1 1 0; min-width: 0; padding: 0 2px; text-align: center;
}
.nav-item span:last-child { overflow-wrap: break-word; max-width: 100%; }
.nav-ico {
    font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 26px; border-radius: var(--radius-pill); transition: background .15s, color .15s;
}
/* Много пунктов (у директора) на узком экране: подписи чуть меньше, чтобы влезали
   в одну строку без горизонтального скролла таб-бара. */
@media (max-width: 380px) {
    .nav-item { font-size: .64rem; }
    .nav-ico { width: 34px; }
}
.nav-item.active .nav-ico { background: var(--primary-container); }
.nav-item.active { color: var(--primary-dark); }

/* Непрочитанные новости — красная точка на пункте меню (мобильный низ) */
.nav-item.nav-news-link .nav-ico { position: relative; }
.nav-item.nav-news-link.has-unread .nav-ico::after {
    content: ''; position: absolute; top: 0; right: 6px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--error);
    box-shadow: 0 0 0 2px var(--surface);
}
.nav-accent .nav-ico { background: var(--primary); color: #fff; box-shadow: var(--elevation-2); }
.nav-accent { color: var(--primary-dark); font-weight: 700; }
.nav-accent.active .nav-ico { background: var(--primary-dark); }

/* ---------- Auth pages ---------- */
/* Мобильный/по умолчанию: карточка поверх фирменного градиента на весь экран */
.auth-body { background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%); min-height: 100vh; }
.auth-shell { min-height: 100vh; display: flex; }
.auth-brand-panel { display: none; }
.auth-container { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 34px 26px;
    /* НЕ width:100% — в этой (дважды вложенной) flex-раскладке проценты у ширины иногда
       резолвятся неверно (Chrome отдаёт ~половину доступного места вместо полной), из-за
       чего карточка на телефоне то маленькая, то большая — например, до и после ошибки
       PIN. vw не зависит от flex-контейнера и считается стабильно. */
    width: min(400px, 90vw);
    box-shadow: var(--elevation-3); text-align: center;
}
.auth-logo { margin-bottom: 8px; }
.auth-logo img { width: 48px; height: 48px; }
.auth-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.auth-card form { text-align: left; margin-top: 18px; }
.auth-switch { margin-top: 16px; font-size: .88rem; color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.demo-box {
    margin-top: 20px; padding: 14px; background: var(--surface-variant); border-radius: var(--radius-sm);
    font-size: .78rem; text-align: left; color: var(--muted); line-height: 1.7;
}
.demo-box strong { color: var(--text); display: block; margin-bottom: 6px; }

/* Десктоп: полноценный двухпанельный экран вместо маленькой карточки в пустоте */
@media (min-width: 900px) {
    .auth-body { background: var(--bg); }
    .auth-brand-panel {
        display: flex; align-items: center; justify-content: center;
        flex: 1 1 44%; max-width: 620px; padding: 60px;
        background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: #fff;
    }
    .auth-brand-inner { max-width: 380px; }
    .auth-brand-logo { margin-bottom: 20px; }
    .auth-brand-logo img { width: 96px; height: 96px; }
    .auth-brand-title { font-size: 2.1rem; font-weight: 700; margin-bottom: 14px; }
    .auth-brand-tag { font-size: 1.05rem; line-height: 1.65; opacity: .9; }
    .auth-container { flex: 1 1 56%; }
    .auth-card { max-width: 420px; box-shadow: none; }
    .pin-card { max-width: 340px; }
}

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter { flex: 1; min-width: 140px; }
.filter label { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.filter .input { padding: 9px 12px; font-size: .9rem; }

/* ---------- Workload chips (директор — заявки по сотрудникам) ---------- */
.workload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.workload-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-right: 2px; }
.workload-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius-pill); background: var(--surface-variant); color: var(--text);
    font-size: .82rem; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; transition: .15s;
}
.workload-chip.active { background: var(--primary); color: #fff; }
.workload-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px;
    background: rgba(0,0,0,.1); font-size: .72rem;
}
.workload-chip.active .workload-count { background: rgba(255,255,255,.25); }

/* ---------- Inline priority/responsible select ---------- */
.priority-inline { display: inline-block; }
.priority-inline .input-sm {
    padding: 5px 10px; font-size: .74rem; font-weight: 600; border-radius: var(--radius-pill);
    border: 1.5px solid transparent; width: auto; min-width: 0;
}
.priority-inline-details .input-sm { font-size: .84rem; padding: 7px 12px; border-color: var(--border); background: var(--surface); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--elevation-1); border: 1px solid var(--border); }
.grid { width: 100%; border-collapse: collapse; font-size: .88rem; }
.grid thead th { text-align: left; padding: 13px 14px; color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.grid tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: var(--surface-variant); }
.grid tbody tr.row-link { cursor: pointer; }

/* Заявка без ответственного (ни сотрудник, ни подрядчик не назначены) — мигает красным,
   чтобы директор/диспетчер сразу заметили, что её ещё не распределили */
.grid tbody tr.row-unassigned { animation: row-unassigned-blink 1.6s ease-in-out infinite; }
.grid tbody tr.row-unassigned td { border-bottom-color: transparent; }
@keyframes row-unassigned-blink {
    0%, 100% { background: transparent; }
    50% { background: var(--error-container); }
}
@media (prefers-reduced-motion: reduce) {
    .grid tbody tr.row-unassigned { animation: none; background: var(--error-container); }
}
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions form { display: inline; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }

/* Тема не растягивает строку — обрезаем с многоточием (полностью видно в деталях) */
.grid td[data-label="Тема"] { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Компактная таблица на телефоне: одна строка на заявку, по ширине — горизонтальный скролл */
@media (max-width: 640px) {
    .grid { font-size: .8rem; }
    .grid thead th, .grid tbody td { padding: 9px 10px; white-space: nowrap; }
    .grid .col-hide-sm { display: none; }            /* прячем второстепенное (Создана) */
    .grid td[data-label="Тема"] { max-width: 140px; }
    .btn-sm { padding: 6px 10px; font-size: .74rem; }
}

/* ---------- Push banner / settings ---------- */
.push-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--primary-container); border: 1px solid transparent; color: var(--on-primary-container);
    padding: 13px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }
.push-banner[hidden] { display: none; }   /* иначе display:flex перебивает атрибут hidden */
.push-banner-actions { display: flex; align-items: center; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.switch { width: 46px; height: 26px; -webkit-appearance: none; appearance: none; background: var(--border); border-radius: var(--radius-pill); position: relative; cursor: pointer; transition: .2s; flex: none; }
.switch:checked { background: var(--primary); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--elevation-1); transition: .2s; }
.switch:checked::after { left: 23px; }

/* ---------- PIN-пад ---------- */
.pin-card { max-width: 320px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 24px 0; min-height: 16px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary); background: transparent; transition: .1s; }
.pin-dot.on { background: var(--primary); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 260px; margin: 0 auto; }
.pin-key { aspect-ratio: 1; border: none; border-radius: 50%; background: var(--surface-variant); color: var(--text); font-size: 1.5rem; font-weight: 500; cursor: pointer; transition: .08s; font-family: inherit; }
.pin-key:active { background: var(--primary); color: #fff; transform: scale(.94); }
.pin-back, .pin-ok { background: transparent; }
.pin-ok { color: var(--primary); font-weight: 700; font-size: 1.7rem; }

/* Анимация загрузки после ввода 4-й цифры PIN (пока идёт хеширование/геолокация/переход) */
.pin-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 0 10px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--primary-container); border-top-color: var(--primary); animation: pin-spin .8s linear infinite; }
@keyframes pin-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; border-top-color: var(--primary-container); }
}

/* ---------- Link button ---------- */
.link-btn { background: none; border: none; color: var(--primary); font-weight: 600; font-size: .88rem; cursor: pointer; text-decoration: underline; font-family: inherit; padding: 0; }

/* ---------- Comments ---------- */
.section-title { font-size: 1.12rem; font-weight: 700; margin: 24px 0 10px; }
.comments { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.comment { background: var(--surface-variant); border-radius: var(--radius-sm); padding: 11px 13px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-head strong { font-size: .9rem; }
.comment-role { font-size: .7rem; background: var(--primary-container); color: var(--on-primary-container); padding: 2px 9px; border-radius: var(--radius-pill); font-weight: 600; }
.comment-date { font-size: .72rem; color: var(--muted); margin-left: auto; }
.comment-text { font-size: .9rem; white-space: pre-wrap; }
.comment-form { margin-top: 6px; }

/* ---------- Timeline (линия жизни) ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.tl-status { font-weight: 700; font-size: .92rem; }
.tl-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.tl-detail { font-size: .85rem; margin-top: 4px; white-space: pre-wrap; }
.st-0 .tl-dot { background: #a35a12; }   /* Новая */
.st-1 .tl-dot { background: #2a5cba; }   /* Распределена (legacy) */
.st-2 .tl-dot { background: #1f7a45; }   /* В работе */
.st-3 .tl-dot { background: #146134; }   /* Завершена */
.st-4 .tl-dot { background: #ba1a1a; }   /* Отменена */

/* ---------- Photo gallery ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-bottom: 14px; }
.photo-thumb { display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Tabs (login) ---------- */
.tabs { display: flex; gap: 6px; background: var(--surface-variant); padding: 4px; border-radius: var(--radius-pill); margin-top: 18px; }
.tab {
    flex: 1; padding: 9px 8px; border: none; background: transparent; cursor: pointer;
    font-size: .88rem; font-weight: 600; color: var(--muted); border-radius: var(--radius-pill); font-family: inherit; transition: .15s;
}
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--elevation-1); }
.tab-panel.hidden { display: none; }

/* ---------- Новости: читаемая лента, отдельно от .cards ---------- */
.news-list { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.news-item {
    background: var(--card); border-radius: var(--radius); padding: 22px 24px;
    box-shadow: var(--elevation-1); border-left: 4px solid var(--primary);
    transition: box-shadow .15s;
}
.news-item:hover { box-shadow: var(--elevation-2); }
.news-eyebrow { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.news-title { font-size: 1.18rem; font-weight: 700; line-height: 1.35; margin-bottom: 10px; }
.news-text { font-size: .96rem; line-height: 1.7; color: var(--text); white-space: pre-wrap; margin-bottom: 14px; max-width: 60ch; }
.news-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.news-footer .badge { background: var(--surface-variant); color: var(--muted); }

/* ---------- Desktop adjustments ---------- */
/* Верхняя навигация только на десктопе */
.top-nav { display: none; }

@media (min-width: 768px) {
    .cards { display: grid; grid-template-columns: repeat(2, 1fr); }
    .user-chip { font-size: .85rem; }        /* на десктопе места достаточно — не нужно мельчить */
    .container { padding-bottom: 32px; }     /* нижняя панель скрыта — лишний отступ не нужен */
    .container.wide { max-width: 1140px; }   /* список заявок шире на десктопе */

    .bottom-nav { display: none; }           /* на десктопе навигация сверху */
    .app-bar-row { flex-wrap: nowrap; }
    .top-nav {
        display: flex; gap: 4px; margin-left: 24px;
        flex: 1 1 auto; min-width: 0; overflow-x: auto;
    }
    .top-nav a { color: #fff; text-decoration: none; font-size: .9rem; padding: 7px 14px; border-radius: var(--radius-pill); opacity: .9; transition: .15s; white-space: nowrap; flex: 0 0 auto; position: relative; }
    .top-nav a:hover { background: rgba(255,255,255,.14); opacity: 1; }
    .top-nav a.active { background: rgba(255,255,255,.94); color: var(--primary-dark); opacity: 1; font-weight: 700; }
    /* Непрочитанные новости — красная точка на пункте меню (десктоп) */
    .top-nav a.nav-news-link.has-unread::after {
        content: ''; position: absolute; top: 4px; right: 8px;
        width: 7px; height: 7px; border-radius: 50%; background: var(--error);
        box-shadow: 0 0 0 2px var(--primary-dark);
    }
    .top-nav a.nav-news-link.active.has-unread::after { box-shadow: 0 0 0 2px #fff; }

    .news-item { padding: 26px 30px; }
    .news-title { font-size: 1.3rem; }
}
