:root {
    --bg: #000000;
    --panel: #050505;
    --panel-2: #080808;
    --border: #1a1a1a;
    --border-soft: #2a2a2a;
    --text: #ffffff;
    --muted: #555555;
    --muted-2: #888888;
    --green: #a3e635;
    --blue: #6366f1;
    --purple: #a855f7;
    --success: #22c55e;
    --danger: #ef4444;
}

* { box-sizing: border-box; }
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

a { color: inherit; }

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
}

.sidebar-rail {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 64px;
    background: rgba(0, 0, 0, 0.45);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.rail-container {
    padding-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.rail-item {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    border: 1px solid transparent;
    text-decoration: none;
    position: relative;
    transition: .2s ease;
}

.rail-item:hover {
    color: #fff;
    background: rgba(255,255,255,.03);
    border-color: var(--border);
}

.rail-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.rail-item.active::before {
    content: '';
    position: absolute;
    left: -13px;
    width: 3px;
    height: 16px;
    background: #fff;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(255,255,255,.25);
}

.rail-label {
    position: absolute;
    left: 54px;
    background: #0a0a0a;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: .72rem;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-5px);
    transition: .2s ease;
    white-space: nowrap;
}

.rail-item:hover .rail-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dashboard-layout {
    display: flex;
    padding-left: 64px;
}

.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 80px auto 40px auto;
    padding: 0 20px;
}

.content-view {
    width: 100%;
}

.section-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 40px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 26px;
}

.page-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.02);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.page-header-text { display: flex; flex-direction: column; gap: 2px; }
.page-title {
    margin: 0;
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.4px;
}
.page-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
}

.view-filters {
    display: flex;
    margin-bottom: 35px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.period-btn {
    background: rgba(255,255,255,.02);
    color: #d7d7d7;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: .2s ease;
    font-family: 'Inter', sans-serif;
    font-size: .85rem;
}

.period-btn:hover,
.period-btn.active {
    background: rgba(255,255,255,.08);
    border-color: #333;
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.three-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.chart-card,
.settings-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    transition: .2s ease;
}

.stat-card:hover,
.chart-card:hover,
.settings-panel:hover {
    transform: translateY(-2px);
    border-color: var(--border-soft);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
    font-weight: 500;
}

.icon-green { color: var(--green); }
.icon-blue { color: var(--blue); }
.icon-purple { color: var(--purple); }

.stat-value {
    margin-top: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    line-height: 1.1;
    word-break: break-word;
}

.stat-value-compact {
    font-size: 1.65rem;
    line-height: 1.2;
}

.currency {
    font-size: 1.5rem;
    margin-right: 2px;
}

.color-green { color: var(--green); }
.color-blue { color: var(--blue); }
.color-purple { color: var(--purple); }

.period-label {
    margin-top: 8px;
    color: var(--muted);
    font-size: .8rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 26px;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(320px, 620px);
    gap: 24px;
}

.settings-label-row {
    margin-bottom: 12px;
}

.settings-section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
}

.settings-panel {
    background: var(--panel-2);
}

.settings-panel-caption {
    color: var(--muted-2);
    font-size: .85rem;
    margin-bottom: 18px;
}

.field-label {
    display: block;
    color: #999;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 10px;
}

.settings-input-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.settings-input {
    flex: 1;
    background: #030303;
    border: 1px solid #333;
    color: #fff;
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 8px;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: .2s ease;
}

.settings-input:focus {
    border-color: #555;
    background: #050505;
}

.save-button-inline {
    min-width: 120px;
    background: #fff;
    color: #000;
    border: none;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    transition: .2s ease;
}

.save-button-inline:hover {
    background: #ececec;
    transform: translateY(-1px);
}

.save-button-inline:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.settings-help {
    margin-top: 12px;
    color: var(--muted);
    font-size: .8rem;
}

.settings-message {
    display: none;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid transparent;
}

.settings-message.show { display: block; }
.settings-message.success {
    color: var(--success);
    background: rgba(34, 197, 94, .06);
    border-color: rgba(34, 197, 94, .25);
}
.settings-message.error {
    color: var(--danger);
    background: rgba(239, 68, 68, .06);
    border-color: rgba(239, 68, 68, .25);
}

