        :root {
            --ink: #1e293b; /* Softer dark for text */
            --muted: #64748b;
            --line: #e2e8f0;
            --panel: #ffffff;
            --surface: #f8fafc; /* Lighter background */
            --nav: #0f172a; /* Slate 900 for sidebar */
            --primary: #0284c7; /* Medical Blue (Sky 600) */
            --primary-soft: #e0f2fe; /* Sky 100 */
            --accent: #2563eb; /* Indigo/Blue */
            --warning: #d97706;
            --danger: #dc2626;
            --success: #16a34a;
        }

        * { letter-spacing: 0; }
        body {
            margin: 0;
            min-height: 100vh;
            background: var(--surface);
            color: var(--ink);
            font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            font-size: 13.5px; /* Reduced for high density */
        }
        a { text-decoration: none; transition: all 0.2s ease; }

        .app-shell { min-height: 100vh; display: flex; }
        .sidebar {
            position: fixed;
            inset: 0 auto 0 0;
            width: 256px; /* Slightly wider */
            background: var(--nav);
            color: #fff;
            display: flex;
            flex-direction: column;
            z-index: 30;
            box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        }
        .brand {
            height: 64px;
            display: flex;
            align-items: center;
            gap: .85rem;
            padding: 0 1.25rem;
            border-bottom: 1px solid rgba(255,255,255,.05);
            transition: all 0.2s ease;
        }
        .brand-mark {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            display: grid;
            place-items: center;
            background: linear-gradient(135deg, #38bdf8, #2563eb);
            box-shadow: 0 4px 15px rgba(37,99,235,.3);
            color: white;
            font-size: 1.1rem;
        }
        .brand strong { font-size: 1.1rem; line-height: 1; letter-spacing: 0.5px; }
        .brand small { color: #94a3b8; font-size: .7rem; }
        .brand:hover .brand-mark { transform: scale(1.05) rotate(-3deg); }
        
        .nav-section { color: #64748b; font-size: .7rem; text-transform: uppercase; font-weight: 800; padding: .4rem .6rem .1rem; letter-spacing: .05em; margin-top: .1rem; }
        .sidebar .nav-link {
            color: #cbd5e1;
            border-radius: 8px;
            padding: .35rem .65rem; 
            display: flex;
            align-items: center;
            gap: .65rem;
            font-size: .85rem; 
            font-weight: 500;
            margin: 0; 
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .sidebar .nav-link i { width: 20px; text-align: center; font-size: 1rem; opacity: 0.8; transition: opacity 0.2s; }
        .sidebar .nav-link:hover {
            color: #fff;
            background: rgba(255,255,255,.05);
            transform: translateX(4px);
        }
        .sidebar .nav-link.active i { opacity: 1; color: #38bdf8; }

        /* Dropdown style for sidebar */
        .sidebar .dropdown-menu { background: var(--nav); border: 1px solid rgba(255,255,255,0.1); box-shadow: 4px 4px 15px rgba(0,0,0,0.3); border-radius: 8px; padding: .2rem; }
        .sidebar .dropdown-item { color: #cbd5e1; font-size: .78rem; border-radius: 6px; padding: .25rem .75rem; transition: all 0.2s; }
        .sidebar .dropdown-item:hover { background: rgba(255,255,255,0.05); color: #fff; transform: translateX(2px); }
        .sidebar .dropdown-item i { width: 16px; text-align: center; color: #38bdf8; opacity: 0.8; }
        .sidebar .dropdown-toggle::after { margin-left: auto; margin-top: auto; margin-bottom: auto; border-top: .3em solid; border-right: .3em solid transparent; border-bottom: 0; border-left: .3em solid transparent; }
        .sidebar .dropend .dropdown-toggle::after { border-top: .3em solid transparent; border-right: 0; border-bottom: .3em solid transparent; border-left: .3em solid; }

        .sidebar-footer {
            margin: .5rem .75rem;
            padding: .75rem;
            border-radius: 10px;
            background: rgba(15,23,42,.8);
            border: 1px solid rgba(255,255,255,.05);
            color: #f1f5f9;
        }
        .main-wrap {
            width: calc(100% - 256px);
            max-width: 1600px;
            margin-right: auto;
            margin-left: 256px;
            min-height: 100vh;
        }
        .topbar {
            height: 72px;
            background: rgba(255,255,255,.85);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--line);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 2rem;
            position: sticky;
            top: 0;
            z-index: 20;
        }
        .page-content { padding: 1.5rem 2rem 2.5rem; }
        .page-title h1 { font-size: 1.5rem; font-weight: 800; margin: 0; color: #0f172a; letter-spacing: -0.5px; }
        .page-title p { color: var(--muted); margin: .35rem 0 0; font-size: 0.9rem;}

        .panel, .card {
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 12px;
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -2px rgba(0,0,0,0.02);
            transition: box-shadow 0.2s ease;
        }
        .panel:hover, .card:hover {
            box-shadow: 0 10px 15px -3px rgba(0,0,0,0.04), 0 4px 6px -4px rgba(0,0,0,0.02);
        }
        .metric {
            padding: 1.25rem;
            min-height: 110px;
            border-radius: 12px;
            background: white;
            border: 1px solid var(--line);
            box-shadow: 0 1px 3px rgba(0,0,0,0.02);
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .metric:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 15px -3px rgba(0,0,0,0.05);
        }
        .metric-label { color: var(--muted); font-size: .75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
        .metric-value { font-size: 1.75rem; font-weight: 800; margin-top: .5rem; color: #0f172a; }
        .metric-note { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
        .icon-box {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: grid;
            place-items: center;
            background: var(--primary-soft);
            color: var(--primary);
            font-size: 1.1rem;
        }
        .toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--line);
            background: #f8fafc;
            border-radius: 12px 12px 0 0;
        }
        
        /* TABLE REDESIGN - HIGH DENSITY */
        .table-responsive { border-radius: 12px; border: 1px solid var(--line); background: #fff; overflow-x: auto; box-shadow: 0 2px 4px rgba(0,0,0,0.01); }
        .table { margin: 0; width: 100%; border-collapse: collapse; font-size: 0.8rem; }
        .table th {
            color: #475569;
            font-size: .68rem;
            text-transform: uppercase;
            font-weight: 700;
            background: #f1f5f9;
            padding: 0.4rem 0.5rem;
            white-space: nowrap;
            border-bottom: 2px solid var(--line);
            letter-spacing: 0.2px;
        }
        .table td { 
            padding: 0.4rem 0.5rem; 
            vertical-align: middle; 
            border-bottom: 1px solid #f1f5f9;
            color: #334155;
        }
        .action-grid {
            display: grid;
            grid-template-columns: repeat(4, min-content);
            gap: 0.15rem; /* Very compact grid */
            justify-content: end;
        }
        .action-grid .btn, .action-grid form {
            margin: 0 !important;
            display: flex;
            justify-content: center;
        }
        .action-grid .btn { width: 100%; }
        .table tbody tr { transition: background-color 0.15s ease; }
        .table tbody tr:hover { background-color: #f8fafc; }
        .table-striped { --bs-table-striped-bg: #e6f4ff; } /* Nuance de bleu clair Bootstrap 5 */
        .table-striped tbody tr:nth-of-type(odd):hover { --bs-table-accent-bg: #dbeafe; }
        .table tbody tr:last-child td { border-bottom: none; }
        
        .status-pill {
            border-radius: 999px;
            padding: .35rem .75rem;
            font-size: .75rem;
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            gap: .4rem;
            border: 1px solid transparent;
            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        }
        .status-pending { color: #b45309; background: #fffbeb; border-color: #fde68a; }
        .status-progress { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
        .status-done { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
        .status-danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
        
        .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: grid;
            place-items: center;
            background: #e0f2fe;
            color: #0369a1;
            font-weight: 700;
            text-transform: uppercase;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
        }
        
        /* BUTTON REDESIGN - HIGH DENSITY */
        .btn { 
            border-radius: 6px; 
            font-weight: 600; 
            font-size: .8rem; 
            padding: 0.4rem 0.8rem;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .btn.btn-sm {
            padding: 0.25rem 0.45rem;
            font-size: 0.7rem;
        }
        .btn-primary { 
            background: linear-gradient(135deg, #0ea5e9, #0284c7); 
            border: none; 
            color: white;
            box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2), inset 0 1px 0 rgba(255,255,255,0.2);
        }
        .btn-primary:hover { 
            background: linear-gradient(135deg, #0284c7, #0369a1); 
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(2, 132, 199, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
        }
        .btn-primary:active { transform: translateY(0); box-shadow: none; }
        
        .btn-outline-primary {
            border: 1px solid #0ea5e9;
            color: #0ea5e9;
            background: transparent;
        }
        .btn-outline-primary:hover {
            background: #f0f9ff;
            color: #0284c7;
            border-color: #0284c7;
            transform: translateY(-1px);
        }
        
        .btn-success {
            background: linear-gradient(135deg, #22c55e, #16a34a);
            border: none;
            box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2), inset 0 1px 0 rgba(255,255,255,0.2);
        }
        .btn-success:hover {
            background: linear-gradient(135deg, #16a34a, #15803d);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
        }

        .btn-danger {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            border: none;
            box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2), inset 0 1px 0 rgba(255,255,255,0.2);
        }
        .btn-danger:hover {
            background: linear-gradient(135deg, #dc2626, #b91c1c);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
        }
        
        /* FORM CONTROLS */
        .form-control, .form-select { 
            border-radius: 8px; 
            border: 1px solid #cbd5e1; 
            font-size: .85rem; 
            padding: 0.55rem 0.75rem;
            transition: all 0.2s;
            background-color: #fff;
        }
        .form-control:focus, .form-select:focus { 
            border-color: #38bdf8; 
            box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); 
            outline: none;
        }
        
        .quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; }
        .quick-action { 
            padding: 1.25rem; 
            color: var(--ink); 
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            background: white;
            border-radius: 12px;
            border: 1px solid var(--line);
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 0.75rem;
            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        }
        .quick-action i { font-size: 1.5rem; color: var(--primary); }
        .quick-action:hover { 
            transform: translateY(-3px); 
            box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08); 
            border-color: #bae6fd;
        }
        .empty-state { padding: 4rem 2rem; text-align: center; color: #94a3b8; background: white; border-radius: 12px; border: 1px dashed #cbd5e1; }
        .empty-state i { font-size: 3rem; color: #cbd5e1; margin-bottom: 1rem; }

        /* Badge and utilities */
        .badge { padding: 0.4em 0.6em; border-radius: 6px; font-weight: 600; }
        .bg-primary { background-color: var(--primary) !important; }

        /* URGENCY BADGE */
        @keyframes urgBlink {
            0% { background-color: #fef2f2; border-color: #fca5a5; color: #ef4444; box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
            50% { background-color: #ef4444; border-color: #dc2626; color: #ffffff; box-shadow: 0 0 12px rgba(239, 68, 68, 0.9); }
            100% { background-color: #fef2f2; border-color: #fca5a5; color: #ef4444; box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
        }
        .stat-badge {
            padding: 0.2rem 0.45rem;
            border-radius: 6px;
            font-size: 0.7rem;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            border: 1px solid transparent;
            vertical-align: middle;
        }
        .urg-blinking {
            animation: urgBlink 1.2s infinite ease-in-out;
        }
        .urg-resolved {
            background-color: #f1f5f9;
            color: #94a3b8;
            border-color: #cbd5e1;
            text-decoration: line-through;
        }

        /* Mobile Menu Button */
        .mobile-menu-btn {
            display: none;
            background: transparent;
            border: none;
            color: #0f172a;
            font-size: 1.5rem;
            padding: 0.5rem;
            cursor: pointer;
        }

        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15,23,42,0.5);
            backdrop-filter: blur(2px);
            z-index: 25;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .sidebar-overlay.show {
            display: block;
            opacity: 1;
        }

        @media (max-width: 992px) {
            .mobile-menu-btn { display: block; }
            .sidebar { 
                position: fixed; 
                height: 100vh;
                width: 280px; 
                box-shadow: 4px 0 15px rgba(0,0,0,0.2); 
                transform: translateX(-100%);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                border-bottom: none;
            }
            .sidebar.show {
                transform: translateX(0);
            }
            .app-shell { display: block; }
            .main-wrap { margin-left: 0; width: 100%; }
            .topbar { position: sticky; padding: 1rem; height: auto; align-items: center; gap: 1rem; flex-wrap: nowrap;}
            .page-content { padding: 1.25rem; }
            .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
        }
        @media (max-width: 576px) {
            .quick-grid { grid-template-columns: 1fr; }
            .toolbar { display: flex; flex-direction: column; align-items: stretch; }
            .toolbar > * + * { margin-top: .75rem; }
        }
    