:root {
    --azul-institucional: #3E6FDB;
    --azul-profundo: #2F56B3;
    --azul-suave: #6F93F2;
    --verde-menta: #49C2A1;
    --verde-medico: #2E9E83;
    --verde-suave: #7FE0C7;
    --azul-background: #EAF1FF;
    --verde-background: #E6F7F3;
    --cinza-light: #F4F6F9;
    --cinza-medio-claro: #D9DEE7;
    --texto-secundario: #4A5568;
    --texto-principal: #2D3748;
    --alto-contraste: #1A202C;
    --azul-cta: #2D8CFF;
    --verde-cta: #1BC58D;
    --ciano-destaque: #00B5D8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--azul-background) 0%, var(--verde-background) 100%);
    min-height: 100vh;
    color: var(--texto-principal);
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--azul-institucional) 0%, var(--azul-profundo) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    max-width: 120px;
    height: auto;
    filter: brightness(0) invert(1);
    margin-bottom: 0.5rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--verde-menta);
}

.sidebar-nav .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: var(--verde-menta);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .tenant-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    background: linear-gradient(135deg, var(--azul-background) 0%, var(--verde-background) 100%);
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(90deg, var(--azul-institucional) 0%, var(--verde-menta) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.filter-card {
    background: white;
    border-left: 4px solid var(--azul-institucional);
}

.filter-card .card-title {
    color: var(--azul-institucional);
    font-weight: 600;
}

.form-label {
    font-weight: 500;
    color: var(--texto-secundario);
    font-size: 0.9rem;
}

.form-control, .form-select {
    border: 1px solid var(--cinza-medio-claro);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--azul-institucional);
    box-shadow: 0 0 0 0.2rem rgba(62, 111, 219, 0.15);
}

.btn-primary {
    background: linear-gradient(90deg, var(--azul-cta) 0%, var(--ciano-destaque) 100%);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 140, 255, 0.3);
    background: linear-gradient(90deg, var(--azul-institucional) 0%, var(--azul-cta) 100%);
}

.stats-card {
    height: 100%;
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card .card-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.stats-card .card-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.processing-card {
    border-left: 4px solid var(--azul-cta);
}

.processing-card .stats-icon {
    background: linear-gradient(135deg, var(--azul-suave) 0%, var(--azul-cta) 100%);
    color: white;
}

.processing-card .card-title {
    color: var(--azul-institucional);
}

.success-card {
    border-left: 4px solid var(--verde-cta);
}

.success-card .stats-icon {
    background: linear-gradient(135deg, var(--verde-suave) 0%, var(--verde-cta) 100%);
    color: white;
}

.success-card .card-title {
    color: var(--verde-medico);
}

.rate-card {
    border-left: 4px solid var(--ciano-destaque);
}

.rate-card .stats-icon {
    background: linear-gradient(135deg, var(--ciano-destaque) 0%, var(--azul-cta) 100%);
    color: white;
}

.rate-card .card-title {
    color: var(--ciano-destaque);
}

.time-card {
    border-left: 4px solid var(--verde-medico);
}

.time-card .stats-icon {
    background: linear-gradient(135deg, var(--verde-menta) 0%, var(--verde-medico) 100%);
    color: white;
}

.time-card .card-title {
    color: var(--verde-medico);
}

.chart-card {
    background: white;
    border-left: 4px solid var(--verde-menta);
}

.chart-card .card-title {
    color: var(--azul-institucional);
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 400px;
    padding: 1rem 0;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

@media (max-width: 768px) {
    .stats-card .card-title {
        font-size: 2rem;
    }
    
    .stats-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

.text-muted {
    color: var(--texto-secundario) !important;
}

small {
    font-size: 0.85rem;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.navbar-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.tenant-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--azul-institucional) 0%, var(--verde-menta) 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-logo {
    max-width: 200px;
    height: auto;
}

.login-title {
    color: var(--azul-institucional);
    font-weight: 700;
    font-size: 1.75rem;
}

.password-input-group {
    position: relative;
}

.password-input-group .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 1rem;
    color: var(--texto-secundario);
    cursor: pointer;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--azul-institucional);
}

.login-footer {
    border-top: 1px solid var(--cinza-medio-claro);
}

.login-info {
    color: rgba(255, 255, 255, 0.9);
}


/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    .col-md-4 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .sidebar-nav {
        padding: 0.5rem 0;
    }
    
    .sidebar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
    
    .sidebar-footer {
        padding: 1rem;
    }
    
    .navbar-logo {
        height: 32px;
    }
    
    .tenant-info {
        display: none;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-container {
        padding: 1rem;
    }
    
    .stats-card .card-title {
        font-size: 1.75rem;
    }
    
    .stats-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}