@media (max-width: 1100px) {
    .three-stats { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dashboard-layout {
        padding-left: 0;
    }

    .sidebar-rail {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        border-right: none;
        border-top: 1px solid var(--border);
    }

    .rail-container {
        flex-direction: row;
        justify-content: space-around;
        padding-top: 0;
        height: 100%;
    }

    .rail-label,
    .rail-item.active::before {
        display: none;
    }

    .main-content {
        margin: 80px auto 88px auto;
    }

    .section-block {
        padding: 24px;
    }

    .settings-input-row {
        flex-direction: column;
    }

    .save-button-inline {
        min-height: 44px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.custom-settings-input {
    width: 100%;
    margin-top: 14px;
    background: #050505;
    border: 1px solid #222;
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    box-sizing: border-box;
}

.custom-settings-input:focus {
    border-color: #333;
}

.save-settings-btn {
    margin-top: 14px;
    background: #fff;
    color: #000;
    border: none;
    padding: 11px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s ease;
}

.save-settings-btn:hover {
    transform: translateY(-1px);
    background: #f2f2f2;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 6px;
    display: none;
    z-index: 1100;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #999;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    text-decoration: none;
}

.dropdown-item.active {
    background: #fff;
    color: #000;
    text-decoration: none;
}

.game-selector {
    position: relative;
    z-index: 101;
}

.selector-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #1a1a1a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.selector-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #333;
}

.selector-btn .chevron {
    width: 14px;
    height: 14px;
    color: #666;
}

.live-result-card {
    margin-top: 24px;
    background: #000;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
    padding: 18px;
}

.live-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.live-result-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.live-result-subtitle {
    color: #555;
    font-size: 0.78rem;
    margin-top: 4px;
}

.live-result-status {
    color: #22c55e;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.live-result-console {
    background: #050505;
    border: 1px solid #151515;
    border-radius: 12px;
    padding: 14px;
    min-height: 240px;
    max-height: 420px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
}

.live-result-empty {
    color: #555;
    font-size: 0.82rem;
}

.live-line {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 4px 0;
    font-size: 0.85rem;
    line-height: 1.45;
}

.live-time {
    color: #666;
    min-width: 72px;
    flex-shrink: 0;
}

.live-login {
    color: #f59e0b;
    flex-shrink: 0;
    white-space: nowrap;
}

.live-msg {
    color: #e5e7eb;
    flex: 1;
    word-break: break-word;
}

.live-msg.white {
    color: #e5e7eb;
}

.live-msg.green {
    color: #22c55e;
}

.live-msg.red {
    color: #ef4444;
}

.live-msg.yellow {
    color: #eab308;
}

.live-msg.blue {
    color: #60a5fa;
}

.live-msg.orange {
    color: #f97316;
}

@media (max-width: 900px) {
    .live-line {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.live-result-console {
    background: #050505;
    border: 1px solid #151515;
    border-radius: 12px;
    padding: 14px;
    min-height: 240px;
    max-height: 420px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #080808;
}

/* Chrome / Edge / Opera */
.live-result-console::-webkit-scrollbar {
    width: 10px;
}

.live-result-console::-webkit-scrollbar-track {
    background: #080808;
    border-radius: 10px;
}

.live-result-console::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2a2a2a, #3a3a3a);
    border-radius: 10px;
    border: 2px solid #080808;
}

.live-result-console::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3a3a3a, #4a4a4a);
}

.live-result-console::-webkit-scrollbar-corner {
    background: #080808;
}

.accounts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.accounts-filters,
.accounts-downloads {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.accounts-filter-btn,
.download-accounts-btn {
    background: #0b0b0b;
    border: 1px solid #1f1f1f;
    color: #d4d4d8;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.84rem;
    transition: 0.2s ease;
}

.accounts-filter-btn:hover,
.download-accounts-btn:hover {
    border-color: #333;
    color: #fff;
}

.accounts-filter-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.accounts-table-card {
    margin-top: 24px;
    background: #000;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
    overflow: hidden;
}

.accounts-table-head,
.accounts-table-row {
    display: grid;
    grid-template-columns: 1.1fr 120px 1.5fr 180px;
    gap: 14px;
    padding: 14px 18px;
    align-items: center;
}

.accounts-table-head {
    background: #070707;
    border-bottom: 1px solid #1a1a1a;
    color: #666;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.accounts-table-row {
    border-bottom: 1px solid #111;
}

.accounts-table-row:last-child {
    border-bottom: none;
}

.accounts-table-body {
    max-height: 520px;
    overflow-y: auto;
}

.accounts-username {
    color: #fff;
    font-weight: 600;
}

.accounts-device,
.accounts-updated {
    color: #888;
    word-break: break-word;
}

.accounts-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid #2a2a2a;
    color: #ddd;
    background: #0b0b0b;
}

.accounts-status-badge.inf {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.25);
    background: rgba(249, 115, 22, 0.08);
}

.accounts-status-badge.solved {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
}

.accounts-empty {
    padding: 26px 18px;
    color: #666;
}

@media (max-width: 980px) {
    .accounts-table-head,
    .accounts-table-row {
        grid-template-columns: 1fr;
    }

    .accounts-table-head {
        display: none;
    }

    .accounts-table-row {
        padding: 16px;
    }
}

.buyer-card {
    background: linear-gradient(180deg, rgba(12,12,18,0.95), rgba(8,8,12,0.98));
    border: 1px solid #1a1d2a;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.35);
}

.buyer-card-title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.buyer-card-subtitle {
    color: #70707a;
    font-size: 0.92rem;
    margin-bottom: 18px;
}

.buyer-textarea {
    width: 100%;
    min-height: 180px;
    background: #050505;
    border: 1px solid #1d1d22;
    color: #fff;
    padding: 16px;
    border-radius: 16px;
    outline: none;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
}

.buyer-textarea:focus {
    border-color: #2d2d35;
}

.buyer-bottom-row {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.buyer-status-text {
    color: #71717a;
    font-size: 0.92rem;
}

.buyer-start-btn {
    background: #14141b;
    border: 1px solid #23232d;
    color: #d4d4d8;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: 0.2s ease;
}

.buyer-start-btn:hover {
    background: #1b1b24;
    border-color: #333344;
    color: #fff;
}
/* ============================================================
   Animations & Effects
   ============================================================ */

/* fade-in для появления секций */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp .45s ease both;
}

/* появление новых карточек по очереди */
.stats-grid.fade-in > .stat-card {
    animation: fadeInUp .45s ease both;
}
.stats-grid.fade-in > .stat-card:nth-child(1) { animation-delay: 0s; }
.stats-grid.fade-in > .stat-card:nth-child(2) { animation-delay: .06s; }
.stats-grid.fade-in > .stat-card:nth-child(3) { animation-delay: .12s; }
.stats-grid.fade-in > .stat-card:nth-child(4) { animation-delay: .18s; }
.stats-grid.fade-in > .stat-card:nth-child(5) { animation-delay: .24s; }

/* флэш на изменение текстового значения */
@keyframes flashUpdate {
    0%   { background-color: rgba(163, 230, 53, 0); }
    30%  { background-color: rgba(163, 230, 53, .12); }
    100% { background-color: rgba(163, 230, 53, 0); }
}

.flash-update {
    animation: flashUpdate .8s ease;
    border-radius: 6px;
}

/* slide-in для новых строк live-log */
@keyframes liveLineIn {
    from {
        opacity: 0;
        transform: translateX(-6px);
        background: rgba(255, 255, 255, .06);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        background: transparent;
    }
}

.live-line-new {
    animation: liveLineIn .45s ease both;
}

/* для accounts-table-row */
@keyframes rowIn {
    from { opacity: 0; transform: translateY(-4px); background: rgba(255,255,255,.05); }
    to   { opacity: 1; transform: translateY(0); background: transparent; }
}

.accounts-table-row.row-new {
    animation: rowIn .45s ease both;
}

/* живой пульс рядом с "Auto refresh 1s" */
.live-result-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
    animation: livePulse 1.6s ease-out infinite;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    70%  { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* кнопки — лёгкий ripple/lift */
.buyer-start-btn,
.save-settings-btn,
.download-accounts-btn,
.accounts-filter-btn {
    position: relative;
    overflow: hidden;
}

.buyer-start-btn:active:not(:disabled),
.save-settings-btn:active:not(:disabled),
.download-accounts-btn:active,
.accounts-filter-btn:active {
    transform: translateY(0) scale(.98);
}

.buyer-start-btn:disabled,
.save-settings-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* spinner внутри кнопки */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinnerRotate .8s linear infinite;
    vertical-align: middle;
}

.save-settings-btn .btn-spinner {
    border-color: rgba(0, 0, 0, .25);
    border-top-color: #000;
}

@keyframes spinnerRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* убираем default outline у иконочных кнопок но оставляем для a11y */
.buyer-start-btn:focus-visible,
.save-settings-btn:focus-visible,
.download-accounts-btn:focus-visible,
.accounts-filter-btn:focus-visible,
.selector-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .35);
    outline-offset: 2px;
}

