:root {
    color-scheme: dark;
    --bg: #02090d;
    --panel: #091922;
    --panel2: #0d2430;
    --line: rgba(173, 229, 218, .14);
    --text: #f2f7f5;
    --muted: #91a7af;
    --green: #7cf200;
    --cyan: #00d9ff;
    --danger: #ff6b7a
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh;
    font: 15px/1.45 Inter, system-ui, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 85% 0, rgba(0, 217, 255, .08), transparent 28%), var(--bg)
}

button,
input,
select,
textarea {
    font: inherit
}

button {
    cursor: pointer
}

.hidden {
    display: none !important
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px
}

.login-card {
    width: min(440px, 100%);
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(9, 25, 34, .94);
    box-shadow: 0 28px 80px #0008
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 850;
    font-size: 1.25rem;
    margin-bottom: 30px
}

.brand img {
    width: 58px;
    height: 58px;
    object-fit: contain
}

.eyebrow {
    color: var(--green);
    font-size: .73rem;
    font-weight: 900;
    letter-spacing: .16em
}

.login-card h1 {
    font-size: 2.25rem;
    letter-spacing: -.04em;
    margin: 8px 0
}

.muted {
    color: var(--muted)
}

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

.span-2 {
    grid-column: span 2
}

label {
    display: grid;
    gap: 7px;
    color: #c9d6da;
    font-size: .84rem;
    font-weight: 700
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #051219;
    color: var(--text);
    padding: 12px 13px;
    outline: none
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px #00d9ff18
}

textarea {
    min-height: 78px;
    resize: vertical
}

.primary,
.secondary,
.danger {
    border: 0;
    border-radius: 10px;
    padding: 12px 17px;
    font-weight: 850
}

.primary {
    background: linear-gradient(135deg, #b7ff36, var(--green));
    color: #071105
}

.secondary {
    background: #102d39;
    color: #e5f0ed;
    border: 1px solid var(--line)
}

.danger {
    background: #451821;
    color: #ffdce1
}

.full {
    width: 100%
}

.message {
    min-height: 23px;
    margin: 12px 0;
    color: #ffd0d5
}

.portal-mensagens {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: grid;
    gap: 10px;
    width: min(390px, calc(100vw - 32px));
    pointer-events: none
}

.portal-aviso {
    display: grid;
    grid-template-columns: 34px 1fr 28px;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid #24505c;
    border-radius: 14px;
    background: #09202aee;
    box-shadow: 0 18px 45px #0008;
    backdrop-filter: blur(12px);
    animation: aviso-entrada .2s ease-out;
    pointer-events: auto
}

.portal-aviso>span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #164452; color: var(--cyan); font-weight: 900 }
.portal-aviso p { margin: 0; color: var(--text); font-weight: 700 }
.portal-aviso button { border: 0; background: transparent; color: var(--muted); font-size: 1.35rem; padding: 0 }
.portal-aviso.sucesso { border-color: #2f6845; background: #0a241bee }
.portal-aviso.sucesso>span { background: #174c2d; color: var(--green) }
.portal-aviso.erro { border-color: #7e3441; background: #2b1118ee }
.portal-aviso.erro>span { background: #65222f; color: #ffd0d5 }
.portal-aviso.saindo { opacity: 0; transform: translateX(24px); transition: .18s ease }
@keyframes aviso-entrada { from { opacity: 0; transform: translateY(-12px) } }

.app {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh
}

.sidebar {
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: #041016;
    position: sticky;
    top: 0;
    height: 100vh
}

.sidebar .brand {
    margin-bottom: 26px
}

.nav {
    display: grid;
    gap: 6px
}

.nav button {
    border: 0;
    text-align: left;
    color: #aabdc4;
    background: transparent;
    padding: 11px 13px;
    border-radius: 9px;
    font-weight: 700
}

.nav button:hover,
.nav button.active {
    color: #fff;
    background: #0d2732
}

.sidebar-footer {
    position: absolute;
    bottom: 22px;
    left: 18px;
    right: 18px;
    display: grid;
    gap: 8px
}

.main {
    padding: 28px clamp(22px, 4vw, 56px);
    min-width: 0
}

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

.topbar h1 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -.04em
}

.section {
    display: none
}

.section.active {
    display: block
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0
}

.card,
.panel {
    background: linear-gradient(160deg, var(--panel2), var(--panel));
    border: 1px solid var(--line);
    border-radius: 15px
}

.card {
    padding: 20px
}

.card b {
    display: block;
    font-size: 1.8rem;
    margin-top: 8px
}

.panel {
    padding: 20px;
    margin: 16px 0
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px
}

.panel h2,
.panel h3 {
    margin: 0
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 11px
}

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

th,
td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap
}

th {
    color: #90aab2;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em
}

tbody tr:hover {
    background: #ffffff05
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #12323c;
    color: #b9f5ff;
    font-size: .72rem;
    font-weight: 800
}

.badge.ok {
    background: #17391d;
    color: #c2ffa9
}

.badge.warn {
    background: #433514;
    color: #ffe19b
}

.dialog {
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #07161e;
    color: var(--text);
    padding: 0;
    width: min(760px, calc(100% - 30px));
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 30px 90px #000b
}

.dialog::backdrop {
    background: #000b
}

.dialog-body {
    padding: 24px
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px
}

.icon-button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.6rem
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px
}

.search-results {
    display: grid;
    gap: 8px;
    margin-top: 10px
}

.search-results button {
    text-align: left;
    background: #0b222d;
    color: #dfeaed;
    border: 1px solid var(--line);
    padding: 10px;
    border-radius: 8px
}

.notice {
    padding: 13px;
    border-radius: 10px;
    background: #13303a;
    color: #c8f5ff;
    margin: 12px 0
}

.amount {
    color: var(--green);
    font-weight: 850
}

.login-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
    color: var(--muted);
    font-size: .85rem
}

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

@media(max-width:980px) {
    .app {
        grid-template-columns: 1fr
    }

    .sidebar {
        height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid var(--line)
    }

    .nav {
        display: flex;
        overflow: auto
    }

    .nav button {
        white-space: nowrap
    }

    .sidebar-footer {
        position: static;
        margin-top: 16px;
        grid-template-columns: 1fr 1fr
    }

    .cards {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:620px) {

    .form-grid,
    .cards {
        grid-template-columns: 1fr
    }

    .span-2 {
        grid-column: auto
    }

    .main {
        padding: 20px 14px
    }

    .topbar {
        align-items: flex-start;
        gap: 12px
    }

    .panel {
        padding: 14px
    }

    .login-card {
        padding: 25px
    }

    .sidebar {
        padding: 16px
    }
}
