/* =========================================================
   IPTV DASH — dark gold theme
   ========================================================= */

:root {
    --bg-0: #04060d;
    --bg-1: #070b15;
    --bg-2: #0b1120;
    --gold-100: #fbeec2;
    --gold-200: #f3d27a;
    --gold-300: #e0b84f;
    --gold-400: #c99a2e;
    --gold-500: #a87a17;
    --text-0: #f5f0e3;
    --text-1: #c8c2b2;
    --text-2: #8c8779;
    --line: rgba(226, 196, 120, 0.13);
    --line-strong: rgba(226, 196, 120, 0.28);
    --glass: rgba(11, 16, 29, 0.74);
    --glass-2: rgba(14, 20, 36, 0.9);
    --ok: #48d597;
    --bad: #f87171;
    --warn: #fbbf24;
    --info: #6aa6ff;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text-0);
    background:
        radial-gradient(1100px 680px at 50% -12%, rgba(70, 96, 175, 0.12), transparent 62%),
        linear-gradient(180deg, #05070f 0%, #070a14 46%, #05070e 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.08);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 6px;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    vertical-align: middle;
}

.muted {
    color: var(--text-2);
}

.small {
    font-size: 12.5px;
}

::selection {
    background: rgba(226, 196, 120, 0.28);
    color: #fff;
}

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(226, 196, 120, 0.24) transparent;
}

*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(226, 196, 120, 0.2);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(226, 196, 120, 0.34);
    background-clip: padding-box;
}

/* =========================================================
   Background: stars + glow
   ========================================================= */

.stars-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.auth-glow,
.app-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 560px at 10% -6%, rgba(226, 196, 120, 0.09), transparent 62%),
        radial-gradient(760px 540px at 102% 2%, rgba(58, 88, 180, 0.1), transparent 58%),
        radial-gradient(1200px 760px at 50% 118%, rgba(226, 196, 120, 0.05), transparent 62%);
}

/* =========================================================
   Brand
   ========================================================= */

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    color: var(--gold-200);
    background: linear-gradient(150deg, rgba(243, 210, 122, 0.17), rgba(226, 196, 120, 0.03));
    border: 1px solid rgba(226, 196, 120, 0.32);
    box-shadow:
        0 0 44px rgba(226, 196, 120, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    animation: logoPulse 5.5s ease-in-out infinite;
}

.brand-mark .icon {
    width: 28px;
    height: 28px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-text h1,
.brand-text strong {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.1;
    color: var(--text-0);
}

.brand-text h1 span,
.brand-text em {
    font-style: normal;
    background: linear-gradient(120deg, var(--gold-100), var(--gold-300) 55%, var(--gold-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-text p,
.brand-text > span {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-2);
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.18s var(--ease), box-shadow 0.24s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
    user-select: none;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 2px solid var(--gold-200);
    outline-offset: 3px;
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-gold {
    background: linear-gradient(135deg, #f9e7a9 0%, #e9c65f 46%, #cfa033 100%);
    color: #221a06;
    border-color: rgba(255, 246, 214, 0.5);
    box-shadow:
        0 12px 30px rgba(201, 154, 46, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    overflow: hidden;
}

.btn-gold::after {
    content: "";
    position: absolute;
    top: -70%;
    left: -40%;
    width: 34%;
    height: 240%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: rotate(16deg) translateX(-160%);
    transition: transform 0.65s ease;
    pointer-events: none;
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 38px rgba(201, 154, 46, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-gold:hover::after {
    transform: rotate(16deg) translateX(520%);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--line);
    color: var(--text-0);
}

.btn-ghost:hover {
    border-color: var(--line-strong);
    background: rgba(226, 196, 120, 0.06);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.32);
    color: #ffc4c4;
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
    height: 36px;
    padding: 0 13px;
    font-size: 13px;
    border-radius: 10px;
}

/* Busy state */
.btn .btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(34, 26, 6, 0.28);
    border-top-color: #221a06;
    animation: spin 0.7s linear infinite;
}

.btn.is-busy .btn-spinner {
    display: inline-block;
}

.btn.is-busy .btn-label {
    opacity: 0.72;
}

.btn.is-busy {
    pointer-events: none;
}

/* =========================================================
   Form fields
   ========================================================= */

.field {
    display: block;
    margin-bottom: 16px;
}

.field-label {
    display: block;
    margin-bottom: 7px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-2);
}

.field-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.085);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field-box > .icon {
    color: var(--text-2);
    transition: color 0.2s;
}

.field-box:focus-within {
    border-color: rgba(226, 196, 120, 0.55);
    background: rgba(226, 196, 120, 0.04);
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.11), 0 0 26px rgba(226, 196, 120, 0.06);
}

.field-box:focus-within > .icon {
    color: var(--gold-200);
}

.field-box input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-0);
    font-family: inherit;
    font-size: 14.5px;
}

.field-box input::placeholder {
    color: rgba(140, 135, 121, 0.72);
}

.field-box input:-webkit-autofill,
.field-box input:-webkit-autofill:hover,
.field-box input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-0);
    -webkit-box-shadow: 0 0 0 1000px #0a0f1c inset;
    caret-color: var(--text-0);
    transition: background-color 5000s ease-in-out 0s;
}

.field-reveal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: -4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.field-reveal:hover {
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.08);
}

.field-reveal .reveal-hide {
    display: none;
}

.field-reveal.is-on .reveal-show {
    display: none;
}

.field-reveal.is-on .reveal-hide {
    display: inline-flex;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-2);
}

.field-error {
    color: #ffb4b4;
}

/* Inputs used directly inside modals (number) */
.input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    background: rgba(255, 255, 255, 0.032);
    color: var(--text-0);
    font-family: inherit;
    font-size: 14.5px;
    outline: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
    border-color: rgba(226, 196, 120, 0.55);
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.11);
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

textarea.input {
    height: auto;
    min-height: 74px;
    padding: 11px 13px;
    resize: vertical;
    line-height: 1.5;
}

/* =========================================================
   Auth pages
   ========================================================= */

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: hidden;
}

.auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 424px;
}

.auth-card {
    position: relative;
    padding: 34px 32px 30px;
    border-radius: 26px;
    background: linear-gradient(168deg, rgba(17, 23, 40, 0.86), rgba(8, 12, 23, 0.9));
    border: 1px solid rgba(226, 196, 120, 0.17);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 0 80px rgba(226, 196, 120, 0.045);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    animation: cardIn 0.6s var(--ease) both;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(243, 210, 122, 0.72), transparent);
}

.auth-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(420px 220px at 50% -30%, rgba(226, 196, 120, 0.1), transparent 70%);
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-heading h2 {
    font-size: 21px;
    font-weight: 720;
    letter-spacing: -0.01em;
}

.auth-heading p {
    margin-top: 5px;
    font-size: 13.5px;
    color: var(--text-2);
}

.auth-form .field {
    animation: fadeUp 0.5s var(--ease) both;
}

.auth-form .field:nth-of-type(1) { animation-delay: 0.08s; }
.auth-form .field:nth-of-type(2) { animation-delay: 0.14s; }
.auth-form .field:nth-of-type(3) { animation-delay: 0.2s; }

.auth-form .btn {
    margin-top: 6px;
    animation: fadeUp 0.5s var(--ease) both;
    animation-delay: 0.24s;
}

.captcha-field {
    margin-top: 2px;
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
    min-width: 0;
}

.captcha-box img {
    flex: 1 1 auto;
    display: block;
    width: 100%;
    max-width: 320px;
    min-width: 0;
    height: auto;
    border-radius: 11px;
    border: 1px solid rgba(226, 196, 120, 0.24);
    background: #0a0f1d;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 20px rgba(0, 0, 0, 0.25);
}

.captcha-refresh {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(226, 196, 120, 0.22);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--gold-100);
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.captcha-refresh:hover {
    background: rgba(226, 196, 120, 0.1);
    border-color: rgba(226, 196, 120, 0.4);
    transform: translateY(-1px);
}

.captcha-refresh:active {
    transform: translateY(0);
}