/* sidebar rail — лёгкая анимация при наведении */
.rail-item:hover i {
    transform: scale(1.08);
}
.rail-item i {
    transition: transform .18s ease;
}

/* dropdown — плавное раскрытие */
.dropdown-menu {
    transform-origin: top left;
    transform: scaleY(.95) translateY(-4px);
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}

.dropdown-menu.show {
    display: block;
    transform: scaleY(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   Toast notifications
   ============================================================ */
.toast-root {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 220px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: #0d0d0d;
    border: 1px solid #1f1f1f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .25s ease, transform .25s ease;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-color: rgba(34, 197, 94, .35);
    background: linear-gradient(180deg, rgba(34, 197, 94, .08), #0d0d0d);
    color: #d1fae5;
}

.toast-error {
    border-color: rgba(239, 68, 68, .35);
    background: linear-gradient(180deg, rgba(239, 68, 68, .08), #0d0d0d);
    color: #fecaca;
}

.toast-info {
    border-color: rgba(99, 102, 241, .35);
    background: linear-gradient(180deg, rgba(99, 102, 241, .08), #0d0d0d);
    color: #e0e7ff;
}

@media (max-width: 600px) {
    .toast-root {
        top: auto;
        bottom: 84px;
        right: 12px;
        left: 12px;
    }
    .toast {
        min-width: 0;
        max-width: 100%;
    }
}

/* orange accent — добавляем недостающий цвет (использовался в buyer-gamepass) */
.color-orange { color: #f97316; }
.icon-orange { color: #f97316; }

/* небольшой рост карточек на странице buyer — компактнее на мобилке */
@media (max-width: 600px) {
    .stat-value { font-size: 1.8rem; }
    .section-block { padding: 22px 16px; }
}

/* code в текстах */
code {
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
    color: #d4d4d8;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

/* ============================================================
   Login page
   ============================================================ */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 600px at 20% 10%, rgba(99, 102, 241, 0.10), transparent 60%),
        radial-gradient(900px 500px at 85% 95%, rgba(168, 85, 247, 0.10), transparent 65%),
        var(--bg);
    padding: 24px;
}

.login-wrap {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 38px 32px 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
}

.login-title {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #fff;
}

.login-subtitle {
    margin: 0 0 26px;
    color: var(--muted-2);
    font-size: 0.92rem;
}

.discord-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #5865F2;
    color: #fff;
    border: 1px solid #4752C4;
    padding: 13px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.2s ease;
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.30);
}

.discord-login-btn:hover {
    background: #4752C4;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(88, 101, 242, 0.45);
}

.login-footer {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

/* ============================================================
   User menu (navbar)
   ============================================================ */

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: #e5e7eb;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: 0.2s ease;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-soft);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a1a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    object-fit: cover;
}

.user-avatar-fallback {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    font-size: 0.78rem;
}

.user-menu-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-chev {
    width: 14px;
    height: 14px;
    color: #777;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    z-index: 1100;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transform-origin: top right;
    transform: scaleY(0.95) translateY(-4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.user-menu-dropdown.show {
    opacity: 1;
    transform: scaleY(1) translateY(0);
    pointer-events: auto;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: 0.15s ease;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.user-menu-item i {
    width: 16px;
    height: 16px;
}

/* ============================================================
   Devices page
   ============================================================ */

.device-form-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 0.8fr;
    gap: 14px;
    margin-top: 14px;
}

@media (max-width: 800px) {
    .device-form-grid {
        grid-template-columns: 1fr;
    }
}

.device-form-field {
    display: flex;
    flex-direction: column;
}

.device-form-field .field-label {
    margin-bottom: 6px;
}

.device-form-field .custom-settings-input {
    margin-top: 0;
}

.input-with-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-action .custom-settings-input {
    flex: 1;
    min-width: 0;
}

.devices-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 8px 0 14px;
}

.devices-counter {
    color: var(--muted-2);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.devices-empty {
    color: #555;
    padding: 22px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

.device-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.device-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-soft);
}

.device-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.device-card-title {
    color: #fff;
    font-weight: 600;
    font-size: 1.02rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-card-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.device-card-label {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.device-card-value {
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-card-value.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}

.device-card-value.muted {
    color: var(--muted-2);
}

.device-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.device-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.device-meta {
    color: var(--muted-2);
    font-size: 0.82rem;
    font-family: 'JetBrains Mono', monospace;
}

.device-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border-soft);
    background: #0b0b0b;
    color: #ddd;
}

.device-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
}

.device-status-pill.online {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
}

.device-status-pill.online .device-status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: livePulse 1.6s ease-out infinite;
}

.device-status-pill.offline {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
}

.device-status-pill.offline .device-status-dot {
    background: #ef4444;
}

.device-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

/* ============================================================
   Buttons (ghost / danger)
   ============================================================ */

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: #d4d4d8;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: 0.2s ease;
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-soft);
    color: #fff;
}

.ghost-btn i {
    width: 16px;
    height: 16px;
}

.ghost-btn-tiny {
    padding: 6px 8px;
    font-size: 0.75rem;
}

.danger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: 0.2s ease;
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.45);
}

