/*
  Цвета заданы переменными: светлая тема живёт в :root, тёмная — в блоке
  :root[data-theme="dark"] ниже. Атрибут data-theme проставляет встроенный
  скрипт в <head> (fragments/layout) ещё до отрисовки страницы, поэтому
  правила во всём файле должны брать цвет только из var(...), без хардкода.
*/
/*
  Тёмный дашборд с фиолетовым акцентом. Тёмная тема — основная, светлая
  подстроена под неё. Общие токены (шрифты, радиусы, тайминги) объявлены один
  раз и не зависят от темы.
*/
:root {
    --font: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --ease: cubic-bezier(.4, 0, .2, 1);

    /* Фиолетовый акцент — общий для обеих тем, оттенок подбирается ниже. */
    --accent-1: #8b5cf6;
    --accent-2: #a78bfa;
    --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

/* ---- Светлая тема ---- */
:root {
    color-scheme: light;

    --bg: #f5f5fb;
    --bg-accent: radial-gradient(1200px 600px at 100% -10%, rgba(139, 92, 246, .10), transparent 60%);
    --surface: #ffffff;
    --surface-2: #f3f2fa;
    --surface-3: #eae8f6;
    --text: #191a22;
    --muted: #6b7180;
    --border: #e7e6f0;
    --border-strong: #d6d4e4;

    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-text: #ffffff;
    --accent-soft: rgba(124, 58, 237, .09);
    --accent-glow: rgba(124, 58, 237, .22);
    --focus-ring: rgba(124, 58, 237, .35);

    --input-bg: #ffffff;

    --error: #dc2626;
    --error-bg: #fdf2f2;
    --error-border: #f6cccc;
    --ok: #059669;
    --ok-bg: #e7f7f0;
    --ok-border: #b9e6d3;
    --warn: #d97706;

    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-text: #ffffff;

    --chip-bg: #efedf9;
    --chip-text: #4a4a5a;

    --shadow-sm: 0 1px 2px rgba(24, 20, 40, .06);
    --shadow: 0 6px 20px rgba(24, 20, 40, .08);
    --shadow-lg: 0 16px 40px rgba(24, 20, 40, .12);

    --badge-phone-bg: #ede9fe;
    --badge-phone-text: #6d28d9;
    --badge-tablet-bg: #e7f7f0;
    --badge-tablet-text: #059669;
    --badge-computer-bg: #e0f2fe;
    --badge-computer-text: #0369a1;
    --badge-car-bg: #fff1e0;
    --badge-car-text: #c2620a;
}

/* ---- Тёмная тема (основная) ---- */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0a0b10;
    --bg-accent: radial-gradient(1100px 550px at 100% -15%, rgba(139, 92, 246, .16), transparent 55%),
                 radial-gradient(900px 500px at -10% 0%, rgba(109, 40, 217, .10), transparent 50%);
    --surface: #14151d;
    --surface-2: #1b1d27;
    --surface-3: #242734;
    --text: #e8e9f0;
    --muted: #8b90a3;
    --border: #23252f;
    --border-strong: #333644;

    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-text: #ffffff;
    --accent-soft: rgba(139, 92, 246, .14);
    --accent-glow: rgba(139, 92, 246, .40);
    --focus-ring: rgba(139, 92, 246, .45);

    --input-bg: #12131a;

    --error: #f87171;
    --error-bg: #2a1518;
    --error-border: #4a2226;
    --ok: #34d399;
    --ok-bg: #0f2a20;
    --ok-border: #1f4d3a;
    --warn: #fbbf24;

    --danger: #f87171;
    --danger-hover: #fca5a5;
    --danger-text: #16090a;

    --chip-bg: #23252f;
    --chip-text: #b6bccb;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 8px 28px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);

    --badge-phone-bg: rgba(139, 92, 246, .16);
    --badge-phone-text: #c4b5fd;
    --badge-tablet-bg: rgba(52, 211, 153, .14);
    --badge-tablet-text: #6ee7b7;
    --badge-computer-bg: rgba(56, 189, 248, .14);
    --badge-computer-text: #7dd3fc;
    --badge-car-bg: rgba(251, 146, 60, .14);
    --badge-car-text: #fdba74;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-accent), var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    letter-spacing: -0.02em;
    font-weight: 700;
}

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

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

::selection {
    background: var(--accent-soft);
    color: var(--text);
}

/* Аккуратная полоса прокрутки под тёмную тему */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
    background-clip: padding-box;
}

