/* ==========================================================================
   LÍDER SEGURANÇA ELETRÔNICA — DESIGN SYSTEM (SOC / LINEAR / DATADOG)
   Central de Operações de Segurança & Gestão de Ordens de Serviço
   Versão: 10.0 — Reconstrução Completa
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & VARIÁVEIS
   -------------------------------------------------------------------------- */
:root {
    /* Tipografia de Alta Precisão */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

    /* Superfícies Escuras Refinadas (SOC Dark Engine) */
    --bg-space: #070D18;
    --surface-dark: #0B1320;
    --surface-dark-card: #0F172A;
    --surface-dark-border: #1E293B;
    --surface-dark-muted: #334155;
    --ink: #0B1320;

    /* Superfícies de Conteúdo & Fundo Suave */
    --surface-white: #FFFFFF;
    --surface: #FFFFFF;
    --bg-canvas: #F8FAFC;
    --bg-main: #F8FAFC;
    --surface-sunken: #F1F5F9;
    --surface-raised: #FFFFFF;

    /* Linhas & Bordas Finas */
    --border-subtle: #E2E8F0;
    --border-medium: #CBD5E1;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    /* Tipografia & Contrastes */
    --text-primary: #0F172A;
    --text-main: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-subtle: #94A3B8;
    --text-faint: #94A3B8;
    --text-on-dark: #F8FAFC;
    --text-on-dark-muted: #94A3B8;

    /* Cores Semânticas Vibrantes */
    /* 1. Disponível (Emerald) */
    --st-available: #10B981;
    --st-available-bg: #ECFDF5;
    --st-available-border: #A7F3D0;
    --st-available-text: #065F46;

    /* 2. Em Andamento (Blue) */
    --st-progress: #2563EB;
    --st-progress-bg: #EFF6FF;
    --st-progress-border: #BFDBFE;
    --st-progress-text: #1E40AF;

    /* 3. Aguardando Aprovação (Amber) */
    --st-waiting: #F59E0B;
    --st-waiting-bg: #FEF3C7;
    --st-waiting-border: #FDE68A;
    --st-waiting-text: #92400E;

    /* 4. Concluído (Teal) */
    --st-done: #0D9488;
    --st-done-bg: #F0FDFA;
    --st-done-border: #99F6E4;
    --st-done-text: #115E59;

    /* 5. Urgente / Atraso / Risco (Red) */
    --st-urgent: #EF4444;
    --st-urgent-bg: #FEF2F2;
    --st-urgent-border: #FECACA;
    --st-urgent-text: #991B1B;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;

    /* Ação Primária & Brand Accent */
    --action: #2563EB;
    --action-hover: #1D4ED8;
    --action-bg: #EFF6FF;
    --action-border: #BFDBFE;

    /* Variáveis de Borda Suave */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* Sombras Suaves com Blur Moderno (Linear/Datadog) */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.07), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 20px -3px rgba(15, 23, 42, 0.09), 0 3px 8px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 18px 36px -6px rgba(15, 23, 42, 0.13), 0 6px 14px -3px rgba(15, 23, 42, 0.07);
    --shadow-xl: 0 25px 50px -12px rgba(7, 13, 24, 0.35);
    --shadow-glow-emerald: 0 0 18px rgba(16, 185, 129, 0.35);
    --shadow-glow-blue: 0 0 18px rgba(37, 99, 235, 0.35);
    --shadow-glow-amber: 0 0 18px rgba(245, 158, 11, 0.35);
    --shadow-glow-red: 0 0 22px rgba(239, 68, 68, 0.45);

    /* Transições & Timings */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.35, 0.64, 1);
    --t-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --t-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);

    /* Dimensões Globais */
    --bottom-nav-h: 68px;
    --header-h: 64px;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: light;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-size: 14.5px;
    line-height: 1.5;
}

input, textarea, select, button {
    font-family: inherit;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Scrollbars Finas e Elegantes */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

svg {
    display: block;
    flex-shrink: 0;
}

.icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
.icon-sm {
    width: 14px;
    height: 14px;
}
.icon-lg {
    width: 24px;
    height: 24px;
}

/* --------------------------------------------------------------------------
   3. ARQUITETURA DE VISUALIZAÇÕES (SPA UNIVERSAL & REGRAS DE LAYOUT)
   -------------------------------------------------------------------------- */
/* REGRA DE OURO: NUNCA MAIS EXIBIR FORMULÁRIO E CALENDÁRIO LADO A LADO! */
.view-section {
    display: none !important;
    width: 100%;
}

.view-section.active-view {
    display: block !important;
    animation: fadeInView 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Container Principal Responsivo */
.main-content {
    width: 100%;
    margin: 0 auto;
    flex: 1;
    display: block !important; /* Desativa explicitamente grids side-by-side legadas */
}

/* Desktop (> 1025px) */
@media (min-width: 1025px) {
    .main-content {
        max-width: 1560px;
        padding: 28px 36px;
        margin: 0 auto;
        display: block !important;
    }
}

/* Tablet (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .main-content {
        padding: 20px;
        display: block !important;
    }
}

/* Mobile (< 640px) */
@media (max-width: 640px) {
    .main-content {
        padding: 12px;
        padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 20px) !important;
        display: block !important;
    }
}

/* Compatibilidade de classes legadas para forçar fluxo unificado em bloco */
.main-content.layout-master,
.main-content.layout-tecnico,
.main-content.layout-full {
    display: block !important;
    grid-template-columns: none !important;
}

/* Painel Base */
.panel-section {
    background: var(--surface-white);
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    margin-bottom: 24px;
}
.panel-section h2 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.panel-section h2 svg {
    color: var(--action);
}

/* --------------------------------------------------------------------------
   4. HEADER & TOP BAR (SOC DARK HEADER)
   -------------------------------------------------------------------------- */
.dashboard-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
}

