:root {
    --sidebar-width: 260px;
    --brand-color: #2c3e6b;
    --brand-color-dark: #1f2c4d;
}

* { box-sizing: border-box; }

body.app-body {
    background: #f4f6f9;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
}

.app-wrapper { min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-color), var(--brand-color-dark));
    color: #fff;
    min-height: 100vh;
    flex-shrink: 0;
}

.sidebar-nav { display: flex; flex-direction: column; padding: .5rem 0; }

.sidebar-nav .nav-link {
    color: rgba(255,255,255,.85);
    padding: .75rem 1.25rem;
    font-size: .95rem;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i { width: 22px; margin-right: 8px; }

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-left-color: #fff;
}

.app-content { min-width: 0; }

.app-topbar {
    background: #fff;
    border-bottom: 1px solid #e3e6ef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.card { border: none; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

.stat-card { border-radius: .75rem; padding: 1.25rem; color: #fff; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-card .stat-label { font-size: .85rem; opacity: .9; }

.btn-primary { background: var(--brand-color); border-color: var(--brand-color); }
.btn-primary:hover { background: var(--brand-color-dark); border-color: var(--brand-color-dark); }

@media (min-width: 992px) {
    .app-sidebar { position: sticky; top: 0; height: 100vh; }
}

@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; z-index: 1045; }
}

/* Tabelas responsivas em telas pequenas */
@media (max-width: 767.98px) {
    .table-responsive-cards thead { display: none; }
    .table-responsive-cards tr {
        display: block;
        margin-bottom: .75rem;
        border: 1px solid #e3e6ef;
        border-radius: .5rem;
        padding: .5rem .75rem;
    }
    .table-responsive-cards td {
        display: flex;
        justify-content: space-between;
        border: none;
        padding: .35rem 0;
    }
    .table-responsive-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        margin-right: .5rem;
    }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-color), var(--brand-color-dark));
    padding: 1rem;
}

.auth-card { max-width: 420px; width: 100%; border-radius: 1rem; }

/* ---- Dashboard ---- */
.kpi { padding: 1.1rem 1.25rem; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,30,60,.08); }
.kpi-icone { width: 40px; height: 40px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: .6rem; }
.kpi-rotulo { font-size: .8rem; color: #6c757d; text-transform: uppercase; letter-spacing: .4px; }
.kpi-valor { font-size: 1.55rem; font-weight: 700; color: #1d2433; line-height: 1.25; }
.kpi-rodape { font-size: .8rem; color: #6c757d; margin-top: .25rem; }
.kpi-progresso { height: 6px; margin-top: .5rem; background: #eef1f6; }
.data-chip { width: 46px; flex-shrink: 0; text-align: center; border-radius: .5rem; background: #eef1f6; padding: .25rem 0; line-height: 1.1; }
.data-chip .dia { display: block; font-weight: 700; font-size: 1.05rem; color: #1d2433; }
.data-chip .mes { display: block; font-size: .7rem; text-transform: uppercase; color: #6c757d; }
.data-chip.atrasada { background: #fde8e8; } .data-chip.atrasada .dia, .data-chip.atrasada .mes { color: #b02a37; }
.data-chip.hoje { background: #fff3cd; }
.avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.min-w-0 { min-width: 0; }
