/* ==========================================================================
   LÍDER SEGURANÇA ELETRÔNICA — CENTRAL DE OPERAÇÕES
   Sistema de design: painel de campo, não site institucional.
   ========================================================================== */
:root {
    /* Base estrutural — grafite, não azul-corporativo */
    --ink: #0B1320;
    --surface-dark: #13203A;
    --surface-dark-2: #1B2A4A;

    --bg-main: #F1F3F7;
    --surface: #FFFFFF;
    --surface-sunken: #F7F8FA;
    --surface-raised: #FCFDFE;

    --text-main: #101826;
    --text-muted: #5B677A;
    --text-faint: #8A93A3;
    --border: #E3E7EE;
    --border-strong: #CCD3DF;

    /* Accent de AÇÃO (botões primários, foco, links) — distinto do azul de
       status "Em Andamento" abaixo. Antes os dois usavam a mesma cor
       (--st-progress), o que confundia: um card azul não deixava claro se
       era "em andamento" ou só o estilo padrão de qualquer botão da tela. */
    --action: #1E5FBF;
    --action-bg: #EBF1FE;

    /* Cores de status — semântica de central de monitoramento */
    --st-urgent: #FF5630;
    --st-urgent-bg: #FFF1ED;
    --st-available: #16B364;
    --st-available-bg: #EAFBF1;
    --st-progress: #6B4FBB;
    --st-progress-bg: #F1EDFB;
    --st-waiting: #FFB020;
    --st-waiting-bg: #FFF8E8;
    --st-done: #16B364;
    --st-done-bg: #EAFBF1;

    --danger: #E03E3E;
    --danger-bg: #FDEEEE;

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(11, 19, 32, 0.04);
    --shadow-sm: 0 2px 8px rgba(11, 19, 32, 0.06);
    --shadow-md: 0 8px 24px -6px rgba(11, 19, 32, 0.12);
    --shadow-lg: 0 20px 40px -12px rgba(11, 19, 32, 0.22);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
    --t-fast: 0.14s var(--ease);
    --t-smooth: 0.26s var(--ease);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

    --bottom-nav-h: 64px;
}

/* ==========================================================================
   RESET
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }

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

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

input, textarea, select, button { font-size: 16px; }

a { color: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

: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; }

/* ==========================================================================
   TELA DE LOGIN
   ========================================================================== */
.login-screen {
    flex: 1;
    display: flex;
    min-height: 100vh;
    background: var(--ink);
    position: relative;
    overflow: hidden;
}

/* Padrão de varredura horizontal, lembrando linhas de um feed de câmera/monitor
   de segurança — em vez do grid de pontos genérico que qualquer painel admin
   usaria. O brilho desliza devagar de cima para baixo, como um sensor ativo. */
.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(91, 169, 214, 0.05) 0px,
        rgba(91, 169, 214, 0.05) 1px,
        transparent 1px,
        transparent 3px
    );
    mask-image: radial-gradient(ellipse 75% 65% at 50% 30%, black, transparent);
}

.login-screen::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 140px;
    background: linear-gradient(to bottom, transparent, rgba(91, 169, 214, 0.07), transparent);
    animation: scanSweep 7s linear infinite;
    pointer-events: none;
}

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

@media (prefers-reduced-motion: reduce) {
    .login-screen::after { display: none; }
}

.login-container {
    background: var(--surface);
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    margin: auto;
    position: relative;
    z-index: 1;
    animation: slideUpFade 0.5s var(--ease-spring) forwards;
}