/* Шапка */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.03em;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

/* Светящаяся точка-логотип перед названием */
.brand::before {
    content: "";
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent-grad);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px 1px var(--accent-glow);
}

.brand:hover {
    color: var(--text);
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.topbar nav span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Текстовые пункты меню (не кнопки) */
.topbar nav a:not(.btn) {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: color .15s var(--ease), background .15s var(--ease);
}

.topbar nav a:not(.btn):hover {
    color: var(--text);
    background: var(--surface-2);
}

.who {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.inline-form {
    display: inline;
    margin: 0;
}

/* Переключатель темы: показываем значок той темы, на которую кнопка переключит.
   Селекторы с двумя классами нужны, чтобы перебить общее правило
   .topbar nav span — оно задевает и значки внутри кнопки. */
.theme-toggle {
    padding: 5px 10px;
    font-size: 16px;
    line-height: 1.2;
}

.theme-toggle .theme-icon {
    display: inline;
}

/* Светлая тема — предлагаем луну, тёмная — солнце */
.theme-toggle .theme-icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .theme-icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .theme-icon-sun {
    display: inline;
}

/* Контейнеры */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 36px 28px 64px;
}

.container.narrow {
    max-width: 460px;
}

.hero {
    padding: 48px 0 24px;
    max-width: 720px;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: 56px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(120deg, var(--text) 30%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 17px;
    max-width: 60ch;
}

.hero .btn {
    padding: 13px 26px;
    font-size: 15px;
}

.muted {
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Карточка / форма */
.card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

label {
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    color: var(--muted);
}

input,
select {
    padding: 11px 13px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

input::placeholder {
    color: var(--muted);
    opacity: .7;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Форма создания пользователя не должна растягиваться на всю ширину списка */
.card.narrow-card {
    max-width: 460px;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--accent-text);
    background: var(--accent-grad);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 10px var(--accent-glow);
    transition: transform .12s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
}

.btn:hover {
    color: var(--accent-text);
    filter: brightness(1.08);
    box-shadow: 0 4px 18px var(--accent-glow);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    margin-top: 0;
    padding: 7px 13px;
    font-size: 13px;
}

/* Второстепенная кнопка: без заливки, с рамкой */
.btn-ghost {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-3);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    filter: none;
}

/* Сообщения */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    border-left-width: 3px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    color: var(--error);
    background: var(--error-bg);
    border-color: var(--error-border);
    border-left-color: var(--error);
}

.alert-ok {
    color: var(--ok);
    background: var(--ok-bg);
    border-color: var(--ok-border);
    border-left-color: var(--ok);
}

.field-error {
    color: var(--error);
    font-size: 13px;
    font-weight: 500;
}

/* Список пользователей в админке */
.table {
    width: 100%;
    margin: 16px 0 32px;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.table tbody tr {
    transition: background .12s var(--ease);
}

.table tbody tr:hover {
    background: var(--surface-2);
}

.table th {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Таблица данных в кабинете */
.details {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 0;
    margin: 0;
}

.details dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.details dd {
    margin: 0;
    padding: 12px 0;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.details dt:last-of-type,
.details dd:last-of-type {
    border-bottom: none;
}

/* ============ Панель мониторинга ============ */

/* Шапка страницы: заголовок слева, вспомогательное справа */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-head {
    margin-bottom: 8px;
}

.page-head h1 {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.account-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.account-chip > span:first-child {
    font-weight: 700;
}

.empty {
    padding: 40px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--muted);
}

.empty.muted {
    color: var(--muted);
}

/* Кнопка удаления */
.btn-danger {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    border-color: color-mix(in srgb, var(--danger) 28%, transparent);
    box-shadow: none;
}

.btn-danger:hover {
    color: var(--danger-text);
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 3px 14px color-mix(in srgb, var(--danger) 35%, transparent);
    filter: none;
    text-decoration: none;
}

/* Бейджи типа устройства и счётчиков */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    border: 1px solid transparent;
}

.badge-soft {
    background: var(--chip-bg);
    color: var(--muted);
}

.badge-phone {
    background: var(--badge-phone-bg);
    color: var(--badge-phone-text);
}

.badge-tablet {
    background: var(--badge-tablet-bg);
    color: var(--badge-tablet-text);
}

.badge-computer {
    background: var(--badge-computer-bg);
    color: var(--badge-computer-text);
}

.badge-car {
    background: var(--badge-car-bg);
    color: var(--badge-car-text);
}

/* ============ Раскладка дашборда: таблица сверху, карта+лог в ряд ============ */

/* Дашборду даём больше ширины, чем страницам форм */
.container-wide {
    max-width: 1320px;
}

/* Нижний ряд: карта (крупная) + живой лог */
.dash-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
    margin: 22px 0 36px;
}

/* Узкий экран — в один столбец: карта, под ней лог */
@media (max-width: 980px) {
    .dash-lower {
        grid-template-columns: 1fr;
    }
}

/* В ряду у панелей свои внешние отступы не нужны */
.dash-lower .globe-panel,
.dash-lower .activity-panel {
    margin: 0;
}

/* В ряду лог может быть повыше — под стать карте */
.dash-lower .activity-feed {
    max-height: 520px;
}

.device-list-panel {
    margin: 22px 0;
}

/* ---- Свёрнутая форма добавления устройства ---- */
.add-device {
    margin-top: 2px;
}

.add-device > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s var(--ease);
}

.add-device > summary::-webkit-details-marker {
    display: none;
}

.add-device > summary:hover {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.add-device[open] > summary {
    margin-bottom: 12px;
}

.add-device-form {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.add-device-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.add-device-row .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 180px;
}

.add-device-row .field label {
    margin-top: 0;
}

.add-device-row .btn {
    margin-top: 0;
}

/* ============ Загрузки клиентского приложения ============ */
.downloads {
    margin: 8px 0 40px;
}

.downloads-head {
    margin-bottom: 16px;
}

.downloads-head h2 {
    margin: 0 0 4px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.download-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}

/* Верхняя цветная полоса — своя для каждой платформы */
.download-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
}

.download-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.download-card.dl-android::before { background: #22c55e; }
.download-card.dl-ios::before     { background: #94a3b8; }
.download-card.dl-windows::before { background: #38bdf8; }
.download-card.dl-linux::before   { background: #f59e0b; }
.download-card.dl-car::before     { background: var(--accent); }

.download-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.download-top h3 {
    margin: 0;
    font-size: 18px;
}

.download-count {
    font-size: 12px;
    white-space: nowrap;
}

.download-os {
    font-size: 13px;
    color: var(--muted);
}

/* Выбор сборки под версию ОС */
.build-select-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin: 0;
}

.build-select {
    width: 100%;
}

.build-panels {
    display: block;
}

.build-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.build-panel.is-hidden {
    display: none;
}

.download-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.download-version {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 13px;
    color: var(--accent);
    padding: 3px 10px;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    border-radius: 999px;
}

.download-date {
    font-size: 12px;
}

.download-changelog {
    flex: 1;
}

.changelog-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin-bottom: 6px;
}

.download-changelog ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.download-changelog li {
    color: var(--text);
}

.download-btn {
    margin-top: 4px;
    width: 100%;
}

.device-list-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-head h2 {
    margin: 0;
    font-size: 18px;
}

.count-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: 999px;
}

/* Длинный список прокручивается по вертикали (высота ≈ карте), а если не хватает
   ширины на все столбцы — по горизонтали, не сминая колонки. */
.device-table-wrap {
    max-height: 540px;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.device-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
}

.device-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.device-table tbody td {
    padding: 10px 9px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* Даты и IP — моноширинные, компактные, не переносятся */
.dt-date,
.dt-ip {
    white-space: nowrap;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.dt-ip {
    font-family: var(--mono);
    font-size: 12px;
}

/* Относительное время последней связи: «(2 минуты назад)» и компактное «2 мин назад» */
.seen-ago {
    margin-left: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.seen-ago-mini {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

/* ============ Настройки телефона ============ */
.settings-form {
    gap: 10px;
    max-width: 520px;
}

.settings-form .btn {
    align-self: flex-start;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--accent);
}

/* ============ Панель управления телефоном ============ */
.remote-screen {
    min-height: 300px;
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
}

.remote-screen .stream-placeholder {
    width: 100%;
    min-height: 300px;
    border: none;
    background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 82%, #000));
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 0;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    font-family: inherit;
    font-size: 22px; /* размер эмодзи-иконки */
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform .12s var(--ease), border-color .12s var(--ease), background .12s var(--ease);
}

.control-btn > span {
    font-size: 13px;
    font-weight: 600;
}

.control-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--surface-3);
}

.control-btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Фиксированные доли 9 столбцов: при table-layout: fixed таблица держится строго
   в пределах контейнера, поэтому горизонтальной прокрутки не возникает вовсе.
   Порядок: Устройство, Тип, Модель, Первое, Последнее, ОС, Страна, IP, действие. */
.device-table th:nth-child(1), .device-table td:nth-child(1) { width: 16%; }
.device-table th:nth-child(2), .device-table td:nth-child(2) { width: 8%; }
.device-table th:nth-child(3), .device-table td:nth-child(3) { width: 16%; }
.device-table th:nth-child(4), .device-table td:nth-child(4) { width: 8%; }
.device-table th:nth-child(5), .device-table td:nth-child(5) { width: 11%; }
.device-table th:nth-child(6), .device-table td:nth-child(6) { width: 12%; }
.device-table th:nth-child(7), .device-table td:nth-child(7) { width: 11%; }
.device-table th:nth-child(8), .device-table td:nth-child(8) { width: 12%; }
.device-table th:nth-child(9), .device-table td:nth-child(9) { width: 6%; }

/* Содержимое ячеек не должно вылезать за свою колонку */
.device-table th,
.device-table td {
    overflow: hidden;
}

/* Кроме колонки действий — там кнопке нужен ховер-эффект целиком */
.device-table td.dt-actions {
    overflow: visible;
}

/* Название устройства — обрезаем длинное имя многоточием */
.dt-device .dt-name {
    min-width: 0;
}

.dt-device .dt-name > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Модель, ОС и страна тоже обрезаем при нехватке места (полное имя — в подсказке) */
.dt-model span,
.dt-os span,
.dt-country span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.device-table tbody tr {
    transition: background .12s var(--ease);
}

.device-table tbody tr:hover {
    background: var(--surface-2);
}

.device-table tbody tr:last-child td {
    border-bottom: none;
}

.dt-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}

.dt-name:hover {
    color: var(--accent);
}

.dt-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.dt-dot.is-online {
    background: var(--ok);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent),
                0 0 10px 1px color-mix(in srgb, var(--ok) 55%, transparent);
}

.dt-dot.is-offline {
    background: var(--muted);
    opacity: .45;
}

.dt-sub {
    display: block;
    margin-top: 3px;
    padding-left: 17px;
    font-size: 11px;
    color: var(--muted);
}

.dt-seen {
    white-space: nowrap;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.dt-actions {
    text-align: right;
    white-space: nowrap;
}

/* Компактная кнопка-крестик удаления в таблице */
.dt-actions .btn-danger {
    padding: 6px 10px;
    line-height: 1;
}

/* ============ Живой лог сервера ============ */
.activity-panel {
    margin: 0 0 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* Индикатор «в реальном времени» с пульсирующей точкой */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px 3px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--error);
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 999px;
}

.live-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--error);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--error) 60%, transparent);
    animation: livePulse 1.6s var(--ease) infinite;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--error) 55%, transparent); }
    70%  { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 14px;
    max-height: 360px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 12.5px;
}