.main-header {
    background: var(--surface-dark);
    color: var(--text-on-dark);
    padding: 0 28px;
    height: var(--header-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--surface-dark-border);
    box-shadow: 0 4px 20px rgba(7, 13, 24, 0.4);
}

.main-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.main-header .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(16, 185, 129, 0.15) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.2);
}
.main-header .brand-icon svg {
    width: 20px;
    height: 20px;
    color: #60A5FA;
}

.main-header h1 {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.3px;
    color: #FFFFFF;
}

.main-header small {
    font-size: 10.5px;
    color: var(--text-on-dark-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    display: block;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info .user-chip {
    font-size: 13px;
    color: var(--text-on-dark-muted);
    font-weight: 500;
    white-space: nowrap;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    margin-right: 4px;
}
.user-info .user-chip strong {
    color: #FFFFFF;
    font-weight: 700;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--t-fast);
}
.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}
.mobile-menu-btn:active {
    transform: scale(0.94);
}

@media (max-width: 899px) {
    .desktop-menu {
        display: none !important;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .main-header {
        padding: 0 16px;
    }
}

/* --------------------------------------------------------------------------
   5. BOTÕES & CONTROLES GLOBAIS
   -------------------------------------------------------------------------- */
button {
    font-family: inherit;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #F8FAFC;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-ghost:active {
    transform: scale(0.97);
}

.btn-login,
.btn-submit {
    width: 100%;
    min-height: 46px;
    padding: 12px 20px;
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--t-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}
.btn-login {
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-submit {
    background: linear-gradient(180deg, #2563EB 0%, #1D4ED8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-login:hover,
.btn-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-login:active,
.btn-submit:active {
    transform: scale(0.98);
}
.btn-submit:disabled,
.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Botões de Ação de OS (Touch-Friendly: Min Height 44px + Feedback Tátil) */
.btn-action {
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #FFFFFF;
    transition: var(--t-fast);
    line-height: 1.2;
    user-select: none;
    touch-action: manipulation;
}
.btn-action:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn-action:active {
    transform: scale(0.98);
}
.btn-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.5);
}

.btn-maps {
    background-color: #1E293B;
    color: #F8FAFC;
    border: 1px solid #334155;
}
.btn-whatsapp {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-done {
    background: linear-gradient(180deg, #0B1320 0%, #070D18 100%);
    border: 1px solid #1E293B;
}
.btn-pegar {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-start {
    background: linear-gradient(180deg, #2563EB 0%, #1D4ED8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-approve {
    background: linear-gradient(180deg, #0D9488 0%, #0F766E 100%);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}
.btn-disabled-wait {
    background-color: var(--surface-sunken);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}
.btn-delete {
    background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-edit {
    background-color: #334155;
    color: #FFFFFF;
}

.btn-icon-circle {
    background: var(--surface-white);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--t-fast);
    box-shadow: var(--shadow-xs);
}
.btn-icon-circle:hover {
    background: var(--surface-dark);
    color: #FFFFFF;
    border-color: var(--surface-dark);
    transform: translateY(-1px);
}
.btn-icon-circle:active {
    transform: scale(0.94);
}

/* --------------------------------------------------------------------------
   6. FITA DE KPIS RÁPIDOS (.kpi-quick-strip)
   -------------------------------------------------------------------------- */
.kpi-quick-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

@media (max-width: 1024px) {
    .kpi-quick-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
}
@media (max-width: 480px) {
    .kpi-quick-strip {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.kpi-card {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    transition: var(--t-fast);
}
.kpi-icon svg {
    width: 22px;
    height: 22px;
}

/* Variações Semânticas dos Cards de KPI */
.kpi-card.kpi-disponivel .kpi-icon {
    background: var(--st-available-bg);
    color: var(--st-available);
    border: 1px solid var(--st-available-border);
}
.kpi-card.kpi-andamento .kpi-icon {
    background: var(--st-progress-bg);
    color: var(--st-progress);
    border: 1px solid var(--st-progress-border);
}
.kpi-card.kpi-aguardando .kpi-icon {
    background: var(--st-waiting-bg);
    color: var(--st-waiting);
    border: 1px solid var(--st-waiting-border);
}
.kpi-card.kpi-concluido .kpi-icon {
    background: var(--st-done-bg);
    color: var(--st-done);
    border: 1px solid var(--st-done-border);
}
.kpi-card.kpi-urgente .kpi-icon {
    background: var(--st-urgent-bg);
    color: var(--st-urgent);
    border: 1px solid var(--st-urgent-border);
    animation: pulseIconGlow 2s infinite;
}

.kpi-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-value {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.kpi-sub {
    font-size: 11px;
    color: var(--text-subtle);
    margin-top: 3px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   7. BARRA DE BUSCA E FILTROS DINÂMICOS (.search-filter-bar)
   -------------------------------------------------------------------------- */
.search-filter-bar {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-subtle);
    pointer-events: none;
}
.search-input-wrapper input {
    width: 100%;
    padding: 11px 40px 11px 42px;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    font-size: 14.5px;
    color: var(--text-primary);
    transition: var(--t-fast);
}
.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--action);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-input-wrapper .search-shortcut {
    position: absolute;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-subtle);
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 2px 6px;
    pointer-events: none;
}
.search-input-wrapper .search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    display: none;
}

.filter-pills-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}
.filter-pills-row::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    background: var(--surface-sunken);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: var(--t-fast);
    white-space: nowrap;
}
.pill-btn:hover {
    background: #E2E8F0;
    color: var(--text-primary);
}
.pill-btn.active {
    background: var(--surface-dark);
    color: #FFFFFF;
    border-color: var(--surface-dark);
    box-shadow: 0 2px 8px rgba(11, 19, 32, 0.2);
}
.pill-counter {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
}
.pill-btn.active .pill-counter {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   8. CARTÕES DE ORDEM DE SERVIÇO (.os-card)
   -------------------------------------------------------------------------- */
.os-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}
@media (min-width: 680px) {
    .os-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 18px;
    }
}
@media (min-width: 1300px) {
    .os-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    }
}

.os-card {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px 20px;
    gap: 10px;
    box-shadow: var(--shadow-xs);
    position: relative;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.os-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-medium);
}

/* Barra Superior de 4px com Gradiente Temático */
.os-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 14px 14px 0 0;
    background: var(--border-medium);
    transition: height 0.2s ease;
}
.os-card:hover::before {
    height: 5px;
}

/* Gradientes e Tonalidades por Status */
.os-card.status-disponivel::before {
    background: linear-gradient(90deg, #10B981, #34D399);
}
.os-card.status-disponivel {
    border-color: #A7F3D0;
    background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 42px);
}

.os-card.status-andamento::before {
    background: linear-gradient(90deg, #2563EB, #60A5FA);
}
.os-card.status-andamento {
    border-color: #BFDBFE;
    background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 42px);
}

.os-card.status-aguardando::before {
    background: linear-gradient(90deg, #F59E0B, #FBBF24);
}
.os-card.status-aguardando {
    border-color: #FDE68A;
    background: linear-gradient(180deg, #FEF3C7 0%, #FFFFFF 42px);
}

.os-card.status-concluido::before {
    background: linear-gradient(90deg, #0D9488, #2DD4BF);
}
.os-card.status-concluido {
    border-color: #99F6E4;
    background: linear-gradient(180deg, #F0FDFA 0%, #FFFFFF 42px);
    opacity: 0.88;
}
.os-card.status-concluido:hover {
    opacity: 1;
}

.os-card.status-urgente::before,
.os-card-atrasada::before {
    background: linear-gradient(90deg, #EF4444, #F87171);
}
.os-card.status-urgente,
.os-card-atrasada {
    border-color: #FECACA;
    box-shadow: 0 0 0 1.5px rgba(239, 68, 68, 0.4), var(--shadow-xs);
}
.os-card-atrasada:hover {
    box-shadow: 0 0 0 1.5px #EF4444, var(--shadow-md);
}

/* Risco Alto: Atrasada e Sem Técnico Atribuído */
.os-card-risco-alto {
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 2px #EF4444, var(--shadow-glow-red) !important;
    animation: pulseBorderRed 2.2s infinite;
}

/* Cabeçalho do Card & Badges */
.os-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge svg {
    width: 12px;
    height: 12px;
}

.badge-disponivel {
    background-color: var(--st-available-bg);
    color: var(--st-available-text);
    border-color: var(--st-available-border);
    position: relative;
    padding-left: 22px;
}
.badge-disponivel::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    background: var(--st-available);
    border-radius: 50%;
    animation: pulseDotEmerald 1.8s infinite;
}
.badge-disponivel svg {
    display: none;
}

.badge-andamento {
    background-color: var(--st-progress-bg);
    color: var(--st-progress-text);
    border-color: var(--st-progress-border);
}

.badge-aguardando {
    background-color: var(--st-waiting-bg);
    color: var(--st-waiting-text);
    border-color: var(--st-waiting-border);
}

.badge-concluido {
    background-color: var(--st-done-bg);
    color: var(--st-done-text);
    border-color: var(--st-done-border);
}

.badge-urgente {
    background-color: var(--st-urgent-bg);
    color: var(--st-urgent-text);
    border-color: var(--st-urgent-border);
    animation: pulseBadgeRed 2s infinite;
}

.badge-atrasado {
    background-color: var(--st-urgent);
    color: #FFFFFF;
}

.badge-risco-alto {
    background-color: var(--st-urgent);
    color: #FFFFFF;
    animation: pulseBadgeRed 1.6s infinite;
}

.badge-neutro {
    background-color: var(--surface-sunken);
    color: var(--text-muted);
    border-color: var(--border-subtle);
}

/* Badges de Prioridade */
.badge-priority-urgente {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    animation: pulseBadgeRed 2s infinite;
}
.badge-priority-alta {
    background: #FFF7ED;
    color: #9A3412;
    border: 1px solid #FED7AA;
}
.badge-priority-normal {
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
}
.badge-priority-baixa {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

/* Tags de Tipo de Serviço */
.tag-service {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}
.tag-service-instalacao {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}
.tag-service-manutencao {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.tag-service-preventiva {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}
.tag-service-emergencia {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

/* Cronômetro de Tempo no Local (JetBrains Mono) */
.os-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: var(--radius-xs);
    background: var(--surface-sunken);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.os-timer.running {
    background: var(--st-progress-bg);
    color: var(--st-progress-text);
    border-color: var(--st-progress-border);
    animation: pulseTimer 2.2s infinite;
}

/* Tipografia do Card */
.os-numero {
    font-size: 12px;
    font-weight: 700;
    color: var(--surface-dark);
    background: var(--surface-sunken);
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    border: 1px solid var(--border-medium);
    letter-spacing: 0.2px;
}

.os-meta-who {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.os-meta-who svg {
    width: 13px;
    height: 13px;
    color: var(--text-subtle);
}

.os-card h3 {
    font-size: 16px;
    font-weight: 800;
    margin: 2px 0 6px;
    color: var(--text-primary);
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.os-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 8px;
    flex: 1;
}

.os-address {
    font-size: 13px;
    font-weight: 600;
    background: var(--surface-sunken);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.03);
}
.os-address svg {
    color: var(--text-subtle);
    flex-shrink: 0;
    margin-top: 2px;
}

.os-prazo-linha {
    font-family: var(--font-mono);
    font-size: 12.5px;
    margin-bottom: 8px;
}

/* POP Checklist Colapsável */
.pop-checklist {
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 8px 0;
}
.pop-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.pop-checklist-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pop-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pop-progress-bar {
    width: 60px;
    height: 6px;
    background: var(--border-medium);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.pop-progress-fill {
    height: 100%;
    background: var(--st-available);
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
}
.pop-progress-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}
.pop-items-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
}
.pop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.pop-item input[type="checkbox"] {
    accent-color: var(--action);
    width: 15px;
    height: 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* Tabela de Materiais Utilizados Compacta */
.os-materials-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 8px 0;
    background: var(--surface-sunken);
    border-radius: var(--radius-xs);
    overflow: hidden;
}
.os-materials-table th,
.os-materials-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
.os-materials-table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.4px;
}
.os-materials-table .qty-cell {
    font-family: var(--font-mono);
    font-weight: 700;
}

/* Mini Galeria de Fotos de Comprovação */
.os-photo-gallery {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}
.photo-count-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--surface-sunken);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
}
.photo-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-medium);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.photo-thumb:hover {
    transform: scale(1.12);
    box-shadow: var(--shadow-md);
    z-index: 5;
    border-color: var(--action);
}

/* Campo de Conclusão / Observação Técnica */
.os-conclusion-field {
    margin-top: 6px;
    margin-bottom: 10px;
}
.os-conclusion-field label {
    font-weight: 700;
    color: var(--st-urgent);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.os-conclusion-field textarea {
    width: 100%;
    height: 76px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-subtle);
    font-family: inherit;
    font-size: 13.5px;
    resize: none;
    background: var(--surface-sunken);
    transition: var(--t-fast);
}
.os-conclusion-field textarea:focus {
    outline: none;
    border-color: var(--action);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Ações do Card de OS */
.os-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}
@media (min-width: 480px) {
    .os-actions {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

/* --------------------------------------------------------------------------
   9. PAINEL HOJE (.today-panel)
   -------------------------------------------------------------------------- */
.today-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
}
.today-header h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    padding: 0;
    border: none;
    text-transform: none;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}
.today-header .today-date {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-mono);
}

.today-section-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 10px 0 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}
.today-section-label svg {
    color: var(--text-subtle);
}
.today-section-label.atraso {
    color: var(--st-urgent);
}
.today-section-label.atraso svg {
    color: var(--st-urgent);
}

.today-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-subtle);
}
.today-empty svg {
    margin: 0 auto 16px;
    color: var(--border-medium);
}
.today-empty p {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. FORMULÁRIO DE NOVA OS (.form-section)
   -------------------------------------------------------------------------- */
.form-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 36px;
    border-radius: 16px;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.form-grid-responsive,
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 580px) {
    .form-grid-responsive,
    .input-row {
        grid-template-columns: 1fr;
    }
}