.captcha-refresh:focus-visible {
    outline: 2px solid rgba(226, 196, 120, 0.55);
    outline-offset: 2px;
}

.captcha-refresh .icon {
    width: 16px;
    height: 16px;
}

.captcha-refresh-text {
    display: none;
}

.captcha-field .field-hint {
    margin-top: 7px;
}

@media (max-width: 480px) {
    .captcha-box {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-refresh {
        width: 100%;
        gap: 8px;
        height: 38px;
    }

    .captcha-refresh-text {
        display: inline;
        font-size: 12px;
        font-weight: 600;
    }
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 20px;
    padding: 13px 14px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid rgba(248, 113, 113, 0.32);
    background: rgba(248, 113, 113, 0.08);
    color: #ffc9c9;
    animation: alertIn 0.3s var(--ease);
}

.auth-alert[hidden] {
    display: none;
}

.auth-alert > .icon {
    color: #ff9b9b;
    margin-top: 1px;
}

.auth-alert-icon {
    display: inline-flex;
    margin-top: 1px;
}

.auth-alert-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-alert-text strong {
    font-size: 13px;
    font-weight: 680;
    color: #ffd9d9;
}

.auth-alert.is-success {
    border-color: rgba(72, 213, 151, 0.32);
    background: rgba(72, 213, 151, 0.08);
    color: #c8f4e0;
}

.auth-alert.is-success .icon {
    color: #71e6b2;
}

.auth-alert.is-success strong {
    color: #e2fff1;
}

.auth-alert.is-error {
    /* default styling above */
}

.auth-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: rgba(226, 196, 120, 0.05);
    color: var(--text-1);
    font-size: 12.5px;
    line-height: 1.45;
}

.auth-note .icon {
    color: var(--gold-200);
    margin-top: 1px;
}

.auth-lead {
    margin-bottom: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-1);
}

.auth-lead strong {
    color: var(--gold-200);
}

.auth-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--text-2);
}

.auth-foot-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--text-2);
}

.auth-foot-row .icon {
    width: 15px;
    height: 15px;
    color: rgba(226, 196, 120, 0.6);
}

.auth-copy {
    margin-top: 22px;
    text-align: center;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(140, 135, 121, 0.62);
}

/* Shake on failed login */
.shake {
    animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* =========================================================
   App shell
   ========================================================= */

.app-page {
    position: relative;
    min-height: 100vh;
}

.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    z-index: 45;
    flex: 0 0 264px;
    width: 264px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 16px 20px;
    background: linear-gradient(180deg, rgba(9, 13, 24, 0.9), rgba(6, 9, 17, 0.94));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 26px;
}

.sidebar-brand .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
}

.sidebar-brand .brand-mark .icon {
    width: 24px;
    height: 24px;
}

.sidebar-brand .brand-text strong {
    font-size: 16px;
}

.sidebar-brand .brand-text > span {
    font-size: 9.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 auto;
    overflow-y: auto;
}

.nav-label {
    padding: 0 12px 8px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(140, 135, 121, 0.64);
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 560;
    color: var(--text-1);
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.nav-item .icon {
    width: 18px;
    height: 18px;
    color: rgba(140, 135, 121, 0.9);
    transition: color 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-0);
}

.nav-item:hover .icon {
    color: var(--gold-200);
}

.nav-item.is-active {
    background: linear-gradient(90deg, rgba(226, 196, 120, 0.13), rgba(226, 196, 120, 0.03));
    border-color: rgba(226, 196, 120, 0.18);
    color: var(--gold-100);
}

.nav-item.is-active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--gold-200), var(--gold-400));
    box-shadow: 0 0 14px rgba(226, 196, 120, 0.5);
}

.nav-item.is-active .icon {
    color: var(--gold-200);
}

.nav-item.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-item.is-disabled:hover {
    background: transparent;
    color: var(--text-1);
}

.nav-count {
    margin-left: auto;
    min-width: 24px;
    height: 21px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 700;
    color: var(--gold-100);
    background: rgba(226, 196, 120, 0.13);
    border: 1px solid rgba(226, 196, 120, 0.2);
}

.nav-soon {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.1);
    border: 1px solid rgba(226, 196, 120, 0.18);
}

.sidebar-foot {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.role-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

.role-card .icon {
    color: var(--gold-200);
    width: 20px;
    height: 20px;
}

.role-card div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.role-card span {
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
}

.role-card strong {
    font-size: 13px;
    font-weight: 650;
    color: var(--gold-100);
}

.sidebar-note {
    margin: 12px 4px 0;
    font-size: 10.5px;
    line-height: 1.5;
    color: rgba(140, 135, 121, 0.62);
}

/* Body column */
.app-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 76px;
    padding: 12px 30px;
    background: rgba(6, 9, 17, 0.72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mobile-menu {
    display: none !important;
}

.topbar-title {
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-title h2 {
    font-size: 18px;
    font-weight: 720;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-title p {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.credits-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 13px;
    border-radius: 11px;
    background: rgba(226, 196, 120, 0.07);
    border: 1px solid rgba(226, 196, 120, 0.2);
    color: var(--gold-200);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.credits-chip .icon {
    width: 17px;
    height: 17px;
}

.credits-value {
    font-size: 14px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    color: var(--gold-100);
}

.credits-chip em {
    font-style: normal;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(226, 196, 120, 0.62);
}

/* User menu */
.user-menu {
    position: relative;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.user-chip:hover,
.user-chip[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 750;
    letter-spacing: 0.04em;
    color: #251c07;
    background: linear-gradient(140deg, #fbeec2, #e0b84f 60%, #b3861f);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 14px rgba(201, 154, 46, 0.25);
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    line-height: 1.2;
}

.user-meta strong {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 650;
}

.user-meta small {
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-2);
}

.user-chip .chev {
    width: 15px;
    height: 15px;
    color: var(--text-2);
    transition: transform 0.2s;
}

.user-chip[aria-expanded="true"] .chev {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    min-width: 208px;
    padding: 6px;
    border-radius: 14px;
    background: var(--glass-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: dropIn 0.18s var(--ease);
    z-index: 50;
}

.user-dropdown[hidden] {
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 0 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 13px;
    text-align: left;
    color: var(--text-1);
    cursor: pointer;
    transition: background 0.16s, color 0.16s;
}

.dropdown-item .icon {
    width: 16px;
    height: 16px;
    color: var(--text-2);
}

.dropdown-item:hover {
    background: rgba(226, 196, 120, 0.08);
    color: var(--text-0);
}

.dropdown-item:hover .icon {
    color: var(--gold-200);
}

.dropdown-item.is-danger:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #ffc4c4;
}

.dropdown-item.is-danger:hover .icon {
    color: #ff9b9b;
}

.user-dropdown form {
    margin: 0;
}

/* Content */
.app-content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 30px 64px;
}

.view[hidden] {
    display: none !important;
}

.view {
    animation: fadeUp 0.32s var(--ease) both;
}

/* =========================================================
   Stats
   ========================================================= */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(208px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 19px 20px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(17, 23, 40, 0.75), rgba(9, 13, 24, 0.82));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 40px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -50px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(226, 196, 120, 0.09), transparent 70%);
    pointer-events: none;
}

.stat-ico {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-ico .icon {
    width: 21px;
    height: 21px;
}

.stat-ico.is-gold {
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.1);
    border-color: rgba(226, 196, 120, 0.2);
}

.stat-ico.is-ok {
    color: #71e6b2;
    background: rgba(72, 213, 151, 0.09);
    border-color: rgba(72, 213, 151, 0.18);
}

.stat-ico.is-off {
    color: #ff9b9b;
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.16);
}

.stat-body {
    min-width: 0;
}

.stat-label {
    margin-bottom: 3px;
    font-size: 10.5px;
    font-weight: 620;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-2);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 780;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text-0);
    font-variant-numeric: tabular-nums;
}

.stat-value--text {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: 0;
    padding-top: 5px;
}

/* =========================================================
   Cards
   ========================================================= */

