/* ═══════════════════════════════════════════════════════════════
   XRISK 360 — REDESIGN VISUAL
   Paleta de cores: #30343F, #FAFAFF, #E4D9FF, #273469, #1E2749
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   1. TOKENS DE COR — Paleta personalizada
   ═══════════════════════════════════════════════════════════════ */

:root {
    --xr-navy-dark: #1e2749;
    --xr-navy: #273469;
    --xr-slate: #30343f;
    --xr-white: #fafaff;
    --xr-lavender: #e4d9ff;

    /* Aliases de design system */
    --ds-primary: #273469;
    --ds-primary-dark: #1e2749;
    --ds-primary-light: #6b7cb8;
    --ds-primary-soft: rgba(39, 52, 105, 0.08);
    --ds-primary-border: #c7d2fe;

    --ds-bg: #fafaff;
    --ds-card: #ffffff;
    --ds-card-hover: #f4f1ff;
    --ds-text: #30343f;
    --ds-text-secondary: #4a5264;
    --ds-muted: #8f95a8;
    --ds-border: #e4d9ff;
    --ds-border-light: #f0eaff;

    --ds-success: #10b981;
    --ds-warning: #f59e0b;
    --ds-danger: #ef4444;
    --ds-info: #06b6d4;

    --ds-radius-sm: 8px;
    --ds-radius-md: 12px;
    --ds-radius-lg: 16px;

    --ds-shadow-sm: 0 1px 3px rgba(30, 39, 73, 0.06), 0 1px 2px rgba(30, 39, 73, 0.04);
    --ds-shadow-md: 0 4px 6px -1px rgba(30, 39, 73, 0.08), 0 2px 4px -2px rgba(30, 39, 73, 0.05);
    --ds-shadow-lg: 0 10px 25px -3px rgba(30, 39, 73, 0.12), 0 4px 6px -4px rgba(30, 39, 73, 0.08);

    --ds-transition: 0.25s ease;
}

/* ═══════════════════════════════════════════════════════════════
   2. SIDEBAR — Cinza escuro com acentos índigo
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
    background: linear-gradient(180deg, #1e2749 0%, #232e54 50%, #30343f 100%) !important;
    border-right: none !important;
    box-shadow: 2px 0 20px rgba(30, 39, 73, 0.3);
}

/* Header da sidebar */
.sidebar-header {
    background: linear-gradient(135deg, rgba(39, 52, 105, 0.5), rgba(30, 39, 73, 0.2)) !important;
    border-bottom: 1px solid rgba(228, 217, 255, 0.1) !important;
}