.danger-btn i {
    width: 16px;
    height: 16px;
}

/* ============================================================
   Navbar refinements (so user menu fits)
   ============================================================ */

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* select inputs use the same look as inputs */
select.custom-settings-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #777 50%),
                      linear-gradient(135deg, #777 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
    cursor: pointer;
}

/* Ensure hidden attribute works on spinner regardless of other rules */
[hidden] { display: none !important; }

/* btn-loading state — fallback if spinner element is missing */
.btn-loading .btn-label { opacity: 0.7; }

/* ============================================================
   Devices toolbar v2 — selection & bulk bar
   ============================================================ */

.devices-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 14px;
    flex-wrap: wrap;
    min-height: 38px;
}

.devices-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- custom checkbox ---- */
.checkbox-wrap {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #333;
    background: #0b0b0b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s ease;
    flex-shrink: 0;
}

.checkbox-wrap:hover .checkbox-box {
    border-color: #555;
}

.checkbox-wrap input:checked + .checkbox-box {
    background: #fff;
    border-color: #fff;
}

.checkbox-wrap input:checked + .checkbox-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #000;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.checkbox-wrap input:indeterminate + .checkbox-box {
    background: rgba(255,255,255,0.15);
    border-color: #666;
}

.checkbox-wrap input:indeterminate + .checkbox-box::after {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    background: #fff;
    border: none;
    transform: none;
}

