/* ============================================================
   mapa.css — Estilos do Mapa de Componentes Aeronáuticos
   Sistema AVA | Gestão de Manutenção de Frota
   Design: Dark Aviation Premium
   ============================================================ */

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

/* ============================================================
   Design Tokens (Custom Properties)
   ============================================================ */
:root {
    /* Paleta principal — Aviation Dark */
    --color-bg-base: #0a0e1a;
    --color-bg-surface: #111827;
    --color-bg-card: #1a2235;
    --color-bg-card-hover: #1e2a40;
    --color-bg-header: #0d1421;
    --color-border: #1e2d45;
    --color-border-subtle: #1a2540;

    /* Acento azul aeronáutico */
    --color-accent: #2563eb;
    --color-accent-light: #3b82f6;
    --color-accent-glow: rgba(37, 99, 235, 0.25);

    /* Status */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-success-border: rgba(16, 185, 129, 0.3);

    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-warning-border: rgba(245, 158, 11, 0.3);

    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-danger-border: rgba(239, 68, 68, 0.3);

    --color-secondary: #6b7280;

    /* Texto */
    --color-text-primary: #f0f4ff;
    --color-text-secondary: #8b9ab8;
    --color-text-muted: #4b5e7a;

    /* Tipografia */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Espaçamentos */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Sombras */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--color-accent-glow);

    /* Transições */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-base);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Utilitários Globais
   ============================================================ */
.oculto {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-danger {
    color: var(--color-danger);
}

.text-warning {
    color: var(--color-warning);
}

.text-success {
    color: var(--color-success);
}

.texto-danger {
    color: var(--color-danger) !important;
    font-weight: 600;
}

.texto-warning {
    color: var(--color-warning) !important;
    font-weight: 600;
}

.texto-success {
    color: var(--color-success) !important;
    font-weight: 600;
}

.ms-1 {
    margin-left: 4px;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ============================================================
   Layout Principal
   ============================================================ */
.ava-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Wrapper abaixo do topbar: sidebar + main */
.ava-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================================
   Sidebar de Navegação
   ============================================================ */
.ava-sidebar {
    width: 220px;
    background: linear-gradient(180deg, #0d1421 0%, #0a0e1a 100%);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 73px;
    /* altura do topbar */
    height: calc(100vh - 73px);
    overflow-y: auto;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
    flex-shrink: 0;
}

.ava-sidebar.colapsado {
    width: 60px;
}

/* Título de grupo do menu */
.sidebar-grupo-titulo {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 20px 16px 6px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s;
}

.ava-sidebar.colapsado .sidebar-grupo-titulo {
    opacity: 0;
    pointer-events: none;
}

/* Item do menu */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--color-text-primary);
    border-left-color: var(--color-accent-light);
}

.sidebar-item.ativo {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    border-left-color: var(--color-accent);
    font-weight: 600;
}

.sidebar-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: var(--transition);
}

.sidebar-item-label {
    transition: opacity 0.2s;
}

.ava-sidebar.colapsado .sidebar-item-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Botão de toggle do sidebar */
.sidebar-toggle {
    margin: auto 16px 16px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-toggle:hover {
    background: var(--color-bg-card-hover);
    color: var(--color-text-primary);
    border-color: var(--color-accent-light);
}

.sidebar-toggle svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s;
}

.ava-sidebar.colapsado .sidebar-toggle svg.icon-chevron {
    transform: rotate(180deg);
}

.sidebar-toggle-label {
    transition: opacity 0.2s;
}

.ava-sidebar.colapsado .sidebar-toggle-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Separador */
.sidebar-sep {
    height: 1px;
    background: var(--color-border-subtle);
    margin: 8px 16px;
}