/* Logo com gradiente índigo */
.sidebar-logo-icon {
    background: linear-gradient(135deg, #273469, #6b7cb8) !important;
    box-shadow: 0 4px 15px rgba(39, 52, 105, 0.4);
}

.sidebar-logo-text {
    color: #fafaff !important;
}

/* User info */
.user-avatar-mini {
    background: linear-gradient(135deg, #273469, #6b7cb8) !important;
    border: 2px solid rgba(228, 217, 255, 0.15) !important;
    box-shadow: 0 2px 10px rgba(39, 52, 105, 0.3);
}

.user-name {
    color: #e4d9ff !important;
}

/* Nav links */
.nav-links a {
    border-radius: 0 10px 10px 0 !important;
    margin-right: 0.5rem !important;
    padding: 0.7rem 1.2rem !important;
    font-size: 0.92rem !important;
    transition: all 0.25s ease !important;
    color: #eef0f9 !important;
}

.nav-links a:hover {
    background: linear-gradient(90deg, rgba(228, 217, 255, 0.15), rgba(228, 217, 255, 0.03)) !important;
    color: #fafaff !important;
    transform: translateX(3px);
}

.nav-links a.active {
    background: linear-gradient(90deg, rgba(228, 217, 255, 0.25), rgba(228, 217, 255, 0.05)) !important;
    border-left: 3px solid #e4d9ff !important;
    color: #fafaff !important;
}

/* Submenu toggle */
.nav-submenu-toggle {
    border-radius: 0 10px 10px 0 !important;
    margin-right: 0.5rem !important;
    transition: all 0.25s ease !important;
    color: #eef0f9 !important;
}

.nav-submenu-toggle:hover {
    background: linear-gradient(90deg, rgba(228, 217, 255, 0.15), rgba(228, 217, 255, 0.03)) !important;
    color: #fafaff !important;
    transform: translateX(3px);
}

/* Submenu */
.nav-submenu a {
    border-radius: 0 8px 8px 0 !important;
    margin-right: 0.5rem !important;
    transition: all 0.2s ease !important;
    color: #e4e8f6 !important;
}

.nav-submenu a:hover {
    background: rgba(228, 217, 255, 0.12) !important;
    color: #fafaff !important;
    transform: translateX(3px);
}

/* Section titles */
.nav-section-title {
    color: #d2d7ec !important;
    font-size: 0.6rem !important;
    letter-spacing: 1.5px !important;
}

/* Company selector */
.company-select {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(228, 217, 255, 0.12) !important;
    border-radius: 10px !important;
    color: #e4d9ff !important;
}

.company-select:focus {
    border-color: #e4d9ff !important;
    box-shadow: 0 0 0 3px rgba(228, 217, 255, 0.15) !important;
}

/* Language selector */
.language-selector-sidebar a {
    color: #eef0f9 !important;
}
.language-selector-sidebar a:hover {
    color: #ffffff !important;
}
.language-selector-sidebar a.active-lang {
    color: #ffffff !important;
    background: rgba(228, 217, 255, 0.15) !important;
    border-color: #e4d9ff !important;
    box-shadow: 0 0 16px rgba(228, 217, 255, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   3. MAIN CONTENT — Branco quase puro com lavanda suave
   ═══════════════════════════════════════════════════════════════ */

.main-content {
    background: linear-gradient(180deg, #fafaff 0%, #f4f1ff 100%) !important;
}

/* Container */
.container {
    max-width: 1600px !important;
    margin: 0 auto !important;
}

/* ═══════════════════════════════════════════════════════════════
   4. CARDS — Branco com sombras índigo suaves
   ═══════════════════════════════════════════════════════════════ */

.card,
.card-premium,
.chart-card,
.list-card {
    border-radius: 14px !important;
    border: 1px solid rgba(228, 217, 255, 0.8) !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(30, 39, 73, 0.05), 0 8px 24px rgba(30, 39, 73, 0.04) !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease !important;
}

.card:hover,
.card-premium:hover,
.chart-card:hover {
    box-shadow: 0 4px 12px rgba(30, 39, 73, 0.08), 0 12px 32px rgba(39, 52, 105, 0.08) !important;
    transform: translateY(-2px);
    border-color: rgba(228, 217, 255, 1) !important;
}

/* Proteção: cards escuros com texto branco devem manter fundo escuro */
.project-summary-card,
[style*="background: linear-gradient(135deg, #0f172a"] {
    background: linear-gradient(135deg, #1e2749 0%, #273469 100%) !important;
    color: #fafaff !important;
}

.project-summary-card *,
[style*="background: linear-gradient(135deg, #0f172a"] * {
    color: #e4d9ff !important;
}

.project-summary-card div[style*="color: white"],
.project-summary-card div[style*="color:#ffffff"],
.project-summary-card div[style*="color: #ffffff"] {
    color: #fafaff !important;
}

/* ═══════════════════════════════════════════════════════════════
   5. PAGE HERO — Azul marinho com lavanda
   ═══════════════════════════════════════════════════════════════ */

.page-hero,
.ds-page-header {
    background: linear-gradient(135deg, #1e2749 0%, #273469 55%, #30343f 100%) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(30, 39, 73, 0.35) !important;
    position: relative;
    overflow: hidden;
}

/* Pulsos decorativos */
.page-hero::before,
.ds-page-header::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(228, 217, 255, 0.05);
    top: -120px;
    right: -100px;
}

.page-hero::after,
.ds-page-header::after {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(228, 217, 255, 0.04);
    bottom: -100px;
    left: 20%;
}

.page-hero *,
.ds-page-header * {
    position: relative;
    z-index: 1;
}

/* KPI badges com glass effect lavender */
.page-hero-kpi,
.ds-page-header-kpi {
    background: rgba(228, 217, 255, 0.1) !important;
    border: 1px solid rgba(228, 217, 255, 0.2) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px !important;
}

.page-hero-title,
.ds-page-header-title {
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #ffffff !important;
}

.page-hero-sub,
.ds-page-header-sub {
    opacity: 1 !important;
    color: #fafaff !important;
}

.page-hero-kpi-val,
.ds-page-header-kpi-val {
    color: #ffffff !important;
}

.page-hero-kpi-lbl,
.ds-page-header-kpi-lbl {
    color: #fafaff !important;
}

/* ═══════════════════════════════════════════════════════════════
   6. BOTÕES — Índigo escuro como primário
   ═══════════════════════════════════════════════════════════════ */

.btn,
.btn-premium,
.ds-btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.ds-btn {
    background: #273469 !important;
    box-shadow: 0 4px 12px rgba(39, 52, 105, 0.25);
}

.ds-btn:hover {
    background: #1e2749 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 52, 105, 0.35) !important;
}

.ds-btn-ghost {
    background: #ffffff !important;
    color: #30343f !important;
    border: 1px solid #e4d9ff !important;
}

.ds-btn-ghost:hover {
    border-color: #273469 !important;
    color: #273469 !important;
    background: rgba(228, 217, 255, 0.3) !important;
}

.btn-primary,
.btn-info {
    background: linear-gradient(135deg, #273469 0%, #1e2749 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(39, 52, 105, 0.25);
}

.btn-primary:hover,
.btn-info:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 52, 105, 0.35) !important;
}

/* ═══════════════════════════════════════════════════════════════
   7. FORMULÁRIOS — Inputs mais limpos
   ═══════════════════════════════════════════════════════════════ */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    border-radius: 8px !important;
    border: 1px solid #e4d9ff !important;
    background: #fafaff !important;
    padding: 0.65rem 0.85rem !important;
    transition: all 0.2s ease !important;
    color: #30343f !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #273469 !important;
    box-shadow: 0 0 0 3px rgba(39, 52, 105, 0.1) !important;
    outline: none;
    background: #ffffff !important;
}

/* Fieldsets */
fieldset {
    border: 1px solid #e4d9ff !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(30, 39, 73, 0.03);
}

legend {
    color: #273469 !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    background: #fafaff;
    padding: 4px 14px !important;
    border-radius: 20px;
    border: 1px solid #e4d9ff;
}

/* ═══════════════════════════════════════════════════════════════
   8. TABELAS — Cabeçalhos com lavanda
   ═══════════════════════════════════════════════════════════════ */

.data-table thead tr,
.table-premium thead tr,
table:not([class]) thead tr {
    background: linear-gradient(135deg, #fafaff, #f4f1ff) !important;
}

.data-table th,
.table-premium th,
table:not([class]) th {
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #273469 !important;
    font-weight: 700 !important;
    padding: 0.8rem 1rem !important;
}

/* ═══════════════════════════════════════════════════════════════
   9. TABS — Índigo escuro ativo
   ═══════════════════════════════════════════════════════════════ */

.dashboard-tabs,
.tabs-premium {
    background: rgba(250, 250, 255, 0.8) !important;
    backdrop-filter: blur(8px);
    border: 1px solid #e4d9ff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(30, 39, 73, 0.04) !important;
}

.tab-btn,
.tab-link-premium {
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.tab-btn:hover,
.tab-link-premium:hover {
    background: rgba(228, 217, 255, 0.4) !important;
    color: #273469 !important;
}

.tab-btn.active,
.tab-link-premium.active {
    background: linear-gradient(135deg, #273469, #1e2749) !important;
    color: #fafaff !important;
    box-shadow: 0 4px 12px rgba(39, 52, 105, 0.3) !important;
}

.tab-link-premium.active {
    border-bottom-color: #273469 !important;
    color: #273469 !important;
    background: rgba(228, 217, 255, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════
   10. STATS — Valores com gradiente índigo
   ═══════════════════════════════════════════════════════════════ */

.stat-value {
    background: linear-gradient(135deg, #273469, #6b7cb8) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.section-title {
    color: #273469 !important;
    border-bottom-color: #e4d9ff !important;
}

/* ═══════════════════════════════════════════════════════════════
   11. BADGES — Lavanda suave
   ═══════════════════════════════════════════════════════════════ */

.badge-status,
.badge {
    border-radius: 8px !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.7rem !important;
}

/* Badge default */
.badge:not([class*="badge-"]):not([class*="status"]) {
    background: #273469 !important;
    color: #fafaff !important;
}

/* ═══════════════════════════════════════════════════════════════
   12. SCROLLBARS
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c5cbe0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a9b3d8;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(228, 217, 255, 0.2);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(228, 217, 255, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   13. HELPERS
   ═══════════════════════════════════════════════════════════════ */

.evidence-dropzone {
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.evidence-dropzone:hover {
    border-color: #273469 !important;
    background: rgba(39, 52, 105, 0.05) !important;
}

/* Focus global */
*:focus-visible {
    outline: 2px solid #273469;
    outline-offset: 2px;
}

/* Æ Links */
a {
    color: #273469;
}

a:hover {
    color: #1e2749;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.25rem !important;
    }

    .container {
        padding: 0 0.5rem !important;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem !important;
    }

    .page-hero-title,
    .ds-page-header-title {
        font-size: 1.4rem !important;
    }

    .page-hero-kpi,
    .ds-page-header-kpi {
        padding: 0.5rem 0.75rem !important;
        min-width: 65px !important;
    }

    .page-hero-kpi-val,
    .ds-page-header-kpi-val {
        font-size: 1.4rem !important;
    }
}