/* Givaweb Encoder — Panel UI (auth, wallet, admin) */

:root {
    --panel3: #213149;
    --ok: #4fd39a;
    --warn: #e5a84b;
    --danger: #ff6b7d;
    --info: #7fa2ff;
    --radius: 14px;
}

a { color: #9db1ff; }
a:hover { color: #c3d0ff; }
code { background: #ffffff10; padding: 2px 6px; border-radius: 5px; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }
.mt { margin-top: 14px; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 20px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s, background .15s, border-color .15s;
    line-height: 1.4;
}
.btn.primary { background: linear-gradient(100deg, #5375e7, #718eff); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.ghost { background: #ffffff08; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: #ffffff12; color: var(--text); }
.btn.danger { background: #ff6b7d22; border-color: #ff6b7d44; color: #ffb3bd; }
.btn.sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.link-sm { font-size: 12px; text-decoration: none; }

/* ---------- Topbar ---------- */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.wallet-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 13px; border-radius: 30px;
    background: #4fd39a14; border: 1px solid #4fd39a33;
    color: #9ff0c9; text-decoration: none; font-size: 12px;
}
.wallet-chip svg { width: 17px; height: 17px; }
.wallet-chip:hover { background: #4fd39a22; color: #c2ffe2; }

.user-menu { position: relative; }
.user-menu summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    padding: 4px 6px 4px 10px; border-radius: 30px;
    border: 1px solid var(--border); background: #ffffff06;
    font-size: 12px; user-select: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(140deg, #7797ff, #4564dc);
    color: #fff; font-weight: 800; font-size: 13px;
}
.caret { color: var(--muted); font-size: 10px; }
.user-menu .menu {
    position: absolute; left: 0; top: calc(100% + 8px);
    min-width: 220px; z-index: 50;
    background: #1a2740; border: 1px solid var(--border);
    border-radius: 12px; padding: 6px;
    box-shadow: 0 18px 50px #0008;
}
.menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head strong, .menu-head small { display: block; }
.menu-head small { color: var(--muted); font-size: 11px; margin-top: 3px; text-align: left; }
.user-menu .menu a, .user-menu .menu button {
    display: block; width: 100%; text-align: right;
    padding: 9px 10px; border-radius: 8px;
    color: var(--text); text-decoration: none;
    font: inherit; font-size: 12px;
    background: none; border: 0; cursor: pointer;
}
.user-menu .menu a:hover, .user-menu .menu button:hover { background: #ffffff0d; }
.user-menu .menu .menu-admin { color: #9db1ff; }
.user-menu .menu button { color: #ff9aa7; }

/* ---------- Alerts ---------- */
.alert {
    border-radius: 10px; padding: 11px 14px; margin: 0 0 14px;
    font-size: 12px; line-height: 1.9; border: 1px solid;
}
.alert-success { color: #9ff0c9; background: #4fd39a12; border-color: #4fd39a33; }
.alert-error { color: #ffb3bd; background: #ff6b7d12; border-color: #ff6b7d33; }
.alert-warning { color: #f3cf8e; background: #e5a84b12; border-color: #e5a84b33; }
.alert-info { color: #bccbff; background: #7fa2ff12; border-color: #7fa2ff33; }
.alert a { color: inherit; font-weight: 700; }
.site-notice { margin-bottom: 18px; }
.main > .alert:first-child { margin-top: 22px; }

/* ---------- Auth ---------- */
.auth-wrap {
    min-height: calc(100vh - 76px - 65px);
    display: grid; place-items: center;
    padding: 40px 16px;
}
.auth-card {
    width: min(100%, 460px);
    background: linear-gradient(145deg, #1b2940, #172235);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px 28px;
    box-shadow: 0 25px 80px #00000035;
}
.auth-card.center { text-align: center; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1, .auth-card h1 { font-size: 20px; margin: 10px 0 6px; }
.auth-head p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.9; }
.auth-icon {
    width: 50px; height: 50px; margin: auto;
    display: grid; place-items: center;
    border-radius: 15px; background: #718eff1c; color: #92aaff;
}
.auth-icon svg { width: 25px; height: 25px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 20px 0 0; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; font-size: 12px; position: relative; }
.field > span:first-child { color: #c6d0e2; font-weight: 600; }
.field-row { display: flex; justify-content: space-between; align-items: center; }
.field input, .field select, .field textarea,
.filters input, .filters select, .inline-filter select {
    width: 100%;
    background: #0f1a2b;
    border: 1px solid #2d3d58;
    border-radius: 10px;
    color: var(--text);
    padding: 11px 13px;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.8; }
.field input:focus, .field select:focus, .field textarea:focus,
.filters input:focus, .filters select:focus {
    border-color: #6b88ff;
    box-shadow: 0 0 0 3px #6387ff22;
}
.field input[dir="ltr"] { text-align: left; }
.field.has-error input, .field.has-error select { border-color: #ff6b7d88; }
.field-error { color: #ff9aa7; font-size: 11px; display: block; }
.hint { color: var(--muted); font-size: 11px; }
.hint.bad { color: #ff9aa7; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-left: 42px; }
.pass-toggle {
    position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; cursor: pointer; opacity: .5;
    font-size: 15px; padding: 6px;
}
.pass-toggle.on { opacity: 1; }
.strength { height: 4px; background: #ffffff0d; border-radius: 4px; overflow: hidden; display: block; }
.strength i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; background: var(--danger); }
.strength i[data-level="mid"] { background: var(--warn); }
.strength i[data-level="strong"] { background: var(--ok); }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: #c6d0e2; cursor: pointer; line-height: 1.8; }
.check input { margin-top: 5px; accent-color: #6387ff; width: 15px; height: 15px; flex: none; }
.check.has-error { color: #ff9aa7; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.grid-3 .form-actions { grid-column: 1 / -1; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- Layout: account & admin ---------- */
.main.wide { width: min(100% - 36px, 1080px); padding-bottom: 40px; }
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 15px; flex-wrap: wrap; margin: 32px 0 20px;
}
.page-head h1 { margin: 0; font-size: 22px; }
.tabs { display: flex; gap: 4px; background: #ffffff06; border: 1px solid var(--border); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: #6387ff22; color: #c3d0ff; }

.card {
    background: linear-gradient(145deg, #1b2940, #172235);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
}
.card-title { font-size: 15px; margin: 0 0 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }
.grid-side { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.grid-side > .card, .grid-2 > .card { margin-bottom: 0; }
.grid-side, .layout-admin .grid-2 { margin-bottom: 18px; }
.stack { display: grid; gap: 18px; }
.stack .card { margin: 0; }
.info-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #ffffff12; font-size: 12px; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 13px; display: grid; gap: 14px; justify-items: center; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
    text-align: right; color: var(--muted); font-weight: 600;
    padding: 10px 10px; border-bottom: 1px solid var(--border);
    white-space: nowrap; font-size: 11px;
}
.table td { padding: 12px 10px; border-bottom: 1px solid #ffffff0a; vertical-align: middle; }
.table tbody tr:hover td { background: #ffffff04; }
.table.compact td { padding: 9px 6px; }
.table a { text-decoration: none; }
.amount-pos { color: var(--ok); font-weight: 700; direction: ltr; unicode-bidi: embed; }
.amount-neg { color: #ff9aa7; font-weight: 700; direction: ltr; unicode-bidi: embed; }
.file-tag { display: inline-block; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: #667ff022; color: #9bb0ff; margin-left: 6px; }
.file-name { word-break: break-all; }
.row-error { display: block; color: #ff9aa7; font-size: 11px; margin-top: 4px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge-success { background: #4fd39a1c; color: #8fe9be; }
.badge-danger { background: #ff6b7d1c; color: #ffa0ac; }
.badge-warning { background: #e5a84b1c; color: #f3cf8e; }
.badge-info { background: #7fa2ff1c; color: #b5c6ff; }
.badge-muted { background: #ffffff0d; color: #a9b5c9; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pager a { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--muted); font-size: 12px; }
.pager a.active { background: #6387ff; color: #fff; border-color: #6387ff; }

.inline-filter select, .filters select { width: auto; padding: 8px 12px; font-size: 12px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px; }
.filters input { width: auto; flex: 1 1 220px; padding: 8px 12px; font-size: 12px; }

/* ---------- Wallet ---------- */
.wallet-top { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; margin-bottom: 18px; }
.wallet-top .card { margin: 0; }
.balance-card {
    border-radius: var(--radius);
    padding: 26px;
    background:
        radial-gradient(circle at 15% 20%, #ffffff22, transparent 45%),
        linear-gradient(135deg, #4564dc, #2c3f99 60%, #23307a);
    border: 1px solid #ffffff1a;
    box-shadow: 0 20px 60px #3450c040;
    display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
    min-height: 220px;
}
.balance-label { font-size: 12px; color: #d4ddff; }
.balance-value { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -.5px; }
.balance-value small { font-size: 14px; font-weight: 500; color: #d4ddff; }
.balance-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; color: #d4ddff; }
.price-hint { font-size: 11px; color: #c8d3ff; background: #00000022; padding: 8px 12px; border-radius: 9px; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 9px; }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset span {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 11px 6px; border-radius: 10px; cursor: pointer;
    border: 1px solid #2d3d58; background: #0f1a2b; font-weight: 700; font-size: 14px;
    transition: border-color .15s, background .15s;
}
.preset span small { font-size: 10px; color: var(--muted); font-weight: 500; }
.preset input:checked + span { border-color: #6b88ff; background: #6387ff1f; color: #cdd8ff; }
.preset input:focus-visible + span { box-shadow: 0 0 0 3px #6387ff44; }

/* ---------- Encoder page additions ---------- */
.file-cost { font-size: 11px; color: #f3cf8e; background: #e5a84b14; padding: 5px 9px; border-radius: 7px; white-space: nowrap; }
.file-cost[hidden] { display: none; }
.notice a { color: #f3cf8e; font-weight: 700; }
.gate { text-align: center; padding: 40px 18px; border: 1.5px dashed #52678b; border-radius: 15px; background: #111d2f80; }
.gate-icon { width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; background: #718eff1c; color: #92aaff; }
.gate-icon svg { width: 28px; height: 28px; }
.gate h3 { margin: 0 0 8px; font-size: 16px; }
.gate p { color: var(--muted); font-size: 12px; max-width: 440px; margin: 0 auto; line-height: 2; }
.gate-prices { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.gate-prices span { font-size: 11px; color: #a9b5c9; border: 1px solid var(--border); padding: 5px 10px; border-radius: 7px; }

/* ---------- Payment result ---------- */
.result-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 800; }
.is-success .result-icon { background: #4fd39a1f; color: var(--ok); box-shadow: 0 0 0 8px #4fd39a0d; }
.is-failed .result-icon { background: #ff6b7d1f; color: var(--danger); box-shadow: 0 0 0 8px #ff6b7d0d; }
.receipt { text-align: right; background: #0f1a2b; border: 1px solid var(--border); border-radius: 12px; padding: 6px 16px; margin-top: 18px; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 76px - 65px); }
.admin-side { border-left: 1px solid var(--border); padding: 22px 14px; display: flex; flex-direction: column; gap: 3px; background: #0d1522aa; }
.side-title { font-size: 11px; color: var(--muted); padding: 0 12px 12px; letter-spacing: .5px; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #b9c5d9; text-decoration: none; font-size: 13px; }
.admin-side a:hover { background: #ffffff08; color: var(--text); }
.admin-side a.active { background: #6387ff22; color: #d4ddff; font-weight: 700; }
.side-icon { width: 20px; text-align: center; color: #91a9ff; }
.admin-side .side-back { margin-top: auto; color: var(--muted); font-size: 12px; }
.admin-main { padding: 0 28px 40px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: linear-gradient(145deg, #1b2940, #172235); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 5px; }
.stat span { font-size: 11px; color: var(--muted); }
.stat strong { font-size: 22px; font-weight: 800; }
.stat strong.sm { font-size: 15px; }
.stat small { font-size: 10px; color: #7e8ea8; }

.sys-status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sys-status span { font-size: 11px; padding: 6px 11px; border-radius: 20px; border: 1px solid; }
.sys-status .ok { color: #8fe9be; border-color: #4fd39a33; background: #4fd39a0d; }
.sys-status .bad { color: #ffa0ac; border-color: #ff6b7d33; background: #ff6b7d0d; }
.sys-status .warn { color: #f3cf8e; border-color: #e5a84b33; background: #e5a84b0d; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar i { display: block; width: 100%; max-width: 34px; background: linear-gradient(180deg, #7f9bff, #4564dc); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bar span { font-size: 10px; color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.settings-grid .full { grid-column: 1 / -1; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.switch-row strong { display: block; font-size: 12px; }
.switch-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.8; }
.switch { position: relative; flex: none; width: 42px; height: 24px; margin-top: 1px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 30px; background: #2d3d58; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: #5f7ff0; }
.switch input:checked + i::after { transform: translateX(-18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px #6387ff44; }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(0deg, var(--bg) 60%, transparent); z-index: 5; }

.seg { display: flex; background: #0f1a2b; border: 1px solid #2d3d58; border-radius: 10px; padding: 3px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--muted); }
.seg input:checked + span { background: #6387ff26; color: #d4ddff; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { flex-direction: row; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--border); padding: 10px; }
    .admin-side a { white-space: nowrap; }
    .side-title, .admin-side .side-back { display: none; }
    .admin-main { padding: 0 16px 30px; }
    .grid-side, .wallet-top { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .user-name, .caret { display: none; }
    .wallet-chip { padding: 6px 10px; }
    .wallet-chip svg { display: none; }
    .grid-2, .grid-3, .settings-grid, .info-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 24px 18px; }
    .card { padding: 16px; }
    .page-head { margin-top: 22px; }
    .nav-actions .btn.sm { padding: 6px 11px; }
}

/* v1.1 — per-user pricing */
.price-box { border: 1px dashed #e5a84b55; border-radius: 12px; padding: 12px 14px 14px; margin: 0; background: #e5a84b08; }
.price-box legend { padding: 0 8px; font-size: 12px; color: #f3cf8e; font-weight: 700; }
.price-box .hint { display: block; margin-top: 8px; }
.field input::placeholder { color: #6f7f99; }
