/* © ФОП Татарников О.Ю. | +380504468872 | https://mambursoft.org.ua */
/**
 * Bevend Cabinet — Retro Skin
 * Спрощений інтерфейс для монтерів без ІТ-досвіду.
 * Мінімум декоративних елементів, максимум інформативності.
 * Активація: html.retro
 */

/* ═══ Загальні перевизначення ═══ */

html.retro {
    --radius: 2px;
    --radius-lg: 4px;
    --radius-xl: 6px;
    --shadow: none;
    --shadow-md: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-lg: 0 2px 4px rgba(0,0,0,0.12);
    --font-display: 'Inter', sans-serif;
}

/* Прибираємо glass-ефекти та складні тіні */
html.retro .tile,
html.retro .glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ═══ Sidebar — компактний ═══ */
html.retro .sidebar {
    width: 200px;
    border-radius: 0;
}

html.retro .sidebar__logo span {
    font-size: 16px;
}

html.retro .sidebar__link {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 2px;
}

html.retro .nav-group__toggle {
    padding: 6px 12px;
    font-size: 13px;
}

html.retro .nav-group__items {
    padding-left: 8px;
}

/* Менше відступ контенту від sidebar */
@media (min-width: 1024px) {
    html.retro .main--with-sidebar {
        margin-left: 200px;
    }
}

/* ═══ Top bar — простіший ═══ */
html.retro .top-bar {
    padding: 6px 12px;
}

html.retro .top-bar__controls,
html.retro .top-bar__actions {
    border-radius: 2px;
}

/* ═══ Сторінка терміналів — таблиця замість карток ═══ */

/* Сітка карток у retro: один стовпець, компактно */
html.retro .tl-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Картка терміналу — горизонтальний рядок */
html.retro .tl-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 2px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: none;
    cursor: pointer;
    transition: background 0.15s;
}

html.retro .tl-card:hover {
    background: var(--brand-bg);
}

html.retro .tl-card--inactive {
    opacity: 0.6;
}

/* Head: назва та статус в рядок */
html.retro .tl-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

html.retro .tl-card__info {
    display: flex;
    align-items: center;
    gap: 6px;
}

html.retro .tl-card__name {
    font-size: 14px;
    font-weight: 600;
}

html.retro .tl-card__type {
    font-size: 11px;
    color: var(--text-muted);
}

html.retro .tl-card__driver {
    display: none;
}

html.retro .tl-card__actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Адреса — компактна */
html.retro .tl-card__addr {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Метрики — в рядок, компактно */
html.retro .tl-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

html.retro .tl-metric {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

html.retro .tl-metric__label {
    display: none;
}

html.retro .tl-metric__val {
    font-size: 13px;
    font-weight: 500;
}

html.retro .tl-metric__sub {
    font-size: 11px;
}

/* Подія/помилка — ВИРАЗНА, червона, жирна */
html.retro .tl-event {
    width: 100%;
    margin-top: 2px;
}

html.retro .tl-event__pill {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

html.retro .tl-event__pill--warn {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

html.retro .tl-event__pill--lock {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* Кольорова смужка — товстіша для помітності */
html.retro .tl-color-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 2px 0 0 2px;
}

/* Позиціонування картки для color bar */
html.retro .tl-card {
    position: relative;
    padding-left: 16px;
}

/* Dropdown меню — приховати в retro (зайве) */
html.retro .tl-dropdown-wrap {
    display: none;
}

/* ═══ Toolbar — спрощений ═══ */
html.retro .tl-toolbar-wrap {
    margin-bottom: 8px;
}

html.retro .tl-toolbar {
    gap: 6px;
    padding: 6px 8px;
    border-radius: 2px;
}

/* Приховати зайві фільтри в retro */
html.retro .tl-filter-group {
    display: none;
}

html.retro .view-toggle {
    display: none;
}

html.retro .tl-sort-hint {
    display: none;
}

/* ═══ Дашборд — спрощений ═══ */

/* Приховати hint/countdown/анімації */
html.retro .td-page-hint {
    display: none;
}

html.retro .td-hint-toggle-btn {
    display: none;
}

/* Оголошення — простіші */
html.retro .announcements-slider {
    border-radius: 2px;
    border: 1px solid var(--border);
}

/* Алерти — крупніші, більш помітні */
html.retro .td-alert-grid {
    gap: 8px;
}

html.retro .td-alert-tile {
    border-radius: 2px;
    padding: 12px;
}

/* ═══ Глобальні фільтри — приховати панель ═══ */
html.retro .gf-panel {
    display: none;
}

html.retro .main--with-gf {
    margin-right: 0 !important;
}

/* ═══ Метрики на картках — показати тільки іконки з title ═══ */

/* Компактний badge статусу */
html.retro .tl-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 2px;
}

/* ═══ Пагінація — простіша ═══ */
html.retro .bv-pager {
    margin: 8px 0;
}

/* ═══ Мобільні ═══ */
@media (max-width: 767px) {
    html.retro .tl-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    html.retro .tl-card__head {
        width: 100%;
    }

    html.retro .tl-card__addr {
        width: 100%;
    }

    html.retro .tl-metrics {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ═══ Загальні спрощення ═══ */

/* Прибираємо зайві градієнти */
html.retro .sidebar__logo i {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--brand);
    background-clip: unset;
    color: var(--brand);
}

/* Компактні заголовки сторінок */
html.retro .page-header {
    margin-bottom: 8px;
}

html.retro .page-title {
    font-size: 18px;
}

/* Instance badge — менший */
html.retro .instance-badge {
    font-size: 10px;
    padding: 1px 10px;
}

/* ═══ Перемикач скіну ═══ */
.retro-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.2s;
}

.retro-toggle:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.retro-toggle--active {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-bg);
}

/* Dark + Retro */
html.dark.retro .tl-event__pill--warn,
html.dark.retro .tl-event__pill--lock {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.3);
}

html.dark.retro .tl-card {
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark.retro .tl-card:hover {
    background: rgba(149, 193, 77, 0.08);
}