/* --- Header / Topbar --- */
.ava-topbar {
    background: linear-gradient(135deg, var(--color-bg-header) 0%, #0f1d35 100%);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.3px;
}

.topbar-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* --- Seletor de Aeronave --- */
.ava-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ava-select-wrapper label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ava-select {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 36px 8px 12px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 220px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b9ab8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ava-select:focus {
    outline: none;
    border-color: var(--color-accent-light);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.ava-select:hover {
    border-color: var(--color-accent-light);
}

/* --- Conteúdo Principal --- */
.ava-main {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   Cards de Contadores (Dashboard)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--card-accent, var(--color-accent));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.stat-card.card-total {
    --card-accent: var(--color-accent-light);
}

.stat-card.card-conforme {
    --card-accent: var(--color-success);
}

.stat-card.card-atencao {
    --card-accent: var(--color-warning);
}

.stat-card.card-vencido {
    --card-accent: var(--color-danger);
}

.stat-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

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

.stat-valor {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============================================================
   Card de Info da Aeronave
   ============================================================ */
.info-aeronave-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-aeronave-card .icon {
    font-size: 16px;
}

#info-aeronave-texto strong {
    color: var(--color-text-primary);
}

/* ============================================================
   Spinner de Loading
   ============================================================ */
.loading-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-accent-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Tabela de Componentes
   ============================================================ */
.tabela-wrapper {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.table-header-bar h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.table-header-bar .updated-at {
    font-size: 11px;
    color: var(--color-text-muted);
}

.tabela-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ava-tabela {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Cabeçalho */
.ava-tabela thead {
    background: linear-gradient(180deg, var(--color-bg-header) 0%, var(--color-bg-surface) 100%);
    border-bottom: 1px solid var(--color-border);
}

.ava-tabela th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    border-right: 1px solid var(--color-border-subtle);
}

.ava-tabela th:last-child {
    border-right: none;
}

/* Linhas */
.ava-tabela td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--color-text-primary);
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border-subtle);
    border-right: 1px solid var(--color-border-subtle);
    transition: background-color 0.15s;
}

.ava-tabela td:last-child {
    border-right: none;
}

.ava-tabela tbody tr:last-child td {
    border-bottom: none;
}

/* Hover nas linhas */
.ava-tabela tbody tr:hover td {
    background-color: var(--color-bg-card-hover);
}

/* Destaque visual por status (borda esquerda na linha) */
.linha-vencido td:first-child {
    border-left: 3px solid var(--color-danger);
}

.linha-atencao td:first-child {
    border-left: 3px solid var(--color-warning);
}

.linha-conforme td:first-child {
    border-left: 3px solid var(--color-success);
}

/* --- Coluna PN/SN --- */
.label-codigo {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

/* --- Frequência --- */
.freq-horas {
    font-weight: 600;
    color: var(--color-text-primary);
}

.freq-meses {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ============================================================
   Badges de Status
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

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

.badge.bg-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.badge.bg-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
    animation: pulse-danger 2s ease-in-out infinite;
}

.badge.bg-secondary {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--color-secondary);
    border: 1px solid rgba(107, 114, 128, 0.25);
}

@keyframes pulse-danger {

    0%,
    100% {
        box-shadow: none;
    }

    50% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    }
}

/* ============================================================
   Botões
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:focus {
    outline: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

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

.btn-outline-primary:hover {
    background: var(--color-accent-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg-surface);
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-text-secondary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================================
   Modal de Dar Baixa
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Estado inicial: oculto */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-caixa {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

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

/* Cabeçalho do Modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(135deg, #1a2235 0%, #0f1a2e 100%);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fechar {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1;
}

.btn-fechar:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-surface);
}

/* Corpo do Modal */
.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 10px 12px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent-light);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-control:read-only {
    background: var(--color-bg-base);
    color: var(--color-text-muted);
    cursor: default;
}

.form-hint {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Rodapé do Modal */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-surface);
}

/* Feedback no modal */
.feedback-msg {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    min-height: 36px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.feedback-sucesso {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.feedback-erro {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

/* ============================================================
   Estado vazio / inicial
   ============================================================ */
.estado-inicial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    gap: 16px;
}

.estado-inicial .icon-grande {
    font-size: 64px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.estado-inicial h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.estado-inicial p {
    font-size: 14px;
    color: var(--color-text-muted);
    max-width: 320px;
}

/* ============================================================
   Responsividade
   ============================================================ */
@media (max-width: 768px) {
    .ava-topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 12px;
    }

    .ava-select-wrapper {
        width: 100%;
    }

    .ava-select {
        min-width: 100%;
        width: 100%;
    }

    .ava-main {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-valor {
        font-size: 24px;
    }

    .ava-tabela th,
    .ava-tabela td {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Oculta colunas menos críticas em mobile */
    .col-pnsn,
    .col-frequencia {
        display: none;
    }

    .modal-caixa {
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-title {
        font-size: 15px;
    }
}

/* ============================================================
   Scrollbar personalizada (Webkit)
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ============================================================
   Autenticação (Login e Cadastro)
   ============================================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: inline-block;
    background: linear-gradient(135deg, var(--color-accent) 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
    margin-top: 10px;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.auth-links a {
    color: var(--color-accent-light);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
}

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

/* ============================================================
   Módulo — Cabeçalho de Página de Módulo
   ============================================================ */
.modulo-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.modulo-icone {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modulo-titulo {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.modulo-subtitulo {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ============================================================
   Módulo — Estado "Em Desenvolvimento"
   ============================================================ */
.modulo-em-desenvolvimento {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
    background: var(--color-bg-card);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-xl);
    max-width: 480px;
    margin: 0 auto;
}

.dev-icone {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.9;
    animation: balancear 2.5s ease-in-out infinite;
}

@keyframes balancear {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

.modulo-em-desenvolvimento h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 10px;
}

.modulo-em-desenvolvimento p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ============================================================
   Ajuste do .ava-main quando há sidebar
   ============================================================ */
.ava-body>.ava-main {
    flex: 1;
    overflow-y: auto;
    max-width: none;
}

/* ============================================================
   Responsive — Sidebar mobile
   ============================================================ */
@media (max-width: 768px) {
    .ava-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        width: 220px !important;
    }

    .ava-sidebar.aberto-mobile {
        transform: translateX(0);
    }

    .ava-body>.ava-main {
        padding: 16px;
    }
}