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

:root {
    --bg: #0d0e10;
    --panel: #17191d;
    --panel-soft: #1d2025;
    --panel-raised: #22252b;
    --sidebar: #070708;
    --gold: #d2a43b;
    --gold-light: #f0cf72;
    --gold-deep: #a97918;
    --text: #f3efe7;
    --muted: #9c968b;
    --line: #2b2e34;
    --green: #22b47a;
    --red: #e24b5d;
    --orange: #e19a2c;
    --shadow: 0 18px 46px rgba(0, 0, 0, .24);
    --radius: 18px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at 82% -10%, rgba(210, 164, 59, .08), transparent 30%), var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
button, input, select, textarea { font: inherit; }

.admin-wrapper {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: 248px;
    height: 100vh;
    padding: 22px 16px 17px;
    overflow-y: auto;
    color: #fff;
    background: linear-gradient(180deg, #0b0b0c 0%, var(--sidebar) 72%);
    border-right: 1px solid rgba(255, 255, 255, .055);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 6px 27px;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
    color: #111;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 9px 30px rgba(210, 164, 59, .12);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand-copy { min-width: 0; }

.sidebar-logo h2 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.025em;
    white-space: nowrap;
}

.sidebar-logo small {
    display: block;
    margin-top: 5px;
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-label {
    padding: 0 13px 9px;
    color: #65625d;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-nav { display: grid; gap: 6px; }

.sidebar-nav a,
.logout-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #d5d0c7;
    font-size: 13px;
    font-weight: 700;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sidebar-nav a svg,
.logout-link svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: .78;
}

.sidebar-nav a:hover,
.logout-link:hover {
    color: #fff;
    background: #171719;
    transform: translateX(2px);
}

.sidebar-nav a.active {
    color: #111;
    background: linear-gradient(100deg, #d8ad49, #b9841d);
    box-shadow: 0 10px 24px rgba(185, 132, 29, .12);
}

.sidebar-nav a.active svg { opacity: 1; }

.sidebar-footer {
    display: grid;
    gap: 7px;
    margin-top: auto;
    padding-top: 17px;
    border-top: 1px solid rgba(255, 255, 255, .075);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 6px;
    color: #77736c;
    font-size: 10px;
    font-weight: 700;
}

.system-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(34, 180, 122, .09);
}

.logout-link { color: #9c968c; }
.sidebar-footer > small { padding: 5px 12px 0; color: #55524e; font-size: 9px; }

.admin-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 112px;
    padding: 23px 31px 21px;
    background: rgba(13, 14, 16, .78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.page-heading { min-width: 0; }

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--gold);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.admin-topbar h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(25px, 3vw, 31px);
    font-weight: 850;
    letter-spacing: -.045em;
    line-height: 1.08;
}

.admin-topbar p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 7px 12px 7px 7px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.admin-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #111;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
    font-size: 12px;
    font-weight: 900;
}

.admin-user-copy { display: grid; gap: 1px; padding-right: 3px; }
.admin-user-copy small { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.admin-user-copy strong { max-width: 150px; overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
}

.menu-toggle span { display: block; width: 100%; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--text); }
.sidebar-backdrop { display: none; }

.admin-body {
    flex: 1;
    width: 100%;
    max-width: 1640px;
    padding: 28px 31px 38px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.stat-card,
.card-box,
.table-box {
    position: relative;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card { min-height: 142px; padding: 20px; }
.stat-card::before { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); content: ""; }
.stat-card:nth-child(2)::before { background: #8c6bd8; }
.stat-card:nth-child(3)::before { background: #299bb1; }
.stat-card:nth-child(4)::before { background: var(--green); }

.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.stat-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--gold-light);
    background: rgba(210, 164, 59, .1);
    font-size: 14px;
    font-weight: 900;
}

.stat-card:nth-child(2) .stat-icon { color: #b49aef; background: rgba(140, 107, 216, .12); }
.stat-card:nth-child(3) .stat-icon { color: #72c7d7; background: rgba(41, 155, 177, .12); }
.stat-card:nth-child(4) .stat-icon { color: #63d5a8; background: rgba(34, 180, 122, .11); }
.stat-card .label { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.stat-card .value { margin-top: 13px; color: var(--text); font-size: 30px; font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.stat-card .hint { margin-top: 8px; color: var(--muted); font-size: 10px; }

.card-box,
.table-box { padding: 21px; margin-bottom: 20px; }
.card-box h3, .table-box h3 { margin: 0; color: var(--text); font-size: 17px; font-weight: 800; letter-spacing: -.025em; }
.card-box h4 { margin: 3px 0 1px; color: var(--text); font-size: 14px; font-weight: 800; }

.compact-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.compact-stats > div {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3px 14px;
    padding: 15px 17px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.compact-stats span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.compact-stats strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    color: var(--gold-light);
    font-size: 22px;
    font-weight: 900;
}

.compact-stats small { color: #716e68; font-size: 9px; }

.table-primary-link { color: var(--text); font-weight: 750; }
.table-primary-link:hover { color: var(--gold-light); }

.empty-state-box {
    display: grid;
    justify-items: center;
    min-height: 270px;
    padding: 45px 22px;
    text-align: center;
    place-content: center;
    background: var(--panel-soft);
    border: 1px dashed #3a3d44;
    border-radius: 14px;
}

.empty-state-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    color: var(--gold-light);
    background: rgba(210, 164, 59, .12);
    border-radius: 14px;
    font-size: 20px;
}

.empty-state-box strong { font-size: 13px; }
.empty-state-box p { max-width: 390px; margin: 7px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.strategy-name { display: grid; gap: 3px; min-width: 130px; }
.strategy-name strong { font-size: 11px; }
.strategy-name small { max-width: 210px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.pattern-mini { display: flex; align-items: center; min-width: 100px; }
.pattern-mini .pattern-token { width: 19px; height: 19px; margin-left: -3px; border: 1px solid var(--panel); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); font-size: 10px; }
.pattern-mini .pattern-token:first-child { margin-left: 0; }

.json-generation-date { font-size: clamp(1rem, 2vw, 1.35rem) !important; line-height: 1.35 !important; }
.json-files-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.json-file-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 14px; }
.json-file-card strong, .json-file-card small { display: block; }
.json-file-card strong { overflow-wrap: anywhere; }
.json-file-card small { margin-top: 3px; color: var(--muted); }
.json-file-icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; color: var(--gold); background: rgba(193, 139, 24, .12); border: 1px solid rgba(193, 139, 24, .32); border-radius: 11px; font-weight: 800; }
.telegram-test-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; background: rgba(210, 164, 59, .06); border: 1px solid rgba(210, 164, 59, .2); border-radius: 14px; }
.telegram-test-box > div { flex: 1 1 280px; }
.telegram-test-box strong, .telegram-test-box small { display: block; }
.telegram-test-box small { margin-top: 4px; color: var(--muted); }
.telegram-test-result { flex-basis: 100%; min-height: 0; font-size: 12px; font-weight: 700; }
.telegram-test-result:empty { display: none; }
.telegram-test-result.is-success { color: var(--green); }
.telegram-test-result.is-error { color: var(--red); }

@media (max-width: 991px) { .json-files-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .json-files-grid { grid-template-columns: 1fr; } }

.pattern-token {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    color: white;
    border: 2px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14);
    font-size: 12px;
    font-weight: 850;
}

.token-b { background: linear-gradient(145deg, #f04b5d, #c9293d); }
.token-p { background: linear-gradient(145deg, #36a9f2, #157dc4); }
.token-t { background: linear-gradient(145deg, #f7ac69, #df7e36); }
.token-b-t { background: linear-gradient(120deg, #ef3348 0 49%, #f5a25b 50% 100%); }
.token-p-t { background: linear-gradient(120deg, #269ce5 0 49%, #f5a25b 50% 100%); }
.token-b-p { background: linear-gradient(120deg, #ef3348 0 49%, #269ce5 50% 100%); }
.token-b-p-t { background: conic-gradient(from -30deg, #f5a25b 0 33.33%, #ef3348 33.33% 66.66%, #269ce5 66.66% 100%); }

.entry-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.entry-badge::before { width: 7px; height: 7px; border-radius: 50%; content: ""; }
.entry-b { color: #f27b88; background: rgba(226, 75, 93, .11); }
.entry-b::before { background: #e93d50; }
.entry-p { color: #78c8f7; background: rgba(30, 143, 215, .12); }
.entry-p::before { background: #269ce5; }
.entry-t { color: #f2b378; background: rgba(223, 126, 54, .12); }
.entry-t::before { background: #f5a25b; }
.entry-b-t { color: #f0b390; background: rgba(226, 75, 93, .09); }
.entry-b-t::before { background: linear-gradient(120deg, #ef3348 0 49%, #f5a25b 50%); }
.entry-p-t { color: #9bcde9; background: rgba(30, 143, 215, .09); }
.entry-p-t::before { background: linear-gradient(120deg, #269ce5 0 49%, #f5a25b 50%); }
.metric-inline { color: #64d8ab; }

.strategy-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 17px;
    align-items: start;
}

.strategy-builder-card { min-width: 0; }
.strategy-help-card { position: sticky; top: 22px; }
.strategy-help-card > h3 { margin: 2px 0 9px; }
.strategy-help-card > p { color: var(--muted); font-size: 11px; line-height: 1.6; }

.form-grid-strategy {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.strategy-identity-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.span-2 { grid-column: 1 / -1; }

.builder-section {
    padding: 19px;
    margin-top: 14px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 15px;
}

.builder-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px;
}

.builder-title > div { display: grid; gap: 4px; }
.builder-title strong { color: var(--text); font-size: 13px; }
.builder-title small { color: var(--muted); font-size: 9px; }
.builder-step { display: grid; place-items: center; width: 25px; height: 25px; color: #111; background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); border-radius: 8px; font-size: 10px; font-weight: 900; }

.token-palette { display: grid; gap: 13px; }
.palette-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 12px; }
.palette-label { color: #c6c0b7; font-size: 10px; font-weight: 800; }
.palette-tokens { display: flex; flex-wrap: wrap; gap: 7px; }
.palette-combinations { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.token-button { width: 36px; height: 36px; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.token-button:hover { transform: translateY(-2px) scale(1.05); filter: brightness(1.1); }
.token-button:active { transform: scale(.96); }

.pattern-workspace { position: relative; }
.pattern-canvas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 11px;
    min-height: 84px;
    padding: 15px;
    background: #141619;
    border: 1px solid #31343a;
    border-radius: 13px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.pattern-canvas.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 75, 93, .12); }
.pattern-empty { width: 100%; color: #6e6b65; font-size: 10px; text-align: center; }
.selected-token { position: relative; }
.selected-token .pattern-token { width: 45px; height: 45px; font-size: 13px; }
.selected-token .pattern-token input { width: 31px; height: 31px; padding: 0; color: white; background: transparent; border: 0; outline: 0; font-size: 13px; font-weight: 900; line-height: 31px; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .72); }
.selected-token .pattern-token input::placeholder { color: rgba(255, 255, 255, .88); opacity: 1; }
.selected-token > button { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 19px; height: 19px; padding: 0 0 2px; color: white; background: #292c31; border: 2px solid var(--panel-soft); border-radius: 50%; font-size: 12px; line-height: 1; }
.builder-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.btn-soft-custom { color: var(--text); background: var(--panel-raised); border: 1px solid #373a41; }
.btn-soft-custom:hover { color: white; background: #292c32; }
.btn-danger-soft { color: #f17b89; background: rgba(226, 75, 93, .07); border: 1px solid rgba(226, 75, 93, .25); }
.btn-danger-soft:hover { color: #ff9ca7; background: rgba(226, 75, 93, .13); }

.strategy-result-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.entry-options, .gale-options { display: flex; flex-wrap: wrap; gap: 9px; }
.entry-option, .gale-option { min-height: 42px; color: var(--muted); background: #17191d; border: 1px solid #34373d; border-radius: 11px; font-size: 10px; font-weight: 800; }
.entry-option { display: flex; align-items: center; gap: 8px; padding: 9px 13px; }
.entry-option .entry-symbol { width: 18px; height: 18px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; }
.entry-symbol-b { background: #e93d50; }
.entry-symbol-p { background: #269ce5; }
.entry-symbol-t { background: #f5a25b; }
.entry-symbol-b-t { background: linear-gradient(120deg, #ef3348 0 49%, #f5a25b 50%); }
.entry-symbol-p-t { background: linear-gradient(120deg, #269ce5 0 49%, #f5a25b 50%); }
.entry-option.selected, .gale-option.selected { color: #111; background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); border-color: var(--gold-deep); box-shadow: 0 7px 18px rgba(210, 164, 59, .12); }
.gale-option { width: 42px; padding: 0; border-radius: 50%; }

.strategy-switches { display: flex; flex-wrap: wrap; gap: 32px; padding: 19px 3px 4px; }
.strategy-submit { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 19px; margin-top: 15px; border-top: 1px solid var(--line); }
.strategy-submit > span { color: var(--muted); font-size: 10px; }
.strategy-submit > span.ready { color: #5ed3a4; }

.help-rule { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.help-rule strong { color: #d6d1c8; font-size: 10px; }
.help-rule span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.notice { padding: 12px 13px; color: #d6c9a7; background: rgba(210, 164, 59, .08); border: 1px solid rgba(210, 164, 59, .22); border-radius: 11px; font-size: 9px; line-height: 1.55; }

.signal-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.signal-metric { position: relative; overflow: hidden; padding: 17px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.signal-metric::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #6d7077; content: ""; }
.signal-metric.green::before { background: var(--green); }
.signal-metric.red::before { background: var(--red); }
.signal-metric.gold::before { background: var(--gold); }
.signal-metric span { display: block; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.signal-metric strong { display: block; margin-top: 7px; color: var(--text); font-size: 23px; font-weight: 900; letter-spacing: -.04em; }
.signal-metric small { display: block; margin-top: 4px; color: #716e68; font-size: 9px; }
.signal-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.signal-filters .form-control { min-width: 155px; }
.date-cell { display: grid; gap: 2px; min-width: 78px; }
.date-cell strong { font-size: 10px; }
.date-cell small { color: var(--muted); font-size: 9px; }
.result-totals { display: grid; gap: 4px; min-width: 78px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.result-green { color: #62d5a7; }
.result-red { color: #ef7887; }
.gale-breakdown { display: flex; align-items: stretch; gap: 5px; min-width: max-content; }
.gale-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 5px; min-width: 50px; padding: 6px 7px; background: #17191d; border: 1px solid #303238; border-radius: 8px; font-size: 8px; text-align: center; }
.gale-stat strong { grid-column: 1 / -1; color: #bbb5ab; font-size: 8px; }
.strategy-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 122px; }
.strategy-row-actions form { margin: 0; }
.strategy-list-tools { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.strategy-list-tools form { margin: 0; }
.strategy-list-tools .form-control { min-width: 220px; }
.strategy-auto-rule { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 17px; padding: 14px 16px; background: linear-gradient(135deg, rgba(210, 164, 59, .1), rgba(210, 164, 59, .025)); border: 1px solid rgba(210, 164, 59, .26); border-radius: 12px; }
.strategy-auto-rule > div { display: grid; gap: 4px; }
.strategy-auto-rule strong { color: var(--text); font-size: 13px; }
.strategy-auto-rule small { max-width: 680px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.strategy-auto-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.percentage-field { position: relative; min-width: 120px; }
.percentage-field .form-control { width: 120px; padding-right: 32px; }
.percentage-field > span { position: absolute; top: 50%; right: 13px; color: var(--gold-light); font-size: 12px; font-weight: 850; transform: translateY(-50%); pointer-events: none; }
.strategy-table { width: max-content; min-width: 100%; }
.strategy-table .stat-head-green { color: #62d5a7; text-align: center; }
.strategy-table .stat-head-red { color: #ef7887; text-align: center; }
.strategy-table .stat-head-gale { color: var(--gold-light); text-align: center; }
.strategy-stat-number { min-width: 58px; font-size: 13px; font-weight: 900; text-align: center; }
.gale-column-cell { min-width: 58px; text-align: center; }
.gale-column-values { display: inline-flex; align-items: baseline; justify-content: center; gap: 3px; min-width: 45px; padding: 8px 7px; background: #17191d; border: 1px solid #303238; border-radius: 8px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.strategy-status-form { margin: 0; }
.strategy-status-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.strategy-status-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.strategy-switch-track { position: relative; width: 34px; height: 19px; background: #34363c; border: 1px solid #494c53; border-radius: 999px; transition: background-color .18s ease, border-color .18s ease; }
.strategy-switch-track::after { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; background: #aaa69f; border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, .35); transition: transform .18s ease, background-color .18s ease; content: ""; }
.strategy-status-switch input:checked + .strategy-switch-track { background: rgba(210, 164, 59, .34); border-color: var(--gold-deep); }
.strategy-status-switch input:checked + .strategy-switch-track::after { transform: translateX(15px); background: var(--gold-light); }
.strategy-switch-label { min-width: 36px; color: var(--muted); font-size: 9px; font-weight: 800; }
.strategy-status-switch input:checked ~ .strategy-switch-label { color: var(--gold-light); }
.strategy-status-switch.is-automatic { cursor: default; }
.strategy-status-switch.is-automatic .strategy-switch-label { min-width: 62px; }

.section-heading-inline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-top: 10px; }
.section-heading-inline h4 { color: var(--text); font-size: 17px; font-weight: 850; letter-spacing: -.025em; }

.strategy-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.strategy-mode-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 13px;
    min-height: 104px;
    padding: 17px;
    cursor: pointer;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 15px;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.strategy-mode-card:hover { transform: translateY(-1px); border-color: #484b51; }
.strategy-mode-card:has(input:checked) { background: linear-gradient(135deg, rgba(210, 164, 59, .12), rgba(210, 164, 59, .025)); border-color: var(--gold-deep); box-shadow: 0 10px 28px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(226, 187, 91, .08); }
.strategy-mode-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mode-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--gold-light); background: rgba(210, 164, 59, .1); border: 1px solid rgba(210, 164, 59, .24); border-radius: 12px; font-size: 17px; font-weight: 900; }
.mode-copy { display: grid; gap: 5px; min-width: 0; }
.mode-copy strong { color: var(--text); font-size: 13px; font-weight: 850; }
.mode-copy small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.mode-check { display: grid; place-items: center; width: 22px; height: 22px; color: #77736c; border: 1px solid #44464b; border-radius: 50%; font-size: 10px; font-weight: 900; }
.strategy-mode-card:has(input:checked) .mode-check { color: #111; background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); border-color: var(--gold); }
.custom-strategy-picker { display: flex; align-items: flex-end; gap: 13px; padding: 17px; background: rgba(210, 164, 59, .045); border: 1px solid rgba(210, 164, 59, .18); border-radius: 14px; }
.strategy-picker-help { display: block; margin-top: 6px; }
.strategy-link-notice { display: flex; align-items: flex-start; gap: 13px; padding: 17px; color: #d8d3ca; background: rgba(210, 164, 59, .055); border: 1px solid rgba(210, 164, 59, .23); border-radius: 14px; }
.strategy-link-notice-icon { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; color: #111; background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); border-radius: 50%; font-size: 11px; font-weight: 950; }
.strategy-link-notice strong { display: block; margin: 1px 0 5px; color: var(--text); font-size: 11px; }
.strategy-link-notice p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.strategy-link-notice b { color: var(--gold-light); }
[hidden] { display: none !important; }

.sequence-filter-card {
    padding: 17px;
    background: linear-gradient(145deg, rgba(210, 164, 59, .07), rgba(255, 255, 255, .018));
    border: 1px solid rgba(210, 164, 59, .24);
    border-radius: 15px;
}

.sequence-filter-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.sequence-filter-heading h5 { margin: 3px 0 4px; color: var(--text); font-size: 14px; font-weight: 850; }
.sequence-filter-heading p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.sequence-filter-badge { flex: 0 0 auto; padding: 6px 9px; color: #17130a; background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); border-radius: 999px; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.sequence-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.sequence-filter-item { min-width: 0; padding: 13px; background: rgba(9, 10, 12, .42); border: 1px solid var(--line); border-radius: 12px; }
.sequence-filter-copy { display: grid; gap: 2px; margin-bottom: 10px; }
.sequence-filter-copy strong { color: var(--gold-light); font-size: 11px; font-weight: 900; }
.sequence-filter-copy small { color: var(--muted); font-size: 8px; }
.sequence-filter-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 9px; }
.sequence-filter-range > div { min-width: 0; }
.sequence-filter-range label { display: block; margin-bottom: 5px; color: #cfc9bf; font-size: 8px; font-weight: 750; }
.sequence-filter-range > span { padding-bottom: 12px; color: var(--muted); font-size: 8px; }
.sequence-filter-note { display: block; margin-top: 11px; color: var(--muted); font-size: 8px; line-height: 1.5; }

.room-settings-section {
    padding-top: 21px;
    margin-top: 10px;
    border-top: 1px solid var(--line);
}

.room-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.room-settings-heading h4 { margin: 0 0 5px; font-size: 17px; }
.room-settings-heading p { margin: 0; color: var(--muted); font-size: 10px; }

.room-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.room-setting-card {
    min-width: 0;
    padding: 17px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 15px;
}

.room-setting-card-title {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.room-setting-card-title > div { display: grid; gap: 3px; }
.room-setting-card-title strong { color: var(--text); font-size: 12px; font-weight: 850; }
.room-setting-card-title small { color: var(--muted); font-size: 9px; line-height: 1.4; }

.room-setting-icon {
    display: grid;
    place-items: center;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    color: var(--gold-light);
    background: rgba(210, 164, 59, .1);
    border: 1px solid rgba(210, 164, 59, .24);
    border-radius: 9px;
    font-size: 9px;
    font-weight: 900;
}

.room-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 65px;
    padding: 13px 1px;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.room-option-row:last-child { padding-bottom: 1px; border-bottom: 0; }
.room-option-row-stack { display: block; }
.room-option-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.room-option-copy { display: grid; gap: 3px; }
.room-option-copy strong { color: #ddd8cf; font-size: 10px; font-weight: 800; }
.room-option-copy small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.room-option-row .form-switch { flex: 0 0 auto; }
.room-option-row .form-switch .form-check-input { width: 2.25em; height: 1.2em; margin: 0; cursor: pointer; }

.room-check-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.room-check-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 33px;
    padding: 7px 10px;
    color: #c9c3b9;
    background: #181a1e;
    border: 1px solid #30333a;
    border-radius: 9px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 750;
}

.room-check-pill:has(input:checked) { color: var(--gold-light); background: rgba(210, 164, 59, .08); border-color: rgba(210, 164, 59, .32); }
.room-check-pill .form-check-input { flex: 0 0 auto; margin: 0; }

.room-inline-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding: 10px;
    background: #181a1e;
    border: 1px solid #30333a;
    border-radius: 10px;
}

.room-inline-field .form-label { margin: 0; }
.room-number-with-suffix { display: flex; align-items: center; gap: 8px; }
.room-number-with-suffix .form-control { width: 78px; min-height: 37px; }
.room-number-with-suffix span { color: var(--muted); font-size: 9px; }

.session-limits-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding-top: 15px;
}

.session-limits-grid > div {
    min-width: 0;
    padding: 12px;
    background: #181a1e;
    border: 1px solid #30333a;
    border-radius: 11px;
}

.session-limits-grid .form-control { min-height: 42px; }
.session-limits-grid small { display: block; margin-top: 7px; color: #77736d; font-size: 8px; line-height: 1.45; }

.room-composer-card { display: flex; flex-direction: column; min-height: 230px; }
.session-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 15px; }
.session-add-row .btn, .goal-add-row .btn { min-height: 44px; align-self: end; }

.goal-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 9px;
    margin-top: 15px;
}

.goal-add-row > div { min-width: 0; }
.goal-separator { padding-bottom: 12px; color: var(--gold-light); font-size: 15px; font-weight: 900; }
.room-added-items { display: flex; flex-wrap: wrap; gap: 7px; min-height: 13px; margin-top: 12px; }
.room-card-hint { display: block; margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 8px; }

.table-responsive { margin-top: 2px; border: 1px solid var(--line); border-radius: 13px; }

.table {
    margin: 0;
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: rgba(255, 255, 255, .018);
    --bs-table-hover-color: var(--text);
    color: var(--text);
    font-size: 12px;
}

.table > :not(caption) > * > * { padding: 13px 12px; color: inherit; background: transparent; border-bottom-color: var(--line); box-shadow: none; vertical-align: middle; }
.table thead th { padding-top: 11px; padding-bottom: 11px; color: var(--muted); background: var(--panel-soft); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.status-badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-success { color: #5ed3a4; background: rgba(34, 180, 122, .11); }
.status-warning { color: #f0b755; background: rgba(225, 154, 44, .12); }
.status-danger { color: #f17988; background: rgba(226, 75, 93, .11); }
.status-muted { color: #aaa39a; background: rgba(156, 150, 139, .11); }
.status-gold { color: var(--gold-light); background: rgba(210, 164, 59, .11); }

.btn { border-radius: 11px; font-size: 11px; font-weight: 800; transition: transform .16s ease, filter .16s ease, box-shadow .16s ease; }
.btn:hover { transform: translateY(-1px); }

.btn-primary-custom {
    padding: 10px 16px;
    color: #111;
    background: linear-gradient(135deg, #ddb451, #bd861b);
    border: 1px solid #ad7816;
    box-shadow: 0 8px 20px rgba(189, 134, 27, .11);
}

.btn-primary-custom:hover,
.btn-primary-custom:focus { color: #111; background: linear-gradient(135deg, #ebc665, #c99529); border-color: #c08d25; box-shadow: 0 10px 24px rgba(189, 134, 27, .16); }

.btn-danger { --bs-btn-bg: #c93649; --bs-btn-border-color: #c93649; --bs-btn-hover-bg: #df4558; --bs-btn-hover-border-color: #df4558; }
.btn-outline-custom { padding: 10px 15px; color: var(--gold-light); background: transparent; border: 1px solid rgba(210, 164, 59, .42); white-space: nowrap; }
.btn-outline-custom:hover, .btn-outline-custom:focus { color: #111; background: var(--gold); border-color: var(--gold); }

.form-label { margin-bottom: 7px; color: #d8d3ca; font-size: 10px; font-weight: 800; letter-spacing: .025em; }

.form-control,
.form-select {
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    background-color: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 12px;
}

.form-control:focus,
.form-select:focus { color: var(--text); background-color: var(--panel-soft); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(210, 164, 59, .12); }
.form-control::placeholder { color: #6f6d68; }
.form-control option, .form-select option { color: var(--text); background: var(--panel-soft); }
textarea.form-control { min-height: 88px; resize: vertical; }

.form-check-input { background-color: #2d3036; border-color: #43464d; }
.form-check-input:checked { background-color: var(--gold-deep); border-color: var(--gold-deep); }
.form-check-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(210, 164, 59, .12); }
.form-check-label { color: #d6d1c8; font-size: 11px; font-weight: 650; }
.bg-light { color: var(--text) !important; background: var(--panel-soft) !important; }
.border, .border-top, .border-bottom { border-color: var(--line) !important; }
hr { border-color: var(--line); opacity: 1; }
.text-muted { color: var(--muted) !important; }
.badge.text-bg-light { color: var(--text) !important; background: var(--panel-raised) !important; }

.alert { border-radius: 12px; border-width: 1px; font-size: 12px; }
.alert-success { color: #7ee0b9; background: rgba(34, 180, 122, .1); border-color: rgba(34, 180, 122, .27); }
.alert-danger { color: #f58a97; background: rgba(226, 75, 93, .09); border-color: rgba(226, 75, 93, .25); }

.admin-footer { display: flex; justify-content: space-between; gap: 16px; padding: 8px 31px 24px; color: #65625d; font-size: 9px; }

.login-page {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 28px 18px;
    overflow: hidden;
    background: radial-gradient(circle at 15% 18%, rgba(210, 164, 59, .13), transparent 31%), radial-gradient(circle at 90% 86%, rgba(210, 164, 59, .07), transparent 32%), #08090a;
}

.login-page::before {
    position: absolute;
    inset: 0;
    opacity: .18;
    background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
    content: "";
}

.login-shell { position: relative; z-index: 1; width: 100%; max-width: 430px; }
.login-brand { display: grid; justify-items: center; margin-bottom: 19px; text-align: center; }
.login-brand .brand-mark { width: 58px; height: 58px; margin-bottom: 13px; border-radius: 17px; font-size: 19px; }
.login-brand strong { color: #fff; font-size: 19px; font-weight: 850; letter-spacing: -.035em; }
.login-brand span { margin-top: 5px; color: var(--gold); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }

.login-box {
    width: 100%;
    padding: 29px;
    background: rgba(23, 25, 29, .94);
    border: 1px solid #303238;
    border-radius: 21px;
    box-shadow: 0 28px 75px rgba(0, 0, 0, .48);
    backdrop-filter: blur(18px);
}

.login-box h1 { margin: 0; color: var(--text); font-size: 23px; font-weight: 850; letter-spacing: -.04em; }
.login-box > p { margin: 7px 0 23px; color: var(--muted); font-size: 11px; }
.login-footnote { display: block; margin-top: 17px; color: #68655f; font-size: 9px; text-align: center; }

@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .strategy-layout { grid-template-columns: 1fr; }
    .strategy-help-card { position: static; }
    .strategy-identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .session-limits-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
    .admin-wrapper { display: block; }
    .admin-sidebar { position: fixed; left: 0; transform: translateX(-102%); transition: transform .24s ease; box-shadow: 24px 0 60px rgba(0, 0, 0, .5); }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 30; display: block; visibility: hidden; opacity: 0; background: rgba(0, 0, 0, .64); transition: opacity .2s ease, visibility .2s ease; }
    .sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
    .menu-toggle { display: block; flex: 0 0 42px; }
    .signal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .signal-list-head { flex-direction: column; }
    .strategy-list-head { align-items: flex-start !important; flex-direction: column; }
    .strategy-list-tools { width: 100%; justify-content: flex-start; }
    .strategy-auto-rule { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 680px) {
    .admin-topbar { align-items: flex-start; min-height: auto; padding: 19px 17px; }
    .admin-topbar p, .eyebrow, .admin-user-copy { display: none; }
    .admin-user { padding: 4px; background: transparent; border-color: transparent; box-shadow: none; }
    .admin-body { padding: 20px 16px 30px; }
    .stats-grid { grid-template-columns: 1fr; }
    .compact-stats { grid-template-columns: 1fr; }
    .form-grid-strategy, .strategy-result-grid { grid-template-columns: 1fr; }
    .strategy-identity-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .palette-row { grid-template-columns: 1fr; }
    .signal-metrics { grid-template-columns: 1fr; }
    .signal-filters { width: 100%; flex-direction: column; }
    .signal-filters .form-control { width: 100%; }
    .strategy-mode-grid { grid-template-columns: 1fr; }
    .custom-strategy-picker { align-items: stretch; flex-direction: column; }
    .strategy-submit { align-items: stretch; flex-direction: column; }
    .strategy-list-tools { align-items: stretch; flex-direction: column; }
    .strategy-list-tools .form-control { width: 100%; min-width: 0; }
    .strategy-auto-form { width: 100%; align-items: stretch; flex-direction: column; }
    .percentage-field, .percentage-field .form-control { width: 100%; }
    .room-settings-grid { grid-template-columns: 1fr; }
    .sequence-filter-heading { flex-direction: column; }
    .sequence-filter-grid { grid-template-columns: 1fr; }
    .room-option-main { align-items: flex-start; }
    .goal-add-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    .goal-add-row .btn { grid-column: 1 / -1; }
    .card-box, .table-box { padding: 16px; border-radius: 15px; }
    .card-box > .d-flex:first-child, .table-box > .d-flex:first-child { align-items: flex-start !important; gap: 12px; }
    .admin-footer { padding: 4px 17px 20px; }
    .admin-footer small:last-child { display: none; }
    .login-box { padding: 23px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
