/* ==========================================================================
   BASE STYLES
   ========================================================================== */

body {
    padding-top: 60px;
    background-color: #e9ecef;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
}

.mb-4 {
    margin-top: 30px;
}
/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 10px 40px 40px 40px;
}

.custom-container {
    max-width: 1600px;
    background-color: #ffffff;
    padding: 10px 40px 40px 40px;
}
/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1 {
    color: #343a40;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}
/* ==========================================================================
   FORMS
   ========================================================================== */

.form-label {
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
}

.form-text {
    font-size: 0.875em;
    color: #6c757d;
    margin-top: 8px;
}
/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, transform .15s ease-in-out;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: #000000;
    border-color: #000000;
    color: #FFFFFF;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #333333;
    border-color: #333333;
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}
/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
    margin-top: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}
/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    width: 100%;
}

.card-header {
    background-color: #000000;
    border-bottom: 1px solid #333333;
    font-weight: 600;
    color: #ffffff;
    padding: 15px 20px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.card-body {
    padding: 25px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table td, .table th {
    vertical-align: middle;
    text-align: center;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination .page-link {
    color: #FFFFFF;
    background-color: #000000;
    border-color: #000000;
}

.pagination .page-item.active .page-link {
    color: #FFFFFF;
    background-color: #333333;
    border-color: #333333;
}

.pagination .page-link:hover {
    color: #FFFFFF;
    background-color: #333333;
    border-color: #333333;
}

/* ==========================================================================
   SPECIFIC COMPONENTS
   ========================================================================== */

.selected-block-item {
    border: 1px solid #000000;
    margin-bottom: 5px;
    border-radius: 5px;
}

/* ==========================================================================
   NAVBAR STYLES
   ========================================================================== */

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 8px;
}

.navbar-nav .dropdown-item {
    padding: 8px 16px;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 2px 8px;
}

.navbar-nav .dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.navbar-nav .dropdown-item.active {
    background-color: #000000;
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.navbar-nav .dropdown-item.active:hover {
    background-color: #333333;
    color: white;
}

.navbar-nav .nav-link {
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-1px);
}

.navbar-nav .dropdown-toggle::after {
    transition: transform 0.3s ease;
}

.navbar-nav .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.navbar-nav .nav-link i,
.navbar-nav .dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Mobile responsive improvements */
@media (max-width: 991px) {
    .navbar-nav .dropdown-menu {
        border: 1px solid #dee2e6;
        margin-left: 20px;
        margin-top: 4px;
    }
    
    .navbar-nav .dropdown-item:hover {
        transform: none;
    }
}

/* ==========================================================================
   DASHBOARD STYLES
   ========================================================================== */

.dashboard-container {
    margin-top: 40px;
}

.dashboard-card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 12px;
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

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

.dashboard-card .card-header {
    background: #000000;
    color: white;
    border-radius: 12px 12px 0 0 !important;
    border: none;
    font-weight: 600;
    padding: 15px 20px;
}

.stat-card {
    border: none;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    background: #000000;
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    color: #6c757d;
    font-size: 1.1rem;
}

.top-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-items-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.item-info {
    display: flex;
    align-items: center;
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 12px;
    font-size: 1.2rem;
}

.item-details {
    text-align: left;
}

.item-details h6 {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.item-details small {
    color: #6c757d;
}

.usage-badge {
    background: #000000;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 0.9rem;
}

.activity-create { background: #d4edda; color: #155724; }
.activity-edit { background: #fff3cd; color: #856404; }
.activity-delete { background: #f8d7da; color: #721c24; }
.activity-view { background: #cce7ff; color: #004085; }

.activity-content {
    text-align: left;
}

.activity-content h6 {
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
}

.activity-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
}

.refresh-button {
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.85rem;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 20px;
}

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

/* Responsive design for dashboard */
@media (max-width: 768px) {
    .stat-number {
        font-size: 1.8rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* ==========================================================================
   PAGE-SPECIFIC STYLES - CRIAR PAGINA
   ========================================================================== */

.criar-pagina-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.hero-section {
    background: #000000;
    color: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white !important;
}

.main-workspace {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.workspace-header {
    background: #000000;
    color: white;
    padding: 1.5rem;
    border: none;
}

.sidebar-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    height: 100%;
    border: 1px solid #e9ecef;
}

.main-section {
    padding: 1.5rem;
}

/* ==========================================================================
   COMMON UTILITY CLASSES
   ========================================================================== */

.min-height-400 {
    min-height: 400px;
}

.overflow-y-auto {
    overflow-y: auto;
}

.width-30 {
    width: 30%;
}

.width-20 {
    width: 20%;
}

.width-250 {
    width: 250px;
}

.width-auto {
    width: auto;
}

.display-inline-block {
    display: inline-block;
}

.bg-yellow-highlight {
    background-color: yellow;
    padding: 5px;
    margin-bottom: 10px;
}

.max-height-200 {
    max-height: 200px;
    overflow-y: auto;
}

/* ==========================================================================
   CUSTOM OVERRIDES - CORES PRETAS
   ========================================================================== */

.bg-primary {
    background-color: #000000 !important;
}

.stat-card {
    background: #000000 !important;
    color: #ffffff !important;
}

.version-card .card-header {
    background: #000000 !important;
    color: #ffffff !important;
}

.filter-section {
    color: #ffffff !important;
}

.metric-card {    color: #ffffff !important;
}

.card-header {
    color: #ffffff !important;
}

#startDate, #endDate, #reportType {
    color: #ffffff !important;
    background-color: #000000 !important;
    border-color: #333333 !important;
}

.fas.fa-download {
    color: #ffffff !important;
}

.btn-outline-primary {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.btn-outline-primary:hover {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Universal card-header rule - ensures all headers are black */
.card-header,
.backup-card .card-header,
.config-card .card-header,
.version-card .card-header,
.api-section .card-header,
.report-card .card-header,
.resource-card .card-header,
.template-card .card-header,
.dashboard-card .card-header {
    background: #000000 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Filter section text white */
.filter-section h5,
.filter-section .form-label,
.filter-section label,
.filter-section .fas {
    color: #ffffff !important;
}

.filter-pill {
    background: #333333 !important;
    color: #ffffff !important;
    border: 1px solid #555555 !important;
}

.filter-pill.active {
    background: #ffffff !important;
    color: #000000 !important;
}

.filter-pill:hover {
    background: #555555 !important;
    color: #ffffff !important;
}

/* Navbar active links - white text with underline - HIGHEST PRIORITY */
.navbar-collapse .navbar-nav .nav-item .nav-link.active,
.navbar-nav .nav-item .nav-link.active,
.navbar-nav .nav-link.active,
a.nav-link.active {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: underline !important;
    text-underline-offset: 4px !important;
    text-decoration-thickness: 2px !important;
}

.navbar-collapse .navbar-nav .nav-item .nav-link:focus,
.navbar-nav .nav-item .nav-link:focus,
.navbar-nav .nav-link:focus,
a.nav-link:focus {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: underline !important;
    text-underline-offset: 4px !important;
    text-decoration-thickness: 2px !important;
}

/* Dropdown toggle active */
.navbar-nav .nav-link.dropdown-toggle.active {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: underline !important;
    text-underline-offset: 4px !important;
    text-decoration-thickness: 2px !important;
}

/* OVERRIDE ALL - Final rule to ensure navbar active links are white */
body .navbar .navbar-nav .nav-item a.nav-link.active,
body .navbar .navbar-nav .nav-item a.nav-link:focus,
body .navbar .navbar-nav .nav-item a.nav-link.dropdown-toggle.active {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: underline !important;
    text-underline-offset: 4px !important;
    text-decoration-thickness: 2px !important;
}