:root {
    --bg: #07070c;
    --panel: #11111a;
    --panel-2: #171525;
    --line: #2b2440;
    --text: #f4f1ff;
    --muted: #a8a0bb;
    --purple: #8b5cf6;
    --purple-2: #c084fc;
    --danger: #fb7185;
    --ok: #34d399;
    --warn: #fbbf24;
    --shadow: 0 22px 70px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 0%, rgba(139, 92, 246, .22), transparent 32rem),
        linear-gradient(135deg, #050509 0%, #101018 55%, #150c24 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid rgba(192, 132, 252, .16);
    background: rgba(7, 7, 12, .78);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
}

.topbar h1,
.hero-band h2,
.table-head h3,
.chart-panel h3 {
    margin: 0;
}

.topbar h1 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.topbar nav {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.dashboard {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
}

.eyebrow {
    display: block;
    color: var(--purple-2);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-band,
.filters-panel,
.chart-panel,
.table-panel,
.error-panel,
.login-panel,
.metric-card {
    border: 1px solid rgba(192, 132, 252, .18);
    background: linear-gradient(180deg, rgba(23, 21, 37, .96), rgba(11, 11, 18, .96));
    box-shadow: var(--shadow);
}

.hero-band {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.hero-band h2 {
    font-size: clamp(1.5rem, 4vw, 3rem);
}

.charge-box {
    min-width: 240px;
    padding: 1rem;
    border-radius: 8px;
    background: #080811;
    border: 1px solid rgba(139, 92, 246, .35);
    text-align: right;
}

.charge-box span,
.metric-card span,
.table-head span {
    color: var(--muted);
    font-size: .86rem;
}

.charge-box strong {
    display: block;
    margin-top: .25rem;
    font-size: 1.55rem;
    color: var(--purple-2);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: 1rem;
}

.metric-card {
    min-height: 116px;
    padding: 1rem;
    border-radius: 8px;
}

.metric-card strong {
    display: block;
    margin-top: .85rem;
    font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.filters-panel,
.chart-panel,
.table-panel,
.error-panel {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .85rem;
    align-items: end;
}

label {
    display: grid;
    gap: .35rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(192, 132, 252, .22);
    border-radius: 7px;
    background: #080811;
    color: var(--text);
    padding: .65rem .75rem;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--purple-2);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .18);
}

input:disabled {
    opacity: .45;
}

button,
.ghost-button,
.filter-actions a,
.pagination a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid rgba(192, 132, 252, .35);
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #fff;
    padding: .65rem .9rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.ghost-button,
.filter-actions a,
.pagination a {
    background: rgba(139, 92, 246, .12);
}

.filter-actions {
    display: flex;
    gap: .6rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-panel.wide {
    grid-column: 1 / -1;
}

.chart-panel h3,
.table-head h3 {
    font-size: 1rem;
    margin-bottom: .75rem;
}

canvas {
    width: 100%;
    max-width: 100%;
}

.table-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: .85rem;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1060px;
}

th,
td {
    padding: .78rem;
    border-bottom: 1px solid rgba(192, 132, 252, .12);
    text-align: left;
    vertical-align: top;
    font-size: .9rem;
}

th {
    color: var(--purple-2);
    font-size: .76rem;
    text-transform: uppercase;
}

td {
    color: #e9e4f7;
}

.notes {
    max-width: 380px;
    color: var(--muted);
}

.status {
    display: inline-flex;
    min-width: 76px;
    justify-content: center;
    padding: .28rem .55rem;
    border-radius: 999px;
    background: rgba(168, 160, 187, .12);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
}

.status.valido {
    background: rgba(52, 211, 153, .12);
    color: var(--ok);
}

.status.expirado {
    background: rgba(251, 113, 133, .12);
    color: var(--danger);
}

.status.teste {
    background: rgba(251, 191, 36, .13);
    color: var(--warn);
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .8rem;
    padding-top: 1rem;
    color: var(--muted);
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 2rem;
}

.error-panel {
    display: grid;
    gap: .5rem;
    color: var(--danger);
}

.error-panel span,
.error-panel small {
    color: var(--muted);
}

.login-page {
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-shell {
    width: min(420px, 100%);
}

.login-panel {
    border-radius: 8px;
    padding: 2rem;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b5cf6, #2e1065);
    font-weight: 950;
    font-size: 1.7rem;
    margin-bottom: 1rem;
}

.login-panel h1 {
    margin: 0;
}

.login-panel p {
    color: var(--muted);
    margin: .4rem 0 1.4rem;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-form button {
    width: 100%;
}

.alert {
    background: rgba(251, 113, 133, .12);
    border: 1px solid rgba(251, 113, 133, .26);
    color: #fecdd3;
    border-radius: 7px;
    padding: .8rem;
    margin-bottom: 1rem;
}

@media (max-width: 1180px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    .topbar,
    .hero-band,
    .table-head {
        align-items: stretch;
        flex-direction: column;
    }

    .cards-grid,
    .filters-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .charge-box {
        min-width: 0;
        text-align: left;
    }

    .filter-actions,
    .topbar nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}


.success-panel {
    border: 1px solid rgba(52, 211, 153, .24);
    background: rgba(52, 211, 153, .1);
    color: #bbf7d0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.actions-cell {
    min-width: 320px;
}

.actions-cell,
.inline-password {
    display: flex;
    gap: .55rem;
    align-items: center;
    flex-wrap: wrap;
}

.actions-cell form {
    margin: 0;
}

.inline-password input {
    width: 150px;
    min-height: 38px;
}

.actions-cell button {
    min-height: 38px;
    padding: .5rem .7rem;
}