.activity-empty {
    font-family: var(--font);
    padding: 20px 4px;
}

.activity-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--border-strong);
    background: var(--surface-2);
    transition: background .12s var(--ease);
}

.activity-item:hover {
    background: var(--surface-3);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.activity-msg {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Цвет полосы и точки по типу события */
.activity-item.act-device_added { border-left-color: var(--ok); }
.activity-item.act-device_added .activity-dot { background: var(--ok); }

.activity-item.act-device_deleted { border-left-color: var(--error); }
.activity-item.act-device_deleted .activity-dot { background: var(--error); }

.activity-item.act-key_regenerated { border-left-color: var(--accent); }
.activity-item.act-key_regenerated .activity-dot { background: var(--accent); }

.activity-item.act-recording_deleted,
.activity-item.act-file_deleted { border-left-color: var(--warn); }
.activity-item.act-recording_deleted .activity-dot,
.activity-item.act-file_deleted .activity-dot { background: var(--warn); }

.activity-item.act-settings_changed { border-left-color: #60a5fa; }
.activity-item.act-settings_changed .activity-dot { background: #60a5fa; }

/* Сетка карточек устройств */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 18px;
    margin: 22px 0 36px;
}

.device-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}

/* Тонкая акцентная полоса сверху, проявляется при наведении */
.device-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--accent-grad);
    opacity: 0;
    transition: opacity .16s var(--ease);
}