/* ---- bulk bar ---- */
.bulk-bar {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 6px 10px;
    animation: fadeInUp 0.25s ease both;
}

.bulk-bar.visible {
    display: flex;
}

.bulk-selected-label {
    font-size: 0.82rem;
    color: var(--muted-2);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    margin-right: 4px;
}

.bulk-action-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
    gap: 6px;
}

.bulk-action-btn i {
    width: 14px;
    height: 14px;
}

.bulk-accounts-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-select {
    margin-top: 0 !important;
    padding: 6px 30px 6px 10px !important;
    font-size: 0.82rem !important;
    height: 34px;
    min-width: 140px;
}

.bulk-clear-btn {
    color: #666;
    border-color: transparent;
    background: transparent;
}

.bulk-clear-btn:hover {
    color: #fff;
    border-color: var(--border);
    background: rgba(255,255,255,0.03);
}

/* ---- device card v2 ---- */

.device-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    transition: 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: default;
    user-select: none;
}

.device-card:hover {
    border-color: var(--border-soft);
    transform: translateY(-1px);
}

.device-card.selected {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.03);
}

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

.device-card-check {
    flex-shrink: 0;
}

.device-card-title {
    flex: 1;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-card-row {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.device-card-label {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.device-card-value {
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-card-value.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

.device-card-value.muted { color: var(--muted-2); }

.device-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.device-card-actions {
    display: flex;
    gap: 6px;
}

/* ---- device state badge ---- */
.device-state-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-soft);
    background: #0b0b0b;
    color: #888;
}

.device-state-badge i {
    width: 12px;
    height: 12px;
}

.device-state-badge.running {
    color: #a3e635;
    border-color: rgba(163, 230, 53, 0.25);
    background: rgba(163, 230, 53, 0.06);
}

.device-state-badge.stopped {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.25);
    background: rgba(249, 115, 22, 0.06);
}

/* ============================================================
   Device card pills group (Online/Offline + Running/Stopped)
   ============================================================ */

.device-card-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Running — same pill shape as online */
.device-status-pill.pill-running {
    color: #a3e635;
    border-color: rgba(163, 230, 53, 0.25);
    background: rgba(163, 230, 53, 0.08);
}

.device-status-pill.pill-running .device-status-dot {
    background: #a3e635;
}

/* Stopped — same pill shape as offline */
.device-status-pill.pill-stopped {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.25);
    background: rgba(249, 115, 22, 0.06);
}

