/* ==========================================
   STYLES.CSS - LAUDU SYSTEM (Tema Claro)
========================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
    /* Brand Colors Laudu */
    --brand-blue: #043ab4;
    --brand-cyan: #0c8695;
    --brand-green: #05b77b;
    --brand-dark: #0f172a;
    --brand-gray: #64748b;
    
    /* Theme Base (Light) */
    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    
    /* Borders & Effects */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --glass-blur: blur(16px);
    
    /* State Colors */
    --danger: #ef4444;       
    --danger-bg: #fee2e2;
    --warning: #f59e0b;      
    --success: #10b981;      
    
    /* Typography */
    --text-main: #0f172a;  
    --text-muted: #64748b; 
    --text-light: #94a3b8;  
    
    /* Spacing & Shapes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows Suaves */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px -10px rgba(4, 58, 180, 0.15);
    --shadow-glow-blue: 0 0 20px rgba(4, 58, 180, 0.2);
}

* { box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }

body {
    margin: 0; padding: 0;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .brand-logo, .section-title, .title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-dark);
}

.text-gradient {
    background: linear-gradient(to right, var(--brand-blue), var(--brand-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

input, select, textarea { font-family: 'Nunito', sans-serif; }

::placeholder { color: #94a3b8 !important; opacity: 1 !important; }

/* Utilities */
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 900 !important; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

/* ==========================================
   BLOCK BANNER
========================================== */
.global-warning-banner {
    position: relative; top: 0; left: 0; width: 100%; z-index: 9999;
    background: var(--danger); color: white; padding: 12px 20px;
    text-align: center; font-weight: 800; font-size: 14px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    text-transform: uppercase; letter-spacing: 1px;
}

body.has-warning .sidebar-unified {
    top: 45px; 
    height: calc(100vh - 45px);
}
@media (max-width: 768px) {
    body.has-warning .sidebar-unified { top: auto; height: auto; }
}

/* ==========================================
   MENU LATERAL (Sidebar)
========================================== */
.sidebar-unified {
    width: 280px; 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 15px rgba(0,0,0,0.02);
    display: flex; flex-direction: column; padding: 24px 16px; z-index: 100;
    position: fixed; height: 100vh; top: 0; left: 0;
}
.brand-logo { 
    padding: 0 10px 32px; text-align: center; 
    border-bottom: 1px solid var(--border-color); margin-bottom: 24px;
}
.brand-logo img { max-height: 45px; margin: 0 auto; }

.nav-link-custom {
    color: var(--brand-gray); 
    padding: 14px 20px; 
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 16px;
    text-decoration: none; font-weight: 700; font-size: 15px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out; 
    cursor: pointer;
}
.nav-link-custom:hover { 
    color: var(--brand-blue); 
    background: var(--bg-card-hover); 
}
.nav-link-custom.active { 
    color: var(--brand-blue); 
    background: rgba(4, 58, 180, 0.08); 
    font-weight: 800;
}
.nav-link-custom i { font-size: 1.25rem; width: 24px; text-align: center; transition: transform 0.2s; }
.nav-link-custom:hover i { transform: scale(1.1); }

/* ==========================================
   ÁREA PRINCIPAL E CARDS
========================================== */
.main-wrapper { 
    margin-left: 280px; 
    padding: 40px; 
    min-height: 100vh; 
    max-width: 1440px;
    position: relative;
}

.view-section { display: none; animation: animateFadeY 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; transform: translateY(12px); }
.view-section.active { display: block; }
@keyframes animateFadeY { to { opacity: 1; transform: translateY(0); } }

.card, .glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); 
    box-shadow: var(--shadow-sm); 
    color: var(--text-main);
    transition: all 0.3s ease;
    padding: 24px;
}
.glass-card:hover {
    border-color: var(--brand-cyan);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.section-title { 
    margin: 0 0 24px 0; 
    font-size: 1.75rem; 
    font-weight: 800; 
    color: var(--brand-dark); 
    display: flex; align-items: center; gap: 12px; 
}

/* ==========================================
   BOTÕES E INPUTS
========================================== */
.btn-brand, .btn-outline-brand {
    font-family: 'Nunito', sans-serif;
    border-radius: var(--radius-md); 
    padding: 14px 24px; 
    cursor: pointer;
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    font-weight: 800;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

.btn-brand {
    background-color: var(--brand-blue);
    color: #fff !important;
    border: none;
    box-shadow: var(--shadow-glow-blue); 
}
.btn-brand:hover:not(:disabled) { 
    background-color: var(--brand-cyan); 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(12, 134, 149, 0.3); 
}
.btn-brand:active { transform: scale(0.98); }
.btn-brand:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline-brand {
    background: transparent !important; 
    color: var(--brand-blue) !important; 
    border: 2px solid var(--brand-blue) !important;
}
.btn-outline-brand:hover, .btn-outline-brand.active { 
    background: var(--brand-blue) !important; 
    color: #fff !important;
}

/* Inputs claros */
.form-control-dark, .form-control { 
    background-color: #ffffff !important; 
    border: 1px solid var(--border-color) !important; 
    color: var(--text-main) !important; 
    border-radius: var(--radius-md) !important; 
    padding: 14px 16px !important; 
    transition: all 0.3s; 
    font-size: 15px;
    font-weight: 600;
}
.form-control-dark:focus, .form-control:focus { 
    border-color: var(--brand-blue) !important; 
    box-shadow: 0 0 0 3px rgba(4, 58, 180, 0.1) !important; 
    outline: none; 
}

/* ==========================================
   MODAIS E TOASTS
========================================== */
.modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.7) !important; backdrop-filter: blur(4px); }
.modal-panel { 
    position: relative; background: #ffffff; border: 1px solid var(--border-color); 
    border-radius: var(--radius-xl); width: 90%; max-width: 600px; padding: 40px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); z-index: 2001; 
}

.toast { 
    position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(20px); 
    background: var(--brand-green); color: white; font-weight: 800; font-family: 'Nunito', sans-serif;
    padding: 14px 32px; border-radius: var(--radius-full); box-shadow: 0 5px 15px rgba(5, 183, 123, 0.3); 
    z-index: 9999; opacity: 0; transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    pointer-events: none; text-transform: uppercase; letter-spacing: 1px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================
   MOBILE RESPONSIVO GERAL
========================================== */
@media (max-width: 1024px) {
    .main-wrapper { margin-left: 240px; padding: 30px; }
    .sidebar-unified { width: 240px; }
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    
    .sidebar-unified { 
        width: 100vw; height: auto; flex-direction: row; justify-content: space-between; align-items: center;
        padding: 8px 4px; position: fixed; bottom: 0; left: 0; top: auto; border-right: none; 
        border-top: 1px solid var(--border-color); 
        background: rgba(255, 255, 255, 0.98); 
        z-index: 999; padding-bottom: env(safe-area-inset-bottom, 12px); box-sizing: border-box;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .brand-logo { display: none; }
    
    .nav-link-custom { 
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 4px; padding: 6px 2px; margin-bottom: 0; border-radius: var(--radius-md); text-align: center; min-width: 0; 
    }

    .nav-link-custom i { font-size: 20px; margin: 0; width: auto; }
    .nav-link-custom span { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; font-weight: 800;}
    
    .nav-link-custom.active { box-shadow: none; background: rgba(4, 58, 180, 0.08); }

    .main-wrapper { margin-left: 0; padding: 20px; margin-bottom: 90px; }
    
    .section-title { font-size: 1.5rem !important; }
}