.device-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.device-card:hover::before {
    opacity: 1;
}

.device-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
}

.status-badge.status-online {
    background: var(--ok-bg);
    color: var(--ok);
    border-color: var(--ok-border);
}

.status-badge.status-offline {
    background: var(--surface-2);
    color: var(--muted);
    border-color: var(--border);
}

.device-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: color .15s var(--ease);
}

.device-name:hover {
    color: var(--accent);
}

.device-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: 999px;
}

.device-meta {
    display: flex;
    gap: 16px;
    margin: 0;
    font-size: 12px;
}

.device-meta div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.device-meta dt {
    color: var(--muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.device-meta dd {
    margin: 0;
    font-weight: 500;
}

.device-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

/* Блок подключения устройства */
.setup {
    gap: 8px;
    margin-bottom: 24px;
}

.setup h2 {
    margin: 0 0 4px;
}

.setup .small {
    font-size: 13px;
}

code {
    padding: 2px 6px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    border-radius: 5px;
}

.copy-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.copy-row input {
    flex: 1;
    font-family: var(--mono);
    font-size: 13px;
    background: var(--surface-2);
}

.copy-row .btn-small {
    white-space: nowrap;
}

/* Список записей */
.recordings {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recording {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s var(--ease);
}

.recording:hover {
    border-color: var(--border-strong);
}

.recording-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
}

.recording-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.recording-player {
    margin-top: 10px;
}

.recording-player summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 14px;
    width: max-content;
}

.recording-player video {
    display: block;
    width: 100%;
    max-height: 70vh;
    margin-top: 10px;
    background: #000;
    border-radius: 8px;
}

/* ============ Глобус с устройствами ============ */

.small {
    font-size: 13px;
}

.globe-panel {
    margin: 22px 0 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.globe-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.globe-head h2 {
    margin-top: 0;
}

.globe-head h2 {
    margin: 0 0 4px;
}

.globe-head p {
    margin: 0;
    max-width: 52ch;
}

.globe-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.globe-control-label {
    margin-top: 0;
    color: var(--muted);
    white-space: nowrap;
}

.globe-controls select {
    padding: 5px 8px;
    font-size: 14px;
}

.globe-frame {
    position: relative;
}

/* Карте нужна заданная высота: без неё контейнер схлопнется в ноль и холст
   MapLibre останется невидимым. */
.globe {
    height: 520px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Сообщение о состоянии поверх карты: «загружаем» или причина, по которой
   карты не будет. Клики пропускает насквозь, чтобы не мешать управлению. */
.globe-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    pointer-events: none;
}

/* Карта загрузилась — прячем сообщение, не удаляя его из разметки. */
.globe-frame.globe-ready .globe-status {
    display: none;
}

/* На Луне маркеры земных устройств ни к чему — прячем их (это чисто для вида). */
.globe-frame.globe-moon .map-pin {
    display: none;
}

.globe-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--muted);
}

