/* Refactored Main CSS for Consulting Control System */
/* Based on specific design requirements */

/* CSS Reset and Base Styles */
@charset "UTF-8";

/* Searchable Dropdown Styles */
.searchable-select {
    position: relative;
    display: inline-block;
    width: 100%;
}

.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.searchable-dropdown.show {
    display: block;
}

.searchable-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.searchable-option:hover,
.searchable-option.selected {
    background-color: var(--e-global-color-primary);
    color: #fff;
}

.searchable-option:last-child {
    border-bottom: none;
}

/* CSS Variables */
:root {
    --e-global-color-primary: #69A370;
    --e-global-color-secondary: #E5BA30;
    --e-global-color-accent: #CE6D2C;
    --e-global-color-extra: #1E514A;
    --e-global-color-text: #262633;
    --e-global-color-background: #F5F7FA;

}

/* Reset and normalize */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Archivo', Arial, sans-serif !important;
    font-size: 16px;
    line-height: 1.6;
    color: var(--e-global-color-text) !important;
    background-color: var(--e-global-color-background) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;

}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    clear: both;
    color: var(--e-global-color-text) !important;
    font-family: 'Archivo', Arial, sans-serif !important;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.1rem; }

p {
    margin-bottom: 1.75em;
    color: var(--e-global-color-text) !important;
}

/* Links */
a {
    color: var(--e-global-color-primary) !important;
    text-decoration: none;
    transition: all 0.2s linear;
}

a:focus, a:hover {
    color: var(--e-global-color-secondary) !important;
    text-decoration: none;
}

a:focus {
    outline: thin dotted;
}

/* Buttons */
.btn, .ast-button, button, input[type=button], input[type=submit] {
    display: inline-block;
    padding: 12px 24px;
    font-family: 'Archivo', Arial, sans-serif !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s linear;
    background: var(--e-global-color-primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(110, 193, 228, 0.15);
}

.btn:hover, .ast-button:hover, button:hover, input[type=button]:hover, input[type=submit]:hover {
    background: var(--e-global-color-secondary) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(84, 89, 95, 0.2);
}

.btn:active, .ast-button:active, button:active, input[type=button]:active, input[type=submit]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(110, 193, 228, 0.15);
}

.btn-primary {
    background: var(--e-global-color-primary) !important;
    color: #fff !important;
    border: none !important;
}

.btn-secondary {
    background: var(--e-global-color-extra) !important;
    color: #fff !important;
    border: none !important;
}

.btn-outline-primary {
    background: transparent !important;
    color: var(--e-global-color-primary) !important;
    border: 2px solid var(--e-global-color-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--e-global-color-primary) !important;
    color: #fff !important;
}

/* Forms */
.form-control, input[type=email], input[type=password], input[type=search], 
input[type=tel], input[type=text], input[type=url], textarea, select {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-family: 'Archivo', Arial, sans-serif !important;
    font-size: 14px;
    line-height: 1.4;
    color: var(--e-global-color-text) !important;
    background-color: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px;
    transition: all 0.2s linear;
    box-shadow: none;
}

.form-control:focus, input[type=email]:focus, input[type=password]:focus, 
input[type=search]:focus, input[type=tel]:focus, input[type=text]:focus, 
input[type=url]:focus, textarea:focus, select:focus {
    border-color: var(--e-global-color-primary) !important;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(105, 163, 112, 0.15);
    color: var(--e-global-color-text) !important;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--e-global-color-extra) !important;
    font-weight: 600;
    font-size: 14px;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: #fff !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(110, 193, 228, 0.08);
}

.table th {
    background: var(--e-global-color-primary) !important;
    color: #fff !important;
    font-weight: 600;
    padding: 16px;
    border: none !important;
    text-align: left;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb !important;
    vertical-align: middle;
    color: var(--e-global-color-text) !important;
}

.table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #eaf5ef !important;
}

/* Cards */
.card {
    background: #fff !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(110, 193, 228, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background: var(--e-global-color-primary) !important;
    color: #fff !important;
    padding: 20px;
    border: none !important;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 24px;
    min-height: 350px !important;
}

.card-title {
    color: #F5F7FA !important;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Card header titles - override any JavaScript interference */
.card-header h5,
.card-header h5.mb-0,
.card-header .mb-0 {
    color: #F5F7FA !important;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
}

/* Force override for any dynamic styling */
.card-header * {
    color: #F5F7FA !important;
}

/* Additional overrides for Bootstrap classes */
.card-header .mb-0,
.card-header h5.mb-0,
.card-header .h5,
.card-header h5 {
    color: #F5F7FA !important;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
}

/* Override any inline styles */
.card-header h5[style*="color"] {
    color: #F5F7FA !important;
}

/* Navigation */
.navbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    padding: 0.5rem 1.5rem;
}