.card {
    position: relative;
    border-radius: var(--radius);
    background: linear-gradient(165deg, rgba(15, 21, 37, 0.78), rgba(8, 12, 22, 0.86));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 22px 60px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.card-head h3 {
    font-size: 15.5px;
    font-weight: 680;
    letter-spacing: -0.005em;
}

.card-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-2);
}

/* =========================================================
   Activity list
   ========================================================= */

.activity-list {
    display: flex;
    flex-direction: column;
    padding: 6px 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px;
    border-radius: 12px;
    border-bottom: 1px solid rgba(226, 196, 120, 0.06);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-ico {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(226, 196, 120, 0.08);
    border: 1px solid rgba(226, 196, 120, 0.14);
    color: var(--gold-200);
}

.activity-ico.is-refund {
    background: rgba(248, 113, 113, 0.07);
    border-color: rgba(248, 113, 113, 0.14);
    color: #ff9b9b;
}

.activity-main {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 13px;
    color: var(--text-1);
    line-height: 1.45;
}

.activity-main strong {
    color: var(--text-0);
    font-weight: 620;
}

.activity-main .muted {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
}

.activity-amount {
    flex: 0 0 auto;
    font-size: 13.5px;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
    color: #71e6b2;
}

.activity-amount.is-refund {
    color: #ff9b9b;
}

.activity-empty {
    padding: 34px 18px;
    text-align: center;
    font-size: 13px;
    color: var(--text-2);
}

/* =========================================================
   Table tools
   ========================================================= */

.table-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    flex: 1 1 320px;
    max-width: 380px;
    padding: 0 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    border-color: rgba(226, 196, 120, 0.45);
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.09);
}

.search-box .icon {
    color: var(--text-2);
    width: 16px;
    height: 16px;
}

.search-box input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-0);
    font-family: inherit;
    font-size: 13px;
}

.search-box input::placeholder {
    color: rgba(140, 135, 121, 0.75);
}

.select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    height: 40px;
    padding: 0 34px 0 13px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-1);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    outline: 0;
    transition: border-color 0.2s;
}

.select-wrap select:hover {
    border-color: var(--line-strong);
}

.select-wrap select:focus {
    border-color: rgba(226, 196, 120, 0.45);
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.09);
}

.select-wrap select option {
    background: #0c1220;
    color: var(--text-0);
}

.select-wrap > .icon {
    position: absolute;
    right: 11px;
    width: 14px;
    height: 14px;
    color: var(--text-2);
    pointer-events: none;
}

/* =========================================================
   Table
   ========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    padding: 12px 20px;
    text-align: left;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-2);
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.014);
}

.data-table tbody td {
    padding: 13px 20px;
    border-bottom: 1px solid rgba(226, 196, 120, 0.065);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.16s;
}

.data-table tbody tr:hover {
    background: rgba(226, 196, 120, 0.035);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.th-actions {
    text-align: right !important;
}

.cell-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
}

.cell-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 12px;
}

.cell-usertext {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cell-usertext strong {
    font-size: 13.5px;
    font-weight: 640;
    color: var(--text-0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-usertext span {
    font-size: 11px;
    color: var(--text-2);
    white-space: nowrap;
}

.cell-date {
    color: var(--text-1);
    font-size: 12.5px;
    white-space: nowrap;
}

.cell-actions {
    text-align: right;
    white-space: nowrap;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 25px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.badge-active {
    color: #6fe3ae;
    background: rgba(72, 213, 151, 0.08);
    border-color: rgba(72, 213, 151, 0.2);
}

.badge-disabled {
    color: #ff9b9b;
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.18);
}

.credits-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gold-100);
    background: rgba(226, 196, 120, 0.09);
    border: 1px solid rgba(226, 196, 120, 0.17);
}

.credits-pill .icon {
    width: 14px;
    height: 14px;
    color: rgba(226, 196, 120, 0.7);
}

/* Icon buttons */
.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    background: rgba(255, 255, 255, 0.028);
    color: var(--text-1);
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.16s;
}

.icon-btn .icon {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    color: var(--gold-200);
    border-color: rgba(226, 196, 120, 0.35);
    background: rgba(226, 196, 120, 0.09);
    transform: translateY(-1px);
}

.icon-btn:focus-visible {
    outline: 2px solid var(--gold-200);
    outline-offset: 2px;
}

.icon-btn.is-ok:hover {
    color: #71e6b2;
    border-color: rgba(72, 213, 151, 0.4);
    background: rgba(72, 213, 151, 0.09);
}

.icon-btn.is-danger:hover {
    color: #ff9b9b;
    border-color: rgba(248, 113, 113, 0.38);
    background: rgba(248, 113, 113, 0.09);
}

/* Tooltip portal: positioned by ui.js so table overflow never clips it. */
.tip-portal {
    position: fixed;
    z-index: 500;
    max-width: 220px;
    padding: 6px 9px;
    border-radius: 7px;
    background: #0d1424;
    border: 1px solid var(--line-strong);
    color: var(--text-0);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.tip-portal.is-in {
    opacity: 1;
    transform: translateY(0);
}

.tip-portal.is-below {
    transform: translateY(-3px);
}

.tip-portal.is-below.is-in {
    transform: translateY(0);
}

.tip-portal::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #0d1424;
}

.tip-portal.is-below::after {
    bottom: auto;
    top: -5px;
    border-top-color: transparent;
    border-bottom-color: #0d1424;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 46px 24px 40px;
    text-align: center;
}

.empty-state[hidden] {
    display: none !important;
}

.empty-ico {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    color: var(--gold-200);
    background: radial-gradient(circle at 50% 30%, rgba(226, 196, 120, 0.13), rgba(226, 196, 120, 0.03));
    border: 1px dashed rgba(226, 196, 120, 0.34);
    margin-bottom: 18px;
}

.empty-ico .icon {
    width: 28px;
    height: 28px;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 680;
    margin-bottom: 7px;
}

.empty-state p {
    max-width: 380px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-2);
}

.table-foot {
    padding: 12px 20px 15px;
    border-top: 1px solid var(--line);
}

/* Skeleton */
.skeleton-line,
.skeleton-row span {
    position: relative;
    display: block;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

.skeleton-line {
    height: 42px;
    margin: 10px 12px;
}

.skeleton-line::after,
.skeleton-row span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(226, 196, 120, 0.09), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

.skeleton-row td {
    padding: 8px 20px !important;
}

.skeleton-row span {
    height: 40px;
}

/* Placeholder card (sub panel) */
.placeholder-card {
    margin-top: 20px;
}

.placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 54px 26px;
    text-align: center;
}

.placeholder-ico {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    margin-bottom: 20px;
    color: var(--gold-200);
    background:
        radial-gradient(circle at 50% 25%, rgba(226, 196, 120, 0.16), rgba(226, 196, 120, 0.03));
    border: 1px solid rgba(226, 196, 120, 0.22);
    box-shadow: 0 0 60px rgba(226, 196, 120, 0.1);
}

.placeholder-ico .icon {
    width: 32px;
    height: 32px;
}

.placeholder-inner h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 9px;
}

.placeholder-inner p {
    max-width: 470px;
    margin-bottom: 22px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-2);
}

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

body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 5, 11, 0.66);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
}

.modal-overlay.is-in {
    opacity: 1;
}

.modal-panel {
    width: 100%;
    max-width: 448px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: linear-gradient(168deg, #121a2c, #090d18 70%);
    border: 1px solid rgba(226, 196, 120, 0.24);
    box-shadow:
        0 34px 100px rgba(0, 0, 0, 0.68),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
}

.modal-overlay.is-in .modal-panel {
    transform: none;
    opacity: 1;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 22px 15px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 {
    flex: 1 1 auto;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.modal-head .modal-sub {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-2);
}

.modal-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -3px -5px 0 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.16s, color 0.16s;
}

.modal-x:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-0);
}

.modal-body {
    padding: 20px 22px 6px;
    overflow-y: auto;
}

.modal-body > p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-1);
}

.modal-sub-text {
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-2);
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 17px 22px 20px;
    border-top: 1px solid var(--line);
}

