/* ╔════════════════════════════════════════════════════════════════════════╗
   ║  ATHENA — UX PREMIUM 2026                                              ║
   ║  Tudo o que separa um "app antigo" de um "Tesla/Apple/Linear" :         ║
   ║   • Motion system com curvas reais (não linear)                         ║
   ║   • Microinterações em hover/focus/active                               ║
   ║   • Skeletons de loading polidos                                         ║
   ║   • Toasts com queue + a11y                                              ║
   ║   • Empty states ilustrados                                              ║
   ║   • View Transitions API pra tema fluido                                 ║
   ║   • Tipografia fluida + focus rings refinados                            ║
   ║  Carregado em App.razor APÓS home.css pra ter precedência via cascade.  ║
   ╚════════════════════════════════════════════════════════════════════════╝ */

/* ── 1) DESIGN TOKENS ─────────────────────────────────────────────────────
   Centraliza valores que regulam a "sensação" do app. Mudar UM token aqui
   recalibra TUDO de uma vez. Tokens nomeados pelo USO (não pelo valor). */
:root {
    /* Easing — curvas Apple/Linear-style. NUNCA usar linear em UI real. */
    --ease-emphasis: cubic-bezier(0.22, 1, 0.36, 1);       /* emphasized — entradas */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);              /* out-expo */
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);          /* swap suave */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);       /* overshoot sutil */
    --ease-spring: cubic-bezier(0.5, 1.25, 0.75, 1.25);     /* spring real */

    /* Durations — escala de 60Hz pensada em frames (16/24/36/56). */
    --dur-instant: 60ms;       /* feedback imediato (click) */
    --dur-fast: 140ms;          /* hover, micro-shift */
    --dur-base: 240ms;          /* transição padrão */
    --dur-slow: 420ms;          /* entrada de elementos grandes */
    --dur-stagger: 60ms;        /* delay entre itens de lista */

    /* Elevações — sombras que comunicam hierarquia.
       Baseado em Material 3 + camadas dark-mode polidas. */
    --elev-1: 0 1px 2px rgba(0, 0, 0, 0.18), 0 1px 1px rgba(0, 0, 0, 0.12);
    --elev-2: 0 4px 8px rgba(0, 0, 0, 0.22), 0 2px 4px rgba(0, 0, 0, 0.14);
    --elev-3: 0 10px 20px rgba(0, 0, 0, 0.28), 0 4px 8px rgba(0, 0, 0, 0.18);
    --elev-4: 0 20px 40px rgba(0, 0, 0, 0.34), 0 8px 16px rgba(0, 0, 0, 0.22);
    --elev-glow-ember: 0 0 32px rgba(255, 104, 31, 0.30), 0 0 8px rgba(255, 104, 31, 0.18);

    /* Focus ring — acessibilidade WCAG 2.5.5 + estética Tesla. */
    --focus-ring: 0 0 0 2px rgba(15, 18, 26, 1), 0 0 0 4px rgba(255, 104, 31, 0.55);

    /* Tipografia fluida — escala com viewport sem media queries.
       clamp(min, preferred, max). Min legibilidade preservada em mobile. */
    --fz-xs: clamp(0.68rem, 0.65rem + 0.15vw, 0.78rem);
    --fz-sm: clamp(0.78rem, 0.74rem + 0.20vw, 0.90rem);
    --fz-base: clamp(0.90rem, 0.84rem + 0.30vw, 1.05rem);
    --fz-md: clamp(1.05rem, 0.95rem + 0.45vw, 1.30rem);
    --fz-lg: clamp(1.30rem, 1.10rem + 1.00vw, 1.85rem);
    --fz-xl: clamp(1.80rem, 1.40rem + 2.00vw, 2.90rem);
}

/* Modo reduzir movimento (a11y) — respeitar prefs do SO. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── 2) FOCUS RINGS REFINADOS ──────────────────────────────────────────────
   Substitui o "outline azul feio" do browser por ring laranja com gap.
   `:focus-visible` só ativa quando usuário navegou via teclado — não polui
   click do mouse. */