.input-group {
    margin-bottom: 18px;
    text-align: left;
}
.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background-color: var(--surface-sunken);
    color: var(--text-primary);
    transition: var(--t-fast);
    font-weight: 500;
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--action);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.input-group textarea {
    height: 110px;
    resize: vertical;
    line-height: 1.55;
}

.form-hint {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    background: var(--surface-sunken);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 6px 0 20px 0;
    border-left: 3px solid var(--action);
    display: flex;
    gap: 10px;
}
.form-hint svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--action);
}
.form-hint-warning {
    background: var(--st-waiting-bg);
    border-left-color: var(--st-waiting);
}
.form-hint-warning svg {
    color: var(--st-waiting-text);
}

/* Switch iOS (Toggles Modernos) */
.ios-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface-sunken);
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    border: 1px solid var(--border-subtle);
}
.ios-switch-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}
.ios-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}
.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.ios-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-medium);
    transition: 0.3s;
    border-radius: 34px;
}
.ios-switch-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}
.ios-switch input:checked + .ios-switch-slider {
    background-color: var(--st-available);
}
.ios-switch input:checked + .ios-switch-slider::before {
    transform: translateX(20px);
}

/* Pills de Modelos Rápidos de Serviço */
.quick-template-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.pill-template {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 600;
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.pill-template:hover {
    background: var(--st-progress-bg);
    border-color: var(--st-progress-border);
    color: var(--st-progress-text);
    transform: translateY(-1px);
}
.pill-template:active {
    transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   11. CALENDÁRIO (.calendar-section)
   -------------------------------------------------------------------------- */
.calendar-section {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 32px;
    border-radius: 16px;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.calendar-header h2 {
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 800;
    border: none;
    margin: 0;
    padding: 0;
    text-transform: none;
    letter-spacing: -0.2px;
    font-family: var(--font-mono);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 800;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    background: var(--surface-sunken);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    min-height: 88px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--t-fast);
    font-family: var(--font-mono);
    color: var(--text-primary);
    position: relative;
}
.calendar-day:hover {
    border-color: var(--action);
    background: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xs);
    z-index: 2;
}
.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}
.calendar-day.empty:hover {
    transform: none;
}
.calendar-day.today {
    background: var(--surface-dark);
    color: #FFFFFF;
    border-color: var(--surface-dark);
    box-shadow: 0 4px 12px rgba(11, 19, 32, 0.25);
}