.globe-legend li {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ---- Маркеры устройств ---- */

.map-pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
}

.map-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}

/* Цвета те же, что у бейджей типов в списке устройств, чтобы точка на карте
   и карточка устройства читались как одно и то же. */
.map-dot-phone {
    background: var(--badge-phone-text);
}

.map-dot-tablet {
    background: var(--badge-tablet-text);
}

.map-dot-computer {
    background: var(--badge-computer-text);
}

.map-dot-car {
    background: var(--badge-car-text);
}

/* Координат ещё нет: устройство стоит в точке по умолчанию, и маркер это показывает. */
.map-dot-placeholder {
    background: transparent;
    border-style: dashed;
    border-color: var(--muted);
}

.map-pin-label {
    max-width: 140px;
    padding: 1px 7px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.map-pin-selected .map-dot {
    width: 18px;
    height: 18px;
}

.map-pin-selected .map-pin-label {
    color: var(--accent-text);
    background: var(--accent);
    border-color: var(--accent);
}

/* ---- Всплывающее окно маркера ---- */

.map-popup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 170px;
}

.map-popup .btn {
    margin-top: 6px;
}

/* MapLibre рисует окно и кнопки управления своим светлым оформлением —
   переводим их на переменные темы, иначе в тёмной теме это белые пятна. */
.maplibregl-popup-content {
    padding: 12px 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: var(--surface);
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
    border-top-color: var(--surface);
}

.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: var(--surface);
}

.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: var(--surface);
}

.maplibregl-ctrl-group {
    background: var(--surface);
    border: 1px solid var(--border);
}

.maplibregl-ctrl-group button + button {
    border-top-color: var(--border);
}

