/* ----- reset & base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --bg: #050508;
    --surface: #0c0c11;
    --surface2: #12121a;
    --border: #21212b;
    --border-light: #2c2c3a;
    --text: #eeedf2;
    --muted: #8984a0;
    --muted2: #5f5a77;
    --purple: #a855f7;
    --purple2: #7c3aed;
    --purple-glow: rgba(168, 85, 247, .25);
    --green: #2dd4a0;
    --yellow: #fbbf24;
    --red: #f87180;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 25px 60px -10px rgba(0, 0, 0, .8);
    --transition: all .25s cubic-bezier(.2, .9, .3, 1);
}
html {
    background: var(--bg);
    scroll-behavior: smooth;
}
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -.015em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}
button,
input,
select {
    font: inherit;
    outline: none;
}
button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}
a {
    color: var(--purple);
    text-decoration: none;
}
.hidden {
    display: none !important;
}

/* ----- scrollbar ----- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--surface);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}

/* ----- login ----- */
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 30% 20%, rgba(124, 58, 237, .12), transparent 55%),
                radial-gradient(circle at 80% 80%, rgba(168, 85, 247, .08), transparent 50%),
                var(--bg);
}
.login-card {
    width: min(440px, 100%);
    padding: 38px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(4px);
    animation: fadeSlide .55s ease;
}
@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}
.logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--purple), var(--purple2));
    font-weight: 900;
    font-size: 22px;
    box-shadow: 0 6px 24px var(--purple-glow);
    color: #fff;
}
.brand-text b {
    display: block;
    font-size: 18px;
    font-weight: 800;
}
.brand-text small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: .02em;
}
.login h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.04em;
    margin-bottom: 6px;
}
.login p.sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 26px;
    font-weight: 400;
}
.field {
    margin: 14px 0;
}
.field label {
    display: block;
    color: var(--muted2);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.field input,
.field select {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    color: #fff;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 450;
}
.field input:focus,
.field select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}
.field input::placeholder {
    color: var(--muted2);
    font-weight: 400;
}
.primary {
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--purple2), var(--purple));
    color: #fff;
    padding: 14px 20px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 20px var(--purple-glow);
    width: 100%;
    border: none;
    font-size: 14px;
    letter-spacing: .02em;
}
.primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 32px rgba(168, 85, 247, .4);
}
.primary:active {
    transform: scale(.97);
}
.error {
    color: var(--red);
    font-size: 12px;
    margin-top: 10px;
    font-weight: 500;
}
.hint {
    margin-top: 18px;
    color: var(--muted2);
    font-size: 11px;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 18px;
}
.hint code {
    background: var(--surface2);
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 10px;
    color: var(--purple);
    border: 1px solid var(--border);
}

/* ----- app shell ----- */
#app {
    display: none;
    min-height: 100vh;
}

/* ----- sidebar ----- */
.sidebar {
    position: fixed;
    z-index: 30;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.2, .9, .3, 1);
    overflow-y: auto;
}
.sidebrand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 28px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.sidebrand .logo {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 14px;
}
.sidebrand b {
    font-size: 15px;
    font-weight: 800;
}
.sidebrand small {
    display: block;
    color: var(--muted2);
    font-size: 9px;
    font-weight: 500;
    margin-top: 1px;
}
.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    transition: var(--transition);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}
.nav button .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.nav button:hover {
    background: var(--surface2);
    color: #fff;
}
.nav button.active {
    background: rgba(168, 85, 247, .12);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--purple);
}
.nav button.active .icon {
    color: var(--purple);
}
.logout-btn {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    color: var(--muted2) !important;
}
.logout-btn:hover {
    color: var(--red) !important;
    background: rgba(248, 113, 128, .08) !important;
}

/* ----- mobile top bar ----- */
.mobilebar {
    display: none;
    height: 64px;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(5, 5, 8, .82);
    backdrop-filter: blur(14px) saturate(1.1);
    border-bottom: 1px solid var(--border);
}
.hamb {
    font-size: 28px;
    color: var(--purple);
    padding: 4px 8px;
    border-radius: 10px;
    transition: var(--transition);
}
.hamb:hover {
    background: var(--surface2);
}
.mobilebar .brand-mid {
    font-weight: 800;
    color: var(--purple);
    font-size: 17px;
    letter-spacing: -.02em;
}
.more-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 20px;
    color: var(--muted);
    transition: var(--transition);
}
.more-btn:hover {
    border-color: var(--purple);
    color: #fff;
}

/* ----- main content ----- */
.main {
    margin-left: 260px;
    min-height: 100vh;
}
.wrap {
    max-width: 1340px;
    padding: 32px 38px;
    margin: 0 auto;
}