*:focus { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    transition: box-shadow var(--dur-fast) var(--ease-out);
}

/* ── 3) MICROINTERAÇÕES ────────────────────────────────────────────────────
   Botões, cards e elementos clicáveis ganham resposta tátil sutil.
   Princípio: hover muda Y -1px + brilho; active pressiona +1px; tudo curto. */
button, .btn, .athena-btn, .sys-btn, [role="button"], .nexus-btn,
.atb-chip, .amms-btn, .tn-btn, .sla-btn {
    transition: transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                filter var(--dur-fast) var(--ease-out);
    will-change: transform;
}
button:hover:not(:disabled), .btn:hover:not(:disabled),
.athena-btn:hover:not(:disabled), .sys-btn:hover:not(:disabled),
[role="button"]:hover:not(:disabled), .nexus-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.06);
}
button:active:not(:disabled), .btn:active:not(:disabled),
.athena-btn:active:not(:disabled), .sys-btn:active:not(:disabled),
[role="button"]:active:not(:disabled), .nexus-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
    filter: brightness(0.96);
    transition-duration: var(--dur-instant);
}

/* Cards que NÃO são clicáveis ainda ganham lift sutil em hover (afeta foco visual). */
.athena-card-hoverable {
    transition: transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out);
}
.athena-card-hoverable:hover {
    transform: translateY(-2px);
    box-shadow: var(--elev-3);
}

/* ── 4) ENTRADA DE PÁGINA / ELEMENTOS — FADE-UP STAGGER ────────────────────
   Aplica em containers com [data-athena-enter]. JS adiciona automaticamente. */
@keyframes athena-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
[data-athena-enter] {
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) both;
}
[data-athena-enter] > * {
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) both;
}
[data-athena-enter] > *:nth-child(1) { animation-delay: calc(var(--dur-stagger) * 0); }
[data-athena-enter] > *:nth-child(2) { animation-delay: calc(var(--dur-stagger) * 1); }
[data-athena-enter] > *:nth-child(3) { animation-delay: calc(var(--dur-stagger) * 2); }
[data-athena-enter] > *:nth-child(4) { animation-delay: calc(var(--dur-stagger) * 3); }
[data-athena-enter] > *:nth-child(5) { animation-delay: calc(var(--dur-stagger) * 4); }
[data-athena-enter] > *:nth-child(6) { animation-delay: calc(var(--dur-stagger) * 5); }
[data-athena-enter] > *:nth-child(n+7) { animation-delay: calc(var(--dur-stagger) * 6); }

/* ── 5) SKELETONS — LOADING STATES POLIDOS ─────────────────────────────────
   Substitui spinners. Shimmer diagonal. Use .athena-sk em qualquer div. */
.athena-sk, .athena-sk-text, .athena-sk-circle, .athena-sk-bar {
    position: relative;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.04) 80%
    );
    background-size: 200% 100%;
    animation: athena-sk-shimmer 1.4s linear infinite;
    border-radius: 6px;
    overflow: hidden;
}
.athena-sk-text {
    height: 12px;
    margin: 4px 0;
}
.athena-sk-text--lg { height: 18px; }
.athena-sk-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
}
.athena-sk-bar { height: 8px; }
@keyframes athena-sk-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 6) TOAST SYSTEM 2026 ──────────────────────────────────────────────────
   Stack vertical no canto inferior direito (desktop) ou full-width no top
   em mobile. Auto-dismiss controlado por JS, mas a animação fica aqui. */