.os-indicator {
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 4px;
    border-radius: var(--radius-xs);
    margin-top: auto;
    width: 100%;
    text-align: center;
    font-family: var(--font-ui);
    letter-spacing: 0.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.os-indicator.disponivel {
    background: var(--st-available);
}
.os-indicator.andamento {
    background: var(--st-progress);
}
.os-indicator.aguardando {
    background: var(--st-waiting);
    color: var(--st-waiting-text);
}
.os-indicator.concluido {
    background: var(--st-done);
}

@media (max-width: 680px) {
    .calendar-section {
        padding: 18px 14px;
    }
    .calendar-grid {
        gap: 4px;
    }
    .calendar-day {
        padding: 5px;
        min-height: 60px;
        font-size: 12px;
        border-radius: var(--radius-xs);
    }
    .calendar-weekdays {
        font-size: 9.5px;
        gap: 4px;
    }
    .os-indicator {
        font-size: 8.5px;
        padding: 2px 1px;
    }
}

/* --------------------------------------------------------------------------
   12. MODAIS E BOTTOM SHEETS
   -------------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 13, 24, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--surface-white);
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-subtle);
    overflow-y: auto;
    padding: 24px;
    position: relative;
    animation: modalPop 0.28s var(--ease-spring) forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--surface-white);
    z-index: 10;
}
.modal-header h3 {
    color: var(--text-primary);
    margin: 0;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.2px;
}

.btn-close-modal {
    background: var(--surface-sunken);
    color: var(--text-muted);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t-fast);
}
.btn-close-modal:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Mobile Bottom Sheet (Sobe do Fundo) */
@media (max-width: 640px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-content {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
        padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
        animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .modal-content::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background: var(--border-medium);
        border-radius: var(--radius-pill);
        margin: -8px auto 14px auto;
    }
}

/* Modal Lightbox de Fotos em Alta Resolução */
.lightbox-modal .modal-content {
    background: rgba(7, 13, 24, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    max-width: 900px;
    padding: 16px;
}
.lightbox-img-full {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   13. SIDEBAR & NAVEGAÇÃO MOBILE
   -------------------------------------------------------------------------- */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: var(--surface-white);
    box-shadow: -10px 0 30px rgba(7, 13, 24, 0.2);
    z-index: 1050;
    transition: right var(--t-smooth);
    display: flex;
    flex-direction: column;
}
.mobile-sidebar.open {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: rgba(7, 13, 24, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity var(--t-smooth);
}
.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border-subtle);
}
.sidebar-header h2 {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-sidebar {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t-fast);
}
.close-sidebar:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.sidebar-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}
.sidebar-profile .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-dark);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.sidebar-profile .who strong {
    display: block;
    font-size: 14.5px;
    color: var(--text-primary);
}
.sidebar-profile .who span {
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    background: var(--surface-sunken);
    color: var(--text-primary);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: var(--t-fast);
}
.sidebar-link:hover {
    background: #E2E8F0;
}
.sidebar-link svg {
    color: var(--text-muted);
}
.sidebar-link.danger {
    color: var(--danger);
    margin-top: auto;
    background: var(--danger-bg);
}
.sidebar-link.danger svg {
    color: var(--danger);
}
.sidebar-link.accent {
    background: var(--action-bg);
    color: var(--action);
    border-color: var(--action-border);
}
.sidebar-link.accent svg {
    color: var(--action);
}