.navbar-brand {
    color: #fff !important;
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand:hover {
    color: #fff !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 12px 16px;
    transition: all 0.2s linear;
}

.navbar-nav .nav-link:hover {
    color: var(--e-global-color-accent) !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.navbar-nav .nav-link.active {
    color: var(--e-global-color-accent) !important;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

/* Sidebar - CRITICAL STYLES */
.sidebar {
    min-height: 100vh !important;
    background: var(--e-global-color-primary) !important;
    padding: 0 !important;
    border: none !important;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 16px 20px !important;
    border-radius: 0 !important;
    margin: 0 !important;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-left: 3px solid transparent;
    transition: all 0.2s linear;
    background: transparent !important;
}

.sidebar .nav-link:hover {
    color: var(--e-global-color-accent) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-left-color: var(--e-global-color-accent);
}

.sidebar .nav-link.active {
    background-color: var(--green);
    color: #fff;
    border-radius: 8px;
    position: relative;
}

.sidebar .nav-link.active::before {
    content: '';
    display: inline-block;
    background: #69A370;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.sidebar .nav-link i {
    margin-right: 12px;
    width: 16px;
    text-align: center;
}

.sidebar .text-white {
    color: #fff !important;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar h4 {
    font-family: 'Archivo', Arial, sans-serif !important;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Main Content */
.main-content {
    background-color: var(--e-global-color-background) !important;
    min-height: 100vh;
    font-family: 'Archivo', Arial, sans-serif !important;
}

.main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5 {
    color: var(--e-global-color-secondary) !important;
    font-family: 'Archivo', Arial, sans-serif !important;
    font-weight: 700;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    margin-bottom: 1rem;
    border: none !important;
    border-radius: 8px;
    font-weight: 500;
}

.alert-primary {
    background: var(--e-global-color-primary) !important;
    color: #fff !important;
}

.alert-success {
    background: var(--e-global-color-accent) !important;
    color: #fff !important;
}

.alert-danger {
    background: #dc3545 !important;
    color: #fff !important;
}

.alert-warning {
    background: #ffc107 !important;
    color: var(--e-global-color-secondary) !important;
}

.alert-info {
    background: var(--e-global-color-primary) !important;
    color: #fff !important;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: var(--e-global-color-primary) !important;
}

.badge.bg-success {
    background: var(--e-global-color-accent) !important;
}

.badge.bg-warning {
    background: #ffc107 !important;
    color: var(--e-global-color-secondary) !important;
}

.badge.bg-danger {
    background: #dc3545 !important;
}

.badge.bg-info {
    background: var(--e-global-color-primary) !important;
}

/* Dashboard Metrics */
.metric-card {
    background: #B22067 !important;
    color: #F5F7FA !important;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(110, 193, 228, 0.15);
    text-align: center;
}

.metric-card h3, .metric-card p {
    color: #F5F7FA !important;
}

.metric-card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.metric-card p {
    opacity: 0.95;
    margin-bottom: 0;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Utilities */
.text-primary { color: var(--e-global-color-primary) !important; }
.text-secondary { color: var(--e-global-color-secondary) !important; }
.text-warning { color: #ffc107 !important; }
.text-success { color: var(--e-global-color-accent) !important; }
.text-danger { color: #dc3545 !important; }
.text-accent { color: var(--e-global-color-accent) !important; }
.text-extra { color: var(--e-global-color-extra) !important; }

.bg-primary { background-color: var(--e-global-color-primary) !important; }
.bg-secondary { background-color: var(--e-global-color-secondary) !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-success { background-color: var(--e-global-color-accent) !important; }
.bg-danger { background-color: #dc3545 !important; }
.bg-accent { background-color: var(--e-global-color-accent) !important; }
.bg-extra { background-color: var(--e-global-color-extra) !important; }

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .metric-card h3 {
        font-size: 2rem;
    }
    
    .navbar {
        padding: 0.5rem 0.5rem;
    }
    
    .progress-stepper img, .activity-timeline img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 16px;
    }
    
    .table th,
    .table td {
        padding: 12px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--e-global-color-accent);
    outline-offset: 2px;
}

/* Loading states */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--e-global-color-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--e-global-color-secondary);
}

/* Chart styling */
canvas {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Ensure chart containers are visible */
.card-body canvas {
    width: 100% !important;
    height: 300px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Chart.js specific overrides */
.chartjs-render-monitor {
    display: block !important;
    visibility: visible !important;
}

/* Ensure chart containers have proper dimensions */
.card-body {
    padding: 24px;
    min-height: 350px !important;
}

/* Notification Styles */
.notifications-container {
    max-width: 100%;
}

.notification-item {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

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

.notification-item.border-warning {
    border-left-color: var(--e-global-color-secondary);
    background-color: #fff3cd;
}

.notification-item .card-header {
    background-color: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.notification-item .card-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--e-global-color-text);
}

.notification-item .card-body {
    padding: 1rem 1.5rem;
    background-color: transparent;
}

.notification-item .card-footer {
    background-color: transparent;
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-meta small {
    font-size: 0.875rem;
    color: #6c757d;
}

.notification-item .btn-group .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.notification-item .btn-outline-success:hover {
    background-color: var(--e-global-color-accent) !important;
    border-color: var(--e-global-color-accent) !important;
}

.notification-item .btn-outline-danger:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

/* Phase Slicer Custom Styles */
.phase-slicer-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: #262633;
    padding: 8px 16px;
    border-radius: 8px;
}
.phase-slicer {
    background: #262633 !important;
    color: #fff !important;
    border: 1px solid #444 !important;
    min-width: 200px;
    max-width: 350px;
    font-weight: 600;
    font-family: 'Archivo', Arial, sans-serif;
}
.phase-slicer option {
    background: #262633;
    color: #fff;
}
.phase-slicer:focus {
    border-color: var(--e-global-color-primary) !important;
    box-shadow: 0 0 0 2px rgba(105,163,112,0.2);
}

/* Progress/stepper using timeline images */
.progress-stepper {
    width: 100%;
    margin: 1.5rem 0;
    text-align: center;
}
.progress-stepper img {
    width: 80%;
    max-width: 600px;
}

/* Status indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-indicator img {
    width: 18px;
    height: 18px;
}

/* Timeline/history */
.activity-timeline {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.activity-timeline img {
    height: 300px;
}
.timeline-labels {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 12px;
}

/* General card/widget style */
.card {
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: none;
    margin-bottom: 1.5rem;
} 