.athena-toast-stack {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 40px));
}
.athena-toast {
    pointer-events: auto;
    background: rgba(15, 18, 26, 0.95);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-left: 3px solid var(--toast-accent, #ff681f);
    color: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: var(--elev-3);
    font-family: var(--font-display, system-ui), sans-serif;
    font-size: 13px;
    line-height: 1.45;
    animation: athena-toast-in var(--dur-base) var(--ease-emphasis) both;
    display: flex; align-items: flex-start; gap: 10px;
}
.athena-toast--ok    { --toast-accent: #4ade80; }
.athena-toast--warn  { --toast-accent: #fbbf24; }
.athena-toast--err   { --toast-accent: #f87171; }
.athena-toast--info  { --toast-accent: #60a5fa; }
.athena-toast-icon { font-size: 16px; line-height: 1; margin-top: 1px; }
.athena-toast-msg { flex: 1; }
.athena-toast-title { font-weight: 700; margin-bottom: 2px; }
.athena-toast-close {
    background: transparent; border: none; color: rgba(255,255,255,.45);
    cursor: pointer; font-size: 16px; padding: 0; line-height: 1;
}
.athena-toast-close:hover { color: #fff; }
.athena-toast.leaving {
    animation: athena-toast-out var(--dur-base) var(--ease-in-out) both;
}
@keyframes athena-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes athena-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px) scale(0.95); }
}
@media (max-width: 640px) {
    .athena-toast-stack {
        top: calc(8px + env(safe-area-inset-top, 0px));
        bottom: auto;
        left: 8px; right: 8px;
        max-width: none;
    }
    .athena-toast {
        animation-name: athena-toast-in-mobile;
    }
    @keyframes athena-toast-in-mobile {
        from { opacity: 0; transform: translateY(-20px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ── 7) EMPTY STATES ───────────────────────────────────────────────────────
   Quando lista/grid vazia, mostra ilustração + microcopy + CTA.
   Use: <div class="athena-empty">…</div> */
.athena-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
}
.athena-empty-icon {
    font-size: 56px;
    line-height: 1;
    opacity: 0.45;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 24px rgba(255, 104, 31, 0.25));
}
.athena-empty-title {
    font-family: var(--font-display, system-ui), sans-serif;
    font-weight: 800;
    font-size: var(--fz-md);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
}
.athena-empty-desc {
    font-size: var(--fz-sm);
    max-width: 38ch;
    line-height: 1.5;
    margin-bottom: 18px;
}
.athena-empty-cta {
    padding: 8px 18px;
    background: linear-gradient(135deg, #ff681f, #ff8c4d);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: var(--fz-sm);
}

/* ── 8) ATALHOS DE TECLADO — KBD STYLE ─────────────────────────────────────
   Tecla aparecendo em tooltips, help modal, microcopy. */
.athena-kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom-width: 2px;
    border-radius: 5px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5) inset;
}

/* Help modal (atalhos) */
.athena-help-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 99998;
    animation: athena-fade-up var(--dur-base) var(--ease-emphasis) both;
}
.athena-help-modal {
    background: rgba(15, 18, 26, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 28px;
    width: min(560px, 90vw);
    box-shadow: var(--elev-4);
}
.athena-help-title {
    font-family: var(--font-display, system-ui), sans-serif;
    font-weight: 800;
    font-size: var(--fz-md);
    color: #fff;
    margin-bottom: 16px;
}
.athena-help-list { display: flex; flex-direction: column; gap: 8px; }
.athena-help-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--fz-sm);
}
.athena-help-keys { display: flex; gap: 4px; }

/* ── 9) TIPOGRAFIA FLUIDA ──────────────────────────────────────────────────
   Aplica em headings sem precisar de @media. */
h1.athena-h1 { font-size: var(--fz-xl); line-height: 1.05; letter-spacing: -0.02em; font-weight: 900; }
h2.athena-h2 { font-size: var(--fz-lg); line-height: 1.15; letter-spacing: -0.015em; font-weight: 800; }
h3.athena-h3 { font-size: var(--fz-md); line-height: 1.25; font-weight: 700; }
.athena-text-base { font-size: var(--fz-base); line-height: 1.55; }
.athena-text-sm   { font-size: var(--fz-sm);  line-height: 1.5; }

/* ── 10) VIEW TRANSITIONS API — modo escuro ↔ claro fluido ────────────────
   Quando suportado, anima a troca de tema com cross-fade radial. */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: var(--dur-slow);
    animation-timing-function: var(--ease-emphasis);
    mix-blend-mode: normal;
}

