@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;700;800;900&display=swap');

:root {
    /* Colors */
    --brand-orange: #ff6b00;
    --brand-orange-dark: #cc5600;
    --brand-orange-light: #ff8b33;
    
    --bg-dark: #0A111F;
    --bg-darker: #05080f;
    --bg-panel: rgba(255, 255, 255, 0.03);
    
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-dark: #0A111F;

    --border-light: rgba(255, 255, 255, 0.1);
    --border-orange: rgba(255, 107, 0, 0.3);

    /* Fonts */
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;

    /* Shadows & Effects */
    --shadow-glow: 0 0 20px rgba(255, 107, 0, 0.4);
    --shadow-panel: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    background-image: radial-gradient(circle at top right, rgba(255, 107, 0, 0.05), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(255, 107, 0, 0.05), transparent 40%);
}

:focus-visible {
    outline: 2px solid var(--brand-orange);
    outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Typography */
.text-gradient {
    background: linear-gradient(90deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-orange {
    color: var(--brand-orange);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: rgba(10, 17, 31, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-brand span {
    color: var(--brand-orange);
}
.navbar-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.btn-primary {
    background-color: var(--brand-orange);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
}
.btn-primary:hover {
    background-color: var(--brand-orange-dark);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--brand-orange);
    color: var(--brand-orange);
}
.btn-block {
    width: 100%;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
}
.btn-md {
    padding: 12px 24px;
    font-size: 0.95rem;
    border-radius: 8px;
}
.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 10px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
}
.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}
.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: -1px;
}
.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Glassmorphism Cards */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-panel);
    position: relative;
    overflow: hidden;
}
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 80px 0;
}
.feature-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
    backdrop-filter: var(--glass-blur);
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-orange);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 1px var(--border-orange);
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 107, 0, 0.1);
    color: var(--brand-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}
.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}
.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand-orange);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}
select.form-control option {
    background-color: var(--bg-darker);
    color: var(--text-main);
}

/* Auth Pages (Login / Register) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}
.auth-box {
    width: 100%;
    max-width: 450px;
    text-align: center;
}
.auth-header {
    margin-bottom: 30px;
}
.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}
.auth-header p {
    color: var(--text-muted);
}
.auth-footer {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-footer a {
    color: var(--brand-orange);
    font-weight: 600;
}
.auth-footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Background Gradients */
.bg-gradient-shapes {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.shape-1 {
    position: absolute;
    top: -10%; left: -10%;
    width: 50%; height: 50%;
    background: radial-gradient(circle, rgba(255,107,0,0.1) 0%, transparent 70%);
    filter: blur(60px);
}
.shape-2 {
    position: absolute;
    bottom: -20%; right: -10%;
    width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(255,107,0,0.08) 0%, transparent 70%);
    filter: blur(80px);
}