/* Bottom Nav (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 20px rgba(11, 19, 32, 0.08);
}
.bottom-nav-inner {
    display: flex;
    height: 100%;
    max-width: 980px;
    margin: 0 auto;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: var(--t-fast);
    position: relative;
}
.bottom-nav-item svg {
    color: var(--text-subtle);
    transition: var(--t-fast);
}
.bottom-nav-item.active {
    color: var(--action);
}
.bottom-nav-item.active svg {
    color: var(--action);
    transform: translateY(-1px);
}
.bottom-nav-item:active {
    transform: scale(0.92);
}
.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: var(--st-urgent);
    color: #FFFFFF;
    font-size: 9.5px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

/* --------------------------------------------------------------------------
   14. TABELAS DE AUDITORIA & HISTÓRICO (auditoria.php)
   -------------------------------------------------------------------------- */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-top: 16px;
    background: var(--surface-white);
    box-shadow: var(--shadow-xs);
}
.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.audit-table th,
.audit-table td {
    padding: 13px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
.audit-table th {
    background-color: var(--surface-sunken);
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.audit-table tr:last-child td {
    border-bottom: none;
}
.audit-table tr:hover td {
    background-color: #F8FAFC;
}

.tag-action {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}
.tag-action-success {
    background-color: var(--st-available-bg);
    color: var(--st-available-text);
    border-color: var(--st-available-border);
}
.tag-action-waiting {
    background-color: var(--st-waiting-bg);
    color: var(--st-waiting-text);
    border-color: var(--st-waiting-border);
}
.tag-action-progress {
    background-color: var(--st-progress-bg);
    color: var(--st-progress-text);
    border-color: var(--st-progress-border);
}
.tag-action-danger {
    background-color: var(--st-urgent-bg);
    color: var(--st-urgent-text);
    border-color: var(--st-urgent-border);
}
.tag-action-neutral {
    background-color: var(--surface-sunken);
    color: var(--text-muted);
    border-color: var(--border-subtle);
}

.audit-time {
    font-family: var(--font-mono);
    white-space: nowrap;
    color: var(--text-primary);
    font-size: 12.5px;
}
.audit-time .audit-hour {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}
.audit-author {
    white-space: nowrap;
    font-weight: 700;
    color: var(--text-primary);
}
.audit-author-system {
    color: var(--text-subtle);
    font-weight: 600;
    font-style: italic;
}
.audit-action-cell {
    white-space: nowrap;
}
.audit-details-cell {
    min-width: 280px;
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
}
.audit-empty-cell {
    text-align: center;
    padding: 36px;
    color: var(--text-muted);
}
.audit-page-intro {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    margin-top: -8px;
}

/* --------------------------------------------------------------------------
   15. GESTÃO DE EQUIPA (usuarios.php)
   -------------------------------------------------------------------------- */
.team-card {
    border-left: 4px solid var(--st-progress);
}
.team-card .os-address {
    margin-bottom: 8px;
}
.team-card .os-address.team-last-field {
    margin-bottom: 16px;
}
.team-card .team-actions {
    grid-template-columns: 1fr;
}
.btn-action.btn-full-width {
    width: 100%;
}

/* --------------------------------------------------------------------------
   16. CONEXÃO DO BOT WHATSAPP (bot_conexao.php)
   -------------------------------------------------------------------------- */
.bot-status-section {
    max-width: 580px;
    margin: 0 auto;
}
.bot-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.bot-status-indicator {
    display: flex;
    align-items: center;
    gap: 14px;
}
.bot-status-indicator strong {
    display: block;
    font-size: 15.5px;
    color: var(--text-primary);
}
.bot-status-detalhe {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}
.bot-status-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bot-status-dot-online {
    background: var(--st-available);
    animation: pulseDotEmerald 1.8s infinite;
}
.bot-status-dot-offline {
    background: var(--text-subtle);
}
.bot-status-dot-loading {
    background: var(--st-waiting);
    animation: pulseDotAmber 1.2s infinite;
}

.bot-acoes {
    margin-top: 18px;
}
.bot-qrcode-area {
    margin-top: 18px;
    text-align: center;
    padding: 24px;
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.bot-qrcode-area img {
    width: 230px;
    height: 230px;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    padding: 10px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.bot-qrcode-area p {
    font-size: 13.5px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 8px;
    line-height: 1.5;
}
.bot-qrcode-aviso {
    color: var(--st-urgent) !important;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   17. TELA DE LOGIN (SOC LÍDER SECURITY SHIELD)
   -------------------------------------------------------------------------- */
.login-screen {
    flex: 1;
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 20%, #0F172A 0%, #070D18 100%);
    position: relative;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Linhas de Varredura de Câmera de Vigilância SOC */
.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(96, 165, 250, 0.04) 0px,
        rgba(96, 165, 250, 0.04) 1px,
        transparent 1px,
        transparent 3px
    );
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent);
    pointer-events: none;
}

.login-screen::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 160px;
    background: linear-gradient(to bottom, transparent, rgba(37, 99, 235, 0.08), transparent);
    animation: scanSweep 8s linear infinite;
    pointer-events: none;
}

/* Card Central Translúcido */
.login-container {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 44px 36px 36px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(37, 99, 235, 0.15);
    width: 100%;
    max-width: 420px;
    margin: auto;
    position: relative;
    z-index: 2;
    animation: slideUpFade 0.45s var(--ease-spring) forwards;
}

/* Brasão Luminoso SOC */
.login-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 32px;
}
.login-mark .mark-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3) 0%, rgba(16, 185, 129, 0.2) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    position: relative;
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.4);
}
.login-mark .mark-icon svg {
    width: 30px;
    height: 30px;
    color: #60A5FA;
}
.login-mark .mark-icon::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--st-available);
    border: 2px solid #0F172A;
    border-radius: 50%;
    box-shadow: 0 0 8px var(--st-available);
    animation: pulseDotEmerald 1.8s infinite;
}

