/* ==========================================================================
   UI-KIT — тёмный флэт-дизайн в стиле VoltNodes (volt-nodes.ru): почти чёрный
   фон, зелёный акцент, Poppins/Inter, мягкие плоские тени + свечение вместо
   классического neumorphism. Токены ниже (--bg, --brand и т.д.) взяты из
   реальных CSS-переменных volt-nodes.ru (--vn-bg, --vn-primary, --vn-surface,
   --vn-radius и т.д.), снятых напрямую с их сайта.
   Поддержка: светлая/тёмная тема, prefers-reduced-motion, фокус для a11y
   ========================================================================== */

/* ---------- Тёмная тема — соответствует фирменной палитре VoltNodes (по умолчанию) ---------- */
:root {
    color-scheme: dark;

    --bg: #0b0f0d;
    --bg-elevated: #0f1512;
    --surface: #121a16;
    --surface-alt: #17211c;

    --text: #f5faf8;
    --text-muted: #a7c2b6;
    --text-inverse: #04150a;

    --brand: #22c55e;
    --brand-2: #16a34a;
    --brand-light: #4ade80;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --success: #22c55e;
    --info: #22d3ee;

    --border-soft: #223026;

    /* В прошлой версии здесь был двойной neumorphism-теневой набор (--shadow-light/
       --shadow-dark). VoltNodes использует плоские карточки с одной мягкой тенью
       и зелёным свечением на hover — переносим их --vn-shadow/--vn-shadow-glow
       на существующие имена переменных, чтобы не переписывать все селекторы ниже. */
    --shadow-raised: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-raised-sm: 0 6px 16px rgba(0, 0, 0, .3);
    --shadow-inset: inset 0 0 0 1px var(--border-soft);
    --shadow-inset-sm: inset 0 0 0 1px var(--border-soft);
    --shadow-hover: 0 0 0 1px rgba(34, 197, 94, .18), 0 10px 26px rgba(34, 197, 94, .1);

    --glass-bg: rgba(18, 26, 22, 0.85);
    --glass-border: #223026;
    --glass-blur: blur(16px);

    --radius-lg: 16px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Светлая тема: явный выбор пользователя ИЛИ системная настройка ----------
   У VoltNodes нет светлой версии сайта — здесь она сконструирована в той же
   зелёной цветовой идентичности (тот же --brand/--brand-2), просто на светлой
   подложке, чтобы переключатель темы продолжал работать предсказуемо. */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg: #f3faf6;
        --bg-elevated: #f3faf6;
        --surface: #ffffff;
        --surface-alt: #eef7f1;

        --text: #0f2419;
        --text-muted: #5b7568;
        --text-inverse: #04150a;

        --border-soft: rgba(15, 36, 25, 0.09);

        --shadow-raised: 0 10px 26px rgba(15, 36, 25, .08);
        --shadow-raised-sm: 0 6px 14px rgba(15, 36, 25, .06);
        --shadow-inset: inset 0 0 0 1px var(--border-soft);
        --shadow-inset-sm: inset 0 0 0 1px var(--border-soft);
        --shadow-hover: 0 0 0 1px rgba(34, 197, 94, .25), 0 10px 22px rgba(34, 197, 94, .14);

        --glass-bg: rgba(255, 255, 255, 0.78);
        --glass-border: rgba(15, 36, 25, 0.1);
    }
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f3faf6;
    --bg-elevated: #f3faf6;
    --surface: #ffffff;
    --surface-alt: #eef7f1;
    --text: #0f2419;
    --text-muted: #5b7568;
    --text-inverse: #04150a;
    --border-soft: rgba(15, 36, 25, 0.09);
    --shadow-raised: 0 10px 26px rgba(15, 36, 25, .08);
    --shadow-raised-sm: 0 6px 14px rgba(15, 36, 25, .06);
    --shadow-inset: inset 0 0 0 1px var(--border-soft);
    --shadow-inset-sm: inset 0 0 0 1px var(--border-soft);
    --shadow-hover: 0 0 0 1px rgba(34, 197, 94, .25), 0 10px 22px rgba(34, 197, 94, .14);
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(15, 36, 25, 0.1);
}

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