.device-status-pill.pill-stopped .device-status-dot {
    background: #f97316;
}

/* footer without the state badge — just actions */
.device-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   Floating bulk action bar
   ============================================================ */

.bulk-float {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;

    display: flex;
    align-items: center;
    gap: 0;

    background: #111113;
    border: 1px solid #2a2a2e;
    border-radius: 16px;
    padding: 8px 10px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 20px 60px rgba(0,0,0,0.7),
        0 4px 20px rgba(0,0,0,0.5);

    white-space: nowrap;
    transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.bulk-float.visible {
    bottom: 32px;
    opacity: 1;
    pointer-events: auto;
}

/* left: selected count badge */
.bulk-float-left {
    padding: 0 14px 0 6px;
}

.bulk-float-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.bulk-float-count span:first-child {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
    line-height: 1;
}

.bulk-float-count-label {
    font-size: 0.72rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* dividers */
.bulk-float-divider {
    width: 1px;
    height: 28px;
    background: #222225;
    flex-shrink: 0;
    margin: 0 8px;
}

/* sections */
.bulk-float-section {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
}

.bulk-float-section-label {
    font-size: 0.68rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: 'JetBrains Mono', monospace;
    margin-right: 2px;
}

/* action buttons inside the bar */
.bulk-float-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease;
    background: rgba(255,255,255,0.04);
    color: #ccc;
    border-color: #222;
}

.bulk-float-btn i {
    width: 14px;
    height: 14px;
}

.bulk-float-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: #333;
    color: #fff;
}

.bulk-float-btn--start {
    color: #a3e635;
    border-color: rgba(163, 230, 53, 0.2);
    background: rgba(163, 230, 53, 0.06);
}
.bulk-float-btn--start:hover {
    background: rgba(163, 230, 53, 0.12);
    border-color: rgba(163, 230, 53, 0.35);
    color: #b8f551;
}

.bulk-float-btn--stop {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.2);
    background: rgba(249, 115, 22, 0.06);
}
.bulk-float-btn--stop:hover {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.35);
    color: #fb923c;
}

.bulk-float-btn--apply {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.06);
}
.bulk-float-btn--apply:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #818cf8;
}

/* custom select inside the bar */
.bulk-float-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bulk-float-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.04);
    border: 1px solid #222;
    color: #ccc;
    padding: 7px 32px 7px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
    transition: 0.15s ease;
}

