/* ============================================================
   BL Manutenção — Portal do Colaborador
   Design System v2 — Mobile-first, moderno e profissional.
   ============================================================ */

/* ── Google Fonts: Inter ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Design Tokens ────────────────────────────────────────── */
:root {
    /* Cores primárias */
    --color-primary:      #1d4ed8;
    --color-primary-d:    #1e3a8a;
    --color-primary-l:    #3b82f6;
    --color-primary-xl:   #eff6ff;

    /* Destaque (laranja/âmbar — identidade industrial) */
    --color-accent:       #f59e0b;
    --color-accent-d:     #d97706;
    --color-accent-l:     #fef3c7;

    /* Status */
    --color-success:      #16a34a;
    --color-success-l:    #dcfce7;
    --color-danger:       #dc2626;
    --color-danger-l:     #fee2e2;
    --color-warning:      #d97706;
    --color-warning-l:    #fef9c3;
    --color-info:         #0891b2;
    --color-info-l:       #e0f2fe;

    /* Neutros */
    --color-bg:           #f1f5f9;
    --color-surface:      #ffffff;
    --color-border:       #e2e8f0;
    --color-border-l:     #f1f5f9;
    --color-text:         #0f172a;
    --color-text-muted:   #64748b;
    --color-text-light:   #94a3b8;

    /* Tipografia */
    --font-family:   'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-size-xs:  0.75rem;
    --font-size-sm:  0.875rem;
    --font-size-md:  1rem;
    --font-size-lg:  1.125rem;
    --font-size-xl:  1.375rem;
    --font-size-2xl: 1.75rem;

    /* Espaçamentos */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Bordas */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Sombras com tom azulado */
    --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
    --shadow-sm: 0 1px 4px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 4px 16px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
    --shadow-lg: 0 10px 32px rgba(15,23,42,.1), 0 4px 8px rgba(15,23,42,.04);

    /* Touch targets */
    --touch: 44px;

    /* Gradientes */
    --gradient-brand: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);

    /* Navbar height */
    --navbar-h: 60px;
    --bottom-nav-h: 64px;
}

/* ── Base ─────────────────────────────────────────────────── */
html, body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout Container ─────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (min-width: 640px) {
    .container { padding: 0 var(--space-lg); }
}

main.container {
    flex: 1;
    padding-top: var(--space-lg);
    padding-bottom: var(--space-xl);
}

/* No mobile com bottom nav, adiciona padding ao main */
@media (max-width: 768px) {
    main.container {
        padding-bottom: calc(var(--bottom-nav-h) + var(--space-lg));
    }
}

/* ── ══════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════ */
.navbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--navbar-h);
}

@media (min-width: 640px) {
    .navbar { padding: 0 var(--space-xl); }
}

/* Brand */
.navbar__brand a {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-primary-d);
    letter-spacing: -.02em;
}

/* Logo da empresa no navbar (opcional) */
.navbar__logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Monograma BL */
.brand-mono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--gradient-brand);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    letter-spacing: -.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(29,78,216,.35);
}

.brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name__main {
    font-size: .95rem;
    font-weight: 800;
    color: var(--color-primary-d);
}

.brand-name__sub {
    font-size: .65rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Controles (sino + hamburger) */
.navbar__controls {
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* Hamburger */
.navbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--color-text);
    transition: background .15s;
    flex-shrink: 0;
}

.navbar__toggle:hover { background: var(--color-bg); }

@media (min-width: 769px) {
    .navbar__toggle { display: none !important; }
}

@media (max-width: 768px) {
    .navbar__toggle { display: flex; }
}

/* Menu */
.navbar__menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .navbar {
        height: auto;
        min-height: var(--navbar-h);
        padding-top: 0;
        padding-bottom: 0;
    }

    .navbar__brand,
    .navbar__controls {
        height: var(--navbar-h);
    }

    .navbar__menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-sm) 0 var(--space-md);
        border-top: 1px solid var(--color-border);
        gap: 2px;
        order: 3;
    }

    .navbar__menu.is-open { display: flex; }
}

/* Links do menu */
.navbar__link {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: .3rem .25rem;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
}

.navbar__link:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

@media (max-width: 768px) {
    .navbar__link {
        display: block;
        padding: .8rem var(--space-sm);
        border-bottom: none;
        border-radius: var(--radius-sm);
        font-size: var(--font-size-md);
        color: var(--color-text);
    }

    .navbar__link:hover {
        background: var(--color-primary-xl);
        border-bottom: none;
        color: var(--color-primary);
    }

    .navbar__divider {
        display: none;
    }

    .navbar__user {
        display: block;
        padding: .75rem var(--space-sm);
        font-size: .9rem;
        font-weight: 600;
        color: var(--color-text);
        border-top: 1px solid var(--color-border);
        margin-top: .25rem;
        padding-top: .85rem;
    }

    .navbar__menu .btn {
        margin-top: .4rem;
        width: 100%;
        justify-content: center;
        padding: .75rem;
    }
}