/* ── 11) SCROLLBARS TEMATIZADAS ────────────────────────────────────────────
   Sutil, não invasiva, combina com a paleta. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 104, 31, 0.35) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(255, 104, 31, 0.30);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 104, 31, 0.55);
    background-clip: padding-box;
}

/* ── 12) SELECTION COLOR ──────────────────────────────────────────────────
   Cor do texto selecionado combina com brand. */
::selection {
    background: rgba(255, 104, 31, 0.40);
    color: #fff;
}

/* ── 13) RIPPLE EFFECT (sutil) — botões grandes ───────────────────────────
   Use .athena-ripple. JS dispara a animação. */
.athena-ripple {
    position: relative;
    overflow: hidden;
}
.athena-ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: athena-ripple-anim var(--dur-slow) var(--ease-out) forwards;
    pointer-events: none;
}
@keyframes athena-ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* ── 14) ONBOARDING SPOTLIGHT (mini-tour) ─────────────────────────────────
   Highlight de elemento com máscara escura ao redor. */
.athena-spotlight-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.78);
    z-index: 99000;
    pointer-events: auto;
    transition: opacity var(--dur-slow) var(--ease-out);
}
.athena-spotlight-tip {
    position: fixed;
    z-index: 99001;
    background: rgba(15, 18, 26, 0.98);
    border: 1px solid rgba(255, 104, 31, 0.40);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 340px;
    box-shadow: var(--elev-glow-ember), var(--elev-3);
    color: #fff;
    font-size: var(--fz-sm);
    animation: athena-fade-up var(--dur-base) var(--ease-emphasis) both;
}
.athena-spotlight-step { font-size: 10px; color: rgba(255, 104, 31, 0.85); font-weight: 700; letter-spacing: 1px; margin-bottom: 6px; }
.athena-spotlight-title { font-family: var(--font-display, system-ui), sans-serif; font-weight: 800; font-size: var(--fz-base); margin-bottom: 6px; }
.athena-spotlight-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
.athena-spotlight-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.athena-spotlight-btn--primary {
    background: linear-gradient(135deg, #ff681f, #ff8c4d);
    border-color: transparent;
}

/* ── 15) BACK-TO-TOP FLOAT ─────────────────────────────────────────────────
   Aparece quando scroll > 400px. Pequeno detalhe que polish. */
.athena-back-top {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9996;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(15, 18, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: opacity var(--dur-base) var(--ease-out),
                visibility var(--dur-base) var(--ease-out),
                transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out);
}
.athena-back-top.visible {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.athena-back-top:hover { box-shadow: var(--elev-glow-ember); }

/* ── 16) INPUT STATES MELHORADOS ──────────────────────────────────────────
   Inputs com label flutuante (Material 3 style), animação suave. */
.athena-field { position: relative; }
.athena-field input,
.athena-field select,
.athena-field textarea {
    width: 100%;
    padding: 18px 12px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    color: #fff;
    font-size: var(--fz-sm);
    transition: border-color var(--dur-base) var(--ease-out),
                background-color var(--dur-base) var(--ease-out);
}
.athena-field input:focus,
.athena-field select:focus,
.athena-field textarea:focus {
    border-color: rgba(255, 104, 31, 0.55);
    background: rgba(255, 255, 255, 0.06);
}
.athena-field label {
    position: absolute;
    left: 12px; top: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--fz-sm);
    pointer-events: none;
    transition: top var(--dur-base) var(--ease-out),
                font-size var(--dur-base) var(--ease-out),
                color var(--dur-base) var(--ease-out);
}
.athena-field input:focus + label,
.athena-field input:not(:placeholder-shown) + label,
.athena-field select:focus + label,
.athena-field textarea:focus + label,
.athena-field textarea:not(:placeholder-shown) + label {
    top: 4px;
    font-size: 10px;
    color: rgba(255, 104, 31, 0.85);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ╔════════════════════════════════════════════════════════════════════════╗
   ║  OVERRIDES VISÍVEIS — aplicam o design system nos elementos REAIS do   ║
   ║  ATHENA sem precisar mudar HTML. Mira nos seletores reais do app.      ║
   ╚════════════════════════════════════════════════════════════════════════╝ */

/* Background do app — gradient profundo com luz ambiente sutil
   no canto superior esquerdo (foco visual onde está o brand). */
.nexus-system-root {
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255, 104, 31, 0.10) 0%, transparent 45%),
        radial-gradient(ellipse at 100% 100%, rgba(96, 165, 250, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, #0a0c12 0%, #0e1118 50%, #0a0c12 100%) !important;
}

/* Sidebar — glassmorphism mais polido + border sutil ember */
.side-panel {
    background: rgba(13, 16, 22, 0.92) !important;
    backdrop-filter: blur(20px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    border-right: 1px solid rgba(255, 104, 31, 0.08) !important;
    box-shadow:
        4px 0 24px rgba(0, 0, 0, 0.35),
        inset -1px 0 0 rgba(255, 255, 255, 0.03) !important;
}

/* Brand header da sidebar — entrada com fade */
.brand-header {
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) both;
}

/* Hierarquia — itens com microhover refinado */
.hierarchy-toggle {
    transition: background-color var(--dur-base) var(--ease-out),
                transform var(--dur-fast) var(--ease-out) !important;
}
.hierarchy-toggle:hover {
    background-color: rgba(255, 104, 31, 0.06) !important;
}

/* System actions buttons (MAPA / COMPARAR / CONFIGURAÇÕES / SAIR) */
.sys-btn {
    transition: all var(--dur-base) var(--ease-out) !important;
}
.sys-btn:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 104, 31, 0.40) !important;
    transform: translateX(2px) !important;
}