.login-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}
.login-mark .mark-icon {
    width: 44px; height: 44px;
    background: var(--ink);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.login-mark .mark-icon svg { width: 24px; height: 24px; color: #fff; position: relative; z-index: 1; }
/* Ponto de status "ativo" no canto do ícone — pequeno detalhe que reforça
   a ideia de sistema de monitoramento sempre vigilante, sem exagerar. */
.login-mark .mark-icon::after {
    content: '';
    position: absolute;
    bottom: 5px; right: 5px;
    width: 6px; height: 6px;
    background: var(--st-available);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--ink);
    animation: pulseDot 2.4s infinite;
}
.login-mark .mark-text { display: flex; flex-direction: column; }
.login-mark .mark-text strong { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }
.login-mark .mark-text span { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; }

.alert {
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.4s var(--ease) both;
}
.alert-danger { background-color: var(--danger-bg); color: #A12B2B; border: 1px solid #F3C6C6; }
.alert-success { background-color: var(--st-done-bg); color: #0E7A48; border: 1px solid #B7EAD1; }

/* ==========================================================================
   FORMULÁRIOS
   ========================================================================== */
.input-group { margin-bottom: 18px; text-align: left; }
.input-group label {
    display: block; font-size: 12.5px; font-weight: 700; color: var(--text-muted);
    margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.4px;
}
.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--surface-sunken);
    color: var(--text-main);
    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: var(--surface);
    box-shadow: 0 0 0 4px rgba(30, 95, 191, 0.12);
}
.input-group textarea { height: 110px; resize: vertical; line-height: 1.5; }

/* ==========================================================================
   BOTÕES
   ========================================================================== */
button { font-family: inherit; }

.btn-login, .btn-submit {
    width: 100%;
    padding: 15px;
    color: white;
    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;
}
.btn-login { background: var(--ink); margin-top: 6px; }
.btn-submit { background: var(--action); }
.btn-login:hover, .btn-submit:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-login:active, .btn-submit:active { transform: translateY(0); filter: brightness(0.96); }

.btn-action {
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: white;
    transition: var(--t-fast);
    line-height: 1.2;
}
.btn-action:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-action:active { transform: translateY(0); }
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-maps { background-color: var(--surface-dark); }
.btn-whatsapp { background-color: #1F9D55; }
.btn-done { background-color: var(--ink); }
.btn-pegar { background-color: var(--st-available); }
.btn-start { background-color: var(--action); }
.btn-approve { background-color: var(--st-available); }
.btn-disabled-wait { background-color: var(--surface-sunken); color: var(--text-faint); border: 1px solid var(--border); }
.btn-delete { background-color: var(--danger); }
.btn-edit { background-color: var(--action); }

.btn-ghost {
    background: rgba(255,255,255,0.08);
    color: white;
    padding: 9px 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: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { background-color: rgba(255,255,255,0.16); }

.btn-icon-circle {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px; height: 36px;
    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(--ink); color: white; border-color: var(--ink); }

/* ==========================================================================
   HEADER (TOPO ESCURO FIXO)
   ========================================================================== */
.dashboard-container { width: 100%; display: flex; flex-direction: column; flex: 1; min-height: 100vh; }

.main-header {
    background: var(--ink);
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 16px;
}
.main-header .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.main-header .brand-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.main-header .brand-icon svg { width: 19px; height: 19px; color: white; }
.main-header h1 { font-size: 16px; font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -0.2px; white-space: nowrap; }
.main-header small { font-size: 10px; opacity: 0.55; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 600; white-space: nowrap; }

.user-info { display: flex; align-items: center; gap: 8px; }
.user-info .user-chip { font-size: 13px; opacity: 0.85; font-weight: 500; white-space: nowrap; margin-right: 4px; }
.user-info .user-chip strong { font-weight: 700; opacity: 1; }

.mobile-menu-btn {
    display: none; background: rgba(255,255,255,0.08); border: none; color: white;
    width: 38px; height: 38px; border-radius: var(--radius-xs); cursor: pointer;
    align-items: center; justify-content: center; transition: var(--t-fast);
}
.mobile-menu-btn:active { transform: scale(0.92); }

@media (max-width: 899px) {
    .desktop-menu { display: none !important; }
    .mobile-menu-btn { display: flex; }
    .main-content { padding: 16px !important; gap: 16px !important; padding-bottom: calc(var(--bottom-nav-h) + 24px) !important; }
    .panel-section { padding: 18px; }
    .main-header h1 { font-size: 15px; }
}

/* ==========================================================================
   LAYOUT GRID
   ========================================================================== */
.main-content { padding: 28px 24px; width: 100%; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 24px; flex: 1; }
@media (min-width: 900px) {
    .main-content.layout-master { grid-template-columns: 360px 1fr; align-items: start; max-width: 1360px; }
    .main-content.layout-tecnico { grid-template-columns: 1fr; max-width: 980px; }
    .main-content.layout-full { grid-template-columns: 1fr; max-width: 1360px; }
}

.panel-section { background: var(--surface); padding: 24px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.panel-section h2 {
    font-size: 14px; font-weight: 800; color: var(--text-main); margin-bottom: 20px; margin-top: 0;
    padding-bottom: 14px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 9px;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.panel-section h2 svg { color: var(--action); }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .input-row { grid-template-columns: 1fr; } }

.form-hint {
    font-size: 12.5px; line-height: 1.55; color: var(--text-muted); background: var(--surface-sunken);
    padding: 12px 14px; border-radius: var(--radius-sm); margin: 4px 0 16px 0;
    border-left: 3px solid var(--action); display: flex; gap: 9px;
}
.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: #92660B; }

/* ==========================================================================
   SIDEBAR MOBILE (DESKTOP < 900px usa drawer; mobile usa bottom-nav "Mais")
   ========================================================================== */
.mobile-sidebar { position: fixed; top: 0; right: -300px; width: 280px; height: 100vh; background: var(--surface); box-shadow: -10px 0 30px rgba(11,19,32,0.18); 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(11,19,32,0.55); backdrop-filter: blur(3px); z-index: 1040; display: none; opacity: 0; transition: opacity var(--t-smooth); }
.sidebar-overlay.open { display: block; opacity: 1; }

.sidebar-header { padding: 22px 18px; display: flex; justify-content: space-between; align-items: center; background: var(--surface-sunken); }
.sidebar-header h2 { color: var(--text-main); font-size: 15px; font-weight: 800; margin: 0; text-transform: uppercase; letter-spacing: 0.4px; }
.close-sidebar { background: var(--surface); border: 1px solid var(--border); 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: 10px; flex: 1; overflow-y: auto; }

.sidebar-profile { display: flex; align-items: center; gap: 12px; padding: 4px 4px 16px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.sidebar-profile .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.sidebar-profile .who strong { display: block; font-size: 14.5px; }
.sidebar-profile .who span { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }

.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-main); border: none; cursor: pointer; text-align: left;
    transition: var(--t-fast);
}
.sidebar-link:hover { background: var(--border); }
.sidebar-link svg { color: var(--text-muted); }
.sidebar-link.danger { color: var(--danger); margin-top: auto; }
.sidebar-link.danger svg { color: var(--danger); }
.sidebar-link.accent { background: var(--action-bg); color: var(--action); }
.sidebar-link.accent svg { color: var(--action); }

/* ==========================================================================
   BOTTOM NAV — MOBILE DO TÉCNICO/MASTER (substitui hambúrguer no fluxo principal)
   ========================================================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 16px rgba(11,19,32,0.06);
}
.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-faint); cursor: pointer; font-size: 11px; font-weight: 700;
    transition: var(--t-fast); position: relative;
}
.bottom-nav-item svg { color: var(--text-faint); transition: var(--t-fast); }
.bottom-nav-item.active { color: var(--action); }
.bottom-nav-item.active svg { color: var(--action); }
.bottom-nav-item:active { transform: scale(0.94); }
.bottom-nav-badge {
    position: absolute; top: 2px; right: calc(50% - 18px);
    background: var(--st-urgent); color: white; font-size: 9.5px; font-weight: 800;
    min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
/* Utilidade genérica para ocultar qualquer elemento via classe, controlada
   pelo JS, em vez de manipular style.display diretamente. Importante: o
   !important é necessário aqui porque .is-hidden é aplicada em elementos
   que também têm display: flex/grid definido por outras regras mais
   específicas (ex: .bot-acoes, .alert) — sem o !important, a especificidade
   dessas regras ganharia e o elemento continuaria visível. */
.is-hidden { display: none !important; }

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

/* Painel "Hoje" mobile: lista direta de serviços do dia, sem precisar abrir o calendário */
.today-panel { display: none; }
@media (max-width: 899px) {
    .today-panel.active-view { display: block; }
    .view-section { display: none; }
    .view-section.active-view { display: block; }
}

.today-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.today-header h2 { font-size: 18px; font-weight: 800; margin: 0; padding: 0; border: none; text-transform: none; letter-spacing: -0.2px; }
.today-header .today-date { font-size: 12.5px; color: var(--text-muted); font-weight: 600; font-family: var(--font-mono); }

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

.today-empty {
    text-align: center; padding: 48px 20px; color: var(--text-faint);
}
.today-empty svg { margin: 0 auto 14px; color: var(--border-strong); }
.today-empty p { font-size: 14px; font-weight: 600; color: var(--text-muted); }

/* ==========================================================================
   CARTÕES DE ORDEM DE SERVIÇO
   ========================================================================== */
.os-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 650px) { .os-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } }

.os-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-xs);
    position: relative;
    transition: var(--t-smooth);
    animation: scaleUpFade 0.3s var(--ease) forwards;
    display: flex;
    flex-direction: column;
}
.os-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.os-card.status-urgente { border-left-color: var(--st-urgent); }
.os-card.status-disponivel { border-left-color: var(--st-available); background: var(--st-available-bg); }
.os-card.status-concluido { border-left-color: var(--st-done); opacity: 0.8; }
.os-card.status-concluido:hover { opacity: 1; }
.os-card.status-andamento { border-left-color: var(--st-progress); background: var(--st-progress-bg); }
.os-card.status-aguardando { border-left-color: var(--st-waiting); background: var(--st-waiting-bg); }

