/* ==========================================================================
   GPlogs — тема панели логов point-rp
   --------------------------------------------------------------------------
   Подключается поверх dist/css/app.css: оттуда берутся сетка Bootstrap,
   компоненты, иконки и select2, здесь — весь внешний вид.

   Идея: не «админка», а диспетчерский пульт. Тёмно-синий фон вместо чёрного,
   янтарный акцент натриевой лампы, данные — моноширинным. У каждой строки
   слева цветная нить (trace rail): по её цвету видно категорию события,
   не читая текст.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    --ink:        #0e1522;   /* фон приложения */
    --ink-deep:   #0a101a;   /* провалы: шапка таблицы, сайдбар */
    --panel:      #151e2e;   /* карточки */
    --panel-2:    #1a2537;   /* наведение, вложенные блоки */
    --line:       #22304a;   /* границы */
    --line-soft:  #1b2639;

    --text:       #dce5f2;
    --muted:      #7c8ca6;
    --dim:        #56657f;

    --amber:      #f2a93b;   /* акцент */
    --amber-dim:  #8a6222;
    --cyan:       #4fc3d9;   /* ссылки и интерактив */
    --red:        #e4574f;
    --green:      #56b87e;
    --violet:     #9d8df1;

    /* Типографика: одна гарнитура на всю панель. */
    --font-ui:      'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: var(--font-ui);   /* заголовки, метки, кнопки */
    --font-data:    var(--font-ui);   /* данные: ники, суммы, IP, время */

    --radius:     10px;
    --rail:       3px;
}

/* ─────────────────────────────── База ─────────────────────────────── */

html { color-scheme: dark; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 13.5px;
    line-height: 1.5;
    /* Montserrat не моноширинный — цифры выравниваем табличными знаками,
       иначе колонки времени и сумм «дышат» от строки к строке. */
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #7ad8e9; text-decoration: underline; }

::selection { background: var(--amber); color: #10161f; }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Заголовки и служебные надписи — Montserrat в разрядку.
   Гарнитура широкая, поэтому трекинг мельче, чем был у узкого гротеска. */
.gp-title,
.gp-eyebrow,
.gp-table thead th,
.gp-nav-group,
.gp-btn {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gp-eyebrow {
    font-size: 10.5px;
    color: var(--dim);
    letter-spacing: 0.12em;
}

.gp-title {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 2px 0 4px;
    color: #fff;
}

.gp-lead { color: var(--muted); max-width: 78ch; margin: 0; }

.mono, .gp-table td.is-mono {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
}

/* ────────────────────────────── Каркас ────────────────────────────── */

.gp-shell { display: flex; min-height: 100vh; }

.gp-sidebar {
    width: 252px;
    flex: 0 0 252px;
    background: var(--ink-deep);
    border-right: 1px solid var(--line-soft);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 18px 12px 32px;
}

.gp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
    color: #fff;
}
.gp-brand:hover { text-decoration: none; color: #fff; }

.gp-brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 1px solid var(--amber-dim);
    border-radius: 8px;
    background: linear-gradient(180deg, #1d2333, #12182390);
    color: var(--amber);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.01em;
}

.gp-brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1.15;
}
.gp-brand-sub { font-size: 11px; color: var(--dim); letter-spacing: 0.06em; }

.gp-nav-group {
    font-size: 10px;
    color: var(--dim);
    padding: 16px 10px 6px;
    letter-spacing: 0.12em;
}

.gp-nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 13.5px;
    border-left: var(--rail) solid transparent;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.gp-nav-link:hover { background: #ffffff08; color: var(--text); text-decoration: none; }
.gp-nav-link i { font-size: 14px; opacity: .55; }

.gp-nav-link.is-active {
    background: #ffffff0d;
    color: #fff;
    border-left-color: var(--amber);
}
.gp-nav-link.is-active i { opacity: 1; color: var(--amber); }

.gp-nav-link.is-stub { color: var(--dim); }
.gp-nav-link.is-stub::after {
    content: 'заглушка';
    margin-left: auto;
    font-size: 9.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--amber);
    opacity: .65;
    border: 1px solid var(--amber-dim);
    border-radius: 4px;
    padding: 0 4px;
}

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

/* ─────────────────────────────── Шапка ─────────────────────────────── */

.gp-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 24px;
    background: #0e1522e6;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line-soft);
}

.gp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
}
.gp-chip b { color: var(--text); font-weight: 500; }
.gp-chip--live { border-color: var(--amber-dim); color: var(--amber); }

.gp-topbar-spacer { margin-left: auto; }

.gp-user {
    display: flex; align-items: center; gap: 10px;
    padding-left: 14px; border-left: 1px solid var(--line-soft);
}
.gp-user-name { font-size: 13px; color: var(--text); line-height: 1.2; }
.gp-user-role { font-size: 11px; color: var(--dim); }

.gp-content { padding: 22px 24px 60px; }

/* ─────────────────────────────── Карточки ─────────────────────────────── */

