/**
 * Premium Design System - SHIFT LEGIS DAY
 * Identity: Deep Teal to Soft Gold Gradient
 */

:root {
    /* --- PALETA EXTRAMENTE DA IMAGEM "SHIFT LEGIS DAY" --- */
    
    /* Cores Principais */
    --brand-teal-dark: #073b4c;   /* Azul Petróleo Profundo (canto esquerdo inferior) */
    --brand-teal: #118ab2;        /* Azul Médio (meio) */
    --brand-gold: #ffd166;        /* Dourado Suave (canto direito superior) */
    --brand-gold-light: #ffeeb6;  /* Dourado Muito Claro (brilho) */

    /* Gradiente Principal ("Day Gradient") - Agora mais profissional e sutil */
    --brand-gradient: #073b4c; 
    --brand-gradient-hover: #0a4d63;

    /* Mapeamento Funcional */
    --primary-color: #073b4c;     /* Usar o tom escuro como primária para textos e bases */
    --accent-color: #118ab2;      /* Acentos em azul médio */
    
    /* Cores de Estado */
    --success-color: #06d6a0;     /* Verde Tifany que combina com a paleta */
    --warning-color: #ffd166;     /* O próprio dourado da marca */
    --danger-color: #ef476f;      /* Rosa/Vermelho suave da paleta complementar */

    /* Superfícies */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;

    /* Texto */
    --text-main: #073b4c;         /* Azul muito escuro, quase preto */
    --text-secondary: #4a6fa5;    /* Azul acinzentado */
    --text-muted: #94a3b8;

    /* Border */
    --border-color: #e2e8f0;
    --border-focus: #118ab2;

    /* Configurações Gerais */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(7, 59, 76, 0.1), 0 2px 4px -2px rgb(7, 59, 76, 0.05); /* Sombra com tom da marca */

    --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* --- OVERRIDES DE LEGADO (FORÇAR APLICACAO) --- */
    --sgi-primary: var(--primary-color);
    --sgi-primary-darker: #052e3b;
    --sgi-accent: var(--accent-color);
    --sgi-bg: var(--bg-body);
    --sgi-text: var(--text-main);
    
    /* Bootstrap Overrides */
    --bs-primary: var(--brand-teal);
    --bs-primary-rgb: 17, 138, 178;
    --bs-body-color: var(--text-main);
    --bs-body-bg: var(--bg-body);
    
    --brand-font: var(--font-sans);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
}

/* =========================================
   HEADER & DASHBOARD HERO (A PLACA DA IMAGEM)
   ========================================= */

.dashboard-hero {
    background: var(--brand-teal-dark) !important;
    padding: 1.5rem 1.5rem; /* Reduzido de 3rem para 1.5rem */
    border-radius: 0 0 1.5rem 1.5rem;
    position: relative;
    box-shadow: 0 8px 20px -10px rgba(7, 59, 76, 0.3);
    margin-bottom: 1.5rem; /* Reduzido para aproximar o conteúdo */
    color: white;
}

@media (max-width: 768px) {
    .dashboard-hero {
        padding: 1.25rem 1rem;
        border-radius: 0 0 1rem 1rem;
        margin-bottom: 1rem;
    }
}

/* Título Dashboard */
.dashboard-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem; /* Tamanho controlado */
    letter-spacing: -0.01em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .dashboard-title {
        font-size: 1.25rem;
    }
}

/* =========================================
   SIDEBAR & NAVIGATION
   ========================================= */

.sidebar-wrapper {
    background: var(--bg-sidebar) !important;
    border-right: 1px solid rgba(0,0,0,0.05) !important;
    box-shadow: 2px 0 20px rgba(0,0,0,0.02);
}

.sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 1rem !important;
}

.logo-text {
    color: var(--brand-teal-dark) !important;
    font-family: var(--font-heading) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Menu Items */
.sidebar-menu-list>li>a {
    color: var(--text-secondary) !important;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.25s ease;
    margin: 4px 10px;
}

/* Hover - Leve toque do dourado ou teal */
.sidebar-menu-list>li>a:hover {
    background: rgba(17, 138, 178, 0.08) !important;
    color: var(--brand-teal) !important;
    transform: translateX(3px);
}

/* ACTIVE STATE - O GRADIENTE DA MARCA */
.sidebar-menu-list>li.mm-active>a,
.sidebar-menu-list>li.active>a,
.sidebar-menu-list>li.open>a {
    background: var(--brand-gradient) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(7, 59, 76, 0.25) !important;
    border: none !important;
}

/* Ícones do menu */
.sidebar-menu-list>li>a .parent-icon {
    color: var(--brand-teal);
    background: rgba(17, 138, 178, 0.1);
    border-radius: 6px;
    transition: all 0.3s;
}

.sidebar-menu-list>li>a:hover .parent-icon {
    background: white;
    color: var(--brand-teal-dark);
}

.sidebar-menu-list>li.mm-active>a .parent-icon, 
.sidebar-menu-list>li.active>a .parent-icon {
    background: rgba(255,255,255,0.2) !important;
    color: white !important;
}

/* =========================================
   CARDS & KPI
   ========================================= */

.card {
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
    border-radius: 12px !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(7, 59, 76, 0.08) !important;
}

/* KPI Icons - Usando as cores da paleta */
/* Ex: total de cadastros */
.bg-primary-subtle {
    background-color: rgba(17, 138, 178, 0.1) !important;
    color: var(--brand-teal) !important;
}
.text-primary { color: var(--brand-teal) !important; }

.bg-success-subtle {
    background-color: rgba(6, 214, 160, 0.1) !important;
    color: var(--success-color) !important;
}
.text-success { color: var(--success-color) !important; }

.bg-warning-subtle {
    background-color: rgba(255, 209, 102, 0.15) !important;
    color: #ebb31a !important; /* Dourado mais escuro para texto */
}
.text-warning { color: #ebb31a !important; }

/* =========================================
   BUTTONS
   ========================================= */

.btn-primary {
    background: var(--brand-teal) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(7, 59, 76, 0.2);
}

.btn-primary:hover {
    background: var(--brand-teal-dark) !important;
    box-shadow: 0 6px 15px rgba(7, 59, 76, 0.3);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--brand-teal) !important;
    color: var(--brand-teal) !important;
    background: transparent !important;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--brand-teal) !important;
    color: white !important;
}

.btn-success {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(6, 214, 160, 0.2);
    transition: all 0.2s ease;
}

.btn-success:hover {
    background-color: #05b88a !important; /* Slightly darker */
    border-color: #05b88a !important;
    filter: brightness(1.05);
    box-shadow: 0 6px 15px rgba(6, 214, 160, 0.3);
    transform: translateY(-1px);
}

/* =========================================
   TABLES
   ========================================= */

.table thead th {
    background: #f1f5f9 !important;
    color: var(--brand-teal-dark) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color) !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.table-hover tbody tr:hover td {
    background-color: rgba(17, 138, 178, 0.03) !important;
}

/* =========================================
   FORMS
   ========================================= */

.form-control:focus, .form-select:focus {
    border-color: var(--brand-teal) !important;
    box-shadow: 0 0 0 3px rgba(17, 138, 178, 0.15) !important;
}

.form-label {
    color: var(--brand-teal-dark) !important;
    font-weight: 600;
}