/* Variables */
:root {
    --primary-color: #ff8c00;
    --secondary-color: #1a1a2e;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background-color: #f3f4f6;
    color: #333;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--secondary-color) 0%, #16213e 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

.sidebar-header i {
    margin-right: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-item:hover {
    background-color: rgba(255, 140, 0, 0.1);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-item.active {
    background-color: rgba(255, 140, 0, 0.15);
    color: white;
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-nav .nav-item i {
    width: 25px;
    margin-right: 0.8rem;
    font-size: 1.1rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.user-info i {
    font-size: 1.8rem;
    margin-right: 0.8rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    margin-right: 1.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.btn-toggle:hover {
    background-color: var(--light-bg);
}

.top-bar h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    flex-grow: 1;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-update {
    color: #6c757d;
    font-size: 0.9rem;
}

.time-update i {
    color: var(--primary-color);
}

.top-bar-actions .btn {
    position: relative;
}

.top-bar-actions .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
}

/* KPI Cards */
.kpi-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 0.35rem 1.2rem rgba(15, 23, 42, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-right: 1.2rem;
    flex-shrink: 0;
}

.kpi-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--secondary-color);
}

.kpi-info p {
    margin: 0.3rem 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.kpi-info small {
    font-size: 0.85rem;
}

/* Cards */
.card {
    background: white !important;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.35rem 1.2rem rgba(15, 23, 42, 0.08);
    margin-bottom: 1.5rem;
}

.card-header {
    background: white !important;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.2rem 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.card-header i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.card-body {
    background: white !important;
    padding: 1.5rem;
}

/* Status Legend */
.status-legend {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 0.8rem;
}

/* Alert Items */
.alert-item {
    display: flex;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-danger {
    background-color: #fff5f5;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: #fffbf0;
    border-left-color: var(--warning-color);
}

.alert-info {
    background-color: #f0f9ff;
    border-left-color: var(--info-color);
}

.alert-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.alert-danger .alert-icon {
    color: var(--danger-color);
}

.alert-warning .alert-icon {
    color: var(--warning-color);
}

.alert-info .alert-icon {
    color: var(--info-color);
}

.alert-content strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: var(--secondary-color);
}

.alert-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.alert-content small {
    display: block;
    margin-top: 0.3rem;
    color: #999;
    font-size: 0.8rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.timeline-content strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: var(--secondary-color);
}

.timeline-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.timeline-content small {
    display: block;
    margin-top: 0.3rem;
    color: #999;
    font-size: 0.8rem;
}

/* Sidebar Toggle (Desktop & Mobile) */
.sidebar.hidden {
    transform: translateX(-100%);
}

.main-content.expanded {
    margin-left: 0;
}

/* Overlay pour mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .kpi-card {
        margin-bottom: 1rem;
    }

    .dashboard-content {
        padding: 1rem;
    }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #e67e00;
}

/* Clean headers for cards */
.card-header-clean {
    background: white;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

.card-header-clean h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
}

.bg-danger-clean {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
}

.bg-danger-clean h5 {
    color: #dc2626 !important;
}

.bg-warning-clean {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%) !important;
}

.bg-warning-clean h5 {
    color: #d97706 !important;
}

.bg-primary-clean {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
}

.bg-primary-clean h5 {
    color: #2563eb !important;
}

.bg-success-clean {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
}

.bg-success-clean h5 {
    color: #16a34a !important;
}

/* Action cards buttons */
.btn-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.3s;
    box-shadow: 0 0.35rem 1.2rem rgba(15, 23, 42, 0.08);
    height: 100%;
}

.btn-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
    border-color: var(--primary-color);
}

.btn-action-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.btn-action-card span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* KPI Cards - Clean Design */
.kpi-card-simple {
    background: white !important;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 0.35rem 1.2rem rgba(15, 23, 42, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.kpi-card-simple:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
}

.kpi-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white !important;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.kpi-icon-circle i {
    color: white !important;
    font-size: 1.5rem;
}

.kpi-content {
    flex: 1;
}

.kpi-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #1a1a2e;
    line-height: 1;
}

.kpi-content p {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
}

.kpi-content small {
    font-size: 0.85rem;
}