.gp-card {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
}
.gp-card + .gp-card { margin-top: 16px; }

.gp-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-soft);
    background: #ffffff04;
}
.gp-card-title {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    font-size: 12.5px;
    color: #fff;
    margin: 0;
}
.gp-card-body { padding: 16px; }

/* Источник данных: из какого файла старых логов взята логика. */
.gp-source {
    font-family: var(--font-data);
    font-size: 11px;
    color: var(--dim);
    border: 1px dashed var(--line);
    border-radius: 5px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* ─────────────────────────────── Плитки ─────────────────────────────── */

.gp-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.gp-tile {
    position: relative;
    display: block;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-left: var(--rail) solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: inherit;
    transition: border-color .14s ease, background-color .14s ease, transform .14s ease;
}
.gp-tile:hover {
    background: var(--panel-2);
    border-left-color: var(--amber);
    text-decoration: none;
    color: inherit;
    transform: translateY(-1px);
}
.gp-tile-label {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .07em;
    font-size: 10.5px;
    color: var(--muted);
}
.gp-tile-value {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 25px;
    line-height: 1.15;
    margin-top: 6px;
    color: #fff;
}
.gp-tile-sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

/* ─────────────────────────────── Таблица ─────────────────────────────── */

.gp-table-wrap { overflow-x: auto; }

.gp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.gp-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--ink-deep);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.gp-table thead th span {
    display: block;
    font-family: var(--font-ui);
    text-transform: none;
    letter-spacing: 0;
    font-size: 10.5px;
    color: var(--dim);
    font-weight: 400;
}

.gp-table tbody td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
}

.gp-table tbody tr { transition: background-color .1s ease; }
.gp-table tbody tr:hover { background: #ffffff07; }

/* Trace rail: цвет нити слева = категория события. */
.gp-table tbody td:first-child {
    border-left: var(--rail) solid var(--rail-color, var(--line));
}
.gp-row--money   { --rail-color: var(--green); }
.gp-row--ban     { --rail-color: var(--red); }
.gp-row--admin   { --rail-color: var(--violet); }
.gp-row--session { --rail-color: var(--cyan); }
.gp-row--item    { --rail-color: var(--amber); }

.gp-num { color: var(--dim); font-size: 11.5px; }

.gp-time { white-space: nowrap; }
.gp-time .d { color: var(--dim); }
.gp-time .t { color: var(--text); }

.gp-nick {
    font-family: var(--font-data);
    font-size: 12.5px;
    color: var(--cyan);
    border-bottom: 1px dotted #4fc3d955;
}
.gp-nick:hover { text-decoration: none; border-bottom-style: solid; }
.gp-nick--empty { color: var(--dim); border: 0; }

.gp-money {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--green);
}
.gp-ip {
    font-family: var(--font-data);
    font-size: 12.5px;
    color: var(--muted);
}

