/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #dee2e6;
    color: #333;
    background-image: url('../images/logo-golden.png');
    background-size: 40% auto;
    background-position: center 50%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-blend-mode: normal;
    position: relative;
    display: block;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    width: 100vw;
    max-width: none;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(222, 226, 230, 0.2);
    z-index: 1;
    pointer-events: none;
}

/* Modal adjustments */
.modal-backdrop {
    display: none !important;
}

.modal {
    z-index: 1000000 !important;
}

.modal-dialog {
    z-index: 1000001 !important;
}

/* Centralizar modal na tela */
.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 1rem);
    margin: 0.5rem auto;
}

.modal-content {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Forçar modal acima de tudo */
.modal.show {
    z-index: 1000000 !important;
}

.modal.show .modal-dialog {
    z-index: 1000001 !important;
}

/* Sidebar styles are now in sidbar.css */

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    position: relative;
    z-index: 2;
    overflow-x: visible;
    padding-top: 20px;
    width: calc(100vw - 280px);
    max-width: none;
    margin-right: 0;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding-top: 20px;
    }
    
    .header {
        left: 0;
    }
    
    body {
        background-position: center 50%;
        background-size: 40% auto;
    }
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    padding: 0.75rem 0;
    border-bottom: 2px solid #d4af37;
    position: relative;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.1);
    width: 100%;
    max-width: none;
    margin-right: 0;
}

.search-bar {
    max-width: 400px;
    flex: 1;
    margin-left: 1rem;
}

.search-bar .form-control {
    border-radius: 25px;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-bar .form-control:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

.search-bar .btn {
    border-radius: 25px;
    margin-left: -1px;
    background-color: #d4af37;
    border-color: #d4af37;
    color: white;
    transition: all 0.3s ease;
}

.search-bar .btn:hover {
    background-color: #b8941f;
    border-color: #b8941f;
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    padding: 0;
    min-height: calc(100vh - 80px);
}

/* Page Styles */
.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #d4af37 0%, #b8860b 100%);
    border-radius: 1px;
}

/* KPI Cards */
.kpi-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-left: 4px solid #d4af37;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
}

.kpi-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.kpi-icon i {
    font-size: 1.5rem;
    color: white;
}

.kpi-number {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.kpi-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.kpi-subtitle {
    color: #999;
    font-size: 0.85rem;
}

/* Chart Card */
.chart-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 100%;
}

.chart-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 0.5rem;
}

.chart-body {
    height: 300px;
    position: relative;
}

/* Activity Card */
.activity-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 100%;
}

.activity-header {
    margin-bottom: 1.5rem;
}

.activity-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.activity-body {
    line-height: 1.6;
}

.activity-body p {
    margin-bottom: 1rem;
    color: #555;
    font-size: 0.95rem;
}