.os-card-header { display: flex; justify-content: space-between; align-items: center; gap: 8px 10px; margin-bottom: 14px; flex-wrap: wrap; }

.badge {
    font-size: 10.5px; font-weight: 800; padding: 5px 10px; border-radius: var(--radius-pill);
    text-transform: uppercase; letter-spacing: 0.4px; display: inline-flex; align-items: center; gap: 5px;
    white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge-urgente { background-color: var(--st-urgent-bg); color: #C73E1D; }
.badge-concluido { background-color: var(--st-done-bg); color: #0E7A48; }
.badge-aguardando { background-color: var(--st-waiting-bg); color: #92660B; }
.badge-disponivel { background-color: var(--st-available-bg); color: #0E7A48; position: relative; padding-left: 22px; }
/* O badge "Disponível" pulsa sutilmente: é o status que comunica a regra mais
   importante do produto — "quem pegar primeiro, assume o serviço" — então
   merece o único elemento animado realmente vivo na interface. */
.badge-disponivel::before {
    content: '';
    position: absolute;
    left: 9px; top: 50%;
    width: 7px; height: 7px;
    margin-top: -3.5px;
    background: var(--st-available);
    border-radius: 50%;
    animation: pulseDot 1.8s infinite;
}
.badge-disponivel svg { display: none; }
.badge-andamento { background-color: var(--st-progress-bg); color: #5639A6; }
.badge-neutro { background-color: var(--surface-sunken); color: var(--text-muted); }
.badge-atrasado { background-color: var(--st-urgent); color: white; }
.badge-risco-alto { background-color: var(--st-urgent); color: white; animation: pulseDotUrgente 1.6s infinite; }

/* Card com prazo vencido: destaque visual sutil sem competir com a cor de status principal */
.os-card-atrasada { box-shadow: 0 0 0 1.5px var(--st-urgent), var(--shadow-xs); }
.os-card-atrasada:hover { box-shadow: 0 0 0 1.5px var(--st-urgent), var(--shadow-md); }
/* Risco alto = atrasada E sem ninguém responsável: o cenário que o gestor
   mais precisa notar de cara, então o contorno é mais espesso que o atraso
   comum (onde já há alguém em campo cuidando do serviço). */
.os-card-risco-alto { box-shadow: 0 0 0 2.5px var(--st-urgent), var(--shadow-md); }
.os-card-risco-alto:hover { box-shadow: 0 0 0 2.5px var(--st-urgent), var(--shadow-lg); }

.os-numero {
    font-size: 12px; font-weight: 700; color: var(--ink); background: var(--surface-sunken);
    padding: 3px 8px; border-radius: var(--radius-xs); font-family: var(--font-mono);
    border: 1px solid var(--border-strong); 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-faint); }

.os-card h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 10px; margin-top: 0; color: var(--text-main); line-height: 1.3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.os-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; flex: 1; }
.os-address {
    font-size: 13px; font-weight: 600; background: var(--surface-sunken); padding: 11px 12px;
    border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; align-items: flex-start; gap: 9px; color: var(--text-main);
}
.os-address svg { color: var(--text-faint); flex-shrink: 0; margin-top: 1px; }

.os-conclusion-field { margin-bottom: 16px; }
.os-conclusion-field label {
    font-weight: 700; color: var(--st-urgent); font-size: 12px; display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.3px;
}
.os-conclusion-field textarea {
    width: 100%; height: 76px; padding: 11px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
    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: var(--surface); }

.os-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: auto; }
@media (min-width: 480px) { .os-actions { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); } }

/* ==========================================================================
   CARTÃO DE MEMBRO DA EQUIPA (usuarios.php)
   ========================================================================== */
.team-card { border-left-color: var(--st-progress); }
.team-card .os-address { margin-bottom: 10px; }
.team-card .os-address.team-last-field { margin-bottom: 18px; }
.team-card .team-actions { grid-template-columns: 1fr; }
.btn-action.btn-full-width { width: 100%; }

/* ==========================================================================
   CALENDÁRIO
   ========================================================================== */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.calendar-header h2 { color: var(--text-main); font-size: 15px; font-weight: 800; border: none; margin: 0; padding: 0; text-transform: none; letter-spacing: -0.1px; font-family: var(--font-mono); }

.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 800; font-size: 11px; color: var(--text-faint); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.calendar-day {
    background: var(--surface-sunken); border: 1.5px solid transparent; border-radius: var(--radius-sm);
    min-height: 78px; padding: 8px; display: flex; flex-direction: column; align-items: flex-end;
    font-size: 13.5px; font-weight: 700; cursor: pointer; transition: var(--t-fast); font-family: var(--font-mono);
    color: var(--text-main);
}
.calendar-day:hover { border-color: var(--action); background: var(--surface); transform: translateY(-2px); z-index: 2; }
.calendar-day.empty { background: transparent; border: none; cursor: default; }
.calendar-day.empty:hover { transform: none; }
.calendar-day.today { background: var(--ink); color: white; border-color: var(--ink); }

.os-indicator {
    color: white; font-size: 10px; font-weight: 700; padding: 4px 2px; border-radius: var(--radius-xs);
    margin-top: auto; width: 100%; text-align: center; font-family: var(--font-ui); letter-spacing: 0.1px;
}
.os-indicator.concluido { background: var(--st-done); }
.os-indicator.disponivel { background: var(--st-available); }
.os-indicator.aguardando { background: var(--st-waiting); color: #5C3E07; }
.os-indicator.andamento { background: var(--st-progress); }

@media (max-width: 600px) {
    .calendar-grid { gap: 4px; }
    .calendar-day { padding: 5px; min-height: 58px; font-size: 12px; border-radius: var(--radius-xs); }
    .calendar-weekdays { font-size: 9.5px; gap: 4px; }
    .os-indicator { font-size: 8.5px; padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 380px) {
    .calendar-grid { gap: 2px; }
    .calendar-weekdays { gap: 2px; font-size: 9px; }
    .calendar-day { padding: 3px; min-height: 50px; font-size: 11px; }
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(11, 19, 32, 0.6); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; padding: 14px; }
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.modal-overlay.active .modal-content { animation: modalPop 0.3s var(--ease-spring) forwards; }

.modal-content { background: var(--surface-sunken); width: 100%; max-width: 640px; max-height: 88vh; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow-y: auto; padding: 18px; position: relative; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; background: var(--surface); padding: 13px 16px; border-radius: var(--radius-sm); position: sticky; top: 0; }
.modal-header h3 { color: var(--text-main); margin: 0; font-weight: 800; font-size: 15px; }
.btn-close-modal { background: var(--surface-sunken); color: var(--text-muted); border: none; width: 30px; height: 30px; 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); }

/* ==========================================================================
   TABELAS DE AUDITORIA
   ========================================================================== */
.table-container { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); border: 1px solid var(--border); margin-top: 14px; background: var(--surface); }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.audit-table th, .audit-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.audit-table th { background-color: var(--surface-sunken); color: var(--text-muted); font-weight: 800; text-transform: uppercase; font-size: 11px; letter-spacing: 0.4px; white-space: nowrap; }
.audit-table tr:last-child td { border-bottom: none; }
.audit-table tr:hover td { background-color: var(--surface-sunken); }
.tag-action { display: inline-flex; align-items: center; padding: 5px 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: #0E7A48; }
.tag-action-waiting { background-color: var(--st-waiting-bg); color: #92660B; }
.tag-action-progress { background-color: var(--st-progress-bg); color: #5639A6; }
.tag-action-danger { background-color: var(--danger-bg); color: #A12B2B; }
.tag-action-neutral { background-color: var(--surface-sunken); color: var(--text-muted); }
.audit-time { font-family: var(--font-mono); white-space: nowrap; color: var(--text-muted); font-size: 12.5px; }
.audit-time .audit-hour { font-size: 11px; margin-left: 4px; }
.audit-author { white-space: nowrap; font-weight: 700; }
.audit-author-system { color: var(--text-faint); font-weight: 600; font-style: italic; }
.audit-action-cell { white-space: nowrap; }
.audit-details-cell { min-width: 280px; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.audit-empty-cell { text-align: center; padding: 30px; color: var(--text-muted); }
.audit-page-intro { color: var(--text-muted); font-size: 13.5px; margin-bottom: 18px; margin-top: -8px; }

/* ==========================================================================
   ANIMAÇÕES
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleUpFade { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modalPop { 0% { opacity: 0; transform: scale(0.92); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shake { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-3px, 0, 0); } 40%, 60% { transform: translate3d(3px, 0, 0); } }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(22, 179, 100, 0.5); } 70% { box-shadow: 0 0 0 6px rgba(22, 179, 100, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 179, 100, 0); } }
@keyframes pulseDotUrgente { 0% { box-shadow: 0 0 0 0 rgba(255, 86, 48, 0.45); } 70% { box-shadow: 0 0 0 5px rgba(255, 86, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 86, 48, 0); } }

@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;
    }
}

/* ==========================================================================
   ESTADOS VAZIOS / UTILITÁRIOS
   ========================================================================== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-faint); grid-column: 1 / -1; }
.empty-state svg { margin: 0 auto 12px; color: var(--border-strong); }
.empty-state p { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }

.layout-full { max-width: 100vw; overflow: hidden; }
@media (max-width: 600px) {
    .main-header h1 { font-size: 15px; }
    .btn-ghost { padding: 8px 11px; font-size: 12.5px; }
    .panel-section { padding: 16px; }
}

/* ==========================================================================
   CONEXÃO DO BOT (bot_conexao.php)
   ========================================================================== */
.bot-status-section { max-width: 560px; 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);
    border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 16px;
}
.bot-status-indicator { display: flex; align-items: center; gap: 12px; }
.bot-status-indicator strong { display: block; font-size: 15px; }
.bot-status-detalhe { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.bot-status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.bot-status-dot-online { background: var(--st-available); animation: pulseDot 1.8s infinite; }
.bot-status-dot-offline { background: var(--text-faint); }
.bot-status-dot-loading { background: var(--st-waiting); animation: pulseDot 1.2s infinite; }

.bot-acoes { margin-top: 18px; }
.bot-qrcode-area {
    margin-top: 18px; text-align: center; padding: 20px;
    background: var(--surface-sunken); border-radius: var(--radius-md); border: 1px solid var(--border);
}
.bot-qrcode-area img { width: 220px; height: 220px; border-radius: var(--radius-sm); background: white; padding: 8px; margin-bottom: 14px; }
.bot-qrcode-area p { font-size: 13px; color: var(--text-muted); max-width: 380px; margin: 0 auto 6px; line-height: 1.5; }
.bot-qrcode-aviso { color: var(--st-urgent) !important; font-weight: 600; }
