
:root {
    color-scheme: dark;
    --bg: #090a0d;
    --surface: #13151a;
    --surface2: #1b1d24;
    --line: #2b2d35;
    --red: #ef3340;
    --text: #f3f3f5;
    --muted: #9699a5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.55 Inter, system-ui, Segoe UI, Arial, sans-serif;
    min-height: 100vh;
}

/* IMAGEM CAPITAL MG EM TODO O FUNDO DIREITO */
body::before {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: 245px;
    right: 0;
    background-image: url("/capital-background.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.layout,
.auth {
    position: relative;
    z-index: 1;
}

a {
    color: #ff626b;
    text-decoration: none;
}

h1 {
    font-size: 27px;
    letter-spacing: -.7px;
    margin: 0 0 12px;
}

h2 {
    font-size: 18px;
    margin: 0 0 16px;
}

h3 {
    font-size: 15px;
}

p {
    color: var(--muted);
}

.brand-accent {
    color: var(--red);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: #101116;
    border-right: 1px solid var(--line);
    padding: 28px 15px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    font-weight: 850;
    font-size: 21px;
    letter-spacing: -.6px;
    margin: 0 12px 30px;
}

.brand b {
    color: var(--red);
}

.sidebar a {
    display: block;
    color: #b6b7c1;
    padding: 11px 13px;
    border-radius: 9px;
    margin: 3px 0;
}

.sidebar a:hover,
.sidebar a.active {
    color: #fff;
    background: #392025;
}

.sidebar small {
    display: block;
    color: #777b86;
    margin: 25px 12px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main {
    width: 100%;
    max-width: 1420px;
    min-width: 0;
    padding: 36px 40px;
    margin: 0 auto;
}

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

.pill {
    border: 1px solid #375545;
    color: #92ddb2;
    background: #14251b;
    padding: 5px 12px;
    border-radius: 99px;
}

.card {
    background: rgba(19, 21, 26, .96);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    margin: 18px 0;
    box-shadow: 0 8px 30px #0002;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stat strong {
    font-size: 29px;
    display: block;
    margin-top: 5px;
}

.stat span {
    color: var(--muted);
}

input,
select,
button {
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid #383a44;
    margin: 4px;
    background: var(--surface2);
    color: #f6f6f8;
    max-width: 100%;
}

input:focus,
select:focus {
    outline: 2px solid #a8323b;
}

button {
    background: var(--red);
    color: white;
    border: 0;
    cursor: pointer;
    font-weight: 650;
}

button:hover {
    filter: brightness(1.13);
}

button.danger {
    background: #70232b;
}

button.secondary {
    background: #30323a;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td,
th {
    padding: 12px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #a3a5af;
    font-size: 12px;
    text-transform: uppercase;
}

form.inline {
    display: inline;
}

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

.warn {
    color: #ff939b;
}

label {
    display: inline-block;
    margin-right: 5px;
}

input[type=number] {
    width: 115px;
}

input[name=reason] {
    min-width: 220px;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

.chart-row { display:grid; grid-template-columns: 170px minmax(0,1fr) 95px; gap:12px; align-items:center; margin:14px 0; }
.chart-track { height:18px; background:#292b33; border-radius:8px; overflow:hidden; }
.chart-fill { height:100%; background:linear-gradient(90deg,#a91f30,#ef3340); border-radius:8px; min-width:0; }
.chart-value { text-align:right; font-weight:700; }
.chart-set { display:none; }
.chart-set.active { display:block; }
@media(max-width:650px) { .chart-row { grid-template-columns: 100px minmax(0,1fr) 75px; gap:7px; font-size:12px; } }


.auth {
    max-width: 440px;
    margin: 9vh auto;
    padding: 20px;
}

.auth input {
    display: block;
    width: 100%;
    margin: 12px 0;
}

.auth button {
    width: 100%;
}

.auth h1,
.auth .sub {
    text-align: center;
}

.auth .card {
    padding: 30px;
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.stack form {
    display: inline;
}

.sidebar form button {
    width: 100%;
    background: #292b33;
    text-align: left;
}

@media(max-width:850px) {
    body::before {
        left: 0;
    }

    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 15px;
    }

    .sidebar a {
        display: inline-block;
    }

    .sidebar small {
        display: none;
    }

    .main {
        padding: 20px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .top {
        flex-wrap: wrap;
    }
}