.modal-foot .btn {
    height: 42px;
}

.modal-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #ffc9c9;
    background: rgba(248, 113, 113, 0.09);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.modal-error[hidden] {
    display: none;
}

.modal-error .icon {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: #ff9b9b;
}

.modal-form .field:last-of-type {
    margin-bottom: 10px;
}

.modal-note {
    margin: 4px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(226, 196, 120, 0.055);
    border: 1px solid var(--line);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-1);
}

.modal-note strong {
    color: var(--gold-200);
}

/* Ledger rows in modal */
.ledger-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
}

.ledger-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px solid rgba(226, 196, 120, 0.07);
    font-size: 12.5px;
}

.ledger-row:last-child {
    border-bottom: 0;
}

.ledger-sign {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(72, 213, 151, 0.08);
    color: #71e6b2;
    border: 1px solid rgba(72, 213, 151, 0.16);
}

.ledger-sign.is-refund {
    background: rgba(248, 113, 113, 0.08);
    color: #ff9b9b;
    border-color: rgba(248, 113, 113, 0.16);
}

.ledger-sign .icon {
    width: 14px;
    height: 14px;
}

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

.ledger-main strong {
    font-size: 12.5px;
    font-weight: 620;
    color: var(--text-0);
}

.ledger-main span {
    font-size: 11px;
    color: var(--text-2);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.ledger-amount {
    font-weight: 720;
    font-variant-numeric: tabular-nums;
    color: #71e6b2;
}

.ledger-amount.is-negative {
    color: #ff9b9b;
}

.ledger-empty {
    padding: 28px 0 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-2);
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(362px, calc(100vw - 32px));
    pointer-events: none;
}

/* Keep notifications clear of modal footers while a dialog is open. */
body.modal-open .toast-stack {
    top: 18px;
    bottom: auto;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border-radius: 13px;
    background: rgba(13, 19, 34, 0.96);
    border: 1px solid var(--line-strong);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateX(24px) scale(0.98);
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
    pointer-events: auto;
    overflow: hidden;
}

.toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gold-300);
}

.toast.is-in {
    opacity: 1;
    transform: none;
}

.toast.is-out {
    opacity: 0;
    transform: translateX(30px) scale(0.97);
}

.toast-success::before { background: var(--ok); }
.toast-error::before { background: var(--bad); }
.toast-info::before { background: var(--info); }

.toast-ico {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.09);
    border: 1px solid rgba(226, 196, 120, 0.16);
}

.toast-success .toast-ico {
    color: #71e6b2;
    background: rgba(72, 213, 151, 0.09);
    border-color: rgba(72, 213, 151, 0.18);
}

.toast-error .toast-ico {
    color: #ff9b9b;
    background: rgba(248, 113, 113, 0.09);
    border-color: rgba(248, 113, 113, 0.18);
}

.toast-info .toast-ico {
    color: #9cc0ff;
    background: rgba(106, 166, 255, 0.09);
    border-color: rgba(106, 166, 255, 0.18);
}

.toast-ico .icon {
    width: 16px;
    height: 16px;
}

.toast-body {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 1px;
}

.toast-title {
    display: block;
    font-size: 12px;
    font-weight: 680;
    letter-spacing: 0.02em;
    margin-bottom: 1px;
}

.toast-msg {
    display: block;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-1);
    overflow-wrap: anywhere;
}

.toast-x {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: -4px -6px 0 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.toast-x:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-0);
}

.toast-x .icon {
    width: 13px;
    height: 13px;
}

/* =========================================================
   Sidebar backdrop (mobile)
   ========================================================= */

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    border: 0;
    padding: 0;
    background: rgba(2, 4, 9, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.22s;
    cursor: pointer;
}

.sidebar-backdrop.is-in {
    opacity: 1;
}

.sidebar-backdrop[hidden] {
    display: none;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.985);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

@keyframes logoPulse {
    0%, 100% {
        box-shadow:
            0 0 38px rgba(226, 196, 120, 0.13),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }
    50% {
        box-shadow:
            0 0 58px rgba(226, 196, 120, 0.26),
            inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1080px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 120;
        transform: translateX(-102%);
        transition: transform 0.3s var(--ease);
        box-shadow: 40px 0 100px rgba(0, 0, 0, 0.5);
        height: 100vh;
    }

    .sidebar.is-open {
        transform: none;
    }

    .mobile-menu {
        display: inline-flex !important;
    }

    .topbar {
        padding: 10px 20px;
    }

    .app-content {
        padding: 22px 20px 56px;
    }
}

@media (max-width: 760px) {
    .topbar-title p {
        display: none;
    }

    .user-meta {
        display: none;
    }

    .user-chip {
        padding: 4px;
    }

    .user-chip .chev {
        display: none;
    }

    .credits-chip em {
        display: none;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
        gap: 12px;
    }

    .stat-value {
        font-size: 23px;
    }

    .stat-ico {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .card-head {
        flex-wrap: wrap;
        padding: 17px 16px;
    }

    .table-tools {
        flex-wrap: wrap;
        padding: 13px 14px;
    }

    .search-box {
        flex: 1 1 100%;
        max-width: none;
    }

    .table-foot {
        padding: 11px 16px 14px;
    }

    .modal-panel {
        max-width: none;
    }

    .toast-stack {
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 22px 24px;
        border-radius: 22px;
    }

    .brand-mark {
        width: 50px;
        height: 50px;
    }

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

    .app-content {
        padding: 18px 14px 50px;
    }

    .topbar {
        gap: 10px;
        padding: 10px 14px;
        min-height: 66px;
    }

    .topbar-title h2 {
        font-size: 15.5px;
    }

    .credits-chip {
        padding: 0 10px;
    }

    .card {
        border-radius: 16px;
    }

    .row-actions {
        gap: 4px;
    }

    .icon-btn {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 760px) {
    .table-wrap {
        overflow-x: visible;
    }

    .data-table {
        min-width: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 12px;
        padding: 15px 16px;
        border-bottom: 1px solid rgba(226, 196, 120, 0.08);
    }

    .data-table tbody td {
        padding: 0;
        border: 0;
    }

    .data-table tbody tr:hover {
        background: transparent;
    }

    .data-table tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .data-table tbody td:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .data-table tbody td:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
    }

    .data-table tbody td:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        text-align: right;
    }

    .data-table tbody td:nth-child(5) {
        grid-column: 1 / -1;
        grid-row: 3;
        margin-top: 8px;
    }

    .cell-user {
        min-width: 0;
    }

    .row-actions {
        justify-content: flex-start;
        gap: 8px;
    }

    .data-table tbody tr.skeleton-row {
        display: block;
        padding: 8px 16px;
    }
}

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

    .stars-canvas {
        opacity: 0.85;
    }
}

/* =========================================================
   Credit balances, activity page, generated passwords
   ========================================================= */

.credits-stack {
    display: flex;
    align-items: center;
    gap: 7px;
}

.credits-chip.is-trial {
    color: #9cc0ff;
    background: rgba(106, 166, 255, 0.07);
    border-color: rgba(106, 166, 255, 0.22);
}

.credits-chip.is-trial .credits-value {
    color: #d5e5ff;
}

.credits-chip.is-trial em {
    color: rgba(156, 192, 255, 0.62);
}

.stat-ico.is-trial {
    color: #9cc0ff;
    background: rgba(106, 166, 255, 0.08);
    border-color: rgba(106, 166, 255, 0.18);
}

.credits-pair {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.credits-pill em {
    font-style: normal;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    opacity: 0.62;
}

.credits-pill.is-trial {
    color: #d5e5ff;
    background: rgba(106, 166, 255, 0.08);
    border-color: rgba(106, 166, 255, 0.2);
}

.credits-pill.is-trial .icon {
    color: rgba(156, 192, 255, 0.72);
}

/* Balance cards */
.balance-section {
    margin-bottom: 20px;
}

.balance-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.balance-head h3 {
    font-size: 15.5px;
    font-weight: 680;
    letter-spacing: -0.005em;
}

.balance-head p {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-2);
}