.navbar__divider {
    width: 1px;
    height: 1.1rem;
    background: var(--color-border);
    display: inline-block;
    margin: 0 .15rem;
}

.navbar__user {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ── ══════════════════════════════════════════════════════════
   NOTIFICAÇÕES — SINO
   ══════════════════════════════════════════════════════════ */
.notif { position: relative; }

.notif__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.15rem;
    position: relative;
    transition: background .15s, border-color .15s;
}

.notif__btn:hover {
    background: var(--color-primary-xl);
    border-color: var(--color-primary-l);
}

.notif__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
    border: 2px solid var(--color-surface);
}

.notif__badge--hidden { display: none; }

/* Dropdown desktop */
.notif__dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}

.notif__dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 10px;
    height: 10px;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    border-top: 1px solid var(--color-border);
    transform: rotate(45deg);
}

/* Mobile: sheet de tela cheia */
@media (max-width: 640px) {
    .notif__dropdown {
        position: fixed;
        top: var(--navbar-h);
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - var(--navbar-h));
        overflow-y: auto;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .notif__dropdown::before { display: none; }
}

.notif__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.notif__header-title {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.notif__marcar-todas {
    background: none;
    border: 1px solid var(--color-primary-l);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: .78rem;
    color: var(--color-primary);
    font-weight: 600;
    padding: .3rem .7rem;
    transition: background .15s;
}

.notif__marcar-todas:hover { background: var(--color-primary-xl); }

.notif__lista {
    list-style: none;
    max-height: 360px;
    overflow-y: auto;
}

@media (max-width: 640px) { .notif__lista { max-height: none; } }

.notif__vazia {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: 2.5rem 1rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.notif__item {
    border-bottom: 1px solid var(--color-border-l);
    transition: background .15s;
}

.notif__item:last-child { border-bottom: none; }

.notif__item--nova { background: #eff6ff; }
.notif__item--nova .notif__titulo { font-weight: 700; }

.notif__item-link {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .9rem 1.1rem;
    text-decoration: none;
    color: inherit;
}

.notif__item-link:hover { background: var(--color-bg); }

.notif__icone {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: .05rem;
}

.notif__corpo {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
    min-width: 0;
}

.notif__titulo {
    font-size: .875rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif__msg {
    font-size: .8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif__tempo {
    font-size: .72rem;
    color: var(--color-text-light);
    margin-top: .05rem;
}

.notif__footer {
    padding: .8rem 1.1rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    background: var(--color-bg);
}

.notif__ver-todas {
    font-size: .85rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.notif__ver-todas:hover { text-decoration: underline; }

/* ── ══════════════════════════════════════════════════════════
   BOTTOM NAVIGATION (mobile — colaborador)
   ══════════════════════════════════════════════════════════ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 16px rgba(15,23,42,.08);
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 768px) {
    .bottom-nav { display: flex; }
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: .68rem;
    font-weight: 500;
    padding: .4rem 0;
    transition: color .2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item:hover,
.bottom-nav__item.is-active {
    color: var(--color-primary);
}

.bottom-nav__item.is-active .bottom-nav__icon-wrap {
    background: var(--color-primary-xl);
    border-radius: var(--radius-sm);
}

.bottom-nav__icon-wrap {
    position: relative;
    padding: .3rem .7rem;
    transition: background .2s;
}

.bottom-nav__icon {
    font-size: 1.3rem;
    line-height: 1;
}

.bottom-nav__badge {
    position: absolute;
    top: 0;
    right: 2px;
    background: var(--color-danger);
    color: #fff;
    font-size: .55rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid var(--color-surface);
}

.bottom-nav__label { letter-spacing: .01em; }

/* ── ══════════════════════════════════════════════════════════
   ALERTAS FLASH
   ══════════════════════════════════════════════════════════ */
.alert {
    padding: .9rem var(--space-lg);
    border-left: 4px solid;
    margin: var(--space-sm) auto;
    max-width: 1100px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.alert--success { background: var(--color-success-l); border-color: var(--color-success); color: #14532d; }
.alert--error   { background: var(--color-danger-l);  border-color: var(--color-danger);  color: #7f1d1d; }
.alert--warning { background: var(--color-warning-l); border-color: var(--color-warning); color: #78350f; }
.alert--info    { background: var(--color-info-l);    border-color: var(--color-info);    color: #164e63; }

/* ── ══════════════════════════════════════════════════════════
   BOTÕES
   ══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: all .2s;
    min-height: var(--touch);
    font-family: var(--font-family);
    letter-spacing: -.01em;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.4;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(29,78,216,.25);
}

.btn--primary:hover {
    background: var(--color-primary-d);
    border-color: var(--color-primary-d);
    box-shadow: 0 3px 8px rgba(29,78,216,.3);
}

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary-l);
}

.btn--outline:hover {
    background: var(--color-primary-xl);
    border-color: var(--color-primary);
}

.btn--success {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
    box-shadow: 0 1px 3px rgba(22,163,74,.25);
}

.btn--success:hover:not(:disabled) {
    background: #15803d;
    border-color: #15803d;
    box-shadow: 0 3px 8px rgba(22,163,74,.3);
}

.btn--success:disabled {
    background: #d1fae5;
    color: #6ee7b7;
    border-color: #a7f3d0;
    cursor: not-allowed;
    box-shadow: none;
}

.btn--danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}

.btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn--assinado {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

.btn--assinado:hover { background: #1e3a8a; border-color: #1e3a8a; }

.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

/* Tamanhos */
.btn--sm {
    padding: .35rem .85rem;
    font-size: .8rem;
    min-height: 36px;
}

.btn--lg {
    padding: .85rem 1.5rem;
    font-size: var(--font-size-md);
    font-weight: 700;
    min-height: 52px;
}

.btn--block { width: 100%; }

/* ── ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
    .card { padding: var(--space-xl); }
}

.card--no-pad {
    padding: 0;
    /* overflow:hidden removido — bloqueava o scroll horizontal do .table-scroll interno.
       Os cantos arredondados do card continuam funcionando via border-radius normalmente. */
}

.card__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--color-text);
    letter-spacing: -.02em;
}

/* ── ══════════════════════════════════════════════════════════
   FORMULÁRIOS
   ══════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .65rem var(--space-md);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color .2s, box-shadow .2s;
    min-height: var(--touch);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

/* ── ══════════════════════════════════════════════════════════
   TABELAS
   ══════════════════════════════════════════════════════════ */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th,
.table td {
    padding: .75rem var(--space-md);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.table th {
    font-weight: 700;
    background: var(--color-bg);
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .06em;
}

.table tbody tr:hover { background: #f8fafc; }

/* ── Wrapper de scroll horizontal (acima de 640px) ──────────────────────────
   Em telas médias a tabela permanece tabela mas pode ser mais larga que a tela.
   O wrapper garante scroll em vez de cortar o conteúdo.
   Dica visual: sombra gradiente na borda direita indica que há mais conteúdo. */

/* .table-wrapper é o nome legado usado em logs.php — mesmo comportamento */
.table-scroll,
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;      /* scroll suave no iOS */
    border-radius: inherit;                 /* herda o border-radius do card pai */
    /* Indicador visual sutil de conteúdo fora da tela */
    background:
        /* Sombra esquerda */
        linear-gradient(to right,  white 30%, transparent) left  / 24px 100% no-repeat,
        /* Sombra direita */
        linear-gradient(to left,   white 30%, transparent) right / 24px 100% no-repeat,
        /* Rastro de scroll esquerdo */
        radial-gradient(ellipse at left,  rgba(0,0,0,.10) 0%, transparent 70%) left  / 12px 100% no-repeat,
        /* Rastro de scroll direito */
        radial-gradient(ellipse at right, rgba(0,0,0,.10) 0%, transparent 70%) right / 12px 100% no-repeat;
    background-attachment: local, local, scroll, scroll;
}

/* Garante largura mínima para que as colunas fiquem legíveis ao rolar.
   Aplica apenas em tabelas SEM --responsive (admin), pois as responsivas
   viram cards no mobile e não precisam de min-width. */
.table-scroll .table:not(.table--responsive),
.table-wrapper .table:not(.table--responsive) {
    min-width: 480px;
}

/* Tabela responsiva → cards no mobile */
@media (max-width: 640px) {
    /* NÃO removemos overflow-x do wrapper — tabelas admin (sem --responsive)
       ainda precisam de scroll horizontal no mobile.
       Tabelas com --responsive viram cards e não geram overflow de qualquer forma. */

    .table--responsive { display: block; }
    .table--responsive thead { display: none; }
    .table--responsive tbody { display: block; }

    .table--responsive tbody tr {
        display: block;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        margin-bottom: .75rem;
        padding: .875rem 1rem;
        background: var(--color-surface);
        box-shadow: var(--shadow-xs);
    }

    .table--responsive tbody tr:hover { background: var(--color-surface); }

    .table--responsive tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .3rem 0;
        border: none;
        font-size: .9rem;
    }

    .table--responsive tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-text-muted);
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .05em;
        flex-shrink: 0;
        margin-right: .5rem;
    }

    .table--responsive tbody td.td-acoes {
        flex-direction: column;
        align-items: stretch;
        gap: .45rem;
        border-top: 1px solid var(--color-border);
        padding-top: .75rem;
        margin-top: .5rem;
    }

    .table--responsive tbody td.td-acoes::before { display: none; }

    .table--responsive tbody td.td-acoes .btn {
        width: 100%;
        margin: 0;
        justify-content: center;
    }
}

/* ── ══════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .65rem;
    border-radius: var(--radius-full);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .01em;
}

.badge--success { background: var(--color-success-l); color: #15803d; border: 1px solid #bbf7d0; }
.badge--danger  { background: var(--color-danger-l);  color: #b91c1c; border: 1px solid #fca5a5; }
.badge--info    { background: var(--color-info-l);    color: #0369a1; border: 1px solid #bae6fd; }
.badge--warning { background: var(--color-warning-l); color: #a16207; border: 1px solid #fef08a; }
.badge--neutral { background: #f1f5f9; color: #475569; border: 1px solid var(--color-border); }
.badge--nova    { background: var(--color-primary); color: #fff; font-size: .65rem; padding: .1rem .45rem; border-radius: 10px; }

/* ── ══════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -.03em;
    line-height: 1.3;
}

.page-subtitle {
    font-size: .9rem;
    color: var(--color-text-muted);
    margin-top: .25rem;
}

/* ── ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.empty-state p { color: var(--color-text-muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── ══════════════════════════════════════════════════════════
   STATS / CARDS DE RESUMO
   ══════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card--danger  { border-left: 4px solid var(--color-danger);  }
.stat-card--info    { border-left: 4px solid var(--color-info);    }
.stat-card--success { border-left: 4px solid var(--color-success); }
.stat-card__value   { font-size: 1.75rem; font-weight: 800; color: var(--color-text); line-height: 1; letter-spacing: -.04em; }
.stat-card__label   { font-size: .75rem; color: var(--color-text-muted); margin-top: .35rem; }

/* ── ══════════════════════════════════════════════════════════
   FILTROS / LOGS
   ══════════════════════════════════════════════════════════ */
.filter-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-form__row .form-group { flex: 1; min-width: 130px; margin-bottom: 0; }
.form-group--actions { flex: 0 0 auto; }

.log-detalhes td    { background: #f8fafc; padding: .5rem 1.5rem; }
.log-detalhes__json { font-family: monospace; font-size: .78rem; color: var(--color-text-muted); white-space: pre-wrap; margin: 0; }

/* ── ══════════════════════════════════════════════════════════
   PAGINAÇÃO
   ══════════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination__info {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
}

/* ── ══════════════════════════════════════════════════════════
   HISTÓRICO DE NOTIFICAÇÕES
   ══════════════════════════════════════════════════════════ */
.notif-historico { list-style: none; }

.notif-historico__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border-l);
    transition: background .15s;
}

.notif-historico__item:last-child { border-bottom: none; }
.notif-historico__item--nova { background: #eff6ff; }
.notif-historico__item:hover { background: var(--color-bg); }

.notif-historico__icone { font-size: 1.4rem; flex-shrink: 0; margin-top: .1rem; }

@media (max-width: 480px) { .notif-historico__icone { display: none; } }

.notif-historico__corpo { flex: 1; min-width: 0; }

.notif-historico__titulo {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.notif-historico__msg { font-size: .875rem; color: var(--color-text-muted); margin-top: .2rem; }
.notif-historico__meta { font-size: .75rem; color: var(--color-text-light); margin-top: .3rem; }

.notif-historico__acao { flex-shrink: 0; align-self: center; }

@media (max-width: 480px) {
    .notif-historico__item { flex-direction: column; gap: .5rem; padding: .875rem 1rem; }
    .notif-historico__acao { width: 100%; }
    .notif-historico__acao .btn { width: 100%; justify-content: center; }
}

/* ── ══════════════════════════════════════════════════════════
   RODAPÉ
   ══════════════════════════════════════════════════════════ */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    margin-top: auto;
}

/* ── ══════════════════════════════════════════════════════════
   PÁGINA DE ERRO
   ══════════════════════════════════════════════════════════ */
.error-page { text-align: center; padding: var(--space-xl) 0; }
.error-page h1 { font-size: 5rem; color: var(--color-primary); line-height: 1; }
.error-page p { color: var(--color-text-muted); margin-top: var(--space-md); }

/* ── ══════════════════════════════════════════════════════════
   UTILITÁRIOS
   ══════════════════════════════════════════════════════════ */
.text-muted   { color: var(--color-text-muted); }
.text-sm      { font-size: var(--font-size-sm); }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.mt-sm        { margin-top: var(--space-sm); }
.mt-md        { margin-top: var(--space-md); }
.mb-md        { margin-bottom: var(--space-md); }
