/* ============================================================
   VIGILÂNCIA MUNICIPAL — Design System
   Versão 1.0.0
   ============================================================ */

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

/* ============================================================
   VARIÁVEIS — Tema Escuro (padrão)
   ============================================================ */
:root {
    /* Backgrounds */
    --bg-base:    #070c16;
    --bg-page:    #0d1526;
    --bg-card:    #111e33;
    --bg-card-2:  #162040;
    --bg-sidebar: #080e1c;
    --bg-topbar:  rgba(7,12,22,0.95);
    --bg-hover:   rgba(255,255,255,0.04);
    --bg-active:  rgba(59,130,246,0.10);
    --bg-input:   rgba(0,0,0,0.3);
    --bg-modal:   #0f1a2e;

    /* Brand */
    --brand:       #3b82f6;
    --brand-hover: #2563eb;
    --brand-light: rgba(59,130,246,0.12);
    --brand-glow:  rgba(59,130,246,0.25);

    /* Borders */
    --border:        rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.13);
    --border-focus:  rgba(59,130,246,0.5);
    --border-card:   rgba(255,255,255,0.06);

    /* Text */
    --text-1: #e8efff;
    --text-2: #8ba3cc;
    --text-3: #4a5e80;
    --text-link: #60a5fa;

    /* Status */
    --success:    #10b981;
    --success-bg: rgba(16,185,129,0.1);
    --success-bd: rgba(16,185,129,0.25);

    --warning:    #f59e0b;
    --warning-bg: rgba(245,158,11,0.1);
    --warning-bd: rgba(245,158,11,0.25);

    --danger:     #ef4444;
    --danger-bg:  rgba(239,68,68,0.1);
    --danger-bd:  rgba(239,68,68,0.25);

    --info:       #06b6d4;
    --info-bg:    rgba(6,182,212,0.1);
    --info-bd:    rgba(6,182,212,0.25);

    /* Layout */
    --sidebar-w:  240px;
    --topbar-h:   60px;
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 24px var(--brand-glow);

    /* Transitions */
    --t-fast: 0.12s ease;
    --t-base: 0.18s ease;
    --t-slow: 0.3s ease;

    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-1);
    background: var(--bg-base);
    min-height: 100vh;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--brand); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ============================================================
   LAYOUT — APP SHELL
   ============================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    transition: transform var(--t-slow);
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    background: var(--brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--brand-glow);
}

.sidebar-brand-icon svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: 0.01em;
}

.sidebar-brand-sub {
    font-size: 0.68rem;
    color: var(--text-3);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 16px 16px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    margin: 1px 8px;
    border-radius: var(--radius-md);
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 450;
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-1);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--brand);
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg,
.nav-item:hover svg {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 99px;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-bd);
}

.nav-item-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    margin: 1px 8px;
    border-radius: var(--radius-md);
    color: var(--text-3);
    font-size: 0.875rem;
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-item-disabled svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-coming-soon {
    font-size: 0.6rem;
    font-weight: 600;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 99px;
    background: rgba(255,255,255,0.05);
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--t-fast);
}

.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.68rem;
    color: var(--text-3);
    text-transform: capitalize;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-page);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-2);
}

.topbar-breadcrumb a {
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--t-fast);
}
.topbar-breadcrumb a:hover { color: var(--text-1); }

.topbar-breadcrumb .separator {
    color: var(--text-3);
    font-size: 0.7rem;
}

.topbar-breadcrumb .current {
    color: var(--text-1);
    font-weight: 500;
}

.topbar-spacer { flex: 1; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-municipio {
    font-size: 0.78rem;
    color: var(--text-2);
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-municipio svg {
    width: 13px;
    height: 13px;
    color: var(--brand);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    flex: 1;
    padding: 28px 28px 40px;
    max-width: 1400px;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header-left {}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-2);
    margin-top: 4px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-1);
}

.card-subtitle {
    font-size: 0.78rem;
    color: var(--text-2);
    margin-top: 2px;
}

.card-body {
    padding: 20px;
}