/* Значки кнопок зашиты в библиотеку тёмными картинками: на тёмном фоне их
   не видно, поэтому в тёмной теме инвертируем. */
:root[data-theme="dark"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
    filter: invert(1);
}

:root[data-theme="dark"] .maplibregl-ctrl-attrib {
    background: rgba(20, 23, 28, .8);
}

:root[data-theme="dark"] .maplibregl-ctrl-attrib a {
    color: var(--accent);
}

/* ============ Информационная панель устройства ============ */

.device-info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 22px 0 28px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.info-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.info-value {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.info-value.online {
    color: var(--ok);
}

.info-value.offline {
    color: var(--muted);
}

/* ============ Система табов ============ */

.tabs-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 22px 0;
}

.tabs-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    padding: 9px 15px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color .15s var(--ease), background .15s var(--ease);
}

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

.tab-btn.active {
    color: var(--accent-text);
    background: var(--accent-grad);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s var(--ease);
}

.tab-content.active {
    display: block;
}

.tab-content > h2 {
    margin-top: 0;
}

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

/* ============ Консоль событий ============ */

.event-console {
    background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 92%, #000));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    min-height: 340px;
    max-height: 560px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.console-output {
    flex: 1;
    padding: 6px 0;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.5;
}

/* ============ Список разрешений ============ */

.permissions-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.permission-item.granted {
    border-left-color: var(--ok);
}

.permission-item.denied {
    border-left-color: var(--error);
}

.permission-name {
    font-weight: 600;
}

.permission-status {
    font-weight: 700;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 999px;
}

.permission-item.granted .permission-status {
    color: var(--ok);
    background: var(--ok-bg);
}

.permission-item.denied .permission-status {
    color: var(--error);
    background: var(--error-bg);
}

/* ============ Карта геолокации ============ */

.location-map {
    min-height: 460px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

/* MapLibre рисует холст внутри — скругляем вместе с контейнером */
.location-map .maplibregl-map,
.location-map canvas {
    border-radius: var(--radius);
}

/* ============ Заполнители (placeholder) ============ */

.file-browser,
.remote-control {
    min-height: 320px;
}

.file-list-placeholder,
.stream-placeholder,
.settings-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 32px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    background: repeating-linear-gradient(
        45deg,
        var(--surface-2),
        var(--surface-2) 12px,
        transparent 12px,
        transparent 24px
    );
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

/* ============ Консоль событий - детали ============ */

.console-output {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.console-line {
    display: grid;
    grid-template-columns: 78px 74px 1fr;
    gap: 12px;
    align-items: start;
    padding: 9px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    line-height: 1.45;
    font-family: var(--mono);
    transition: background .1s var(--ease);
}

.console-line:hover {
    background: var(--surface-2);
}

.console-line:last-child {
    border-bottom: none;
}

/* Тонкая цветная полоса слева по уровню события */
.console-line[class*="level-"] {
    border-left: 2px solid transparent;
    padding-left: 14px;
}

.console-line.level-error {
    border-left-color: var(--error);
}

.console-line.level-warning {
    border-left-color: var(--warn);
}

.console-timestamp {
    color: var(--muted);
    white-space: nowrap;
    font-weight: 500;
}

.console-level {
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    text-align: center;
    font-size: 10.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    height: fit-content;
}

.console-line.level-info .console-level {
    background: rgba(96, 165, 250, 0.14);
    color: #60a5fa;
}

.console-line.level-warning .console-level {
    background: rgba(251, 191, 36, 0.14);
    color: var(--warn);
}

.console-line.level-error .console-level {
    background: rgba(248, 113, 113, 0.14);
    color: var(--error);
}

.console-line.level-debug .console-level {
    background: var(--accent-soft);
    color: var(--accent);
}

.console-title {
    font-weight: 600;
    color: var(--text);
}

.console-message {
    grid-column: 1 / -1;
    padding-left: 12px;
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.console-source {
    grid-column: 1 / -1;
    padding-left: 12px;
    color: var(--muted);
    font-size: 10px;
    font-style: italic;
    margin-top: 2px;
}

/* ============ Список файлов ============ */

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    gap: 16px;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}

.file-item:hover {
    border-color: var(--border-strong);
    background: var(--surface-3);
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.file-path {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--muted);
}

.file-size {
    font-weight: 600;
}

.file-date {
    font-weight: 500;
}

.file-item .delete-form {
    margin: 0;
    flex-shrink: 0;
}