.balance-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

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

.stat-grid--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-grid--five .stat-card {
    padding: 18px 16px;
    gap: 12px;
}

.stat-grid--five .stat-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.stat-grid--five .stat-label {
    font-size: 9.5px;
    letter-spacing: 0.1em;
}

.stat-grid--five .stat-value {
    font-size: 26px;
}

@media (max-width: 1000px) {
    .stat-grid--five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .stat-grid--five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.balance-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(150deg, rgba(226, 196, 120, 0.1), rgba(10, 15, 27, 0.86) 62%);
    border: 1px solid rgba(226, 196, 120, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 46px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.balance-card::after {
    content: "";
    position: absolute;
    right: -46px;
    top: -60px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(226, 196, 120, 0.13), transparent 70%);
    pointer-events: none;
}

.balance-card.is-trial {
    background: linear-gradient(150deg, rgba(106, 166, 255, 0.1), rgba(10, 15, 27, 0.86) 62%);
    border-color: rgba(106, 166, 255, 0.24);
}

.balance-card.is-trial::after {
    background: radial-gradient(circle, rgba(106, 166, 255, 0.15), transparent 70%);
}

.balance-ico {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.1);
    border: 1px solid rgba(226, 196, 120, 0.2);
}

.balance-card.is-trial .balance-ico {
    color: #9cc0ff;
    background: rgba(106, 166, 255, 0.1);
    border-color: rgba(106, 166, 255, 0.2);
}

.balance-ico .icon {
    width: 24px;
    height: 24px;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.balance-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-2);
}

.balance-value {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-0);
}

.balance-card.is-trial .balance-value {
    color: #e6f0ff;
}

.balance-note {
    font-size: 11.5px;
    color: var(--text-2);
}

/* Select inside modal fields */
.field-box--select {
    padding-right: 11px;
}

.field-box--select select {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-0);
    font-family: inherit;
    font-size: 14.5px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.field-box--select select option {
    background: #0c1220;
    color: var(--text-0);
}

.field-box--select > .icon {
    width: 15px;
    height: 15px;
    color: var(--text-2);
    pointer-events: none;
}

/* Generated password modal */
.generated-box .generated-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.035em;
    color: var(--gold-100);
}

.generated-box .field-reveal:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

.generated-actions {
    display: flex;
    justify-content: flex-start;
    margin: -2px 0 12px;
}

/* Activity page */
.activity-tools {
    flex-wrap: wrap;
}

.activity-table {
    min-width: 860px;
}

.tx-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tx-badge.is-added {
    color: #6fe3ae;
    background: rgba(72, 213, 151, 0.08);
    border-color: rgba(72, 213, 151, 0.2);
}

.tx-badge.is-refunded {
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.09);
    border-color: rgba(226, 196, 120, 0.2);
}

.tx-badge.is-deducted {
    color: #ff9b9b;
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.18);
}

.tx-badge.is-topup {
    color: #9cc0ff;
    background: rgba(106, 166, 255, 0.08);
    border-color: rgba(106, 166, 255, 0.18);
}

.tx-amount {
    font-size: 13px;
    font-weight: 740;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tx-amount.is-positive {
    color: #71e6b2;
}

.tx-amount.is-negative {
    color: #ff9b9b;
}

.credit-type-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid rgba(226, 196, 120, 0.18);
    background: rgba(226, 196, 120, 0.09);
    color: var(--gold-200);
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.credit-type-badge.is-trial {
    color: #9cc0ff;
    background: rgba(106, 166, 255, 0.08);
    border-color: rgba(106, 166, 255, 0.2);
}

.activity-account {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
}

.activity-account strong {
    font-size: 13px;
    font-weight: 640;
    color: var(--text-0);
}

.activity-account span {
    font-size: 10.5px;
    color: var(--text-2);
}

.cell-desc {
    max-width: 280px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-1);
    overflow-wrap: anywhere;
}

.activity-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.page-state {
    min-width: 68px;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-2);
}

.pagination .icon-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

.ledger-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ledger-main em.credit-type-badge {
    margin-left: 4px;
}

@media (max-width: 900px) {
    .balance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .credits-stack {
        gap: 5px;
    }

    .credits-chip {
        height: 36px;
        padding: 0 9px;
    }

    .balance-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .balance-card {
        padding: 18px;
    }

    .balance-value {
        font-size: 29px;
    }

    .activity-table {
        min-width: 0;
    }

    .activity-table thead {
        display: none;
    }

    .data-table.activity-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 12px;
        padding: 15px 16px;
        border-bottom: 1px solid rgba(226, 196, 120, 0.08);
    }

    .data-table.activity-table tbody td {
        padding: 0;
        border: 0;
    }

    .data-table.activity-table tbody tr:hover {
        background: transparent;
    }

    .data-table.activity-table tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .data-table.activity-table tbody td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        text-align: left;
    }

    .data-table.activity-table tbody td:nth-child(3) {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .data-table.activity-table tbody td:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
    }

    .data-table.activity-table tbody td:nth-child(5) {
        grid-column: 1;
        grid-row: 3;
        justify-self: start;
    }

    .data-table.activity-table tbody td:nth-child(6) {
        grid-column: 1 / -1;
        grid-row: 4;
        max-width: none;
    }

    .data-table.activity-table tbody tr.skeleton-row {
        display: block;
        padding: 8px 16px;
    }

    .activity-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .credits-chip {
        height: 33px;
        padding: 0 7px;
        gap: 5px;
    }

    .credits-chip .icon {
        width: 15px;
        height: 15px;
    }

    .credits-value {
        font-size: 12.5px;
    }

    .topbar-right {
        gap: 7px;
    }

    .balance-head h3 {
        font-size: 15px;
    }

    .balance-value {
        font-size: 27px;
    }
}

/* =========================================================
   UI polish: hover, focus, selection and native control colors
   ========================================================= */

:root {
    color-scheme: dark;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--gold-200);
    outline-offset: 2px;
}

.btn {
    transition: transform 0.18s var(--ease), box-shadow 0.22s var(--ease),
                background 0.2s, border-color 0.2s, color 0.2s, filter 0.2s;
}

.btn:hover {
    filter: brightness(1.035);
}

.btn:active {
    transform: translateY(1px) scale(0.995);
}

.btn-ghost:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.icon-btn {
    transition: background 0.18s, border-color 0.18s, color 0.18s,
                transform 0.18s var(--ease), box-shadow 0.18s;
}

.icon-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

.icon-btn:active {
    transform: translateY(1px) scale(0.96);
}

