/* ═══════════════════════════════════════════════════════════════════════════
   INCIDENT-DC — Système de Gestion d'Incidents Filiales → Holding
   Design System & Styles
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Couleurs principales */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;

    --secondary: #475569;
    --secondary-light: #64748b;

    /* Couleurs priorités */
    --p1: #dc2626;
    --p1-bg: #fef2f2;
    --p1-border: #fecaca;
    --p2: #ea580c;
    --p2-bg: #fff7ed;
    --p2-border: #fed7aa;
    --p3: #ca8a04;
    --p3-bg: #fefce8;
    --p3-border: #fef08a;
    --p4: #16a34a;
    --p4-bg: #f0fdf4;
    --p4-border: #bbf7d0;

    /* Couleurs statuts */
    --nouveau: #6366f1;
    --en-cours: #3b82f6;
    --en-attente: #f59e0b;
    --escalade: #ef4444;
    --resolu: #22c55e;
    --cloture: #6b7280;

    /* Neutres */
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition: all 0.2s ease;

    /* Radius */
    --radius: 8px;
    --radius-lg: 12px;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0f172a 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sidebar-brand small {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.nav-section {
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: var(--primary-light);
}

.sidebar-nav a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav .nav-badge {
    margin-left: auto;
    background: var(--p1);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-left h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right .notif-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.topbar-right .notif-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.notif-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--p1);
    color: white;
    font-size: 0.6rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.page-content {
    padding: 1.5rem 2rem;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ─── Stats Cards ────────────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-100); color: var(--primary); }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-icon.red { background: #fef2f2; color: #dc2626; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }
.stat-icon.yellow { background: #fef9c3; color: #ca8a04; }

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.1rem;
}

.stat-trend {
    font-size: 0.7rem;
    margin-top: 0.3rem;
    font-weight: 600;
}

.stat-trend.up { color: #16a34a; }
.stat-trend.down { color: #dc2626; }

/* ─── Priority Badges ────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-p1 { background: var(--p1-bg); color: var(--p1); border: 1px solid var(--p1-border); }
.badge-p2 { background: var(--p2-bg); color: var(--p2); border: 1px solid var(--p2-border); }
.badge-p3 { background: var(--p3-bg); color: var(--p3); border: 1px solid var(--p3-border); }
.badge-p4 { background: var(--p4-bg); color: var(--p4); border: 1px solid var(--p4-border); }

.badge-nouveau { background: #eef2ff; color: var(--nouveau); border: 1px solid #c7d2fe; }
.badge-en-cours { background: #eff6ff; color: var(--en-cours); border: 1px solid #bfdbfe; }
.badge-en-attente { background: #fffbeb; color: var(--en-attente); border: 1px solid #fde68a; }
.badge-escalade { background: #fef2f2; color: var(--escalade); border: 1px solid #fecaca; }
.badge-resolu { background: #f0fdf4; color: var(--resolu); border: 1px solid #bbf7d0; }
.badge-cloture { background: #f9fafb; color: var(--cloture); border: 1px solid #e5e7eb; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--bg);
    padding: 0.7rem 0.85rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    vertical-align: middle;
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--primary-50);
}

table .incident-ref {
    font-weight: 600;
    color: var(--primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
}

table .incident-titre {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sla-warning {
    color: var(--p2);
    font-weight: 600;
}

.sla-danger {
    color: var(--p1);
    font-weight: 700;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-group label .required {
    color: var(--p1);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-success {
    background: #16a34a;
    color: white;
}

.btn-success:hover {
    background: #15803d;
    color: white;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    color: white;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ─── Priority Indicator ─────────────────────────────────────────────────── */

.priority-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.priority-indicator.P1 { background: var(--p1-bg); color: var(--p1); border: 2px solid var(--p1-border); }
.priority-indicator.P2 { background: var(--p2-bg); color: var(--p2); border: 2px solid var(--p2-border); }
.priority-indicator.P3 { background: var(--p3-bg); color: var(--p3); border: 2px solid var(--p3-border); }
.priority-indicator.P4 { background: var(--p4-bg); color: var(--p4); border: 2px solid var(--p4-border); }

.priority-indicator .priority-label {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ─── Flash Messages ─────────────────────────────────────────────────────── */

.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    animation: flashIn 0.3s ease;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.flash-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.flash-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ─── Incident Detail ────────────────────────────────────────────────────── */

.incident-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.incident-header-left {
    flex: 1;
}

.incident-header .ref {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.incident-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.incident-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.incident-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.detail-field {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-field .label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-field .value {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: right;
}

/* ─── Timeline ───────────────────────────────────────────────────────────── */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--border);
}

.timeline-item.escalade::before { background: var(--escalade); }
.timeline-item.resolution::before { background: var(--resolu); }
.timeline-item.creation::before { background: var(--nouveau); }

.timeline-item .time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.timeline-item .description {
    font-size: 0.82rem;
    color: var(--text);
}

/* ─── Comment ────────────────────────────────────────────────────────────── */

.comment {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-size: 0.82rem;
    font-weight: 600;
}

.comment-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.6;
}

.comment-type {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 0.5rem;
}

.comment-type.technique { background: #dbeafe; color: #1e40af; }
.comment-type.communication { background: #dcfce7; color: #166534; }
.comment-type.escalade { background: #fef2f2; color: #991b1b; }

/* ─── Filters ────────────────────────────────────────────────────────────── */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.filters-bar .form-control {
    max-width: 200px;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
}

.filters-bar .search-input {
    max-width: 280px;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.pagination a, .pagination span {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-50);
    border-color: var(--primary-light);
    color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ─── Charts placeholder ─────────────────────────────────────────────────── */

.chart-container {
    position: relative;
    height: 250px;
    padding: 1rem;
}

/* ─── Notification list ──────────────────────────────────────────────────── */

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.notif-item:hover {
    background: var(--primary-50);
}

.notif-item.unread {
    background: #eff6ff;
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.notif-dot.info { background: var(--primary-light); }
.notif-dot.warning { background: var(--en-attente); }
.notif-dot.urgent { background: var(--p1); }
.notif-dot.escalade { background: var(--escalade); }

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.notif-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ─── KPI Cards ──────────────────────────────────────────────────────────── */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.kpi-value.good { color: #16a34a; }
.kpi-value.warning { color: #d97706; }
.kpi-value.danger { color: #dc2626; }
.kpi-value.neutral { color: var(--primary); }

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.5rem;
}

.kpi-target {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ─── Progress bars ──────────────────────────────────────────────────────── */

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.green { background: #22c55e; }
.progress-fill.yellow { background: #f59e0b; }
.progress-fill.red { background: #ef4444; }
.progress-fill.blue { background: #3b82f6; }

/* ─── Login Page ─────────────────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0f172a 100%);
    padding: 2rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: var(--primary);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: 0.82rem;
    opacity: 0.8;
}

.login-body {
    padding: 2rem;
}

.login-body .form-group {
    margin-bottom: 1.25rem;
}

.login-body .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
}

.login-footer {
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-content {
        padding: 1rem;
    }
    .topbar {
        padding: 0.5rem 1rem;
    }
}

/* ─── Grid layout helpers ────────────────────────────────────────────────── */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ─── Empty state ────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ─── SLA gauge ──────────────────────────────────────────────────────────── */

.sla-gauge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.sla-gauge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sla-gauge.ok .dot { background: #22c55e; }
.sla-gauge.ok { color: #16a34a; }
.sla-gauge.warning .dot { background: #f59e0b; }
.sla-gauge.warning { color: #d97706; }
.sla-gauge.breach .dot { background: #ef4444; }
.sla-gauge.breach { color: #dc2626; }

/* ─── SLA progress bar in detail ─────────────────────────────────────────── */

.sla-timeline {
    margin: 1rem 0;
}

.sla-timeline .bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.sla-timeline .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.sla-timeline .labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ─── Misc ───────────────────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Badges Projets ─────────────────────────────────────────────────────── */

.badge-prj-initiation { background: #ede9fe; color: #7c3aed; }
.badge-prj-planification { background: #e0f2fe; color: #0284c7; }
.badge-prj-en_cours { background: #dbeafe; color: #2563eb; }
.badge-prj-en_attente { background: #fef3c7; color: #b45309; }
.badge-prj-revue { background: #fce7f3; color: #be185d; }
.badge-prj-termine { background: #dcfce7; color: #16a34a; }
.badge-prj-annule { background: #f1f5f9; color: #64748b; text-decoration: line-through; }

.badge-phase-cadrage { background: #f3e8ff; color: #9333ea; }
.badge-phase-conception { background: #e0e7ff; color: #4f46e5; }
.badge-phase-realisation { background: #dbeafe; color: #2563eb; }
.badge-phase-recette { background: #fef9c3; color: #a16207; }
.badge-phase-deploiement { background: #ccfbf1; color: #0d9488; }
.badge-phase-cloture { background: #d1fae5; color: #059669; }

.badge-prio-critique { background: #fef2f2; color: #dc2626; font-weight: 700; }
.badge-prio-haute { background: #fff7ed; color: #ea580c; }
.badge-prio-moyenne { background: #eff6ff; color: #2563eb; }
.badge-prio-basse { background: #f0fdf4; color: #16a34a; }
