:root {
    --bg: #f5f7fb;
    --surface: #fff;
    --line: #e7ecf2;
    --ink: #172236;
    --muted: #748297;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #d84f62;
    --success: #0f9d83;
    --warning: #b97918;
    --sidebar: #14263f;
    --sidebar-soft: #1d3555;
    --shadow: 0 12px 35px rgba(22, 42, 72, .06);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
code { display: block; color: #45627f; background: #f3f6fa; border-radius: 8px; padding: 11px 13px; font-size: 11px; overflow-x: auto; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 245px; flex: 0 0 245px; min-height: 100vh; color: #d6e1ef; background: var(--sidebar); padding: 25px 15px 18px; display: flex; flex-direction: column; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 9px 35px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #3477e6; color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 8px 20px rgba(52, 119, 230, .28); }
.brand strong { display: block; color: #fff; font-size: 17px; letter-spacing: -.03em; }
.brand small { display: block; color: #8da5c2; margin-top: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-close { display: none; border: 0; color: #a9bad0; background: transparent; font-size: 21px; }
.nav-caption { padding: 0 13px 10px; color: #738baa; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; border-radius: 9px; padding: 11px 13px; color: #aebfd4; font-size: 12px; transition: .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.active { color: #fff; background: var(--sidebar-soft); box-shadow: inset 3px 0 0 #5592f2; }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; color: currentColor; }
.nav-icon svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.sidebar-note { display: flex; gap: 10px; margin: auto 7px 18px; padding: 13px 11px; border: 1px solid rgba(147, 177, 211, .16); border-radius: 10px; background: rgba(255,255,255,.045); }
.sidebar-note-icon { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #9fc6ff; background: rgba(82, 144, 238, .2); font-size: 11px; }
.sidebar-note strong { display: block; color: #dce9f8; font-size: 10px; }
.sidebar-note p { color: #8da4bf; font-size: 10px; line-height: 1.45; margin: 4px 0 0; }
.sidebar-bottom { display: flex; align-items: center; gap: 8px; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); color: #8ea5bf; font-size: 10px; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: #44d29d; box-shadow: 0 0 0 4px rgba(68, 210, 157, .12); }
.sidebar-overlay { display: none; }

.main-shell { min-width: 0; flex: 1; }
.topbar { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 39px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7); }
.topbar-left { display: flex; align-items: flex-start; gap: 14px; }
.menu-toggle { display: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: #59708a; background: #fff; font-size: 10px; }
.breadcrumb { margin: 0 0 5px; color: #9aa8b9; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.topbar h1 { margin: 0; color: #1a2b41; font-size: 24px; letter-spacing: -.045em; }
.topbar-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.local-badge { display: flex; align-items: center; gap: 7px; color: #718097; font-size: 11px; }
.local-badge i { width: 7px; height: 7px; border-radius: 50%; background: #2eb789; }
.avatar-link { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #2e6fd9; font-size: 10px; font-weight: 800; }
.page-content { width: min(1360px, calc(100% - 78px)); margin: 0 auto; padding: 30px 0 10px; }
.page-footer { width: min(1360px, calc(100% - 78px)); margin: auto; display: flex; justify-content: space-between; gap: 15px; padding: 26px 0 32px; color: #99a7b6; font-size: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card { padding: 18px 20px; }
.stat-card span, .stat-card small { color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin: 9px 0 3px; color: #1c2d45; font-size: 28px; letter-spacing: -.06em; }
.stat-card.danger strong { color: var(--danger); }
.stat-card.success strong { color: var(--success); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.checks-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.checks-grid > .panel { min-width: 0; margin-bottom: 0; }
.check-panel { display: flex; min-height: 318px; flex-direction: column; overflow: hidden; }
.single-check-panel { min-height: 0; }
.panel { min-width: 0; margin-bottom: 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 22px 24px 17px; }
.check-head { min-height: 102px; padding-bottom: 14px; }
.panel-head h2 { margin: 0; color: #21334b; font-size: 18px; letter-spacing: -.04em; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rank-search { width: 220px; }
.rank-list-head { align-items: flex-end; }
.rank-list-actions { flex: 0 1 440px; align-items: stretch; justify-content: flex-end; }
.rank-list-actions .rank-search { width: auto; flex: 1 1 220px; }
.rank-list-actions .button { white-space: nowrap; }
.panel-copy { max-width: 260px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.check-icon { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #2868d4; background: #eaf2ff; font-size: 11px; font-weight: 800; }
.eyebrow { margin: 0 0 6px; color: #9ba9b8; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 24px 24px; }
.quick-card { min-height: 105px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; transition: .18s; }
.quick-card:hover { border-color: #b7cdf5; background: #f5f8ff; transform: translateY(-1px); }
.quick-card span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; color: #2868d4; background: #eaf2ff; font-size: 10px; font-weight: 800; }
.quick-card strong { display: block; margin-top: 11px; font-size: 12px; }
.quick-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.info-list { display: grid; gap: 0; padding: 0 24px 20px; }
.info-list > div { padding: 13px 0; border-top: 1px solid #eff2f6; }
.info-list strong { color: #30445d; font-size: 11px; }
.info-list p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.button, .mini-button { border: 0; border-radius: 8px; font-size: 11px; font-weight: 700; text-decoration: none; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 13px; line-height: 1.2; }
.button.primary { color: #fff; background: var(--primary); box-shadow: 0 5px 13px rgba(37,99,235,.15); }
.button.primary:hover { background: var(--primary-dark); }
.button.ghost { color: #536981; background: #f1f4f8; }
.button.ghost:hover { background: #e8eef6; }
.button.danger { color: #b63b4e; background: #fff0f2; }
.button.danger:hover { color: #fff; background: #c74759; }
.mini-button { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; line-height: 1.2; color: #55708e; background: #f2f5f9; }
.mini-button:hover { color: var(--primary); background: #eaf1ff; }
.mini-button.danger:hover { color: var(--danger); background: #fff0f2; }

.toolbar { display: flex; gap: 9px; padding: 0 24px 17px; }
.input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: #fbfcfe; font-size: 12px; }
.input { min-height: 39px; padding: 10px 11px; }
.input:focus, textarea:focus { border-color: #81aaf0; box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.select { width: 180px; }
.stack-form { display: grid; gap: 11px; padding: 0 24px 18px; }
.check-panel .stack-form { min-height: 103px; align-content: start; }
textarea { resize: vertical; min-height: 90px; padding: 11px; line-height: 1.6; }
.form-message { min-height: 15px; margin: 0; color: #64809b; font-size: 11px; }
.form-hint { margin: -4px 0 0; color: #8d9aae; font-size: 10px; line-height: 1.45; }
.form-actions-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.field { display: grid; gap: 6px; color: #60738a; font-size: 11px; }
.result-box { margin: auto 24px 24px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: #728398; background: #fbfcfe; font-size: 11px; line-height: 1.6; overflow: hidden; }
.result-empty { display: flex; flex-direction: column; justify-content: center; min-height: 70px; }
.result-empty span, .result-empty small { display: block; }
.result-empty small { margin-top: 4px; color: #9aa8b7; }
.result-loading { display: flex; align-items: center; min-height: 70px; color: #647993; }
.result-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; padding-bottom: 10px; border-bottom: 1px solid #edf1f5; }
.result-title:only-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.result-title strong { min-width: 0; overflow: hidden; color: #31455f; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.result-title .status-pill { flex: 0 0 auto; }
.result-details { display: grid; gap: 7px; color: #718399; font-size: 10px; }
.result-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; align-items: start; }
.result-row b { color: #98a6b6; font-weight: 700; }
.result-row span { min-width: 0; overflow-wrap: anywhere; color: #526a83; }
.result-note { display: block; margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf1f5; color: #9a6e25; font-size: 10px; font-style: normal; line-height: 1.45; }
.result-error { border-color: #f3cad1; color: #b63b4e; background: #fff8f9; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th { padding: 11px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #96a4b3; background: #fbfcfe; font-size: 9px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 14px 16px; border-bottom: 1px solid #eef2f6; color: #53677e; font-size: 11px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
tr:last-child td { border-bottom: 0; }
td strong { display: block; color: #2a3e57; font-size: 11px; }
td small { display: block; margin-top: 4px; color: #9aa8b7; font-size: 10px; }
.compact-table { min-width: 590px; }
.status-pill { display: inline-flex; white-space: nowrap; padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.status-pill.danger { color: #b63b4e; background: #fff0f2; }
.status-pill.success { color: #0d806a; background: #e9faf4; }
.status-pill.warning { color: #a46915; background: #fff6e5; }
.status-pill.muted { color: #6d7d90; background: #f0f3f7; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 5px; }
.table-footer { padding: 13px 24px; border-top: 1px solid var(--line); color: #8e9cad; font-size: 10px; }
.empty-row td { padding: 35px 24px; color: #99a7b7; text-align: center; }
.history-limit-note { margin: -4px 24px 17px; color: #8e9cad; font-size: 10px; }
.rotator-domain-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.rotator-domain-search { position: relative; min-width: 0; }
.rotator-domain-picker .input { min-width: 0; }
.rotator-domain-results { position: absolute; z-index: 12; top: calc(100% + 6px); right: 0; left: 0; overflow: hidden; border: 1px solid #dbe4ef; border-radius: 10px; background: #fff; box-shadow: 0 14px 28px rgba(32,57,86,.12); }
.rotator-domain-option { display: block; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid #eef2f6; color: #2d435d; background: #fff; font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.rotator-domain-option:last-child { border-bottom: 0; }
.rotator-domain-option:hover, .rotator-domain-option:focus { outline: 0; color: #fff; background: var(--primary); }
.rotator-domain-empty { padding: 11px 14px; color: #98a6b6; font-size: 11px; }
.rotator-domain-line { display: block; margin-bottom: 5px; color: #53677e; }
.rotator-domain-line:last-child { margin-bottom: 0; }
.rotator-priority { display: inline; margin-right: 4px; color: #98a6b6; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.rotator-domain-line small { margin-top: 2px; }
.rank-schedule-cell { min-width: 155px; }
.rank-schedule-cell small { display: block; margin-top: 4px; color: #9aa8b7; font-size: 10px; line-height: 1.35; }

.settings-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 24px 18px; border-color: #dfe8f3; background: #edf3fa; }
.settings-tabs .page-tab { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 14px; text-align: left; }
.settings-tabs .page-tab > span:last-child { display: grid; gap: 2px; min-width: 0; }
.settings-tabs .page-tab strong { color: #536a84; font-size: 11px; }
.settings-tabs .page-tab small { color: #96a5b6; font-size: 9px; font-weight: 500; }
.settings-tabs .page-tab.active strong { color: var(--primary); }
.settings-tabs .page-tab.active .page-tab-number { border-color: #bdd2f7; color: var(--primary); background: #eaf2ff; }
.settings-tab-panel { min-width: 0; }
.settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 0 24px 24px; }
.settings-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.settings-card h3 { margin: 0 0 12px; color: #31465e; font-size: 12px; }
.settings-help { margin: 13px 0 0; padding-top: 11px; border-top: 1px solid #edf1f5; color: #8b9aaa; font-size: 10px; line-height: 1.5; }
.settings-guide-button { width: 100%; margin: 0 0 10px; }
.settings-guide { margin: 0 0 12px; padding: 13px; border: 1px solid #dbe7fb; border-radius: 10px; color: #52677f; background: #f5f8ff; font-size: 10px; line-height: 1.5; }
.settings-guide[hidden] { display: none; }
.settings-guide ol { margin: 0; padding-left: 17px; }
.settings-guide li { margin: 0 0 6px; }
.settings-guide p { margin: 9px 0 11px; color: #7a8da3; }
.settings-guide .button { min-height: 32px; padding: 7px 11px; }
.worker-monitor { margin-top: 14px; padding: 11px 12px; border: 1px solid #e7ecf2; border-radius: 9px; background: #fff; }
.worker-monitor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.worker-monitor-head strong { color: #30445d; font-size: 11px; }
.worker-state { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.worker-state-normal { color: #0d806a; background: #e9faf4; }
.worker-state-warning { color: #a46915; background: #fff6e5; }
.worker-state-error { color: #b63b4e; background: #fff0f2; }
.worker-state-pending { color: #6d7d90; background: #f0f3f7; }
.worker-monitor p { margin: 8px 0 0; color: #718399; font-size: 10px; line-height: 1.45; }
.worker-monitor small { display: block; margin-top: 6px; color: #9aa8b7; font-size: 9px; line-height: 1.4; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 9px 0; border-bottom: 1px solid #edf1f5; }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; font-size: 11px; }
.switch-row small { display: block; margin-top: 4px; color: #98a6b5; font-size: 10px; line-height: 1.4; }
.switch { position: relative; width: 34px; height: 19px; flex: 0 0 auto; }
.switch input { width: 0; height: 0; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #d7dfe8; transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .2s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(15px); }
.switch.locked i { background: #a9c3ef; }
.settings-card .field { margin-bottom: 10px; }
.settings-card .field:last-child { margin-bottom: 0; }
.settings-tech-fields { display: grid; gap: 10px; margin-top: 13px; padding-top: 13px; border-top: 1px solid #edf1f5; }
.settings-tech-fields .field { margin-bottom: 0; }
.settings-tech-fields .field small { color: #98a6b5; font-size: 9px; line-height: 1.4; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.settings-form-actions { padding: 0 24px 24px; }
.small-badge { color: #5b718a; background: #f1f4f8; border-radius: 99px; padding: 7px 9px; font-size: 10px; }
.code-list { display: grid; gap: 7px; padding: 0 24px 17px; }
.notice { margin: 0 24px 22px; padding: 11px 13px; border: 1px solid #f1e2b6; border-radius: 9px; color: #896d31; background: #fff9e9; font-size: 11px; line-height: 1.5; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }
.toast { max-width: 350px; padding: 11px 14px; border-radius: 8px; color: #fff; background: #2a3b54; box-shadow: 0 12px 25px rgba(0,0,0,.15); font-size: 11px; opacity: 0; transform: translateY(12px); transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #168b75; }
.toast-danger, .toast-error { background: #c74759; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #eef4ff, #f8fafc); }
.auth-card { width: min(100%, 430px); padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 20px 55px rgba(22, 42, 72, .1); }
.auth-brand { margin-bottom: 32px; }
.auth-card h1 { margin: 0; color: #21334b; font-size: 24px; letter-spacing: -.04em; }
.auth-copy { margin: 8px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-form { padding: 0; }
.auth-error { margin: 0 0 14px; padding: 11px 13px; border: 1px solid #f3cad1; border-radius: 9px; color: #b63b4e; background: #fff8f9; font-size: 11px; line-height: 1.45; }
.auth-links { margin: 15px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.auth-links a { color: var(--primary); font-weight: 700; }
.auth-google { width: 100%; margin-top: 10px; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 360px)); gap: 14px; padding: 0 24px 24px; }
.package-card { display: flex; min-height: 225px; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.package-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.package-card-label { color: #9aa8b7; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.package-card-check { padding: 4px 7px; border-radius: 99px; color: #0d806a; background: #e9faf4; font-size: 8px; font-weight: 800; letter-spacing: .05em; }
.package-card h3 { margin: 0 0 9px; color: #30445d; font-size: 13px; }
.package-card > strong { display: block; color: var(--primary); font-size: 19px; }
.package-features { display: grid; gap: 7px; margin: 13px 0 18px; color: #647b94; font-size: 10px; }
.package-features span { display: flex; align-items: center; gap: 7px; }
.package-features span::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: #6da0f2; }
.package-card .button { width: 100%; margin-top: auto; }
.package-disabled { opacity: .55; }
.addon-purchase-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(250px, auto); gap: 12px; align-items: end; padding: 0 24px 24px; }
.addon-purchase-form .field { min-width: 0; }
.addon-action-group { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border: 1px solid #dbe7fb; border-radius: 11px; background: #f5f8ff; }
.addon-total { display: grid; flex: 1 1 auto; gap: 4px; min-width: 110px; padding: 3px 5px; color: var(--muted); font-size: 10px; }
.addon-total strong { color: var(--primary); font-size: 15px; }
.addon-action-group > .button { width: auto; min-height: 36px; padding-right: 15px; padding-left: 15px; white-space: nowrap; }
.addon-purchase-form > .form-hint { grid-column: 1 / -1; margin: 0; }
.addon-pricing-hint { color: #7186a0; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.addon-pricing-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; padding: 0 24px 24px; }
.addon-pricing-form .form-actions { grid-column: auto; align-self: end; }
.addon-pricing-form .button { white-space: nowrap; }
.empty-state { margin: 0; padding: 0 24px 24px; color: var(--muted); font-size: 11px; }
.selectable-package { transition: .18s ease; }
.selectable-package:hover { border-color: #5592f2; box-shadow: 0 0 0 3px rgba(85, 146, 242, .12); }
.page-tabs { display: flex; gap: 7px; margin: 0 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #f5f7fb; }
.page-tab { border: 0; border-radius: 7px; padding: 10px 14px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.page-tab.active { color: var(--primary); background: #fff; box-shadow: 0 2px 8px rgba(22, 42, 72, .08); }
.tab-panel[hidden] { display: none; }
.purchase-member-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; border-color: #dfe8f3; background: #edf3fa; }
.purchase-member-tabs .page-tab { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 14px; text-align: left; }
.purchase-member-tabs .page-tab > span:last-child { display: grid; gap: 2px; min-width: 0; }
.purchase-member-tabs .page-tab strong { color: #536a84; font-size: 11px; }
.purchase-member-tabs .page-tab small { color: #96a5b6; font-size: 9px; font-weight: 500; }
.purchase-member-tabs .page-tab.active strong { color: var(--primary); }
.page-tab-number { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #d6e1ee; border-radius: 8px; color: #8293a7; background: #f7fafe; font-size: 9px; font-weight: 800; }
.purchase-member-tabs .page-tab.active .page-tab-number { border-color: #bdd2f7; color: var(--primary); background: #eaf2ff; }
.purchase-settings-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; padding: 6px; border-color: #dfe8f3; background: #edf3fa; }
.purchase-settings-tabs .page-tab { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 11px; text-align: left; }
.purchase-settings-tabs .page-tab > span:last-child { display: grid; gap: 2px; min-width: 0; }
.purchase-settings-tabs .page-tab strong { overflow: hidden; color: #536a84; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.purchase-settings-tabs .page-tab small { overflow: hidden; color: #96a5b6; font-size: 8px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.purchase-settings-tabs .page-tab.active strong { color: var(--primary); }
.purchase-settings-tabs .page-tab.active .page-tab-number { border-color: #bdd2f7; color: var(--primary); background: #eaf2ff; }
.purchase-settings-panel { overflow: hidden; }
.domain-tools-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; padding: 6px; border-color: #dfe8f3; background: #edf3fa; }
.domain-tools-tabs .page-tab { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 14px; text-align: left; }
.domain-tools-tabs .page-tab > span:last-child { display: grid; gap: 2px; min-width: 0; }
.domain-tools-tabs .page-tab strong { color: #536a84; font-size: 11px; }
.domain-tools-tabs .page-tab small { color: #96a5b6; font-size: 9px; font-weight: 500; }
.domain-tools-tabs .page-tab.active strong { color: var(--primary); }
.domain-tools-tabs .page-tab.active .page-tab-number { border-color: #bdd2f7; color: var(--primary); background: #eaf2ff; }
.manual-results { display: grid; gap: 10px; max-height: 520px; overflow-y: auto; }
.manual-result-item { padding-bottom: 10px; border-bottom: 1px solid #edf1f5; }
.manual-result-item:last-child { padding-bottom: 0; border-bottom: 0; }
.manual-result-item .result-title { margin-bottom: 8px; }
.purchase-step-panel { overflow: hidden; }
.step-badge { display: inline-flex; flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; color: #627a95; background: #f1f5f9; font-size: 9px; font-weight: 700; }
.purchase-access-note { display: flex; align-items: center; gap: 12px; margin: 0 24px 24px; padding: 14px 16px; border: 1px solid #dbe7fb; border-radius: 10px; color: #52677f; background: #f5f8ff; font-size: 11px; }
.purchase-access-note strong { color: #314c70; }
.purchase-access-note span { flex: 1; color: var(--muted); font-size: 10px; }
.purchase-access-note .mini-button { flex: 0 0 auto; }
.qris-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.qris-preview, .qris-member { display: block; width: min(100%, 190px); aspect-ratio: 1; object-fit: contain; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qris-member { margin-top: 9px; width: min(100%, 230px); }
.proof-form { display: grid; gap: 5px; margin-top: 7px; }
.proof-form input { max-width: 170px; color: #718399; font-size: 10px; }
.purchase-confirm-note { margin-bottom: 6px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.purchase-list { display: grid; gap: 10px; padding: 0 24px 24px; }
.purchase-card { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.purchase-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.purchase-card-label { display: block; margin-bottom: 5px; color: #9aa8b7; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.purchase-card-head strong { color: #2a3e57; font-size: 14px; }
.purchase-card-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; margin-top: 15px; padding-top: 13px; border-top: 1px solid #e8edf3; }
.purchase-card-details span { display: block; margin-bottom: 4px; color: #9aa8b7; font-size: 10px; }
.purchase-card-details strong { display: block; color: #53677e; font-size: 11px; }
.purchase-card-details small { display: block; margin-top: 3px; color: #9aa8b7; font-size: 10px; }
.purchase-card-total { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.purchase-inline-payment { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; margin-left: auto; }
.purchase-inline-payment > span { margin: 0; color: #9aa8b7; font-size: 10px; white-space: nowrap; }
.purchase-card-note { margin: 12px 0 0; padding: 9px 11px; border-radius: 8px; color: #9a6e25; background: #fff9e9; font-size: 10px; line-height: 1.45; }
.purchase-card-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.purchase-card { display: grid; grid-template-columns: minmax(170px, 1.35fr) repeat(3, minmax(110px, 1fr)) auto; align-items: center; gap: 16px; padding: 14px 16px; }
.purchase-card-head, .purchase-card-details { display: contents; }
.purchase-card-details { margin: 0; padding: 0; border: 0; }
.purchase-card-head > div:not(.purchase-card-status) { order: 1; }
.purchase-card-details > div:nth-child(1) { order: 2; }
.purchase-card-details > div:nth-child(2) { order: 3; }
.purchase-card-details > div:nth-child(3) { order: 4; }
.purchase-card-head > .purchase-card-status { display: grid; justify-items: start; gap: 5px; order: 5; justify-self: start; }
.purchase-card-field-label { color: #9aa8b7; font-size: 10px; }
.purchase-card-note { grid-column: 1 / -1; order: 6; }
.purchase-inline-payment { align-items: flex-end; }
.quota-inline { display: flex; align-items: stretch; gap: 0; padding: 0 24px; border-top: 1px solid var(--line); }
.quota-inline span { flex: 1; display: grid; gap: 4px; padding: 15px 18px 14px 0; }
.quota-inline span + span { padding-left: 18px; border-left: 1px solid var(--line); }
.quota-inline strong { color: #21334b; font-size: 12px; }
.quota-inline small { color: var(--muted); font-size: 10px; }
.payment-proof-form { display: grid; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.payment-proof-status { margin: 10px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 31, 50, .58); }
.modal-card { position: relative; width: min(100%, 450px); max-height: min(90vh, 720px); overflow: auto; padding: 25px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 25px 70px rgba(17, 31, 50, .25); }
.modal-card h2 { margin: 0 0 15px; color: #21334b; font-size: 20px; }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; color: #718399; background: transparent; font-size: 25px; line-height: 1; }
.payment-modal-content { margin: 10px 0 15px; padding: 15px; border: 1px solid #dbe7fb; border-radius: 10px; color: #52677f; background: #f5f8ff; font-size: 12px; line-height: 1.55; }
.payment-modal-content p { margin: 5px 0 0; }
.payment-modal-instructions { margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.qris-modal { display: block; width: min(100%, 280px); margin: 12px auto 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.proof-modal-card { width: min(100%, 780px); }
.proof-frame { display: block; width: 100%; height: min(68vh, 620px); border: 1px solid var(--line); border-radius: 9px; background: #f5f7fb; }
.purchase-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid #dbe7fb; border-radius: 10px; color: #52677f; background: #f5f8ff; font-size: 11px; }
.purchase-total strong { color: var(--primary); font-size: 18px; }

@media (max-width: 980px) {
    .sidebar { width: 210px; flex-basis: 210px; }
    .settings-layout { grid-template-columns: 1fr 1fr; }
    .settings-card:last-of-type { grid-column: span 2; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .checks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .check-panel { min-height: 0; }
}
@media (max-width: 860px) {
    .checks-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .sidebar { position: fixed; z-index: 30; top: 0; left: 0; height: 100vh; transform: translateX(-100%); transition: .22s; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close, .menu-toggle { display: block; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(17, 31, 50, .38); }
    .sidebar-overlay.show { display: block; }
    .topbar { min-height: 82px; padding: 17px 18px; }
    .topbar h1 { font-size: 21px; }
    .topbar-right .local-badge { display: none; }
    .page-content, .page-footer { width: calc(100% - 36px); }
    .page-content { padding-top: 20px; }
    .page-footer { flex-direction: column; padding-top: 18px; }
    .stat-grid, .grid-2, .checks-grid { grid-template-columns: 1fr; }
    .checks-grid > .panel:last-child { grid-column: auto; }
    .quick-grid { grid-template-columns: 1fr 1fr; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-tabs { margin-right: 16px; margin-left: 16px; }
    .settings-tabs .page-tab { padding: 9px 8px; }
    .settings-tabs .page-tab small { display: none; }
    .settings-card:last-of-type { grid-column: auto; }
    .toolbar { flex-direction: column; }
    .select { width: 100%; }
    .rank-search { width: 100%; }
    .purchase-list { padding: 0 16px 18px; }
    .purchase-member-tabs { gap: 4px; padding: 4px; }
    .purchase-member-tabs .page-tab { justify-content: center; gap: 6px; padding: 9px 5px; }
    .purchase-member-tabs .page-tab small { display: none; }
    .purchase-member-tabs .page-tab-number { width: 22px; height: 22px; border-radius: 6px; font-size: 8px; }
    .purchase-settings-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .purchase-settings-tabs .page-tab { padding: 9px 8px; }
    .domain-tools-tabs { gap: 4px; padding: 4px; }
    .domain-tools-tabs .page-tab { justify-content: center; gap: 6px; padding: 9px 5px; }
    .domain-tools-tabs .page-tab small { display: none; }
    .domain-tools-tabs .page-tab-number { width: 22px; height: 22px; border-radius: 6px; font-size: 8px; }
    .package-grid { grid-template-columns: minmax(0, 1fr); }
    .purchase-access-note { align-items: flex-start; flex-wrap: wrap; }
    .purchase-access-note span { flex-basis: calc(100% - 12px); }
    .purchase-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .purchase-card-head > div:not(.purchase-card-status) { grid-column: 1; }
    .purchase-card-head > .purchase-card-status { grid-column: 2; }
    .purchase-card-details > div:nth-child(3) { grid-column: 1 / -1; }
    .purchase-inline-payment { align-items: flex-end; }
    .addon-purchase-form { grid-template-columns: 1fr 1fr; }
    .addon-action-group { grid-column: 1 / -1; justify-self: start; }
    .addon-pricing-form { grid-template-columns: 1fr; }
    .addon-pricing-form .form-actions { grid-column: auto; justify-self: start; }
    .quota-inline { padding: 0 16px; }
    .quota-inline span { padding-right: 12px; }
    .quota-inline span + span { padding-left: 12px; }
    .rank-list-head { align-items: stretch; }
    .rank-list-actions { width: 100%; flex-direction: column; }
    .rank-list-actions .rank-search { width: 100%; }
    .rank-list-actions .button { width: 100%; }
    .check-head { min-height: 0; }
    .result-box { margin-bottom: 18px; }
}
@media (max-width: 430px) {
    .purchase-settings-tabs { grid-template-columns: 1fr; }
    .domain-tools-tabs { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: 1fr; }
}