.icon-btn[disabled] {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.field-reveal {
    transition: color 0.18s, background 0.18s, transform 0.18s var(--ease);
}

.field-reveal:hover {
    transform: scale(1.06);
}

.field-reveal:active {
    transform: scale(0.94);
}

.modal-x {
    transition: background 0.18s, color 0.18s, transform 0.2s var(--ease);
}

.modal-x:hover {
    transform: rotate(90deg);
}

.modal-x:active {
    transform: rotate(90deg) scale(0.94);
}

.toast-x {
    transition: background 0.18s, color 0.18s, transform 0.18s;
}

.toast-x:hover {
    transform: scale(1.08);
}

.nav-item {
    transition: background 0.2s, color 0.2s, border-color 0.2s,
                transform 0.2s var(--ease), box-shadow 0.2s;
}

.dropdown-item {
    transition: background 0.16s, color 0.16s, transform 0.16s var(--ease);
}

.dropdown-item:hover {
    transform: translateX(2px);
}

.dropdown-item:active {
    transform: translateX(1px) scale(0.995);
}

.stat-card,
.balance-card {
    transition: transform 0.22s var(--ease), border-color 0.22s,
                box-shadow 0.22s, background 0.22s;
}

.stat-card .stat-ico,
.balance-card .balance-ico {
    transition: transform 0.22s var(--ease), box-shadow 0.22s, border-color 0.22s;
}

.data-table tbody tr {
    transition: background 0.18s, box-shadow 0.18s;
}

.data-table tbody tr:focus-within {
    background: rgba(226, 196, 120, 0.05);
    box-shadow: inset 2px 0 0 rgba(226, 196, 120, 0.55);
}

.search-box {
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.select-wrap select,
.field-box--select select {
    color-scheme: dark;
    transition: color 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.field-box--select select.is-placeholder {
    color: var(--text-2);
}

.field-box--select select option,
.select-wrap select option {
    color: var(--text-0);
    background-color: #0c1220;
}

.field-box--select select option:disabled {
    color: var(--text-2);
    background-color: #0a0f1b;
}

.field-box--select select option:checked,
.select-wrap select option:checked {
    color: var(--gold-100);
    background-color: #2a2412 !important;
}

.field-box--select select option:checked:disabled,
.select-wrap select option:checked:disabled {
    color: var(--text-2);
    background-color: #151a26 !important;
}

.field-box--select select option:hover,
.select-wrap select option:hover {
    background-color: #182033 !important;
}

.field-box--select select:disabled,
.select-wrap select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--gold-300);
    cursor: pointer;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid var(--gold-200);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .stat-card:hover,
    .balance-card:hover {
        transform: translateY(-2px);
        border-color: rgba(226, 196, 120, 0.34);
        box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .balance-card.is-trial:hover {
        border-color: rgba(106, 166, 255, 0.38);
    }

    .stat-card:hover .stat-ico,
    .balance-card:hover .balance-ico {
        transform: translateY(-1px) scale(1.04);
    }

    .nav-item:not(.is-disabled):not(.is-active):hover {
        transform: translateX(2px);
    }

    .nav-item.is-active:hover {
        border-color: rgba(226, 196, 120, 0.3);
        box-shadow: 0 0 0 1px rgba(226, 196, 120, 0.06), 0 8px 22px rgba(0, 0, 0, 0.18);
    }

    .data-table tbody tr:hover {
        background: rgba(226, 196, 120, 0.045);
        box-shadow: inset 2px 0 0 rgba(226, 196, 120, 0.32);
    }

    .field-box:not(:focus-within):hover {
        border-color: rgba(226, 196, 120, 0.2);
    }

    .user-chip:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    }
}

/* =========================================================
   Host Management
   ========================================================= */

.hosts-table {
    min-width: 900px;
    table-layout: fixed;
}

.hosts-table th:nth-child(1) { width: 27%; }
.hosts-table th:nth-child(2) { width: 12%; }
.hosts-table th:nth-child(3) { width: 11%; }
.hosts-table th:nth-child(4) { width: 15%; }
.hosts-table th:nth-child(5) { width: 15%; }
.hosts-table th:nth-child(6) { width: 20%; }

.hosts-table th,
.hosts-table td {
    padding-left: 14px;
    padding-right: 14px;
}

.stat-card--default {
    padding: 18px 12px;
    gap: 8px;
}

.stat-card--default .stat-ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.stat-card--default .stat-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: 0;
    word-break: normal;
    overflow-wrap: anywhere;
}

.host-primary {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.host-primary strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-0);
    word-break: break-all;
}

.host-structured {
    font-size: 10.5px;
    color: var(--text-2);
    word-break: break-all;
}

.host-default-value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: 0;
    word-break: break-all;
}

.host-default-host {
    font-size: inherit;
    line-height: 1.2;
    word-break: break-all;
}

.host-default-port {
    font-size: 11px;
    line-height: 1.25;
    color: var(--text-2);
}

.badge-default {
    color: var(--gold-100);
    background: rgba(226, 196, 120, 0.14);
    border-color: rgba(226, 196, 120, 0.28);
}

.icon-btn.is-gold {
    color: var(--gold-200);
    border-color: rgba(226, 196, 120, 0.32);
    background: rgba(226, 196, 120, 0.1);
}

.icon-btn.is-gold[disabled] {
    opacity: 0.55;
}

.hosts-table .host-created,
.hosts-table .host-updated {
    color: var(--text-1);
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .data-table.hosts-table {
        min-width: 0;
    }

    .data-table.hosts-table tbody td {
        padding: 0;
    }

    .hosts-view .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hosts-view .stat-grid .stat-card--default {
        grid-column: 1 / -1;
    }

    .stat-card--default .stat-value {
        font-size: 15px;
    }

    .data-table.hosts-table tbody td:nth-child(6) {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 6px;
        justify-self: start;
    }

    .hosts-table .host-created,
    .hosts-table .host-updated {
        font-size: 11.5px;
    }

    .data-table.hosts-table tbody td.host-created::before,
    .data-table.hosts-table tbody td.host-updated::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        font-size: 9px;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--text-2);
    }

    .data-table.hosts-table tbody td.host-created {
        text-align: right;
    }

    .host-primary strong {
        font-size: 12.5px;
    }

    .host-default-value {
        font-size: 15px;
    }
}

/* =========================================================
   IPTV Lines
   ========================================================= */

.lines-table {
    min-width: 900px;
    table-layout: fixed;
}

.lines-table th:nth-child(1) { width: 38px; }
.lines-table th:nth-child(2) { width: 15%; }
.lines-table th:nth-child(3) { width: 12%; }
.lines-table th:nth-child(4) { width: 12%; }
.lines-table th:nth-child(5) { width: 12%; }
.lines-table th:nth-child(6) { width: 10%; }
.lines-table th:nth-child(7) { width: 31%; }

.lines-table th,
.lines-table td {
    padding-left: 14px;
    padding-right: 14px;
}

.line-username {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: 0.04em;
    color: var(--text-0);
}

.line-sub {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
    color: var(--text-2);
    white-space: nowrap;
}

.line-plan strong {
    display: block;
    font-size: 12.5px;
    font-weight: 640;
    color: var(--text-0);
}

.line-plan span {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
    color: var(--text-2);
}

.line-plan .line-days {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-2);
    transition: color 0.2s;
}

.line-plan .line-days::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 7px currentColor;
    opacity: 0.85;
}

.line-plan .line-days.is-safe {
    color: var(--ok);
}

.line-plan .line-days.is-warning {
    color: var(--warn);
}

.line-plan .line-days.is-critical,
.line-plan .line-days.is-expired {
    color: var(--bad);
}

.lines-table .cell-date {
    font-size: 12px;
    white-space: nowrap;
}

.line-actions {
    gap: 4px;
}

.lines-table .cell-actions {
    padding-left: 8px;
    padding-right: 8px;
}

.lines-table .icon-btn {
    width: 30px;
    height: 30px;
}

.lines-table .line-details-btn {
    height: 30px;
    padding: 0 9px;
    font-size: 11.5px;
    gap: 5px;
}

.lines-table .line-details-btn .icon {
    width: 14px;
    height: 14px;
}

.badge-pending {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
}

.badge-expired {
    color: #c7b9a0;
    background: rgba(199, 185, 160, 0.07);
    border-color: rgba(199, 185, 160, 0.18);
}

.tx-badge.is-purchase {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.2);
}

/* Add Lines */
.line-add-layout {
    max-width: 1020px;
    margin: 0 auto;
}

.line-create-body {
    padding: 20px 22px 24px;
}

.line-type-field {
    margin-top: 18px;
}

.line-type-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.line-type-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.line-type-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.line-type-inner {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.line-type-card:hover .line-type-inner {
    border-color: rgba(226, 196, 120, 0.3);
    transform: translateY(-1px);
}

.line-type-card.is-selected .line-type-inner {
    border-color: rgba(226, 196, 120, 0.6);
    background: rgba(226, 196, 120, 0.1);
    box-shadow: 0 0 0 1px rgba(226, 196, 120, 0.14), 0 10px 26px rgba(0, 0, 0, 0.22);
}

.line-type-card input:focus-visible + .line-type-inner {
    outline: 2px solid var(--gold-200);
    outline-offset: 2px;
}

.line-type-name {
    font-size: 14px;
    font-weight: 650;
    color: var(--text-0);
}

.line-type-duration {
    font-size: 11px;
    color: var(--text-2);
}

.line-type-cost {
    margin-top: 5px;
    font-size: 14px;
    font-weight: 750;
    color: var(--gold-200);
}

.line-type-cost em {
    display: inline-block;
    margin-left: 3px;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-2);
}