/* Asset header (card "2202 / Telemetry link active") — elevação premium */
.asset-header-bar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.005) 100%),
        rgba(15, 18, 26, 0.85) !important;
    backdrop-filter: blur(12px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-left: 3px solid #ff681f !important;
    box-shadow:
        var(--elev-2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) both;
}

/* Map container — borda glow ember + animação de entrada */
.map-container {
    box-shadow:
        var(--elev-3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 40px rgba(255, 104, 31, 0.04) !important;
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) 80ms both;
}

/* Cards de KPIs do dashboard (VELOCIDADE / RPM / FUEL / TEMP) */
.pdf-kpi-box,
.mc-signal,
.athena-card,
.nexus-card,
[class*="kpi-box"],
[class*="signal-card"] {
    transition: transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out) !important;
}
.pdf-kpi-box:hover,
.mc-signal:hover,
.athena-card:hover,
.nexus-card:hover,
[class*="kpi-box"]:hover,
[class*="signal-card"]:hover {
    transform: translateY(-2px) !important;
    box-shadow:
        var(--elev-3),
        0 0 0 1px rgba(255, 104, 31, 0.20) !important;
}

/* Animação cascateada de entrada pros KPIs */
.mc-signals-grid > *,
.pdf-grid-4 > * {
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) both;
}
.mc-signals-grid > *:nth-child(1),
.pdf-grid-4 > *:nth-child(1) { animation-delay: 0ms; }
.mc-signals-grid > *:nth-child(2),
.pdf-grid-4 > *:nth-child(2) { animation-delay: 50ms; }
.mc-signals-grid > *:nth-child(3),
.pdf-grid-4 > *:nth-child(3) { animation-delay: 100ms; }
.mc-signals-grid > *:nth-child(4),
.pdf-grid-4 > *:nth-child(4) { animation-delay: 150ms; }
.mc-signals-grid > *:nth-child(5),
.pdf-grid-4 > *:nth-child(5) { animation-delay: 200ms; }
.mc-signals-grid > *:nth-child(n+6),
.pdf-grid-4 > *:nth-child(n+6) { animation-delay: 250ms; }

