:root {
    --bg: #081a2d;
    --bg-2: #10253b;
    --card: #142d45;
    --line: rgba(147, 181, 212, 0.24);
    --text: #e9f1f8;
    --muted: #9fb6ca;
    --brand: #57ddd8;
    --brand-2: #1fb8ba;
    --ok: #7de28e;
    --warn: #f8d479;
    --danger: #ff8f8f;
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% -10%, rgba(87, 221, 216, 0.18), transparent 30%),
        radial-gradient(circle at 100% 0%, rgba(62, 112, 170, 0.18), transparent 36%),
        linear-gradient(180deg, #08182a 0%, #0b2136 55%, #08192b 100%);
    padding: 14px 12px 86px;
}

body.theme-home {
    --brand: #57ddd8;
    --brand-2: #1fb8ba;
}

body.theme-login {
    --brand: #6cc7ff;
    --brand-2: #3977ff;
}

body.theme-cadastro {
    --brand: #7be8b6;
    --brand-2: #2ea06f;
}

body.theme-comprar {
    --brand: #89e0ff;
    --brand-2: #2980d8;
}

body.theme-recargas {
    --brand: #90e7d8;
    --brand-2: #1ea98f;
}

body.theme-historico {
    --brand: #f3d88f;
    --brand-2: #cf9a2b;
}

body.theme-conta {
    --brand: #c0b5ff;
    --brand-2: #7f6dff;
}

body.theme-sobre {
    --brand: #ffb8e1;
    --brand-2: #d161b1;
}

body.theme-admin {
    --brand: #83d2ff;
    --brand-2: #3f8cff;
}

body.admin-page {
    padding: 18px;
}

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

@keyframes pulseSoft {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
}

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

.screen {
    width: min(100%, 430px);
    margin: 0 auto;
}

.screen-history {
    padding-top: 2px;
}

.history-fixed {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, rgba(8, 24, 42, 0.98) 0%, rgba(8, 24, 42, 0.92) 100%);
    backdrop-filter: blur(4px);
    padding-top: 4px;
    margin-bottom: 10px;
}

.history-fixed .topbar {
    margin-bottom: 10px;
}

.history-list-card {
    margin-top: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.custom-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.custom-alert-overlay.show {
    display: flex;
}

.custom-alert-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
    width: min(100%, 410px);
    padding: 1rem;
    color: #f8fafc;
}

.custom-alert-header {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    color: #38bdf8;
}