/* ---------- Сброс и база ---------- */
* , *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    /* Фон в духе VoltNodes: едва заметная точечная сетка на почти чёрном фоне
       (первый слой) + два больших мягких зелёных "пятна" свечения (второй и
       третий слои), которые медленно "плывут" по экрану через анимацию
       vn-glow-drift ниже — тот самый переливающийся зелёный эффект с
       volt-nodes.ru. Сетка остаётся статичной (у неё свой отдельный слой и
       фиксированный background-size), анимируются только position пятен. */
    background-image:
        radial-gradient(rgba(34, 197, 94, 0.06) 1px, transparent 1px),
        radial-gradient(650px circle at 15% 20%, rgba(34, 197, 94, .16), transparent 60%),
        radial-gradient(600px circle at 85% 75%, rgba(74, 222, 128, .13), transparent 60%);
    background-size: 22px 22px, 140% 140%, 140% 140%;
    background-repeat: repeat, no-repeat, no-repeat;
    background-attachment: fixed, fixed, fixed;
    animation: vn-glow-drift 16s ease-in-out infinite;
    color: var(--text);
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
@keyframes vn-glow-drift {
    0%, 100% { background-position: 0 0, 10% 15%, 90% 80%; }
    50%      { background-position: 0 0, 60% 55%, 35% 30%; }
}
/* Светлая тема — то же самое, но заметно бледнее: на светлом фоне яркие
   зелёные пятна выглядели бы пятнами краски, а не тонким свечением. */
:root[data-theme="light"] body {
    background-image:
        radial-gradient(rgba(34, 197, 94, 0.05) 1px, transparent 1px),
        radial-gradient(650px circle at 15% 20%, rgba(34, 197, 94, .07), transparent 60%),
        radial-gradient(600px circle at 85% 75%, rgba(74, 222, 128, .06), transparent 60%);
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) body {
        background-image:
            radial-gradient(rgba(34, 197, 94, 0.05) 1px, transparent 1px),
            radial-gradient(650px circle at 15% 20%, rgba(34, 197, 94, .07), transparent 60%),
            radial-gradient(600px circle at 85% 75%, rgba(74, 222, 128, .06), transparent 60%);
    }
}
@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
}
a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 800; }
p { margin: 0 0 1em; }
img { max-width: 100%; }

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid var(--border-soft);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.sidebar-brand .logo-3d {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    /* Три цвета вместо двух + background-size больше самого элемента —
       позволяет анимировать background-position и получить "переливающийся"
       градиент вместо статичного (тот же приём, что и у фона body выше). */
    background: linear-gradient(135deg, var(--brand), var(--brand-light), var(--brand-2), var(--brand));
    background-size: 300% 300%;
    animation: vn-logo-shimmer 6s ease-in-out infinite;
    box-shadow: 0 6px 18px rgba(34, 197, 94, .25);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-inverse); font-weight: 800; font-size: 18px;
}
@keyframes vn-logo-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar-brand .logo-3d { animation: none; }
}
.sidebar-brand strong { font-size: 15px; display:block; }
.sidebar-brand strong .sidebar-brand__sub { font-weight: 400; opacity: .7; font-size: .85em; }
.sidebar-brand span { font-size: 12px; color: var(--text-muted); }

.nav-group { display: flex; flex-direction: column; gap: 6px; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.nav-link:hover { color: var(--text); text-decoration: none; background: var(--surface-alt); box-shadow: var(--shadow-raised-sm); transform: translateY(-2px); }
.nav-link.active { color: var(--brand-light); background: rgba(34, 197, 94, .12); box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .3); }
.nav-link .count { margin-left: auto; background: var(--brand); color: var(--text-inverse); font-size: 11px; padding: 2px 7px; border-radius: 20px; font-weight: 800; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-soft);
    position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }

.content { padding: 28px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---------- Карточки (плоские, с мягкой тенью и зелёным свечением на hover) ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised);
    padding: 20px;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
    will-change: transform;
}
.card:hover { box-shadow: var(--shadow-hover); border-color: rgba(34, 197, 94, .35); }
.card--flat { box-shadow: none; border: 1px solid var(--border-soft); }
.card--tight { padding: 14px 16px; }

