:root {
    --primary: #0d6efd;
    --sidebar-bg: #1a2332;
    --sidebar-hover: #2a3548;
}

body {
    background-color: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--sidebar-bg);
    color: #fff;
    overflow-y: auto;
    z-index: 1000;
}
.sidebar .logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.25rem;
    font-weight: 600;
}
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.2s;
}
.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar .nav-link.active {
    background: var(--primary);
    color: #fff;
}
.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
}

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 1.5rem 2rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* === CARDS STAT === */
.card-stat {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}
.card-stat:hover {
    transform: translateY(-2px);
}
.card-stat .icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* === LOGIN === */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-card {
    max-width: 420px;
    width: 100%;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.login-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
}
.login-body {
    padding: 2rem;
}

/* === Recherche globale === */
.recherche-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.recherche-item:hover {
    background: #f8f9fa;
}
.recherche-item:last-child {
    border-bottom: none;
}

/* === Mode sombre === */
body.dark-mode {
    background-color: #1a1d23;
    color: #e1e1e1;
}
body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .dropdown-menu {
    background-color: #2a2d33;
    color: #e1e1e1;
    border-color: #3a3d43;
}
body.dark-mode .card-header,
body.dark-mode .card-footer,
body.dark-mode .table-light,
body.dark-mode .bg-white {
    background-color: #2a2d33 !important;
    color: #e1e1e1 !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background-color: #1a1d23;
    border-color: #3a3d43;
    color: #e1e1e1;
}
body.dark-mode .text-muted {
    color: #999 !important;
}
body.dark-mode .table {
    color: #e1e1e1;
}
body.dark-mode a:not(.btn):not(.nav-link):not(.badge) {
    color: #6ea8fe;
}

/* === Badges statut === */
.badge-statut-planifie { background: #ffc107; color: #000; }
.badge-statut-confirme { background: #198754; color: #fff; }
.badge-statut-en_cours { background: #0dcaf0; color: #000; }
.badge-statut-termine { background: #6c757d; color: #fff; }
.badge-statut-annule { background: #dc3545; color: #fff; }

/* === DICOM Viewer === */
#dicom-viewport {
    width: 100%;
    height: 600px;
    background: #000;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}
.viewer-toolbar {
    background: #1a2332;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media print {
    .sidebar, .btn, form { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
}