.custom-alert-body {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.custom-alert-close {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 0.7rem;
    font-size: 1rem;
    font-weight: 700;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
}

.custom-alert-close:hover {
    background: #1d4ed8;
}
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 14px;
    color: #072222;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand h1 {
    font-size: 15px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.page-tag {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-tag.welcome-tag {
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 12px;
    color: #c8dff0;
}

.pill {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.pill.ok {
    color: var(--ok);
    border-color: rgba(125, 226, 142, 0.45);
}

.pill.warn {
    color: var(--warn);
    border-color: rgba(248, 212, 121, 0.45);
}

.pill.danger {
    color: var(--danger);
    border-color: rgba(255, 143, 143, 0.45);
}

.card {
    background: linear-gradient(180deg, var(--card) 0%, #132a42 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
    animation: fadeUp 0.28s ease both;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #bfd0de;
    margin-bottom: 10px;
}

.tiny {
    color: var(--muted);
    font-size: 12px;
}

.tiny.ok {
    color: var(--ok);
}

.tiny.danger {
    color: var(--danger);
}

.summary-card {
    border-color: rgba(102, 195, 228, 0.45);
    box-shadow: 0 16px 28px rgba(6, 18, 32, 0.42);
}

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

.summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px dashed rgba(168, 202, 231, 0.2);
    padding: 9px 0;
    font-size: 13px;
    color: #d4e3ef;
}

.summary-row:first-of-type {
    border-top: none;
}

.summary-row strong {
    font-size: 18px;
    color: #aaf2ee;
}

.summary-row .muted-value {
    font-size: 14px;
    color: #d8e7f3;
    font-weight: 700;
}

.summary-row .muted-value.ok {
    color: var(--ok);
}

.summary-row .muted-value.danger {
    color: var(--danger);
}

.kpi-list {
    display: grid;
    gap: 8px;
}

.kpi {
    border: 1px solid rgba(99, 172, 207, 0.32);
    border-radius: 13px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kpi-label {
    font-size: 12px;
    color: #d2dde7;
    font-weight: 600;
}

.kpi-value {
    font-size: 19px;
    font-weight: 800;
    color: #a6f4f0;
}

.kpi-value.small {
    font-size: 14px;
}

.grid-2,
.grid-3,
.grid-4,
.actions {
    display: grid;
    gap: 10px;
}

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

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

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

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

.tile {
    min-height: 80px;
    border: 1px solid rgba(130, 160, 196, 0.35);
    border-radius: 12px;
    background: linear-gradient(180deg, #223756 0%, #1b304b 100%);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeUp 0.34s ease both;
}

.tile:hover {
    transform: translateY(-1px);
    border-color: rgba(133, 200, 255, 0.62);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
}

.tile-code {
    width: 33px;
    height: 33px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
    font-size: 0;
    color: #b8d9ef;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tile:hover .tile-code {
    transform: translateY(-1px);
    border-color: rgba(135, 202, 255, 0.68);
}

.tile-code svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.9;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tile-buy .tile-code {
    color: #7be7a7;
    background: rgba(123, 231, 167, 0.12);
    border-color: rgba(123, 231, 167, 0.42);
}

.tile-recargas .tile-code {
    color: #78d7ff;
    background: rgba(120, 215, 255, 0.12);
    border-color: rgba(120, 215, 255, 0.42);
}

.tile-historico .tile-code {
    color: #f5d984;
    background: rgba(245, 217, 132, 0.13);
    border-color: rgba(245, 217, 132, 0.45);
}

.tile-conta .tile-code {
    color: #cbb8ff;
    background: rgba(203, 184, 255, 0.14);
    border-color: rgba(203, 184, 255, 0.4);
}

.tile-sobre .tile-code {
    color: #ffb8db;
    background: rgba(255, 184, 219, 0.15);
    border-color: rgba(255, 184, 219, 0.42);
}

.tile-verificar .tile-code {
    color: #86f2a1;
    background: rgba(134, 242, 161, 0.13);
    border-color: rgba(134, 242, 161, 0.45);
}

.tile-sair .tile-code {
    color: #ffb08f;
    background: rgba(255, 176, 143, 0.14);
    border-color: rgba(255, 176, 143, 0.45);
}

.tile-primary .tile-code {
    animation: pulseSoft 2.2s ease-in-out infinite;
}

.tile-wide {
    grid-column: span 3;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    margin-bottom: 10px;
    outline: none;
}

select.input-select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    margin-bottom: 10px;
    outline: none;
}

input::placeholder {
    color: #89a2b8;
}

input:focus {
    border-color: rgba(87, 221, 216, 0.56);
}

select.input-select:focus {
    border-color: rgba(87, 221, 216, 0.56);
}

.btn {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 8px;
    transition: transform 0.15s ease, box-shadow 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:last-child {
    margin-bottom: 0;
}

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

.btn:disabled,
input:disabled,
select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #60e0db 0%, #25bec0 100%);
    color: #072120;
    box-shadow: 0 10px 18px rgba(31, 184, 186, 0.24);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--line);
    color: #dbe7f0;
}

.btn-danger {
    background: linear-gradient(135deg, #ffb0b0 0%, #f06f84 100%);
    color: #311017;
}

.btn-icon {
    width: 20px;
    height: 20px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
}

.btn-icon svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-primary .btn-icon {
    color: #0c6160;
    background: rgba(5, 72, 69, 0.18);
}

.btn-outline .btn-icon {
    color: #8fc0df;
    background: rgba(143, 192, 223, 0.16);
}

.btn-danger .btn-icon {
    color: #6f1d2c;
    background: rgba(111, 29, 44, 0.16);
}

.list-row {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.list-row:last-child {
    margin-bottom: 0;
}

.row-title {
    font-size: 13px;
    font-weight: 700;
}

.row-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.row-sub.ok {
    color: var(--ok);
}

.row-sub.danger {
    color: var(--danger);
}

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: min(calc(100% - 18px), 430px);
    padding: 8px;
    border-radius: 15px;
    border: 1px solid rgba(151, 181, 212, 0.25);
    background: rgba(10, 27, 45, 0.94);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.bottom-nav a {
    text-align: center;
    padding: 9px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.bottom-nav a.active {
    background: rgba(87, 221, 216, 0.14);
    color: #b6f8f4;
}

.admin-shell {
    width: min(100%, 1200px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
}

.admin-side .card,
.admin-main .card {
    margin-bottom: 14px;
}

.admin-main .card:last-child,
.admin-side .card:last-child {
    margin-bottom: 0;
}

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

.admin-status {
    min-height: 38px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.admin-status.ok {
    color: var(--ok);
    border-color: rgba(125, 226, 142, 0.45);
}

.admin-status.danger {
    color: var(--danger);
    border-color: rgba(255, 143, 143, 0.45);
}

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

.admin-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.admin-note {
    font-size: 12px;
    color: var(--muted);
}

.visa-form-card {
    border-color: rgba(118, 178, 255, 0.48);
    background: linear-gradient(135deg, #1f3f6b 0%, #153253 56%, #102a45 100%);
}

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

.visa-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #d8ebff;
}

.visa-body {
    border: 1px solid rgba(161, 200, 243, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
}

.recarga-card {
    border: 1px solid rgba(123, 197, 231, 0.34);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 10px;
}

.recarga-card:last-child {
    margin-bottom: 0;
}

.recarga-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 19, 0.72);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 16px;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    width: min(100%, 430px);
    border-radius: 18px;
    border: 1px solid rgba(130, 201, 162, 0.45);
    background: linear-gradient(180deg, #122a42 0%, #102338 100%);
    box-shadow: 0 22px 38px rgba(0, 0, 0, 0.36);
    padding: 18px;
    text-align: center;
    animation: fadeUp 0.22s ease both;
}

.modal-card.danger {
    border-color: rgba(255, 143, 143, 0.48);
    background: linear-gradient(180deg, #2c1a27 0%, #201624 100%);
}

.modal-check {
    width: 88px;
    height: 88px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 2px solid rgba(125, 226, 142, 0.5);
    background: rgba(125, 226, 142, 0.2);
    color: #8fff9d;
    font-size: 46px;
    font-weight: 900;
    display: grid;
    place-items: center;
    line-height: 1;
}

.modal-check.danger {
    border-color: rgba(255, 143, 143, 0.52);
    background: rgba(255, 143, 143, 0.18);
    color: #ffb1c8;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.modal-text {
    font-size: 13px;
    color: #d5e6f3;
    line-height: 1.5;
    margin-bottom: 14px;
}

@media (max-width: 1080px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    body.admin-page {
        padding: 12px;
    }

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

    .tile-wide {
        grid-column: span 2;
    }

    .admin-grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