/* ----- top header ----- */
.top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}
.title h1 {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -.06em;
    line-height: 1.05;
    background: linear-gradient(135deg, #fff 40%, var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.title h1 span {
    -webkit-text-fill-color: var(--purple);
}
.title p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px;
    font-weight: 400;
    -webkit-text-fill-color: var(--muted);
}
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    border-radius: 60px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--purple), #ec4899);
    font-size: 11px;
    font-weight: 800;
    color: #fff;
}

/* ----- pages ----- */
.page {
    display: none;
    animation: fadeSlide .45s ease;
}
.page.active {
    display: block;
}

/* ----- stats cards ----- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.stat {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat:hover {
    border-color: var(--purple);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .6);
}
.stat .bg-glow {
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    opacity: .05;
    pointer-events: none;
}
.stat.green .bg-glow {
    background: var(--green);
}
.stat.yellow .bg-glow {
    background: var(--yellow);
}
.stat label {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted2);
    font-weight: 700;
    position: relative;
    z-index: 2;
}
.stat .num {
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.05em;
    margin-top: 8px;
    position: relative;
    z-index: 2;
}
.stat .num.green {
    color: var(--green);
}
.stat .num.yellow {
    color: var(--yellow);
}
.stat .sub-label {
    color: var(--muted2);
    font-size: 11px;
    margin-top: 4px;
    font-weight: 400;
    position: relative;
    z-index: 2;
}
.stat .icon-big {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    opacity: .06;
    pointer-events: none;
    color: var(--purple);
}

/* ----- panels ----- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 20px;
    overflow: hidden;
    transition: var(--transition);
}
.panel:hover {
    border-color: var(--border-light);
}
.panel-head {
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.panel-head h2 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-head h2 .emoji {
    color: var(--purple);
}
.panel-body {
    padding: 20px 24px;
}

.btn-ghost {
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 700;
    transition: var(--transition);
}
.btn-ghost:hover {
    border-color: var(--purple);
    color: #fff;
    background: rgba(168, 85, 247, .08);
}

/* ----- activity rows ----- */
.activity-list {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 2px 16px;
    border: 1px solid var(--border);
}
.arow {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.2fr;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.arow:last-child {
    border-bottom: 0;
}
.arow .label {
    display: block;
    color: var(--muted2);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 3px;
}
.arow .value {
    font-weight: 600;
    font-size: 13px;
}
.arow .value small {
    font-weight: 400;
    color: var(--muted);
    font-size: 11px;
}
.empty-state {
    padding: 30px 20px;
    text-align: center;
    color: var(--muted2);
    font-size: 13px;
}

/* ----- ranking ----- */
.rank-list {
    padding: 0 4px;
}
.rank-row {
    display: grid;
    grid-template-columns: 50px 1fr 90px;
    align-items: center;
    padding: 14px 8px;
    border-bottom: 1px solid var(--border);
}
.rank-row:last-child {
    border-bottom: 0;
}
.rank-no {
    font-size: 20px;
    font-weight: 900;
    color: var(--purple);
}
.rank-name b {
    font-size: 14px;
    font-weight: 700;
}
.rank-name small {
    display: block;
    color: var(--muted2);
    font-size: 10px;
    font-weight: 400;
    margin-top: 1px;
}
.rank-count {
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
}

/* ----- table / keys ----- */
.toolbar {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}
.toolbar input {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #fff;
    transition: var(--transition);
}
.toolbar input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}
.toolbar input::placeholder {
    color: var(--muted2);
}
.btn-tool {
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-tool:hover {
    border-color: var(--purple);
    color: #fff;
    background: rgba(168, 85, 247, .06);
}

.table-wrap {
    overflow-x: auto;
    padding: 0 4px 4px 4px;
}
.table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    font-size: 12px;
}
.table th {
    text-align: left;
    padding: 14px 16px;
    color: var(--muted2);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td {
    border-bottom: 0;
}
.table .key-highlight {
    color: var(--purple);
    font-weight: 700;
    font-family: 'SF Mono', monospace;
    font-size: 12px;
}
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge.active {
    background: rgba(45, 212, 160, .15);
    color: var(--green);
}
.badge.paused {
    background: rgba(251, 191, 36, .15);
    color: var(--yellow);
}
.badge.ban {
    background: rgba(248, 113, 128, .15);
    color: var(--red);
}
.actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.btn-act {
    padding: 5px 10px;
    border: 1px solid var(--border);
    background: var(--surface2);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    color: var(--muted);
    transition: var(--transition);
}
.btn-act:hover {
    border-color: var(--purple);
    color: #fff;
}
.btn-act.danger {
    color: var(--red);
}
.btn-act.danger:hover {
    border-color: var(--red);
    color: var(--red);
    background: rgba(248, 113, 128, .06);
}

/* ----- forms ----- */
.form-panel {
    padding: 28px 30px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}
.form-grid .full {
    grid-column: 1 / -1;
}
.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.mode-toggle button {
    padding: 12px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    color: var(--muted);
    transition: var(--transition);
}
.mode-toggle button.sel {
    border-color: var(--purple);
    background: rgba(168, 85, 247, .1);
    color: #fff;
    box-shadow: 0 0 20px var(--purple-glow);
}
.mode-toggle button:hover {
    border-color: var(--purple);
}
.cost-hint {
    color: var(--muted2);
    font-size: 11px;
    margin-top: 6px;
    font-weight: 400;
}
.result-box {
    margin-top: 22px;
    padding: 18px 22px;
    border: 1.5px dashed var(--purple);
    background: rgba(168, 85, 247, .04);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.result-box code {
    font-size: 18px;
    font-weight: 800;
    color: #d8c2ff;
    font-family: 'SF Mono', monospace;
    word-break: break-all;
}
.btn-copy {
    padding: 6px 16px;
    background: rgba(168, 85, 247, .15);
    border-radius: 40px;
    font-size: 11px;
    font-weight: 700;
    color: var(--purple);
    transition: var(--transition);
    border: 1px solid transparent;
}
.btn-copy:hover {
    background: rgba(168, 85, 247, .25);
    border-color: var(--purple);
}

/* ----- credit ----- */
.credit-section {
    max-width: 660px;
    padding: 32px 36px;
}
.credit-number {
    font-size: 70px;
    font-weight: 900;
    color: #c6a5ff;
    letter-spacing: -.04em;
    margin: 8px 0 16px;
}
.notice-box {
    margin-top: 20px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}
.notice-box strong {
    color: var(--text);
}

/* ----- footer ----- */
.footer {
    text-align: center;
    color: var(--muted2);
    font-size: 11px;
    padding: 40px 0 12px;
    border-top: 1px solid var(--border);
    margin-top: 28px;
}

/* ----- responsive ----- */
@media (max-width: 1024px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat .num {
        font-size: 40px;
    }
    .stat {
        min-height: 130px;
        padding: 20px 24px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        display: none;
    }
    .sidebar.open {
        transform: translateX(0);
        display: flex;
    }
    .mobilebar {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .main {
        margin-left: 0;
    }
    .wrap {
        padding: 24px 22px;
    }
    .user-badge {
        display: flex !important;
        font-size: 10px;
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }
    .user-badge .avatar {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }
    .user-badge #headerCredit {
        font-size: 10px !important;
        margin-left: 4px !important;
        padding-left: 6px !important;
        border-left: 1px solid var(--border) !important;
    }
    #mobileCredit {
        display: inline-block !important;
        font-size: 13px !important;
        color: #2dd4a0 !important;
        font-weight: 700 !important;
    }
}

@media (max-width: 640px) {
    .wrap {
        padding: 16px 12px;
    }
    .title h1 {
        font-size: 24px;
    }
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat {
        min-height: 100px;
        padding: 14px 16px;
    }
    .stat .num {
        font-size: 28px;
        margin-top: 4px;
    }
    .stat .icon-big {
        font-size: 30px;
        right: 10px;
    }
    .stat label {
        font-size: 8px;
    }
    .stat .sub-label {
        font-size: 8px;
        margin-top: 2px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid .full {
        grid-column: auto;
    }
    .panel-head {
        padding: 12px 14px;
    }
    .panel-body {
        padding: 12px 14px;
    }
    .arow {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 0;
    }
    .rank-row {
        grid-template-columns: 30px 1fr 60px;
        padding: 8px 4px;
    }
    .rank-no {
        font-size: 16px;
    }
    .rank-name b {
        font-size: 12px;
    }
    .rank-count {
        font-size: 11px;
    }
    .credit-number {
        font-size: 40px;
    }
    .credit-section {
        padding: 18px 14px;
    }
    .toolbar {
        padding: 10px 12px;
        gap: 6px;
    }
    .toolbar input {
        min-width: 120px;
        padding: 8px 10px;
        font-size: 11px;
    }
    .btn-tool {
        padding: 8px 10px;
        font-size: 9px;
    }
    .result-box code {
        font-size: 13px;
    }
    .table {
        min-width: 600px;
        font-size: 10px;
    }
    .table th, .table td {
        padding: 8px 10px;
    }
    .table .key-highlight {
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat {
        min-height: 80px;
        padding: 10px 12px;
    }
    .stat .num {
        font-size: 22px;
    }
    .stat .icon-big {
        font-size: 24px;
        right: 8px;
    }
    .stat label {
        font-size: 7px;
    }
    .stat .sub-label {
        font-size: 7px;
    }
    .login-card {
        padding: 20px 16px;
    }
    .user-badge {
        font-size: 8px;
        padding: 2px 6px 2px 2px;
        gap: 4px;
    }
    .user-badge .avatar {
        width: 18px;
        height: 18px;
        font-size: 7px;
    }
    .user-badge #headerCredit {
        font-size: 8px !important;
        margin-left: 2px !important;
        padding-left: 4px !important;
    }
    #mobileCredit {
        font-size: 10px !important;
    }
    .mobilebar {
        height: 50px;
        padding: 0 12px;
    }
    .mobilebar .brand-mid {
        font-size: 13px;
    }
    .hamb, .more-btn {
        font-size: 20px;
    }
}

/* ===== v8 polish ===== */
.login-card {
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: "";
    position: absolute;
    inset: -120px -80px auto auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(168, 85, 247, .08);
    filter: blur(20px);
    pointer-events: none;
}
.login-card .primary {
    min-height: 48px;
}
.error {
    min-height: 18px;
}
.btn-act.danger {
    border-color: rgba(248,113,128,.25);
}
.btn-act.danger:hover {
    background: rgba(248,113,128,.10);
    border-color: var(--red);
}
@media (max-width: 600px) {
    .login {
        padding: 14px;
    }
    .login-card {
        padding: 30px 22px;
        border-radius: 18px;
    }
}

/* ============================================
   CONTACT (WhatsApp / Telegram / TikTok)
   ============================================ */
.login-contact {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.login-contact span {
    display: block;
    font-size: 12px;
    color: var(--muted2);
    margin-bottom: 10px;
}
.contact-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.contact-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel2, #161b22);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease;
}
.contact-btn:hover {
    transform: translateY(-2px);
    border-color: var(--green);
}
.contact-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-panel .contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.contact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius, 14px);
    border: 1px solid var(--border);
    background: var(--panel2, #161b22);
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, border-color .15s ease;
}
.contact-card:hover {
    transform: translateY(-2px);
    border-color: var(--green);
}
.contact-card img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.contact-card b {
    display: block;
    font-size: 14px;
}
.contact-card small {
    color: var(--muted2);
    font-size: 12px;
}