/* Dashboard Basics */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 280px;
    background: var(--bg-darker);
    border-right: 1px solid var(--border-light);
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.main-content {
    flex: 1;
    padding: 30px;
    background: var(--bg-dark);
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tbody tr {
    transition: background 0.2s;
}
.table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.badge-status-pendente { background: rgba(255, 193, 7, 0.15); color: #ffc107; border: 1px solid rgba(255,193,7,0.3); }
.badge-status-andamento { background: rgba(23, 162, 184, 0.15); color: #17a2b8; border: 1px solid rgba(23,162,184,0.3); }
.badge-status-fechada { background: rgba(40, 167, 69, 0.15); color: #28a745; border: 1px solid rgba(40,167,69,0.3); }
.badge-status-cancelada { background: rgba(220, 53, 69, 0.15); color: #dc3545; border: 1px solid rgba(220,53,69,0.3); }
.badge-status-nova { background: rgba(111, 66, 193, 0.15); color: #d0bfff; border: 1px solid rgba(111,66,193,0.3); }

/* Badges antigos mantidos temporariamente se houver hardcodes que faltamos alterar, mas ideal remover depois */
.badge-pendente { background: rgba(255, 193, 7, 0.15); color: #ffc107; border: 1px solid rgba(255,193,7,0.3); }
.badge-admin { background: rgba(220, 53, 69, 0.2); color: #ff6b6b; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.badge-indicator { background: rgba(40, 167, 69, 0.2); color: #28a745; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.badge-em_andamento { background: rgba(23, 162, 184, 0.15); color: #17a2b8; border: 1px solid rgba(23,162,184,0.3); }
.badge-fechada { background: rgba(40, 167, 69, 0.15); color: #28a745; border: 1px solid rgba(40,167,69,0.3); }
.badge-cancelada { background: rgba(220, 53, 69, 0.15); color: #dc3545; border: 1px solid rgba(220,53,69,0.3); }

/* Premium Policy Formatting (Word Docs) */
.premium-policy {
    font-family: var(--font-sans);
    line-height: 1.8;
    color: var(--text-muted);
    font-size: 1.05rem;
}
.premium-policy h1 {
    font-family: var(--font-display);
    color: var(--brand-orange);
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}
.premium-policy h2 {
    font-family: var(--font-display);
    color: #fff;
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
}
.premium-policy p {
    margin-bottom: 15px;
    text-align: justify;
}
.premium-policy strong {
    color: #fff;
    font-weight: 600;
}
.premium-policy ul, .premium-policy ol {
    margin-bottom: 20px;
    padding-left: 20px;
}
.premium-policy li {
    margin-bottom: 10px;
}
.premium-policy table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.premium-policy table td, .premium-policy table th {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
}
.premium-policy table tr:last-child td {
    border-bottom: none;
}
.premium-policy table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.premium-policy a {
    color: var(--brand-orange);
    text-decoration: none;
}
.premium-policy a:hover {
    text-decoration: underline;
}

/* SaaS Premium Landing Page Classes */
.saas-hero { padding: 140px 0 60px 0; min-height: 90vh; display: flex; align-items: center; position: relative; overflow: hidden; }
.saas-hero-container { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.saas-hero-text h1 { font-size: 3.8rem; line-height: 1.1; margin: 20px 0; }
.saas-hero-text p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 30px; max-width: 500px; }
.saas-hero-cta { display: flex; gap: 16px; margin-bottom: 40px; }
.badge-premium { display: inline-block; padding: 8px 16px; border-radius: 50px; background: rgba(255,107,0,0.1); border: 1px solid rgba(255,107,0,0.3); color: var(--brand-orange); font-weight: 600; font-size: 0.9rem; margin-bottom: 15px; }
.btn-glow { box-shadow: 0 0 20px rgba(255,107,0,0.5); }
.btn-glow:hover { box-shadow: 0 0 30px rgba(255,107,0,0.8); transform: translateY(-3px); }
.saas-hero-stats { display: flex; gap: 30px; border-top: 1px solid var(--border-light); padding-top: 30px; }
.saas-hero-stats div { display: flex; flex-direction: column; }
.saas-hero-stats strong { font-size: 1.5rem; font-weight: 800; font-family: var(--font-display); }
.saas-hero-stats span { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.glass-mockup { position: relative; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 10px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); transform: perspective(1000px) rotateY(-5deg) rotateX(5deg); transition: transform 0.5s ease; }
.glass-mockup:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg); }
.mockup-header { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; } .dot.yellow { background: #ffbd2e; } .dot.green { background: #27c93f; }
.glass-mockup img { width: 100%; border-radius: 8px; display: block; }
.floating-card { position: absolute; background: rgba(10,17,31,0.9); backdrop-filter: blur(10px); border: 1px solid var(--border-orange); border-radius: 8px; padding: 15px 20px; font-weight: 600; font-size: 0.9rem; color: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.fc-1 { top: 15%; left: -40px; z-index: 2; }
.fc-2 { bottom: 15%; right: -40px; z-index: 2; }
.animate-float-delayed { animation: float-slow 4s ease-in-out infinite 2s; }
.proof-logos { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; }
.logo-pill { background: rgba(255,255,255,0.03); border: 1px solid var(--border-light); padding: 10px 20px; border-radius: 50px; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.bento-card { border-radius: 24px; padding: 40px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.bento-large { grid-column: span 2; }
.bento-icon { font-size: 2.5rem; margin-bottom: 20px; }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    
    /* Navbar Mobile */
    .navbar .container { flex-direction: column; gap: 15px; }
    .navbar-brand { font-size: 1.3rem; }
    .navbar-nav { width: 100%; justify-content: space-between; gap: 10px; }
    .navbar-nav .btn { flex: 1; text-align: center; padding: 10px; font-size: 0.85rem; }

    /* Hero Section Mobile SaaS */
    .saas-hero-container { grid-template-columns: 1fr; gap: 60px; }
    .saas-hero-text h1 { font-size: 2.5rem; }
    .saas-hero-cta { flex-direction: column; gap: 12px; }
    .saas-hero-cta .btn { width: 100%; text-align: center; }
    .saas-hero-stats { flex-wrap: wrap; gap: 20px; }
    .fc-1 { left: -10px; top: -20px; }
    .fc-2 { right: -10px; bottom: -20px; }
    
    .bento-grid { grid-template-columns: 1fr; }
    .bento-large { grid-column: span 1; }

    .features-grid { grid-template-columns: 1fr; }
    .dashboard-layout { flex-direction: column; }
    
    /* Sidebar Mobile */
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-light); padding: 15px 20px; }
    .sidebar nav { flex-direction: row !important; overflow-x: auto; padding-bottom: 10px; gap: 10px; }
    .sidebar nav a { white-space: nowrap; font-size: 0.85rem; padding: 10px 14px !important; }
    
    /* Main Content Mobile */
    .main-content { padding: 15px; width: 100%; max-width: 100vw; box-sizing: border-box; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 15px; padding-bottom: 15px; }
    .topbar > div:last-child { width: 100%; display: flex; justify-content: space-between; align-items: center; }
    .topbar h2 { font-size: 1.4rem !important; }
    
    /* Panels and Modals */
    .modal-content { padding: 20px; width: 95%; margin: 10% auto; max-height: 80vh; overflow-y: auto; }
    
    /* Tables */
    .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .table th, .table td { padding: 10px 8px; font-size: 0.85rem; white-space: nowrap; }
    
    /* Form & Filters Overrides */
    .glass-panel[style*="display: flex"] { flex-direction: column; gap: 10px !important; align-items: stretch !important; }
    .glass-panel[style*="display: flex"] > div { width: 100% !important; min-width: 100% !important; flex: none !important; margin: 0 !important; }
    .glass-panel[style*="display: flex"] > div[style*="flex-basis: 100%"] { flex-direction: column; justify-content: stretch !important; }
    .glass-panel[style*="display: flex"] > div[style*="flex-basis: 100%"] button { width: 100%; margin-bottom: 8px; }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 95%;
    margin: 50px auto;
    color: var(--text-main);
    box-shadow: var(--shadow-panel);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    width: 800px;
}

.close {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
}
.close:hover {
    color: var(--brand-orange);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        margin: 20px auto;
        width: 95%;
    }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 40px);
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.05) inset;
    pointer-events: all;
    animation: toast-in 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    border: 1px solid;
}
.toast.hide {
    animation: toast-out 0.3s ease forwards;
}
.toast-success { background: rgba(40,167,69,0.14); border-color: rgba(40,167,69,0.35); }
.toast-error   { background: rgba(220,53,69,0.14); border-color: rgba(220,53,69,0.35); }
.toast-warning { background: rgba(255,193,7,0.14); border-color: rgba(255,193,7,0.35); }
.toast-info    { background: rgba(23,162,184,0.14); border-color: rgba(23,162,184,0.35); }

.toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toast-success .toast-icon { background: rgba(40,167,69,0.2); color: #5cb85c; }
.toast-error   .toast-icon { background: rgba(220,53,69,0.2); color: #e05a6a; }
.toast-warning .toast-icon { background: rgba(255,193,7,0.2); color: #ffc107; }
.toast-info    .toast-icon { background: rgba(23,162,184,0.2); color: #17a2b8; }

.toast-msg { flex: 1; color: var(--text-main); line-height: 1.5; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    margin-top: -1px;
    transition: color 0.2s;
}
.toast-close:hover { color: var(--text-main); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

/* ==========================================
   SIDEBAR NAV ITEMS WITH ICONS
   ========================================== */
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.18s ease, color 0.18s ease;
    text-decoration: none;
}
.nav-item:hover {
    background: rgba(255,107,0,0.07);
    color: var(--text-main);
}
.nav-item.active {
    background: rgba(255,107,0,0.12);
    color: var(--brand-orange);
    font-weight: 600;
}
.nav-item svg {
    flex-shrink: 0;
    transition: opacity 0.18s;
    opacity: 0.6;
}
.nav-item:hover svg  { opacity: 0.9; }
.nav-item.active svg { opacity: 1; }

/* ==========================================
   STAT CARDS WITH ICONS
   ========================================== */
.stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-orange { background: rgba(255,107,0,0.12);  color: var(--brand-orange); }
.stat-icon-green  { background: rgba(40,167,69,0.12);  color: #28a745; }
.stat-icon-blue   { background: rgba(23,162,184,0.12); color: #17a2b8; }
.stat-icon-yellow { background: rgba(255,193,7,0.12);  color: #ffc107; }
.stat-icon-red    { background: rgba(220,53,69,0.12);  color: #dc3545; }
.stat-icon-white  { background: rgba(255,255,255,0.08); color: #fff; }

.stat-info { flex: 1; min-width: 0; }
.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 5px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-value-orange { color: var(--brand-orange); }
.stat-value-green  { color: #28a745; }
.stat-value-blue   { color: #17a2b8; }
.stat-value-yellow { color: #ffc107; }
.stat-value-white  { color: #fff; }

/* ==========================================
   ALERT (inline messages)
   ========================================== */
.alert {
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    border: 1px solid;
}
.alert.success {
    background: rgba(40,167,69,0.1);
    border-color: rgba(40,167,69,0.3);
    color: #5cb85c;
    display: block;
}
.alert.error {
    background: rgba(220,53,69,0.1);
    border-color: rgba(220,53,69,0.3);
    color: #e05a6a;
    display: block;
}

/* ==========================================
   USER CHIP (topbar)
   ========================================== */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    padding: 5px 14px 5px 5px;
}
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,107,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-orange);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ==========================================
   TOPBAR ACTIONS
   ========================================== */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
}
.btn-danger {
    background: transparent;
    color: #dc3545;
    border: 1px solid rgba(220,53,69,0.4);
}
.btn-danger:hover {
    background: rgba(220,53,69,0.1);
    border-color: #dc3545;
}
.btn-info {
    background: transparent;
    color: #17a2b8;
    border: 1px solid rgba(23,162,184,0.4);
}
.btn-info:hover {
    background: rgba(23,162,184,0.1);
    border-color: #17a2b8;
}

@media (max-width: 768px) {
    #toast-container { top: 10px; right: 10px; width: calc(100% - 20px); }
    .stat-card { padding: 16px; gap: 14px; }
    .stat-value { font-size: 1.8rem; }
    .stat-icon { width: 42px; height: 42px; border-radius: 10px; }
    .topbar-actions { gap: 8px; }
}

/* ==========================================
   Acessibilidade (WCAG 2.1)
   ========================================== */
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .pulse-soft {
        animation: none;
    }
}

/* ==========================================
   MOBILE SIDEBAR DRAWER
   ========================================== */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1100;
    height: 56px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    padding: 0 16px;
    gap: 14px;
}
.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.07); }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1050;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    /* Mobile topbar visível */
    .mobile-topbar { display: flex; }

    /* Layout: preserva row, desloca para baixo da topbar */
    .dashboard-layout {
        flex-direction: row !important;
        padding-top: 56px;
        min-height: calc(100vh - 56px);
    }

    /* Sidebar: drawer fixo, oculto à esquerda */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -300px !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1200 !important;
        overflow-y: auto !important;
        transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-right: 1px solid var(--border-light) !important;
        border-bottom: none !important;
        padding: 24px !important;
    }
    .sidebar nav {
        flex-direction: column !important;
        overflow-x: visible !important;
        padding-bottom: 0 !important;
        gap: 4px !important;
    }
    .sidebar nav a {
        font-size: 0.9rem !important;
        white-space: normal !important;
        padding: 11px 14px !important;
    }

    /* Drawer aberto */
    body.sidebar-open .sidebar  { left: 0 !important; }
    body.sidebar-open .sidebar-overlay { display: block; }

    /* Conteúdo principal: largura total */
    .main-content {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100vw;
        padding: 16px !important;
        overflow-x: hidden;
    }

    /* Topbar: empilha título e ações */
    .topbar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .topbar > div:first-child h2 { font-size: 1.3rem !important; line-height: 1.25; }
    .topbar > div:first-child p  { font-size: 0.85rem; }
    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .topbar-actions .user-chip { flex: 1; min-width: 0; }
    #userName {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block !important;
        vertical-align: middle;
    }

    /* Filtros: cada campo ocupa linha inteira */
    .glass-panel > div[style*="min-width: 200px"],
    .glass-panel > div[style*="min-width: 150px"] {
        flex: 0 0 100% !important;
        min-width: 100% !important;
    }
    /* Botões de exportar: igual largura e esticados */
    .glass-panel > div[style*="flex-basis: 100%"] {
        justify-content: stretch !important;
    }
    .glass-panel > div[style*="flex-basis: 100%"] button { flex: 1 !important; }

    /* Modal lg: usa quase toda a tela */
    .modal-content.modal-lg {
        width: 98%;
        margin: 10px auto;
        max-height: 92vh;
    }

    /* Accept-policy: botões empilhados */
    #btnAccept {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    #btnAccept ~ .btn {
        display: block;
        width: 100%;
        margin-left: 0 !important;
    }
}

/* ==========================================
   Validação de Formulários
   ========================================== */
input.is-invalid, select.is-invalid, textarea.is-invalid {
    border-color: #ff6b6b !important;
}
input.is-valid, select.is-valid, textarea.is-valid {
    border-color: #4ade80 !important;
}
.field-error-msg {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}
input.is-invalid ~ .field-error-msg,
select.is-invalid ~ .field-error-msg,
textarea.is-invalid ~ .field-error-msg {
    display: block;
}

/* ==========================================
   Skeleton Loaders & Empty States
   ========================================== */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.04) 50%, var(--surface) 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
}
.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}
