/* ── Шрифт ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Переменные ─────────────────────────────────────────────────────── */
:root {
    --bg:           #0f1117;
    --surface:      #181c27;
    --surface-2:    #1e2333;
    --border:       #2a3045;
    --accent:       #3b82f6;
    --accent-dim:   #1d3f7a;
    --text:         #e2e8f0;
    --text-muted:   #64748b;
    --text-dim:     #94a3b8;
    --ok:           #22c55e;
    --ok-bg:        #052e16;
    --error:        #f97316;
    --error-bg:     #431407;
    --radius:       8px;
    --radius-sm:    4px;
    --mono:         'JetBrains Mono', monospace;
    --sans:         'Golos Text', sans-serif;
}

/* ── Сброс и база ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 32px 24px 64px;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Шапка страницы ─────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
}

.page-header h1 span {
    color: var(--accent);
}

#last-updated {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ── Обёртка таблицы ────────────────────────────────────────────────── */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

/* ── Таблица ────────────────────────────────────────────────────────── */
#dynamicTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

/* Заголовки */
#dynamicTable thead {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

#dynamicTable thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
    position: relative;
}

#dynamicTable thead th:hover {
    color: var(--text);
}

/* Стрелки сортировки */
#dynamicTable thead th::after {
    content: '';
    display: inline-block;
    width: 10px;
    margin-left: 6px;
    opacity: 0.3;
}
#dynamicTable thead th.sorted-asc::after  { content: '↑'; opacity: 1; color: var(--accent); }
#dynamicTable thead th.sorted-desc::after { content: '↓'; opacity: 1; color: var(--accent); }

/* Строки */
#dynamicTable tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
#dynamicTable tbody tr:last-child { border-bottom: none; }
#dynamicTable tbody tr:hover { background: var(--surface-2); }

#dynamicTable tbody td {
    padding: 10px 16px;
    vertical-align: top;
}

/* ── Имя магазина ───────────────────────────────────────────────────── */
.store-name {
    display: block;
    font-weight: 500;
    color: var(--text);
}
.store-ip {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Дата ───────────────────────────────────────────────────────────── */
.date-ok {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ok);
    background: var(--ok-bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(34,197,94,0.2);
}
.date-error {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--error);
    background: var(--error-bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(249,115,22,0.2);
}

/* ── Видео ──────────────────────────────────────────────────────────── */
.video-cell {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.8;
}

/* ── Музыка ─────────────────────────────────────────────────────────── */
.music-count {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

/* ── Даты обновлений ────────────────────────────────────────────────── */
.upd-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.upd-dates span {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}