/* Login button loading state */
.primary.loading {
    opacity: .7;
    pointer-events: none;
}

/* Admin-tree visibility helper (matches owner-only pattern) */
.owner-admin-only { display: none; }
.no-admin { }

/* ============================================
   v9.1 — LOGO / BRAND LINK
   ============================================ */
.logo img.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}
a.brand-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: var(--transition);
}
a.brand-link:hover {
    opacity: .85;
}
.mobilebar .brand-mid.brand-link {
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-logo-mini {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 14px var(--purple-glow);
}
.contact-btn.web img.brand-logo-img,
.contact-card.web img.brand-logo-img {
    object-fit: cover;
    background: linear-gradient(135deg, var(--purple), var(--purple2));
}

/* ----- sidebar section labels ----- */
.nav-label {
    padding: 16px 14px 6px 14px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted2);
}
.nav-label:first-child {
    padding-top: 4px;
}

/* ----- expired / extend related badges ----- */
.badge.expired {
    background: rgba(248, 113, 128, .15);
    color: var(--red);
}
.badge.nonaktif {
    background: rgba(137, 132, 160, .18);
    color: var(--muted);
}
.expiry-soon {
    color: var(--yellow) !important;
    font-weight: 700;
}
.expiry-expired {
    color: var(--red) !important;
    font-weight: 700;
}
.btn-act.extend {
    color: var(--green);
    border-color: rgba(45, 212, 160, .3);
}
.btn-act.extend:hover {
    border-color: var(--green);
    background: rgba(45, 212, 160, .1);
    color: var(--green);
}

/* ============================================
   MODAL (Perpanjang / Extend)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(3, 3, 6, .72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeSlide .2s ease;
}
.modal-box {
    width: min(460px, 100%);
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 26px 28px;
    animation: fadeSlide .25s ease;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.modal-head h3 {
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    transition: var(--transition);
}
.modal-close:hover {
    color: #fff;
    border-color: var(--red);
}
.modal-sub {
    color: var(--muted);
    font-size: 12.5px;
    margin-bottom: 14px;
    line-height: 1.5;
}
.modal-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--muted);
}
.modal-current b {
    color: var(--purple);
    font-size: 13px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}
.modal-actions .btn-ghost {
    padding: 12px 20px;
}
.modal-actions .primary {
    width: auto;
    padding: 12px 22px;
}
.extend-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}
.extend-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--purple);
}

@media (max-width: 480px) {
    .modal-box {
        padding: 20px 18px 22px;
    }
    .modal-actions {
        flex-direction: column-reverse;
    }
    .modal-actions .btn-ghost,
    .modal-actions .primary {
        width: 100%;
    }
}