/* Hero empty state — refinado */
.nexus-hero-shell {
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) both;
}

/* Topbar — refinamento adicional do gradient inferior */
.athena-topbar::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 104, 31, 0.30) 20%,
        rgba(255, 104, 31, 0.90) 50%,
        rgba(255, 104, 31, 0.30) 80%,
        transparent 100%) !important;
    height: 1px !important;
    filter: blur(0.3px);
}

/* Botões de ação no header do ativo (Gerar PDF / Editar / Excluir) */
.btn-report-stealth,
.btn-edit-stealth,
.btn-delete-stealth {
    transition: all var(--dur-base) var(--ease-out) !important;
    position: relative;
    overflow: hidden;
}
.btn-report-stealth:hover,
.btn-edit-stealth:hover,
.btn-delete-stealth:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(255, 104, 31, 0.25) !important;
}

/* Mission control / signals grid */
.mc-signals-band,
.mc-arcs-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%),
        rgba(15, 18, 26, 0.85) !important;
    backdrop-filter: blur(10px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: var(--elev-2), inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
    animation: athena-fade-up var(--dur-slow) var(--ease-emphasis) 120ms both;
}

/* Tabelas — hover em rows */
table tbody tr {
    transition: background-color var(--dur-fast) var(--ease-out);
}
table tbody tr:hover {
    background-color: rgba(255, 104, 31, 0.04);
}

/* Chat IA flutuante — refinamento */
.ia-chat-button,
[class*="athena-chat-bubble"],
.athena-ia-fab {
    transition: all var(--dur-base) var(--ease-out) !important;
    box-shadow:
        var(--elev-3),
        0 0 32px rgba(255, 104, 31, 0.35) !important;
}
.ia-chat-button:hover,
[class*="athena-chat-bubble"]:hover,
.athena-ia-fab:hover {
    transform: translateY(-3px) scale(1.04) !important;
    box-shadow:
        var(--elev-4),
        0 0 48px rgba(255, 104, 31, 0.55) !important;
}

/* Mobile menu / search input glow ao focar */
.search-container input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 104, 31, 0.50) !important;
    box-shadow:
        0 0 0 3px rgba(255, 104, 31, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
    transition: border-color var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out) !important;
}

/* Modais — glassmorphism mais elegante */
.modal-overlay,
.modal-overlay-2026,
.athena-help-overlay,
[class*="modal-bg"] {
    animation: athena-fade-up var(--dur-base) var(--ease-out) both !important;
}
.modal-card,
.modal-content,
.cadastro-truck-card,
[class*="modal-dialog"] > div {
    animation: athena-modal-scale-in var(--dur-base) var(--ease-emphasis) both !important;
}
@keyframes athena-modal-scale-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Loading dots no chat IA */
.thinking-dots span {
    animation-timing-function: var(--ease-in-out) !important;
}

/* Ícones de status (online/offline dot) — pulso mais elegante */
.mapa-frota-dot {
    animation: athena-pulse-dot 1.8s var(--ease-in-out) infinite !important;
}
@keyframes athena-pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 12px rgba(0, 255, 102, 0.7), 0 0 4px rgba(0, 255, 102, 0.5); }
    50%      { opacity: 0.65; box-shadow: 0 0 4px rgba(0, 255, 102, 0.3); }
}

/* ── 17) LOADER PRINCIPAL DA APP — substitui spinner padrão ──────────────── */
.athena-app-loader {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 18px;
    background: radial-gradient(circle at center, #14171f 0%, #0a0c12 100%);
    z-index: 99997;
}
.athena-app-loader-ring {
    width: 56px; height: 56px;
    border: 3px solid rgba(255, 255, 255, 0.10);
    border-top-color: #ff681f;
    border-radius: 50%;
    animation: athena-spin 0.9s linear infinite;
}
.athena-app-loader-msg {
    color: rgba(255, 255, 255, 0.65);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
@keyframes athena-spin {
    to { transform: rotate(360deg); }
}