.gp-badge {
    display: inline-block;
    font-family: var(--font-data);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 5px;
    border: 1px solid var(--line);
    background: #ffffff08;
    color: var(--text);
    white-space: nowrap;
}
.gp-badge--red   { border-color: #e4574f55; color: #ffa39c; background: #e4574f14; }
.gp-badge--green { border-color: #56b87e55; color: #9fe3bd; background: #56b87e14; }
.gp-badge--amber { border-color: var(--amber-dim); color: #f7c778; background: #f2a93b14; }
.gp-badge--cyan  { border-color: #4fc3d955; color: #a5e6f2; background: #4fc3d914; }
.gp-badge--muted { color: var(--muted); }

.gp-empty {
    padding: 42px 16px;
    text-align: center;
    color: var(--muted);
}
.gp-empty i { font-size: 26px; color: var(--dim); display: block; margin-bottom: 8px; }

/* ─────────────────────────────── Формы ─────────────────────────────── */

.gp-field { display: block; margin-bottom: 12px; }
.gp-label {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
    font-family: var(--font-display);
}

.gp-input,
.gp-select {
    width: 100%;
    background: var(--ink-deep);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    padding: 7px 10px;
    font-size: 13px;
    font-family: var(--font-data);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.gp-input::placeholder { color: var(--dim); }
.gp-input:focus,
.gp-select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px #f2a93b1f;
    outline: none;
}

.gp-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    border-radius: 7px;
    padding: 7px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.gp-btn:hover { background: #22304a; color: #fff; text-decoration: none; }

.gp-btn--primary {
    background: var(--amber);
    border-color: var(--amber);
    color: #10161f;
    font-weight: 500;
}
.gp-btn--primary:hover { background: #ffbe58; border-color: #ffbe58; color: #10161f; }

.gp-btn--ghost { background: transparent; color: var(--muted); }
.gp-btn--ghost:hover { color: var(--text); }

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

.gp-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

.gp-hint { color: var(--dim); font-size: 12px; }

.gp-alert {
    border: 1px solid var(--line);
    border-left: var(--rail) solid var(--amber);
    background: #f2a93b0f;
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 13px;
}
.gp-alert--error { border-left-color: var(--red); background: #e4574f12; }
.gp-alert--ok    { border-left-color: var(--green); background: #56b87e12; }

/* ─────────────────────────── Заглушки разделов ─────────────────────────── */

.gp-stub-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
    border-bottom: 1px solid var(--line-soft);
}
.gp-stub-mark {
    width: 42px; height: 42px; flex: 0 0 42px;
    display: grid; place-items: center;
    border: 1px dashed var(--amber-dim);
    border-radius: 10px;
    color: var(--amber);
    font-size: 19px;
}
.gp-stub-block { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.gp-stub-block:last-child { border-bottom: 0; }
.gp-stub-block h3 {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .07em;
    font-size: 11.5px;
    color: var(--amber);
    margin: 0 0 8px;
}
.gp-stub-block p { margin: 0; color: var(--muted); max-width: 80ch; }
.gp-stub-block code {
    font-family: var(--font-data);
    font-size: 12px;
    color: var(--text);
    background: #ffffff0a;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    padding: 1px 5px;
}

/* Скелет таблицы под заглушкой — показывает, как раздел будет выглядеть. */
.gp-skeleton { padding: 4px 0 10px; }
.gp-skeleton-row {
    height: 10px;
    margin: 10px 22px;
    border-radius: 3px;
    background: linear-gradient(90deg, #ffffff0d, #ffffff05 70%);
}
.gp-skeleton-row:nth-child(2n) { width: 78%; }
.gp-skeleton-row:nth-child(3n) { width: 63%; }

/* ─────────────────────────── Пагинация ─────────────────────────── */

.gp-pager { display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.gp-pager .pagination { margin: 0; gap: 4px; }
.gp-pager .page-link {
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 6px;
    font-size: 12.5px;
    padding: 4px 10px;
}
.gp-pager .page-link:hover { background: #22304a; color: #fff; }
.gp-pager .page-item.active .page-link {
    background: var(--amber);
    border-color: var(--amber);
    color: #10161f;
}
.gp-pager .page-item.disabled .page-link { background: transparent; color: var(--dim); }
.gp-pager svg { width: 12px; height: 12px; }

/* ─────────────────────── select2 в тёмной теме ─────────────────────── */

.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
    background: var(--ink-deep) !important;
    border: 1px solid var(--line) !important;
    border-radius: 7px !important;
    min-height: 36px;
    padding: 2px 4px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text) !important;
    line-height: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 32px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #22304a !important;
    border: 1px solid var(--line) !important;
    color: var(--text) !important;
    border-radius: 5px !important;
    font-size: 12px;
    margin-top: 5px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--muted) !important; }
.select2-container--default .select2-search--inline .select2-search__field { color: var(--text); font-size: 13px; }
.select2-dropdown {
    background: var(--panel) !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    color: var(--text);
}
.select2-container--default .select2-results__option { font-size: 13px; padding: 6px 10px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--amber) !important;
    color: #10161f !important;
}
.select2-container--default .select2-results__option[aria-selected=true] { background: #22304a !important; }
.select2-search--dropdown .select2-search__field {
    background: var(--ink-deep);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 6px;
}

/* ─────────────────────────── Карточка игрока ─────────────────────────── */

.gp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--line-soft); }
.gp-fact { background: var(--panel); padding: 12px 16px; }
.gp-fact-label { font-size: 10px; letter-spacing: .08em; font-weight: 600; text-transform: uppercase; color: var(--dim); font-family: var(--font-display); }
.gp-fact-value { font-family: var(--font-data); font-size: 15px; margin-top: 4px; color: var(--text); word-break: break-all; }

.gp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); gap: 16px; }

.gp-car { display: flex; gap: 10px; align-items: center; }
.gp-car img { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-soft); background: var(--ink-deep); }

/* ─────────────────────────── Вход ─────────────────────────── */

.gp-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 380px at 50% -10%, #1b2740 0%, transparent 70%),
        var(--ink);
}
.gp-auth-card { width: 100%; max-width: 380px; }
.gp-auth-head { text-align: center; margin-bottom: 20px; }
.gp-auth-mark {
    width: 52px; height: 52px; margin: 0 auto 14px;
    display: grid; place-items: center;
    border: 1px solid var(--amber-dim); border-radius: 12px;
    color: var(--amber); font-family: var(--font-display); font-size: 20px;
    background: linear-gradient(180deg, #1d2333, #12182390);
}

/* ─────────────────────────── Адаптив ─────────────────────────── */

@media (max-width: 900px) {
    .gp-shell { flex-direction: column; }
    .gp-sidebar {
        width: 100%; flex: none; height: auto; position: static;
        border-right: 0; border-bottom: 1px solid var(--line-soft);
        padding-bottom: 14px;
    }
    .gp-content { padding: 16px 14px 48px; }
    .gp-topbar { padding: 10px 14px; flex-wrap: wrap; }
    .gp-table thead th { position: static; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    .gp-tile:hover { transform: none; }
}