.grid { display: grid; gap: 18px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Виджет статистики: чем важнее (просрочено), тем сильнее подсветка */
.stat-widget { display: flex; flex-direction: column; gap: 6px; }
.stat-widget .value { font-size: 30px; font-weight: 800; }
.stat-widget .label { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.stat-widget--warn { box-shadow: var(--shadow-raised), 0 0 0 2px rgba(245, 158, 11, 0.35); }
.stat-widget--danger { box-shadow: var(--shadow-raised), 0 0 0 2px rgba(244, 63, 94, 0.4); }
.stat-widget--danger .value { color: var(--danger); }
.stat-widget--warn .value { color: var(--warning); }

/* Карточка задания */
.task-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.task-card:active { transform: translateY(1px) scale(.995); }
.task-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-card__title { font-weight: 700; font-size: 15px; }
.task-card__meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 12.5px; }
.task-card--overdue { box-shadow: var(--shadow-raised), 0 0 0 2px rgba(244, 63, 94, 0.45); }

/* ---------- Бейджи статусов (плоский градиент + лёгкое свечение, как у VoltNodes) ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
    color: var(--text-inverse); box-shadow: var(--shadow-raised-sm);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.badge--new { background: linear-gradient(135deg, #38bdf8, #0284c7); color: #04150a; }
.badge--in_progress { background: linear-gradient(135deg, #fbbf24, var(--warning)); color: #2b1a00; }
.badge--done_pending { background: linear-gradient(135deg, #67e8f9, var(--info)); color: #04211f; }
.badge--accepted { background: linear-gradient(135deg, var(--brand-light), var(--brand)); }
.badge--rework { background: linear-gradient(135deg, #fb7185, var(--danger)); color: #fff; }
.badge--cancelled { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.badge--priority-urgent { background: linear-gradient(135deg, #fb7185, var(--danger)); color: #fff; }
/* Раньше здесь был точно такой же жёлто-оранжевый градиент, что и у статуса
   badge--in_progress ("В работе") чуть выше — на карточке задания, где оба
   бейджа стоят рядом, их легко было спутать. Теперь "Высокий" приоритет —
   отдельный, более тёмный оранжево-красный тон: заметно отличается и от
   жёлтого "В работе", и от розово-красного "Срочно" (--priority-urgent). */
.badge--priority-high { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.badge--priority-normal { background: linear-gradient(135deg, #67e8f9, var(--info)); color:#04211f; }
.badge--priority-low { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1f2937; }

.badge-outline {
    display:inline-flex; align-items:center; gap:6px; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: var(--text-muted); box-shadow: var(--shadow-inset-sm);
}

/* ---------- Кнопки (плоские, зелёный градиент + свечение — стиль VoltNodes) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text);
    font-weight: 700; font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-raised-sm);
    transition: transform .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-inset-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-inset-sm); }

.btn--primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: var(--text-inverse);
    box-shadow: 0 6px 18px rgba(34, 197, 94, .28);
}
.btn--primary:hover { box-shadow: 0 8px 22px rgba(34, 197, 94, .4); }
.btn--success { background: linear-gradient(135deg, var(--brand-light), var(--success)); color: var(--text-inverse); }
.btn--danger { background: linear-gradient(135deg, #fb7185, var(--danger)); color: #fff; }
.btn--ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn--ghost:hover { box-shadow: var(--shadow-raised-sm); }
/* Вторичная кнопка "как у VoltNodes": прозрачный фон + зелёная обводка (см. их "Войти") */
.btn--outline { background: transparent; border-color: var(--brand); color: var(--brand-light); box-shadow: none; }
.btn--outline:hover { background: rgba(34, 197, 94, .1); }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--icon { width: 42px; height: 42px; padding: 0; border-radius: 50%; }

/* ---------- Формы ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 7px; color: var(--text-muted); }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field .error { font-size: 12px; color: var(--danger); margin-top: 6px; font-weight: 600; }

.input, .select, .textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: none;
    font-size: 14px;
    font-family: inherit;
    transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    outline: none;
}
.textarea { resize: vertical; min-height: 100px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--brand); }

.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.filters-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
    padding: 16px; margin-bottom: 20px;
}

/* ---------- Модальные окна (glassmorphism, тёмное стекло) ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(4, 8, 6, 0.6);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised);
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    padding: 26px;
}
.modal__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal__footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Баланс в шапке (см. balance.php) ---------- */
.balance-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 999px;
    background: rgba(34, 197, 94, .12); color: var(--success);
    font-weight: 700; font-size: 13.5px; white-space: nowrap;
    text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.balance-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-raised-sm); }
.balance-pill .icon { flex-shrink: 0; }
.balance-pill--negative { background: rgba(244, 63, 94, .12); color: var(--danger); }

/* ---------- Аватары ---------- */
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: var(--text-inverse); font-size: 14px;
    box-shadow: var(--shadow-raised-sm);
    flex-shrink: 0;
}

/* ---------- Колокольчик уведомлений ---------- */
.notif-bell { position: relative; }
.notif-bell .dot {
    position: absolute; top: -2px; right: -2px;
    min-width: 16px; height: 16px; padding: 0 3px;
    border-radius: 50%; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 6px rgba(244, 63, 94, .8);
}
/* Без этого правила атрибут [hidden] на .dot ничего не давал: явный
   display:flex у класса .dot (правило автора страницы) перебивает стандартный
   стиль браузера "[hidden]{display:none}" при той же специфичности — точка
   оставалась видимой всегда, даже когда app.js уже проставил dot.hidden = true
   после прочтения. Та же самая причина и тот же фикс, что раньше понадобился
   для .notif-panel[hidden] чуть ниже по файлу. */
.notif-bell .dot[hidden] { display: none; }
/* Сама иконка колокольчика (не только счётчик-точка) подсвечивается красным,
   пока есть непрочитанные уведомления — управляется классом .has-unread,
   который app.js вешает/снимает с [data-notif-bell] на основе unread > 0
   (см. initNotifications() -> render()). Лёгкая пульсация — чтобы новое
   уведомление было заметно боковым зрением, не только по числу на бейдже. */
.notif-bell.has-unread [data-open-notif] {
    color: var(--danger);
    animation: notif-bell-pulse 1.6s ease-in-out infinite;
}
@keyframes notif-bell-pulse {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-12deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-6deg); }
    40% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
    .notif-bell.has-unread [data-open-notif] { animation: none; }
}
.notif-panel {
    position: absolute; right: 0; top: calc(100% + 10px); width: 340px; max-height: 420px;
    z-index: 50;
    /* Раньше overflow-y:auto/padding стояли прямо на .notif-panel и скроллилось
       содержимое целиком одним блоком. Теперь внутри два уровня: неподвижный
       .notif-panel__header (кнопка "Очистить" всегда доступна, даже если список
       прокручен) и [data-notif-list] — скроллится только он. Поэтому сама панель
       больше не скроллится и не имеет отступов — паддинг у .card (20px) явно
       обнулён, каждый внутренний блок задаёт свой отступ сам. */
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* Без этого правила атрибут [hidden] на .notif-panel ничего не давал: у
   класса .notif-panel есть свой явный display:flex, а он (тот же уровень
   специфичности, но правило автора страницы) перебивает стандартный стиль
   браузера "[hidden]{display:none}" — панель оставалась видимой всегда,
   даже когда JS (app.js) уже проставил hidden. Та же причина, по которой у
   .modal-overlay отдельно задано .modal-overlay[hidden]{display:none} —
   здесь для .notif-panel было пропущено. */
.notif-panel[hidden] { display: none; }
.notif-panel__header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 16px; border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}
[data-notif-list] {
    overflow-y: auto; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 8px;
}
.notif-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius-sm); }
.notif-item.unread { box-shadow: var(--shadow-inset-sm); background: rgba(34, 197, 94, .06); }
.notif-item .time { font-size: 11px; color: var(--text-muted); }