.line-summary {
    margin: 8px 0 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-1);
}

.line-summary.is-warning {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(248, 113, 113, 0.05);
}

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

.line-summary-grid span {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--text-2);
}

.line-summary-grid strong {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-0);
}

.line-summary-grid strong.is-low {
    color: #ff9b9b;
}

.line-summary-warning {
    margin: 10px 0 0;
    font-size: 12px;
    color: #ffb4b4;
}

.line-summary-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--text-2);
}

.line-summary-note strong {
    color: var(--text-1);
    font-weight: 600;
}

.line-error {
    margin-top: 0;
    margin-bottom: 12px;
}

.line-create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.line-fine-print {
    margin-top: 16px;
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-2);
}

.credentials-panel {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(226, 196, 120, 0.25);
    background: linear-gradient(150deg, rgba(226, 196, 120, 0.08), rgba(11, 16, 29, 0.72));
    animation: fadeUp 0.3s var(--ease);
}

.credentials-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.credentials-head h4 {
    font-size: 14px;
    font-weight: 680;
}

.credentials-head p {
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--text-2);
}

.credential-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.credential-label {
    width: 72px;
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-2);
}

.credential-row code {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--gold-100);
    word-break: break-all;
}

.credentials-note {
    margin-top: 10px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-2);
}

.credentials-note strong {
    color: var(--gold-200);
}

/* Sub dashboard */
.line-overview-card {
    margin-top: 20px;
}

.line-mini-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 10px 12px;
}

.line-mini {
    padding: 12px 14px;
    border-right: 1px solid var(--line);
}

.line-mini:last-child {
    border-right: 0;
}

.line-mini span {
    display: block;
    margin-bottom: 2px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-2);
}

.line-mini strong {
    font-size: 22px;
    font-weight: 750;
    color: var(--text-0);
}

/* Line details modal */
.modal-panel--wide {
    max-width: 640px;
}

.modal-panel--xl {
    max-width: 940px;
}

.details-loading {
    padding: 26px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-2);
}

.details-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    margin-bottom: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.details-host-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 240px;
}

.details-host-picker > span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
}

.details-host-picker select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 38px;
    padding: 0 34px 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background-color: rgba(255, 255, 255, 0.03);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b7ad92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    color: var(--text-0);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    cursor: pointer;
    outline: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.details-host-picker select:hover {
    border-color: var(--line-strong);
}

.details-host-picker select:focus {
    border-color: rgba(226, 196, 120, 0.45);
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.09);
}

.details-host-picker select option {
    background: #0c1220;
    color: var(--text-0);
}

.details-toolbar .btn {
    flex: 0 0 auto;
}

.line-details-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-1);
}

.line-details-meta strong {
    color: var(--text-0);
}

.details-section {
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.details-section:first-of-type {
    border-top: 0;
}

.details-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.details-section-head h4 {
    font-size: 13px;
    font-weight: 680;
    letter-spacing: 0.02em;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.detail-row > span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
}

.detail-row code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-0);
    word-break: break-all;
}

.details-help {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-2);
}

.details-note {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-1);
}

.details-note.is-warning {
    color: #ffc9c9;
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.28);
}

.details-url {
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--gold-100);
    word-break: break-all;
    user-select: all;
}

.line-details-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: var(--text-2);
}

.line-details-dates strong {
    color: var(--text-1);
    font-weight: 600;
}

/* Manage content modal */
.content-line-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    color: var(--text-1);
}

.content-line-meta strong {
    color: var(--text-0);
    font-weight: 650;
}

.content-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow-x: auto;
}

.content-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.content-tab:hover {
    color: var(--text-0);
    background: rgba(255, 255, 255, 0.035);
}

.content-tab.is-active {
    color: var(--gold-100);
    border-color: rgba(226, 196, 120, 0.3);
    background: rgba(226, 196, 120, 0.09);
}

.content-tab:focus-visible {
    outline: 2px solid rgba(226, 196, 120, 0.45);
    outline-offset: 1px;
}

.content-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-1);
    font-size: 10px;
    font-weight: 700;
}

.content-tab.is-active .content-tab-count {
    background: rgba(226, 196, 120, 0.18);
    color: var(--gold-100);
}

.content-tab-panel[hidden] {
    display: none;
}

.content-head--access {
    align-items: center;
}

.access-card--inline {
    flex: 0 0 auto;
    min-width: 220px;
    padding: 10px 12px;
}

.category-picker {
    max-height: 280px;
}

.content-section {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.content-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.content-section h4 {
    font-size: 13px;
    font-weight: 680;
    letter-spacing: 0.01em;
}

.content-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.content-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--text-2);
}

.content-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.content-head-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.content-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 14px;
}

.content-pane {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.018);
    overflow: hidden;
}

.content-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
}

.content-hint {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: rgba(140, 135, 121, 0.75);
}

.bouquet-order {
    list-style: none;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 344px;
    overflow-y: auto;
}

.bouquet-order-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.18s;
}

.bouquet-order-item:hover {
    border-color: var(--line-strong);
    background: rgba(226, 196, 120, 0.045);
}

.bouquet-order-item.is-placeholder {
    justify-content: center;
    border-style: dashed;
    border-color: rgba(226, 196, 120, 0.38);
    background: rgba(226, 196, 120, 0.05);
}

.bouquet-order-item.is-placeholder .bouquet-name {
    font-size: 11px;
    color: var(--text-2);
}

.bouquet-order-item.is-dragging {
    position: fixed;
    z-index: 400;
    cursor: grabbing;
    pointer-events: none;
    border-color: rgba(226, 196, 120, 0.55);
    background: linear-gradient(160deg, #1a2236, #101725);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6);
    transform: scale(1.015);
}

body.is-reordering {
    user-select: none;
    cursor: grabbing;
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-2);
    cursor: grab;
    touch-action: none;
    transition: color 0.18s, background 0.18s;
}

.drag-handle:hover {
    color: var(--gold-100);
    background: rgba(226, 196, 120, 0.09);
}

.drag-handle:focus-visible {
    outline: 2px solid rgba(226, 196, 120, 0.5);
    outline-offset: 1px;
}

.drag-handle .icon {
    width: 14px;
    height: 14px;
}

.bouquet-index {
    flex: 0 0 auto;
    width: 18px;
    font-size: 10px;
    font-weight: 600;
    text-align: right;
    color: var(--text-2);
}

.bouquet-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--text-0);
}

.bouquet-id {
    flex: 0 0 auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    color: var(--text-2);
}

.bouquet-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    opacity: 0.55;
    transition: color 0.18s, background 0.18s, opacity 0.18s;
}

.bouquet-remove:hover {
    color: #ff9d9d;
    background: rgba(248, 113, 113, 0.12);
    opacity: 1;
}

.bouquet-remove .icon {
    width: 13px;
    height: 13px;
}

.bouquet-order-empty {
    padding: 34px 12px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
    color: var(--text-2);
}

.bouquet-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    max-height: 344px;
    overflow-y: auto;
}

.bouquet-check {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

.bouquet-check:hover {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--line);
}

.bouquet-check.is-selected {
    background: rgba(226, 196, 120, 0.07);
    border-color: rgba(226, 196, 120, 0.2);
}

.bouquet-check input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.bouquet-check-box {
    position: relative;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.bouquet-check input:checked + .bouquet-check-box {
    border-color: rgba(240, 212, 138, 0.8);
    background: linear-gradient(135deg, #f0d48a, #d4ab52);
}

.bouquet-check input:checked + .bouquet-check-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #1a1408;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bouquet-check input:focus-visible + .bouquet-check-box {
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.18);
}

.bouquet-check-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-1);
}

.bouquet-check.is-selected .bouquet-check-name {
    color: var(--text-0);
}

.bouquet-check-id {
    flex: 0 0 auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9.5px;
    color: var(--text-2);
}

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

.access-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.access-card:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.03);
}