.login-mark .mark-text strong {
    font-size: 22px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.login-mark .mark-text span {
    font-size: 11.5px;
    color: #94A3B8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 3px;
    display: block;
}

/* Inputs no Tema Escuro do Login */
.login-container .input-group label {
    color: #94A3B8;
}
.login-container .input-group input {
    background: rgba(30, 41, 59, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}
.login-container .input-group input:focus {
    background: #1E293B;
    border-color: var(--action);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}

/* Status TLS 1.3 Criptografia de Segurança */
.login-tls-badge {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 11.5px;
    color: #64748B;
    font-family: var(--font-mono);
}
.login-tls-badge svg {
    width: 13px;
    height: 13px;
    color: var(--st-available);
}

/* --------------------------------------------------------------------------
   18. ALERTAS, ESTADOS VAZIOS & UTILITÁRIOS
   -------------------------------------------------------------------------- */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}
.alert-danger {
    background-color: var(--st-urgent-bg);
    color: var(--st-urgent-text);
    border-color: var(--st-urgent-border);
}
.alert-success {
    background-color: var(--st-available-bg);
    color: var(--st-available-text);
    border-color: var(--st-available-border);
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-subtle);
    grid-column: 1 / -1;
}
.empty-state svg {
    margin: 0 auto 14px;
    color: var(--border-medium);
}
.empty-state p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.is-hidden {
    display: none !important;
}