/* ============================================================
   KPI CARDS (Stats)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color var(--t-base), box-shadow var(--t-base);
}

.stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg { width: 18px; height: 18px; }

.stat-icon-blue   { background: var(--brand-light); color: var(--brand); }
.stat-icon-green  { background: var(--success-bg);  color: var(--success); }
.stat-icon-red    { background: var(--danger-bg);   color: var(--danger); }
.stat-icon-yellow { background: var(--warning-bg);  color: var(--warning); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-footer {
    font-size: 0.75rem;
    color: var(--text-3);
}

.stat-footer strong {
    color: var(--text-2);
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--t-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    height: 38px;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn:disabled,
.btn.loading {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary */
.btn-primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    box-shadow: 0 1px 3px rgba(59,130,246,0.3);
}
.btn-primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    box-shadow: 0 2px 8px rgba(59,130,246,0.4);
    color: white;
}

/* Secondary */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-1);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    background: var(--bg-card-2);
    border-color: rgba(255,255,255,0.2);
    color: var(--text-1);
}

/* Danger */
.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-bd);
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Success */
.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-bd);
}
.btn-success:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-1);
}

/* Sizes */
.btn-sm {
    height: 32px;
    padding: 5px 12px;
    font-size: 0.8rem;
    gap: 5px;
}
.btn-sm svg { width: 13px; height: 13px; }

.btn-lg {
    height: 46px;
    padding: 10px 24px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

/* Loading spinner */
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.btn.loading .btn-spinner { display: block; }
.btn.loading .btn-text { display: none; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control,
.form-select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    outline: none;
    appearance: none;
}

.form-control::placeholder { color: var(--text-3); }

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%238ba3cc' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 32px;
    cursor: pointer;
}

.form-select option { background: var(--bg-modal); }

.input-group {
    display: flex;
    gap: 8px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table thead th {
    padding: 11px 14px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast);
}

.table tbody tr:last-child { border-bottom: none; }

.table tbody tr:hover { background: var(--bg-hover); }

.table tbody td {
    padding: 11px 14px;
    color: var(--text-1);
    vertical-align: middle;
}

.table-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-3);
}

.table-empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-bd); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-bd); }
.badge-muted   { background: var(--bg-hover);   color: var(--text-2);  border-color: var(--border); }
.badge-brand   { background: var(--brand-light); color: var(--brand);  border-color: rgba(59,130,246,0.3); }

/* ============================================================
   CÉLULA DE MÊS (tabela SISAGUA)
   ============================================================ */
.mes-cell {
    width: 36px;
    height: 28px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.mes-pendente {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-bd);
}

.mes-ok {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-bd);
}

.mes-nao-verificado {
    background: rgba(255,255,255,0.03);
    color: var(--text-3);
    border: 1px dashed var(--border);
}

/* ============================================================
   MODAL DE PROGRESSO DA AUTOMAÇÃO
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--t-slow);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    margin: 20px;
    box-shadow: var(--shadow-lg);
    transform: translateY(10px) scale(0.98);
    transition: transform var(--t-slow);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-header-icon svg { width: 20px; height: 20px; color: var(--brand); }

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-2);
    margin-top: 2px;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Progress bar */
.progress-bar-wrapper {
    background: rgba(0,0,0,0.3);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 99px;
    transition: width 0.5s ease;
    box-shadow: 0 0 12px var(--brand-glow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-2);
    margin-bottom: 16px;
}

.progress-status {
    font-size: 0.82rem;
    color: var(--text-1);
    margin-bottom: 12px;
    min-height: 20px;
}

/* Log terminal */
.log-terminal {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    height: 200px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.7;
}

.log-line { display: flex; gap: 8px; }
.log-time { color: var(--text-3); flex-shrink: 0; }
.log-msg-info    { color: var(--text-2); }
.log-msg-sucesso { color: var(--success); }
.log-msg-aviso   { color: var(--warning); }
.log-msg-erro    { color: var(--danger); }

/* ============================================================
   TOOLBAR (filtros e ações)
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left  { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border: 1px solid;
    margin-bottom: 20px;
}

.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-bd); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-bd); }

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.animate-in { animation: fadeIn 0.25s ease both; }

.pulse { animation: pulse 2s ease infinite; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-1);
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: slideInRight 0.3s ease;
    max-width: 360px;
}

.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--success); }
.toast-danger  { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-wrapper { margin-left: 0; }
    .page-content { padding: 20px 16px 32px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .toolbar { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.text-1 { color: var(--text-1); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-brand   { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-mono { font-family: var(--font-mono); }
.font-bold  { font-weight: 700; }
.font-500   { font-weight: 500; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.w-full { width: 100%; }

.truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}