.access-card.is-on {
    border-color: rgba(226, 196, 120, 0.32);
    background: rgba(226, 196, 120, 0.05);
    box-shadow: inset 0 0 0 1px rgba(226, 196, 120, 0.05);
}

.access-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.access-copy strong {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-0);
}

.access-copy > span {
    font-size: 11px;
    color: var(--text-2);
}

.switch-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.switch-ui {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.switch-ui > span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8b8577;
    transition: transform 0.22s ease, background 0.22s ease;
}

.switch-input:checked + .switch-ui {
    border-color: rgba(240, 212, 138, 0.7);
    background: linear-gradient(135deg, #e2c478, #c9a24d);
}

.switch-input:checked + .switch-ui > span {
    background: #1a1408;
    transform: translateX(18px);
}

.switch-input:focus-visible + .switch-ui {
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.18);
}

.content-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.08);
    font-size: 12px;
    line-height: 1.45;
    color: #ffc9c9;
}

.content-error[hidden] {
    display: none;
}

.content-error .icon {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
}

.content-restore {
    margin-right: auto;
}

@media (max-width: 480px) {
    .modal-panel--xl .modal-foot {
        flex-wrap: wrap;
    }

    .modal-panel--xl .modal-foot .btn {
        flex: 1 1 100%;
    }

    .content-restore {
        margin-right: 0;
    }
}

@media (max-width: 760px) {
    .content-columns,
    .access-grid {
        grid-template-columns: 1fr;
    }

    .bouquet-picker {
        grid-template-columns: 1fr;
    }

    .content-head {
        flex-direction: column;
    }

    .access-card--inline {
        width: 100%;
        min-width: 0;
    }

    .content-head-side {
        width: 100%;
        justify-content: flex-start;
    }

    .content-head-actions {
        width: 100%;
    }

    .content-head-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 900px) {
    .line-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .data-table.lines-table {
        min-width: 0;
    }

    .data-table.lines-table tbody td {
        padding: 0;
    }

    .data-table.lines-table tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }

    .data-table.lines-table tbody td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        text-align: left;
    }

    .data-table.lines-table tbody td:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        text-align: right;
    }

    .data-table.lines-table tbody td:nth-child(4) {
        grid-column: 1;
        grid-row: 3;
        justify-self: start;
        text-align: left;
    }

    .data-table.lines-table tbody td:nth-child(5) {
        grid-column: 2;
        grid-row: 3;
        justify-self: end;
        text-align: right;
    }

    .data-table.lines-table tbody td:nth-child(6) {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .data-table.lines-table tbody td:nth-child(7) {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 6px;
        justify-self: start;
    }

    .data-table.lines-table tbody td.line-activated::before,
    .data-table.lines-table tbody td.line-expires::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        font-size: 9px;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--text-2);
    }

    .data-table.lines-table tbody td.line-activated {
        text-align: left;
    }

    .data-table.lines-table tbody tr.skeleton-row {
        display: block;
        padding: 8px 16px;
    }

    .line-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .line-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .line-create-actions {
        justify-content: stretch;
    }

    .line-create-actions .btn {
        flex: 1 1 auto;
    }

    .line-mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 6px;
    }

    .line-mini {
        padding: 10px;
    }

    .line-mini strong {
        font-size: 19px;
    }

    .line-mini:nth-child(3n) {
        border-right: 0;
    }

    .line-mini:nth-child(n+4) {
        border-top: 1px solid var(--line);
    }

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

@media (max-width: 480px) {
    .line-type-inner {
        padding: 11px;
    }

    .line-type-name {
        font-size: 13px;
    }

    .line-type-cost {
        font-size: 13px;
    }

    .line-summary {
        padding: 12px;
    }

    .credential-label {
        width: 60px;
    }

    .line-actions {
        flex-wrap: wrap;
    }
}

/* Toasts must never block the controls underneath them. */
.toast {
    pointer-events: none;
}

.toast-x {
    pointer-events: auto;
}


/* ------------------------------------------------------------------
   Line extension modal
   ------------------------------------------------------------------ */

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

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

.extend-meta > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.extend-meta span {
    font-size: 11px;
    color: var(--text-2);
}

.extend-meta strong {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-0);
}

.activation-code {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold-200);
}

@media (max-width: 700px) {
    .line-extend-grid,
    .extend-meta {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------
   Manage lines: selection + download
   ------------------------------------------------------------------ */

.head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.selection-count {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: var(--gold-200);
    background: rgba(226, 196, 120, 0.1);
    border: 1px solid rgba(226, 196, 120, 0.22);
}

.th-select,
.cell-select {
    width: 36px;
    padding-right: 0 !important;
    text-align: center;
}

.line-select {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: middle;
    border-radius: 5px;
    border: 1px solid rgba(226, 196, 120, 0.32);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.line-select:hover {
    border-color: var(--gold-300);
    background: rgba(226, 196, 120, 0.08);
}

.line-select:focus-visible {
    outline: 2px solid var(--gold-200);
    outline-offset: 2px;
}

.line-select:checked {
    background: var(--gold-300);
    border-color: var(--gold-300);
    box-shadow: 0 0 0 3px rgba(226, 196, 120, 0.12);
}

.line-select:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #171204;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.line-select:indeterminate {
    background: rgba(226, 196, 120, 0.55);
    border-color: var(--gold-300);
}

.line-select:indeterminate::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 6px;
    width: 8px;
    height: 2px;
    border-radius: 1px;
    background: #171204;
}

.select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    font-size: 12px;
    font-weight: 550;
    color: var(--text-1);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.select-all:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-0);
}

/* ------------------------------------------------------------------
   Account activity summary (per sub / seller)
   ------------------------------------------------------------------ */

.account-net {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.account-net-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.account-net-item span {
    font-size: 9.5px;
    line-height: 1.25;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}

.account-net-item strong {
    font-size: 16px;
    font-weight: 680;
    color: var(--text-0);
}

@media (max-width: 560px) {
    .account-net {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Seller table: per-sub network column */
.users-table--network th,
.users-table--network td {
    padding-left: 12px;
    padding-right: 12px;
}

.users-table--network .row-actions {
    gap: 4px;
}

.cell-network {
    white-space: nowrap;
}

@media (max-width: 760px) {
    .data-table.users-table--network tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .data-table.users-table--network tbody td:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .data-table.users-table--network tbody td:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
    }

    .data-table.users-table--network tbody td:nth-child(4) {
        grid-column: 1 / -1;
        grid-row: 3;
        margin-top: 4px;
        justify-self: stretch;
        text-align: left;
    }

    .data-table.users-table--network tbody td:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
        margin-top: 0;
        justify-self: end;
        text-align: right;
    }

    .data-table.users-table--network tbody td:nth-child(6) {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 6px;
        justify-self: start;
    }

}

.account-net-intro {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-2);
}

.account-net-intro strong {
    font-weight: 650;
    color: var(--text-1);
}

.account-net-item em {
    margin-top: 1px;
    font-style: normal;
    font-size: 9px;
    color: var(--text-2);
}

.account-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 9px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.account-lines > span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-size: 10.5px;
    color: var(--text-1);
}

.account-lines em {
    font-style: normal;
    font-size: 8.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
}

.account-lines strong {
    font-size: 12px;
    font-weight: 680;
    color: var(--text-0);
}

.account-usage {
    margin-bottom: 8px;
    font-size: 11.5px;
    color: var(--text-2);
}

.account-usage strong {
    font-weight: 650;
    color: var(--gold-200);
}

.account-balance-label {
    margin-bottom: 6px;
    font-size: 8.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-2);
}

.net-details {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    margin-top: 6px;
    padding: 0 7px;
    border: 1px solid rgba(226, 196, 120, 0.25);
    border-radius: 999px;
    background: rgba(226, 196, 120, 0.07);
    font: inherit;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--gold-200);
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.net-details:hover {
    background: rgba(226, 196, 120, 0.14);
    border-color: rgba(226, 196, 120, 0.45);
    color: var(--gold-100);
}

.net-details .icon {
    width: 11px;
    height: 11px;
}