.layout-full {
    max-width: 100vw;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   19. ANIMAÇÕES & KEYFRAMES (SOC ENGINE)
   -------------------------------------------------------------------------- */
@keyframes fadeInView {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.94);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scanSweep {
    0% { top: -160px; }
    100% { top: 100%; }
}

@keyframes pulseDotEmerald {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseDotAmber {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
    70% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pulseBadgeRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulseBorderRed {
    0% { box-shadow: 0 0 0 2px #EF4444, 0 0 10px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 2px #EF4444, 0 0 24px rgba(239, 68, 68, 0.75); }
    100% { box-shadow: 0 0 0 2px #EF4444, 0 0 10px rgba(239, 68, 68, 0.4); }
}

@keyframes pulseTimer {
    0% { border-color: var(--st-progress-border); }
    50% { border-color: var(--st-progress); box-shadow: 0 0 8px rgba(37, 99, 235, 0.3); }
    100% { border-color: var(--st-progress-border); }
}

@keyframes pulseIconGlow {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5)); }
    100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   20. ACESSIBILIDADE & PREFERÊNCIA DE MOVIMENTO REDUZIDO
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}


/* --------------------------------------------------------------------------
   21. COMPONENTES SOC ADICIONAIS (UI & FRONTEND ENGINE v26.0)
   -------------------------------------------------------------------------- */

/* Banner Offline / Online */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    padding: 9px 16px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transform: translateY(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.offline-banner.visible {
    transform: translateY(0);
}
.offline-banner.online-recovered {
    background: linear-gradient(90deg, #10B981 0%, #059669 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
}

/* Abas de Navegação no Cabeçalho Desktop */
.desktop-nav-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-on-dark-muted);
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-tab-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}
.nav-tab-btn.active {
    background: var(--action);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Botão de Destaque Verde (+ Nova OS) */
.btn-new-os-highlight {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--t-fast);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    text-decoration: none;
}
.btn-new-os-highlight:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    filter: brightness(1.08);
}

/* Alternador de Visibilidade de Senha */
.input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.input-with-toggle input {
    width: 100%;
    padding-right: 44px !important;
}
.btn-toggle-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94A3B8;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t-fast);
}
.btn-toggle-pw:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

/* Moldura Scanner Laser Animada para QR Code */
.scanner-laser-frame {
    position: relative;
    display: inline-block;
    padding: 14px;
    background: #0B1320;
    border: 2px solid #2563EB;
    border-radius: var(--radius-md);
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.35);
    overflow: hidden;
    margin: 12px auto;
}
.scanner-laser-beam {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #38BDF8, #60A5FA, #38BDF8, transparent);
    box-shadow: 0 0 12px #38BDF8, 0 0 20px #38BDF8;
    animation: laserScan 2.4s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 10;
}
@keyframes laserScan {
    0% { top: 8%; opacity: 0.8; }
    50% { opacity: 1; }
    100% { top: 92%; opacity: 0.8; }
}

