html { height:100%; }
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family:'Tahoma','Segoe UI',sans-serif;
    background:#222831;
    min-height:100vh;
    color:#EEEEEE;
    font-size:15px;
}
body.auth-page {
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
}
body.dash-page {
    padding:0;
}
a { color:inherit; }

.card {
    background:#393E46;
    border:1px solid #4a5259;
    border-radius:20px;
    padding:40px 28px;
    max-width:420px;
    width:100%;
    text-align:center;
    box-shadow:0 12px 50px rgba(0,0,0,0.5);
}
.card-wide {
    max-width:460px;
}
.card-sm {
    max-width:380px;
    padding:32px 28px;
}

.logo {
    width:80px; height:80px; border-radius:50%;
    background:#0092CA;
    display:flex; align-items:center; justify-content:center;
    margin:0 auto 20px; font-size:34px; color:#fff;
    box-shadow:0 4px 20px rgba(0,146,202,0.3);
}

h1 { color:#fff; font-size:24px; margin-bottom:6px; letter-spacing:1px; }
h1.center { text-align:center; }
p { color:#b0b8c0; font-size:13px; margin-bottom:28px; line-height:1.7; }
p.center { text-align:center; }

.form-group { margin-bottom:18px; text-align:right; }
.form-group label { display:block; color:#EEEEEE; font-size:13px; margin-bottom:6px; }
.form-group input, .form-group select {
    width:100%; padding:15px 16px;
    border:2px solid #4a5259; border-radius:14px;
    background:#222831; color:#fff; font-size:16px;
    font-family:inherit; outline:none; transition:border-color .2s;
}
.form-group select option { background:#393E46; color:#fff; }
.form-group input:focus, .form-group select:focus { border-color:#0092CA; box-shadow:0 0 0 3px rgba(0,146,202,0.15); }
.form-group input::placeholder { color:#6a727a; }
.form-group input.code-input {
    text-align:center; letter-spacing:10px; font-size:24px;
}

.btn {
    width:100%; padding:16px;
    background:#0092CA; color:#fff; border:none; border-radius:14px;
    font-size:16px; font-family:inherit; cursor:pointer;
    transition:transform .15s, box-shadow .15s;
    box-shadow:0 4px 20px rgba(0,146,202,0.3);
    font-weight:bold;
}
.btn:hover { transform:translateY(-2px); box-shadow:0 8px 30px rgba(0,146,202,0.4); }
.btn:active { transform:translateY(0); }

.btn-secondary {
    display:inline-block; padding:12px 28px;
    background:rgba(0,146,202,0.12); color:#0092CA;
    border:1px solid rgba(0,146,202,0.25); border-radius:12px;
    font-size:14px; font-family:inherit; cursor:pointer; text-decoration:none; transition:all .2s;
}
.btn-secondary:hover { background:rgba(0,146,202,0.2); }

.error {
    background:rgba(206,38,38,0.12); color:#CE2626;
    padding:12px; border-radius:12px; font-size:13px; margin-bottom:16px;
    border:1px solid rgba(206,38,38,0.2);
}

.note { color:#6a727a; font-size:12px; margin-top:16px; }

.back-link {
    color:#6a727a; font-size:13px; text-decoration:none; transition:color .2s;
}
.back-link:hover { color:#0092CA; }

.admin-link {
    color:#6a727a; font-size:12px; text-decoration:none;
    position:fixed; bottom:16px; left:50%; transform:translateX(-50%);
    transition:color .2s;
}
.admin-link:hover { color:#0092CA; }

.dev-code {
    background:rgba(0,146,202,0.1); border:1px solid #0092CA;
    color:#0092CA; padding:12px; border-radius:12px; font-size:18px;
    margin-bottom:16px; font-weight:bold; letter-spacing:4px; direction:ltr;
}

/* Dashboard */
.header {
    background:#393E46; border-bottom:1px solid #4a5259;
    padding:14px 20px; display:flex; align-items:center; justify-content:space-between;
    position:sticky; top:0; z-index:10; box-shadow:0 2px 15px rgba(0,0,0,0.3);
}
.header h2 { color:#fff; font-size:16px; }
.header a {
    color:#b0b8c0; font-size:13px; text-decoration:none;
    padding:8px 16px; border-radius:10px;
    background:rgba(0,0,0,0.2); transition:all .2s;
}
.header a:hover { color:#fff; background:#0092CA; }

.container { max-width:640px; margin:0 auto; padding:16px; }
.container-wide { max-width:960px; }

.section { margin-bottom:24px; }
.section-title {
    color:#6a727a; font-size:13px; margin-bottom:12px; padding:0 4px;
    display:flex; justify-content:space-between;
}
.section-title .count { color:#6a727a; font-size:11px; }

.sub-card {
    background:#393E46; border:1px solid #4a5259;
    border-radius:16px; padding:18px; margin-bottom:12px;
    box-shadow:0 4px 20px rgba(0,0,0,0.2);
}
.sub-card.active { border-color:#00c853; background:rgba(0,200,83,0.06); }
.sub-card.expired { opacity:0.55; }
.sub-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.sub-name { color:#fff; font-size:15px; font-weight:bold; }
.sub-status { font-size:11px; padding:4px 14px; border-radius:20px; font-weight:bold; }
.sub-status.active { background:rgba(0,200,83,0.15); color:#00c853; }
.sub-status.expired { background:rgba(206,38,38,0.15); color:#CE2626; }
.sub-info { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.sub-info-item { color:#b0b8c0; font-size:12px; }
.sub-info-item strong { color:#fff; display:block; font-size:14px; margin-bottom:2px; }
.sub-link {
    display:inline-flex; align-items:center; gap:6px;
    margin-top:12px; padding:9px 20px;
    background:rgba(0,146,202,0.12); color:#0092CA;
    border:1px solid rgba(0,146,202,0.25); border-radius:10px;
    font-size:13px; text-decoration:none; cursor:pointer; transition:background .2s;
}
.sub-link:hover { background:rgba(0,146,202,0.2); }

.btn-buy {
    display:block; width:100%; text-align:center; padding:16px;
    background:#0092CA; color:#fff; border:none; border-radius:14px;
    font-size:16px; font-family:inherit; cursor:pointer; text-decoration:none;
    font-weight:bold;
    box-shadow:0 4px 20px rgba(0,146,202,0.3);
    transition:transform .15s, box-shadow .15s; margin-bottom:24px;
}
.btn-buy:hover { transform:translateY(-2px); box-shadow:0 8px 30px rgba(0,146,202,0.4); }

.pay-item {
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 0; border-bottom:1px solid rgba(255,255,255,0.05);
}
.pay-item:last-child { border-bottom:none; }
.pay-info { color:#b0b8c0; font-size:12px; }
.pay-info strong { color:#fff; display:block; font-size:14px; margin-bottom:2px; }
.pay-status { font-size:11px; padding:3px 12px; border-radius:12px; font-weight:bold; }
.pay-status.verified { background:rgba(0,200,83,0.15); color:#00c853; }
.pay-status.pending { background:rgba(255,193,7,0.15); color:#ffc107; }
.pay-status.failed { background:rgba(206,38,38,0.15); color:#CE2626; }
.hist-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid #1e2430; }
.hist-row:last-child { border:none; }
.hist-main { display:flex; flex-direction:column; gap:2px; }
.hist-amount { font-size:14px; font-weight:bold; color:#fff; }
.hist-amount small { font-size:11px; font-weight:normal; opacity:0.6; }
.hist-product { font-size:11px; color:#6a727a; }
.hist-meta { text-align:left; display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.hist-date { font-size:10px; color:#6a727a; }
.hist-badge { font-size:10px; padding:2px 10px; border-radius:10px; font-weight:bold; }
.hist-badge.verified { background:rgba(0,200,83,0.12); color:#00c853; }
.hist-badge.awaiting_approval { background:rgba(255,193,7,0.12); color:#ffc107; }
.hist-badge.notified { background:rgba(255,193,7,0.12); color:#ffc107; }
.hist-badge.cancelled { background:rgba(255,152,0,0.12); color:#ff9800; }
.hist-badge.failed { background:rgba(206,38,38,0.12); color:#e53935; }
.hist-badge.pending { background:rgba(255,193,7,0.12); color:#ffc107; }

.empty { text-align:center; padding:40px 0; color:#6a727a; font-size:13px; }
.user-info { color:#6a727a; font-size:12px; }
.user-info strong { color:#fff; }

/* Buy page */
.subtitle { color:#b0b8c0; font-size:13px; text-align:center; margin-bottom:28px; }
.price-box {
    background:rgba(0,146,202,0.06); border:1px solid #0092CA;
    border-radius:14px; padding:18px; text-align:center; margin-bottom:20px;
}
.price-box .total { color:#fff; font-size:30px; font-weight:bold; }
.price-box .total small { font-size:14px; opacity:0.7; }
.price-box .label { color:#6a727a; font-size:12px; margin-top:4px; }
.price-breakdown { color:#6a727a; font-size:12px; margin-top:4px; }

/* Result page */
.icon-big {
    width:80px; height:80px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    margin:0 auto 20px; font-size:36px;
}
.icon-big.success { background:rgba(0,200,83,0.15); color:#00c853; }
.icon-big.error { background:rgba(206,38,38,0.15); color:#CE2626; }
.icon-big.wait { background:rgba(255,193,7,0.15); color:#ffc107; }

.info-box {
    background:rgba(0,200,83,0.06); border:1px solid rgba(0,200,83,0.2);
    border-radius:14px; padding:16px; margin-bottom:16px; text-align:right;
}
.info-box p { margin-bottom:4px; font-size:13px; color:#b0b8c0; }
.info-box strong { color:#fff; }
.info-box span { color:#b0b8c0; }

/* Subscribe page */
.info-card {
    background:rgba(0,200,83,0.06); border:1px solid rgba(0,200,83,0.2);
    border-radius:12px; padding:16px; margin-bottom:16px;
    font-size:13px; color:#b0b8c0;
}
.info-card strong { color:#fff; display:block; margin-bottom:4px; }

.link-box {
    background:#222831; border:1px solid #4a5259; border-radius:12px;
    padding:16px; margin-bottom:16px; word-break:break-all;
    direction:ltr; text-align:left; color:#EEEEEE;
    font-size:13px; line-height:1.6;
    max-height:300px; overflow-y:auto; white-space:pre-wrap;
}
.copy-btn {
    width:100%; padding:14px;
    background:rgba(0,146,202,0.12); color:#0092CA;
    border:1px solid rgba(0,146,202,0.25); border-radius:12px;
    font-size:14px; font-family:inherit; cursor:pointer;
    transition:background .2s; margin-bottom:12px;
}
.copy-btn:hover { background:rgba(0,146,202,0.2); }
.qr-box { text-align:center; margin-bottom:16px; }
.qr-box canvas, .qr-box img { max-width:180px; border-radius:12px; }

/* Admin panel */
.admin-header {
    background:#393E46; border-bottom:1px solid #4a5259;
    padding:14px 20px; display:flex; align-items:center; justify-content:space-between;
    position:sticky; top:0; z-index:10; box-shadow:0 2px 15px rgba(0,0,0,0.3);
}
.admin-header h1 { font-size:16px; margin:0; }
.admin-header-links { display:flex; gap:10px; }
.admin-header-links a {
    color:#b0b8c0; font-size:12px; text-decoration:none;
    padding:4px 12px; border-radius:8px;
    background:rgba(0,0,0,0.2); transition:all .2s;
}
.admin-header-links a:hover, .admin-header-links a.active { color:#fff; background:#0092CA; }

.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; margin-bottom:24px; }
.stat-box {
    background:#393E46; border:1px solid #4a5259; border-radius:14px;
    padding:16px; text-align:center; box-shadow:0 2px 12px rgba(0,0,0,0.15);
}
.stat-box .num { font-size:24px; font-weight:bold; color:#0092CA; }
.stat-box .num.green { color:#00c853; }
.stat-box .num.yellow { color:#ffc107; }
.stat-box .num.red { color:#CE2626; }
.stat-box .lbl { font-size:11px; color:#6a727a; margin-top:4px; }

.filter-bar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.filter-bar a {
    padding:6px 14px; border-radius:8px; font-size:12px; text-decoration:none;
    color:#b0b8c0; background:#393E46; border:1px solid #4a5259; transition:all .2s;
}
.filter-bar a.active, .filter-bar a:hover { color:#fff; background:#0092CA; border-color:#0092CA; }
.filter-bar form { display:flex; gap:6px; align-items:center; }
.filter-bar select, .filter-bar input {
    padding:6px 10px; border-radius:8px; border:1px solid #4a5259;
    background:#222831; color:#fff; font-size:12px;
}

.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:12px; min-width:500px; }
th {
    text-align:right; color:#6a727a; font-weight:normal;
    padding:8px 4px; border-bottom:1px solid #4a5259; font-size:11px;
}
td { padding:8px 4px; border-bottom:1px solid rgba(255,255,255,0.04); color:#b0b8c0; }
.badge { font-size:10px; padding:3px 10px; border-radius:12px; font-weight:bold; }
.badge.green { background:rgba(0,200,83,0.15); color:#00c853; }
.badge.red { background:rgba(206,38,38,0.15); color:#CE2626; }
.badge.yellow { background:rgba(255,193,7,0.15); color:#ffc107; }
.actions a {
    color:#0092CA; text-decoration:none; margin-left:6px;
    font-size:11px; transition:color .2s;
}
.actions a:hover { text-decoration:underline; color:#00b5f5; }
.actions a.danger { color:#CE2626; }
.actions a.danger:hover { color:#ff4444; }

.msg {
    background:rgba(0,200,83,0.12); color:#00c853;
    padding:8px 14px; border-radius:8px; font-size:12px;
    margin-bottom:14px; border:1px solid rgba(0,200,83,0.2);
}

.chart { display:flex; gap:6px; align-items:end; height:120px; padding:10px 0; }
.chart-bar {
    flex:1; border-radius:4px 4px 0 0; min-height:4px;
    background:#0092CA; position:relative; transition:height .3s;
}
.chart-bar:hover { opacity:0.7; }
.chart-label { font-size:9px; color:#6a727a; text-align:center; margin-top:4px; }

.tabs { display:flex; gap:4px; margin-bottom:16px; }
.tab {
    padding:8px 16px; border-radius:8px; font-size:12px; text-decoration:none;
    color:#b0b8c0; background:#393E46; border:1px solid #4a5259; transition:all .2s;
}
.tab.active, .tab:hover { color:#fff; background:#0092CA; border-color:#0092CA; }

/* Responsive */
@media(max-width:600px) {
    .stats-grid { grid-template-columns:repeat(2,1fr); }
    .table-wrap { overflow-x:auto; }
    table { font-size:11px; }
    .header, .admin-header { flex-direction:column; gap:8px; }
    .header-links, .admin-header-links { flex-wrap:wrap; }
}
/* Settings accordion */
.setting-group {
    background:#1e2430; border-radius:14px;
    margin-bottom:14px; border:1px solid #2a313a;
    overflow:hidden; transition:all .2s;
}
.setting-group-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 18px; cursor:pointer; user-select:none;
    transition:background .2s;
}
.setting-group-header:hover { background:#252d38; }
.setting-group-header h3 { font-size:14px; color:#EEEEEE; display:flex; align-items:center; gap:8px; margin:0; }
.setting-group-header .toggle-icon {
    font-size:12px; color:#6a727a; transition:transform .3s;
}
.setting-group.open .toggle-icon { transform:rotate(180deg); }
.setting-group-body { padding:0 18px; max-height:0; overflow:hidden; transition:max-height .4s ease, padding .3s ease; }
.setting-group:hover .setting-group-body,
.setting-group.open .setting-group-body { max-height:2000px; padding:0 18px 18px; }
.setting-group-body .form-group:last-child { margin-bottom:0; }
.settings-save-btn { margin-top:10px; width:100%; padding:14px; background:#cacaca; color:#222; border:none; border-radius:10px; font-size:15px; cursor:pointer; font-weight:bold; transition:all .2s; }
.settings-save-btn:hover { background:#fff; }

.panel-form-wrap { margin-top:12px; border-top:1px solid #2a313a; }
.panel-form-toggle {
    padding:12px 14px; cursor:pointer;
    color:#0092CA; font-size:14px; font-weight:bold; border-radius:10px;
    transition:background .2s;
}
.panel-form-toggle:hover { background:#11151a; }
.panel-form-body { max-height:0; overflow:hidden; transition:max-height .35s ease; }
.panel-form-wrap:hover .panel-form-body,
.panel-form-wrap.open .panel-form-body { max-height:600px; }
.panel-form-body form { padding:10px 12px 12px; }
.pf-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.pf-row label { font-size:12px; color:#b0b8c0; min-width:85px; text-align:right; flex-shrink:0; }
.pf-row input, .pf-row select { flex:1; padding:8px 10px; font-size:13px; border-radius:6px; border:1px solid #4a5259; background:#222831; color:#fff; outline:none; transition:border-color .2s; }
.pf-row input:focus, .pf-row select:focus { border-color:#0092CA; }
.pf-row select option { background:#393E46; color:#fff; }

.support-fab {
    position:absolute; bottom:56px; right:8px; z-index:50;
    width:40px; height:40px; border-radius:50%;
    background:#0092ca; color:#fff;
    border:none; cursor:pointer;
    box-shadow:0 3px 14px rgba(0,146,202,0.35);
    transition:transform .15s, box-shadow .15s;
    display:flex; align-items:center; justify-content:center; text-decoration:none;
}
.support-fab:hover { transform:scale(1.1); box-shadow:0 4px 20px rgba(0,146,202,0.45); }
@media(max-width:480px) {
    .card, .card-wide, .card-sm { padding:24px 16px; }
    .sub-info { grid-template-columns:1fr; }
    .header { padding:12px 16px; }
    .container { padding:12px; }
    .link-box { font-size:12px; }
}

/* App Layout (Mobile-first) */
body.app-mode { background:#0a0e14; display:flex; justify-content:center; margin:0; height:100%; min-height:0; overflow:hidden; }
.app-screen { width:100%; max-width:480px; height:100vh; height:100dvh; overflow:hidden; display:flex; flex-direction:column; background:#12161c; box-shadow:0 0 30px rgba(0,0,0,0.4); position:relative; }
.app-header { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; background:#12161c; border-bottom:1px solid #1e2430; min-height:44px; }
.app-header .title { text-align:center; font-size:17px; font-weight:bold; color:#e0e0e0; }
.app-header .back-arrow { color:#b0b8c0; font-size:26px; text-decoration:none; padding:2px 8px; border-radius:8px; line-height:1; }
.app-header .back-arrow:hover { background:rgba(255,255,255,0.06); }
.app-header .logout-btn { color:#e53935; font-size:20px; text-decoration:none; padding:6px 10px; border-radius:8px; }
.app-header .logout-btn:hover { background:rgba(229,57,53,0.1); }
.app-content { flex:1; overflow-y:auto; padding:12px 16px; min-height:0; font-size:14px; }
.app-content .section { margin-bottom:14px; }
.app-content .section-title { font-size:14px; margin-bottom:8px; }
.app-content .sub-card { padding:10px 12px; margin-bottom:8px; border-radius:10px; }
.app-content .sub-card-top { margin-bottom:4px; }
.app-content .sub-name { font-size:14px; }
.app-content .sub-status { font-size:11px; padding:3px 12px; }
.app-content .sub-info { gap:2px 8px; }
.app-content .sub-info-item { padding:1px 0; font-size:12px; }
.app-content .sub-info-item strong { font-size:13px; margin-bottom:0; display:inline; margin-left:4px; }
.app-content .sub-link { margin-top:8px; padding:6px 16px; font-size:13px; border-radius:6px; }
.app-content .empty { padding:20px; font-size:14px; }
.app-nav { display:flex; align-items:flex-end; background:#0d1117; border-top:1px solid #1e2430; padding:6px 0 4px; padding-bottom:max(4px, env(safe-area-inset-bottom)); }
.app-nav .nav-item { flex:1; text-align:center; color:#6a727a; text-decoration:none; font-size:12px; padding:4px 0; transition:color 0.2s; }
.app-nav .nav-item.active { color:#0092ca; }
.app-nav .nav-item .nav-icon { font-size:22px; display:block; margin-bottom:2px; }
.buy-glass { display:flex; align-items:center; justify-content:center; gap:8px; padding:14px; margin:8px 12px; border-radius:12px; background:rgba(255,255,255,0.07); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); border:1px solid rgba(255,255,255,0.12); color:#e0e0e0; font-size:15px; font-weight:bold; text-decoration:none; transition:all 0.15s; }
.buy-glass:hover { background:rgba(255,255,255,0.12); border-color:rgba(255,255,255,0.2); }
