:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 280px;
    --header-height: 70px;
    --header-mobile-height: 60px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f7fb;
    color: #333;
    transition: all 0.3s;
}

body.sidebar-open {
    overflow: hidden;
}

/* ====== LOGIN PAGE ====== */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f7fb;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.login-left {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-right {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), #0a4db3);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-right::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.login-logo img {
    width: 50px;
    height: 50px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.login-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 40px;
}

.form-control {
    padding: 14px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #f8f9fa;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
    background-color: white;
}

.form-label {
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.btn-login {
    background: var(--primary-color);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    width: 100%;
    margin-top: 24px;
    transition: all 0.3s;
}

.btn-login:hover {
    background: #0a4db3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.feature-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.feature-text p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

/* ====== SIDEBAR ====== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-user {
    display: none;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-user-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.sidebar-user-role {
    font-size: 0.85rem;
    color: #888;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.25rem 1.5rem 0.5rem;
    color: #888;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    margin-right: 0.75rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #f0f0f0;
}

.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #dc3545;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-footer .nav-link:hover {
    background: rgba(220, 53, 69, 0.1);
}

.sidebar-footer .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    margin-right: 0.75rem;
    text-align: center;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ====== HEADER MOBILE ====== */
.header-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-mobile-height);
    background: white;
    z-index: 1030;
    display: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-mobile-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 100%;
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #555;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: #f8f9fa;
}

.header-mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.header-mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: #555;
}

.btn-icon:hover {
    background: #f8f9fa;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(30%, -30%);
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
}

.user-dropdown-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown .dropdown-menu {
    width: 220px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.user-role {
    font-size: 0.75rem;
    color: #888;
}

/* ====== MAIN CONTENT ====== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: #f5f7fb;
    transition: margin 0.3s;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-content {
    padding: 2rem;
}

/* ====== CARDS & METRICS ====== */
.card {
    background: white;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
    border-top-left-radius: 0.75rem !important;
    border-top-right-radius: 0.75rem !important;
}

.card-body {
    padding: 1.5rem;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 100%;
    transition: all 0.3s;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-title {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.metric-info {
    font-size: 0.85rem;
    color: #666;
}

/* Dashboard Cards */
.dashboard-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 12px;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

.dashboard-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ====== TABLES ====== */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #666;
    border-top: none;
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Efeitos para tabela com hover */
.table-hover tbody tr {
    transition: background-color 0.2s;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* ====== FORMS & INPUTS ====== */
.form-control, .form-select {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
}

/* ====== BUTTONS ====== */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

.btn-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.btn-lg {
    font-size: 1.125rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
}

/* ====== STATUS BADGES ====== */
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge.pendente {
    background: #fff3cd;
    color: #856404;
}

.status-badge.aprovado {
    background: #d4edda;
    color: #155724;
}

.status-badge.rejeitado {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.problema_identificado {
    background: #ffe5d0;
    color: #fd7e14;
}

.status-badge.aberto {
    background: #cce5ff;
    color: #004085;
}

.status-badge.concluido {
    background: #d4edda;
    color: #155724;
}

.priority-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-badge.urgente {
    background: #dc3545;
    color: white;
}

.priority-badge.normal {
    background: #ffc107;
    color: #212529;
}

.priority-badge.baixa {
    background: #6c757d;
    color: white;
}

/* ====== DROPDOWN & MENUS ====== */
.dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.dropdown-item:hover, 
.dropdown-item:focus {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Dropdown de notificações */
.notification-dropdown-menu {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    border: none;
}

.notification-dropdown .dropdown-item {
    white-space: normal;
    transition: background-color 0.2s;
}

.notification-dropdown .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* ====== TABS & PILLS ====== */
.nav-tabs {
    border-bottom: 2px solid #eee;
}

.nav-tabs .nav-link {
    border: none;
    color: #666;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.2s;
    position: relative;
}

.nav-tabs .nav-link:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    font-weight: 600;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.nav-pills .nav-link {
    color: #555;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* ====== MODAL ====== */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
}

/* ====== AVATARS & ICONS ====== */
.avatar-sm {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====== ANIMATIONS ====== */
/* Pulse dot para indicador de dados ao vivo */
.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #198754;
    position: relative;
}

.pulse-dot:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(25, 135, 84, 0.4);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    70% { transform: scale(2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Animações para notificações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate__animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__heartBeat {
    animation-name: heartBeat;
    animation-duration: 1.3s;
    animation-timing-function: ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* ====== TOASTS & ALERTS ====== */
.toast {
    z-index: 1090;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

/* ====== LOADER & SPINNER ====== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====== SCROLLBAR CUSTOM ====== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ====== RESPONSIVE STYLES ====== */
@media (max-width: 1199.98px) {
    .user-info {
        display: none;
    }
    
    .page-content {
        padding: 1.75rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .dashboard-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 991.98px) {
    :root {
        --sidebar-width: 280px;
    }
    
    body {
        padding-top: var(--header-mobile-height);
    }
    
    .header-mobile {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: min(var(--sidebar-width), 80vw);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-user {
        display: flex;
        align-items: center;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-header {
        display: none;
    }
    
    .page-content {
        padding: 1.5rem;
    }
    
    .login-right {
        display: none;
    }
    
    .login-left {
        padding: 40px 20px;
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 1.25rem;
    }
    
    .metric-card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 1rem;
    }
    
    .header-mobile-logo span {
        display: none;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.35rem 0.85rem;
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.65rem;
        font-size: 0.9rem;
    }
    
    .mobile-menu-btn,
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    
    .notification-badge {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .user-dropdown-btn img {
        width: 30px;
        height: 30px;
    }
}