/* Passo a Passo de Conexão WhatsApp */
.bot-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0 16px;
    text-align: left;
}
@media (max-width: 680px) {
    .bot-steps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
.bot-step-card {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-xs);
}
.bot-step-num {
    width: 28px;
    height: 28px;
    background: var(--action-bg);
    color: var(--action);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    font-family: var(--font-mono);
}
.bot-step-card strong {
    font-size: 14px;
    color: var(--text-primary);
}
.bot-step-card p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* BI & Métricas Executivas */
.bi-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.bi-card {
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    text-align: center;
}
.bi-card .bi-num {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}
.bi-card .bi-lbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 0.5px;
}
.podium-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.podium-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}
.podium-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}
.podium-rank-1 { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.podium-rank-2 { background: #F1F5F9; color: #475569; border: 1px solid #CBD5E1; }
.podium-rank-3 { background: #FFEDD5; color: #C2410C; border: 1px solid #FED7AA; }

/* Linha do Tempo de Histórico Local */
.timeline-list {
    position: relative;
    padding-left: 24px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.timeline-list::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-medium);
}
.timeline-item {
    position: relative;
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.timeline-dot {
    position: absolute;
    left: -20px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--action);
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 2px var(--action);
}

/* Upload de fotos com preview em miniatura e remoção */
.upload-previews-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.upload-thumb-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-medium);
}
.upload-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.btn-remove-thumb {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(239, 68, 68, 0.9);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
}

/* Banner de Aviso de Recusa Anterior */
.os-rejected-banner {
    background: var(--st-urgent-bg);
    border: 1px solid var(--st-urgent-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 12.5px;
    color: var(--st-urgent-text);
}
.os-rejected-banner strong {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

/* ============================================================================
   ASSINATURA DIGITAL TOUCH & MÓDULO COMERCIAL
   ============================================================================ */
.signature-canvas-wrapper {
    background-color: #FFFFFF;
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.signature-canvas-wrapper:hover {
    border-color: var(--brand-accent);
}
#canvasAssinatura {
    width: 100%;
    height: 150px;
    display: block;
    cursor: crosshair;
}
.badge-billing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--surface-sunken);
    color: var(--text-secondary);
}

/* ============================================================================
   CARD DE OS COMPACTO & ELEGANTE (VISÃO RESUMIDA)
   ============================================================================ */
.os-card {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.os-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: var(--brand-accent);
}
.os-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 4px 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.os-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.os-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.os-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 0;
}
.os-meta-item svg {
    flex-shrink: 0;
    color: var(--text-muted);
}
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.os-chips-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.os-mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.os-mini-chip.chip-timer {
    background: #EFF6FF;
    color: #2563EB;
    border-color: #BFDBFE;
}
.os-mini-chip.chip-billing {
    background: #F8FAFC;
    color: #475569;
    border-color: #E2E8F0;
}
.os-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}
.btn-sm {
    min-height: 34px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
}

/* ============================================================================
   MODAL DE DETALHES COMPLETOS DA OS (#modalDetalhesOS)
   ============================================================================ */
.detalhe-block {
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.detalhe-block-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.detalhe-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
}
@media (max-width: 640px) {
    .detalhe-grid-2 {
        grid-template-columns: 1fr;
    }
}
.detalhe-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.detalhe-field-lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}
.detalhe-field-val {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}
.detalhe-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   STATUS DOS SERVIÇOS (DevLA Cloud) & CENTRAL DE ATUALIZAÇÕES
   ========================================================================== */

/* Banner Geral de Integridade */
.status-overall-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    gap: 12px;
    transition: background 0.2s ease;
}
.status-overall-banner.online {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.25));
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10B981;
}
.status-overall-banner.alerta {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #F59E0B;
}
.status-overall-banner strong {
    font-size: 14.5px;
    color: var(--text-primary);
}

/* Pulso animado de status */
.status-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}
.status-pulse-dot.online {
    background: #10B981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseStatus 2s infinite cubic-bezier(0.66, 0, 0, 1);
}
.status-pulse-dot.alerta {
    background: #F59E0B;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulseStatus 2s infinite cubic-bezier(0.66, 0, 0, 1);
}
.status-pulse-dot.offline {
    background: #EF4444;
}

@keyframes pulseStatus {
    to {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* Grade de Monitoramento de Serviços */
.services-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 640px) {
    .services-status-grid {
        grid-template-columns: 1fr;
    }
}

.service-status-card {
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.service-status-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-1px);
}
.service-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}
.service-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-primary);
}
.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-indicator-dot.online { background: #10B981; }
.status-indicator-dot.alerta { background: #F59E0B; }
.status-indicator-dot.offline { background: #EF4444; }

.service-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.service-badge.online {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.service-badge.alerta {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.service-meta-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.service-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}
.service-meta-item strong {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
}

/* Central de Atualizações (Changelog / Release Notes) */
.changelog-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.changelog-release {
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    position: relative;
    transition: border-color 0.2s ease;
}
.changelog-release.current {
    border-color: rgba(37, 99, 235, 0.4);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.04), var(--surface-sunken));
}
.changelog-release-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.release-tag {
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(37, 99, 235, 0.15);
    color: #60A5FA;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(37, 99, 235, 0.3);
}
.changelog-release.current .release-tag {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.3);
}
.release-date {
    font-size: 12px;
    color: var(--text-muted);
}
.changelog-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 12px;
    line-height: 1.35;
}
.changelog-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.changelog-list li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.pill-release {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.4px;
    flex-shrink: 0;
}
.pill-release.new {
    background: rgba(16, 185, 129, 0.18);
    color: #10B981;
}
.pill-release.security {
    background: rgba(139, 92, 246, 0.18);
    color: #A78BFA;
}
.pill-release.perf {
    background: rgba(245, 158, 11, 0.18);
    color: #F59E0B;
}
.pill-release.fix {
    background: rgba(59, 130, 246, 0.18);
    color: #60A5FA;
}