.activity-body ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.activity-body li {
    margin-bottom: 0.75rem;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

.activity-body li b {
    color: #333;
    font-weight: 600;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.activity-icon i {
    font-size: 1rem;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.activity-time {
    color: #999;
    font-size: 0.8rem;
}

/* Quick Actions */
.quick-actions-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.quick-actions-header {
    margin-bottom: 1.5rem;
}

.quick-actions-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.quick-action-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.quick-action-btn span {
    font-weight: 500;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 280px;
        width: calc(100vw - 280px);
        max-width: none;
    }
    
    .header {
        padding: 0.25rem 0;
        width: 100%;
        max-width: none;
    }
    
    .kpi-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding-top: 20px;
        max-width: none;
        width: 100vw;
    }
    
    .header {
        padding: 0.25rem 0;
        position: relative;
        z-index: 1040;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        max-width: none;
        width: 100%;
    }
    
    .header .d-flex {
        flex-direction: row-reverse;
    }
    
    .search-bar {
        margin-left: 0;
        margin-right: 1rem;
    }
    
    .dropdown-menu-responsive {
        right: 0 !important;
        left: auto !important;
    }
    
    .logo {
        font-size: 1.1rem;
        justify-content: center;
        width: 100%;
        display: flex;
        align-items: center;
        text-align: center;
    }
    
    .logo-image {
        height: 45px;
        width: auto;
        background: transparent;
        margin: 0 auto;
        display: block;
    }
    
    .search-bar {
        max-width: 180px;
    }
    
    .search-bar .form-control {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* KPI Cards - 2x2 grid */
    .kpi-card {
        margin-bottom: 0.75rem;
        padding: 1rem;
    }
    
    .kpi-icon {
        width: 45px;
        height: 45px;
    }
    
    .kpi-icon i {
        font-size: 1.2rem;
    }
    
    .kpi-number {
        font-size: 1.4rem;
    }
    
    .kpi-label {
        font-size: 0.8rem;
    }
    
    .kpi-subtitle {
        font-size: 0.7rem;
    }
    
    .page-title {
        font-size: 1.75rem;
        margin-top: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-legend {
        margin-top: 1rem;
        flex-wrap: wrap;
    }
    
    .activity-card {
        margin-top: 1rem;
    }
    
    .activity-body p {
        font-size: 0.9rem;
    }
    
    .activity-body li {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
    }
    
    .quick-action-btn {
        padding: 1rem 0.75rem;
    }
    
    .quick-action-btn i {
        font-size: 1.5rem;
    }
    
    .quick-action-btn span {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding-top: 20px;
    }
    
    .header {
        padding: 0.25rem 0;
        position: relative;
    }
    
    .header .d-flex {
        flex-direction: row-reverse;
    }
    
    .search-bar {
        margin-left: 0;
        margin-right: 1rem;
    }
    
    .dropdown-menu-responsive {
        right: 0 !important;
        left: auto !important;
    }
    
    body {
        background-position: center 50%;
        background-size: 30% auto;
    }
    
    .logo {
        font-size: 1rem;
        justify-content: center;
        width: 100%;
        display: flex;
        align-items: center;
        text-align: center;
    }
    
    .logo-image {
        height: 40px;
        width: auto;
        background: transparent;
        margin: 0 auto;
        display: block;
    }
    
    .search-bar {
        max-width: 150px;
    }
    
    .search-bar .form-control {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-top: 0.5rem;
    }
    
    /* KPI Cards - 2x2 grid with smaller sizes */
    .kpi-card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .kpi-icon {
        width: 35px;
        height: 35px;
    }
    
    .kpi-icon i {
        font-size: 1rem;
    }
    
    .kpi-number {
        font-size: 1.2rem;
    }
    
    .kpi-label {
        font-size: 0.75rem;
    }
    
    .kpi-subtitle {
        font-size: 0.65rem;
    }
    
    .quick-action-btn {
        padding: 0.875rem 0.5rem;
    }
    
    .quick-action-btn i {
        font-size: 1.3rem;
    }
    
    .quick-action-btn span {
        font-size: 0.75rem;
    }
    
    .activity-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .activity-text {
        font-size: 0.8rem;
    }
    
    .activity-time {
        font-size: 0.7rem;
    }
    
    .activity-body p {
        font-size: 0.85rem;
    }
    
    .activity-body li {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding-top: 20px;
    }
    
    .header {
        padding: 0.5rem 0;
        position: relative;
    }
    
    .header .d-flex {
        flex-direction: row-reverse;
    }
    
    .search-bar {
        margin-left: 0;
        margin-right: 1rem;
    }
    
    .dropdown-menu-responsive {
        right: 0 !important;
        left: auto !important;
    }
    
    body {
        background-position: center 50%;
        background-size: 25% auto;
    }
    
    .logo {
        font-size: 0.9rem;
        justify-content: center;
        width: 100%;
        display: flex;
        align-items: center;
        text-align: center;
    }
    
    .logo-image {
        height: 35px;
        width: auto;
        background: transparent;
        margin: 0 auto;
        display: block;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .search-bar {
        display: none;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
    
    /* KPI Cards - 2x2 grid with very small sizes */
    .kpi-card {
        padding: 0.5rem;
        margin-bottom: 0.4rem;
    }
    
    .kpi-icon {
        width: 30px;
        height: 30px;
    }
    
    .kpi-icon i {
        font-size: 0.9rem;
    }
    
    .kpi-number {
        font-size: 1rem;
    }
    
    .kpi-label {
        font-size: 0.7rem;
    }
    
    .kpi-subtitle {
        font-size: 0.6rem;
    }
    
    .quick-action-btn {
        padding: 0.75rem 0.4rem;
    }
    
    .quick-action-btn i {
        font-size: 1.2rem;
    }
    
    .quick-action-btn span {
        font-size: 0.7rem;
    }
    
    .activity-item {
        padding: 0.5rem;
        margin-bottom: 0.4rem;
    }
    
    .activity-icon {
        width: 30px;
        height: 30px;
    }
    
    .activity-icon i {
        font-size: 0.8rem;
    }
    
    .activity-text {
        font-size: 0.75rem;
    }
    
    .activity-time {
        font-size: 0.65rem;
    }
    
    .activity-body p {
        font-size: 0.8rem;
    }
    
    .activity-body li {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e9ecef;
        background-image: url('../images/logo-bg.png');
        background-size: 300px 300px;
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-blend-mode: overlay;
    }
    
    body::before {
        background: rgba(26, 26, 26, 0.85);
    }
    
    .header {
        background-color: #2d2d2d;
        border-bottom-color: #404040;
    }
    
    .kpi-card,
    .chart-card,
    .activity-card,
    .quick-actions-card {
        background-color: #2d2d2d;
        color: #e9ecef;
    }
    
    .kpi-number {
        color: #e9ecef;
    }
    
    .kpi-label {
        color: #adb5bd;
    }
    
    .activity-text {
        color: #e9ecef;
    }
    
    .quick-action-btn {
        background: linear-gradient(135deg, #2d2d2d, #404040);
        color: #e9ecef;
    }
    
    .quick-action-btn:hover {
        background: linear-gradient(135deg, #d4af37, #b8860b);
        color: white;
    }
}

/* ===== LOADING SCREEN ===== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    max-width: 200px;
    padding: 1rem;
}

.loading-logo {
    margin-bottom: 1rem;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-loading {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.3));
    transition: all 1s ease-out;
}

.loading-text h3 {
    color: #d4af37;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.loading-text p {
    color: #6c757d;
    font-size: 0.7rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.loading-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(212, 175, 55, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37 0%, #e6c547 50%, #d4af37 100%);
    background-size: 200% 100%;
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressShimmer 2s ease-in-out infinite;
    box-shadow: 0 1px 2px rgba(212, 175, 55, 0.3);
}

.loading-percentage {
    color: #d4af37;
    font-size: 0.8rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animações */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes progressShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsividade do Loading */
@media (max-width: 768px) {
    .loading-content {
        padding: 0.8rem;
        max-width: 180px;
    }
    
    .logo-loading {
        width: 50px;
    }
    
    .loading-text h3 {
        font-size: 0.9rem;
    }
    
    .loading-text p {
        font-size: 0.65rem;
    }
    
    .loading-percentage {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .loading-content {
        padding: 0.6rem;
        max-width: 160px;
    }
    
    .logo-loading {
        width: 45px;
    }
    
    .loading-text h3 {
        font-size: 0.8rem;
    }
    
    .loading-text p {
        font-size: 0.6rem;
    }
    
    .loading-percentage {
        font-size: 0.7rem;
    }
}