.bulk-float-select:hover,
.bulk-float-select:focus {
    border-color: #333;
    color: #fff;
    background: rgba(255,255,255,0.07);
}

.bulk-float-select option {
    background: #111113;
    color: #fff;
}

.bulk-float-select-chev {
    position: absolute;
    right: 9px;
    width: 13px;
    height: 13px;
    color: #555;
    pointer-events: none;
}

/* close button */
.bulk-float-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: #555;
    cursor: pointer;
    transition: 0.15s ease;
    flex-shrink: 0;
    margin-left: 2px;
}

.bulk-float-close i {
    width: 15px;
    height: 15px;
}

.bulk-float-close:hover {
    background: rgba(255,255,255,0.05);
    border-color: #333;
    color: #fff;
}

/* mobile */
@media (max-width: 700px) {
    .bulk-float {
        left: 12px;
        right: 12px;
        bottom: -100px;
        transform: none;
        flex-wrap: wrap;
        border-radius: 14px;
    }
    .bulk-float.visible {
        bottom: 16px;
    }
    .bulk-float-divider { display: none; }
    .bulk-float-section-label { display: none; }
}

/* ============================================================
   Clean / Inf accs card
   ============================================================ */

.accs-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 4px;
}

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

.accs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.accs-dot--clean { background: #a3e635; }
.accs-dot--inf   { background: #ef4444; }

.accs-label {
    color: var(--muted-2);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 38px;
    flex-shrink: 0;
}

.accs-val {
    font-size: 1.45rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    min-width: 36px;
}

.accs-pct {
    font-size: 0.78rem;
    color: var(--muted-2);
    font-family: 'JetBrains Mono', monospace;
    margin-left: auto;
}

.color-red { color: #ef4444; }

/* ============================================================
   Stat card — footer pinned to bottom
   ============================================================ */

.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-footer--bottom {
    margin-top: auto;
    padding-top: 10px;
}

.color-blue { color: #6366f1; }

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay.visible .modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-box {
    background: #111113;
    border: 1px solid #222226;
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7);
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #1a1a1e;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.modal-title i {
    width: 18px;
    height: 18px;
    color: #a3e635;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: #666;
    cursor: pointer;
    transition: 0.15s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.05);
    border-color: #333;
    color: #fff;
}

.modal-close i { width: 15px; height: 15px; }

.modal-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 14px 22px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #1a1a1e;
}

/* page-header with button aligned right */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-header .save-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
}

.page-header .save-settings-btn i {
    width: 16px;
    height: 16px;
}

/* ============================================================
   Settings card — footer with save button pinned to bottom
   ============================================================ */

.settings-card {
    display: flex;
    flex-direction: column;
}

.settings-card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 14px;
}

.settings-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #000;
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.settings-save-btn:disabled {
    background: #222225;
    color: #444;
    cursor: not-allowed;
    opacity: 1;
}

.settings-save-btn:not(:disabled):hover {
    background: #e8e8e8;
}

/* ============================================================
   Reset dashboard button — subtle
   ============================================================ */

.reset-dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: #444;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: 0.2s ease;
}

.reset-dash-btn i {
    width: 13px;
    height: 13px;
}

.reset-dash-btn:hover {
    background: rgba(239, 68, 68, 0.07);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ============================================================
   Admin — upload drop zone & update history
   ============================================================ */

.upload-drop-zone {
    border: 1.5px dashed #2a2a2e;
    border-radius: 12px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s ease;
    text-align: center;
}

.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.04);
}

.upload-drop-label {
    color: #777;
    font-size: 0.88rem;
    margin: 0;
}

.upload-browse {
    color: #6366f1;
    text-decoration: underline;
    cursor: pointer;
}

.upload-file-name {
    color: #555;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
}

.update-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.update-row-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: #ccc;
}

/* accs download button */
.accs-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: #444;
    cursor: pointer;
    transition: 0.15s ease;
    margin-left: 6px;
    flex-shrink: 0;
}

.accs-download-btn i {
    width: 12px;
    height: 12px;
}

.accs-download-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: #333;
    color: #aaa;
}