/* ---------- Таблица (для списков без карточек, если нужно) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-raised); border: 1px solid var(--border-soft); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data-table th, table.data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
table.data-table th { color: var(--text-muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-elevated); }
table.data-table tr:last-child td { border-bottom: none; }

/* ---------- Алерты / флеши ---------- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 600; box-shadow: var(--shadow-inset-sm); }
.alert--success { color: var(--brand-light); background: rgba(34, 197, 94, .1); }
.alert--error { color: #fda4af; background: rgba(244, 63, 94, .1); }
.alert--info { color: #67e8f9; background: rgba(34, 211, 238, .1); }

/* ---------- Фото-превью в отчётах ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.photo-grid a { display: block; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-raised-sm); aspect-ratio: 1; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }

.upload-drop {
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-soft);
    box-shadow: none;
    padding: 26px; text-align: center; color: var(--text-muted); font-weight: 600;
    cursor: pointer;
}
.upload-drop:hover { border-color: var(--brand); color: var(--brand-light); }
.upload-drop input { display: none; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.upload-preview .thumb { width: 74px; height: 74px; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-raised-sm); position: relative; }
.upload-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Тема-переключатель ---------- */
.theme-toggle { display: flex; align-items: center; gap: 8px; }

/* ---------- Утилиты ---------- */
.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---------- Мобильная адаптация ---------- */
.mobile-topbar { display: none; }
@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; height: 100%; z-index: 200;
        transform: translateX(-100%); transition: transform .25s var(--ease);
        box-shadow: var(--shadow-hover);
    }
    .sidebar.open { transform: translateX(0); }
    .mobile-topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--bg-elevated); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border-soft); }
    .content { padding: 18px; }
    .topbar { padding: 12px 18px; }
    /* На тач-устройствах нет hover — оставляем только тень и активное нажатие */
    .card:hover, .task-card:hover { box-shadow: var(--shadow-raised); transform: none; }
    .nav-link:hover { transform: none; }
}
.sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150; }
.sidebar-scrim.open { display: block; }

/* ---------- prefers-reduced-motion: убираем движение и наклоны ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .card, .task-card, .btn, .nav-link {
        transform: none !important;
    }
}

/* Точка расширения: доступность tilt-эффекта задаётся инлайн-стилями через JS (app.js),
   он сам проверяет prefers-reduced-motion и наличие touch перед инициализацией. */

/* ---------- SVG-иконки (см. src/Icons.php) взамен эмодзи ---------- */
.icon {
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
}
.icon--sm { width: 0.85em; height: 0.85em; }
.icon--lg { width: 1.4em; height: 1.4em; }
.btn .icon, .nav-link .icon, .badge .icon {
    margin-right: 0.35em;
}
.icon-only .icon { margin-right: 0; }
