/* ============================================================
   MyBoite CRM — Feuille de style principale
   Design SaaS moderne : bleu nuit / gris / blanc
   ============================================================ */

/* ─── Variables CSS ─── */
:root {
    /* Couleurs principales */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-bg: rgba(59, 130, 246, 0.08);

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: rgba(59, 130, 246, 0.15);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;

    /* Fond */
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;

    /* Textes */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Bordures */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

    /* Arrondis */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

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

    /* Couleurs sémantiques */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ─── App Layout ─── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.page-content {
    flex: 1;
    padding: 24px 32px 40px;
}

/* ─── SIDEBAR ─── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    margin: 12px 14px 8px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-img {
    max-height: 34px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.sidebar-close-mobile {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 20px 12px 8px;
    opacity: 0.6;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--sidebar-text);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 450;
    transition: var(--transition);
}

.nav-item a:hover {
    background: var(--sidebar-hover);
    color: var(--text-white);
}

.nav-item.active a {
    background: var(--sidebar-active);
    color: var(--primary-light);
    font-weight: 500;
}

.nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name-sm {
    font-size: 13px;
    color: var(--text-white);
    font-weight: 500;
}

.user-role-sm {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ─── TOP HEADER ─── */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Notifications dropdown */
.header-notification, .header-user {
    position: relative;
}

.notif-btn, .user-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.notif-btn:hover, .user-btn:hover {
    background: var(--bg-hover);
}

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

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.notif-dropdown, .user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    z-index: 200;
    overflow: hidden;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.notif-list {
    max-height: 300px;
    overflow-y: auto;
}

.notif-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}

.user-dropdown a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* ─── FLASH MESSAGES ─── */
.flash-container {
    padding: 0 32px;
    margin-top: 16px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 8px;
    cursor: pointer;
    animation: slideDown 0.3s ease;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fed7aa; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    color: inherit;
}

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

/* ─── CARDS ─── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-warning {
    border-left: 3px solid var(--warning);
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px 24px;
}

.card-chart .card-body {
    padding: 16px 20px;
    height: 300px;
}

/* ─── KPI CARDS ─── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

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

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

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 450;
    margin-top: 2px;
}

/* ─── DASHBOARD GRID ─── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ─── STATUS LIST ─── */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.status-row:last-child { border-bottom: none; }

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.status-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── ACTION LIST ─── */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.action-item:last-child { border-bottom: none; }

.action-date {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-date.overdue {
    background: #fef2f2;
    color: var(--danger);
}

.action-day {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.action-month {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.action-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.action-info strong {
    font-size: 13px;
    color: var(--text-primary);
}

.action-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── BADGES ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.badge-outline {
    background: transparent !important;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge-sm {
    padding: 2px 8px;
    font-size: 10px;
}

/* ─── TABLES ─── */
.table-responsive {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.row-overdue {
    background: #fffbeb !important;
}

.link-name {
    color: var(--text-primary);
}
.link-name:hover { color: var(--primary-light); }

.text-link {
    color: var(--primary-light);
    font-size: 12px;
}

.sort-link {
    color: var(--text-muted);
    font-weight: 600;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; }
.font-semibold { font-weight: 600; }

/* Inline status select */
.inline-status {
    padding: 4px 8px;
    border-radius: 20px;
    border: 2px solid;
    font-size: 11px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.inline-status:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Digital level bar */
.digital-level {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.digital-level-bar {
    height: 6px;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ─── ACTION BUTTONS ─── */
.action-btns {
    display: flex;
    gap: 4px;
}

.overdue-indicator { margin-left: 4px; }

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination-pages {
    display: flex;
    gap: 4px;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}
.btn-primary:hover { opacity: 0.9; color: white; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 8px;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* ─── FORMS ─── */
.form-page {
    max-width: 900px;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child { border-bottom: none; }

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-hover);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    margin-top: 16px;
}

/* Filters */
.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.filters-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    width: 200px;
    transition: var(--transition);
}

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

.filter-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
}

.results-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ─── ACQUISITION PAGE ─── */
.acquisition-header {
    margin-bottom: 20px;
}

.global-progress {
    display: flex;
    align-items: center;
    gap: 16px;
}

.global-progress-info {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.global-progress-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

.global-progress-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    min-width: 45px;
    text-align: right;
}

/* Phase cards */
.phases-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.phase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    transition: var(--transition);
}

.phase-header:hover {
    background: var(--bg-hover);
}

.phase-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.phase-number {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.phase-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.phase-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.phase-progress-mini {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-mini-container {
    width: 80px;
    height: 5px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-mini {
    height: 100%;
    background: var(--primary-light);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.phase-progress-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.phase-chevron {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.phase-content {
    border-top: 1px solid var(--border-light);
    padding: 16px 24px;
}

/* Tasks */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.task-item:hover {
    background: var(--bg-hover);
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-checkbox {
    position: relative;
    cursor: pointer;
    display: flex;
}

.task-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-light);
}

.task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.task-title {
    font-size: 13px;
    color: var(--text-primary);
}

.task-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.task-delete {
    opacity: 0;
    transition: opacity 0.2s;
}

.task-item:hover .task-delete {
    opacity: 1;
}

.add-task-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.add-task-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}

.add-task-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

/* ─── DETAIL PAGES ─── */
.detail-page {
    max-width: 1100px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.detail-badges {
    display: flex;
    gap: 6px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
}

.info-notes {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.info-notes h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.info-notes p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
}

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

.timeline-item {
    position: relative;
    padding-bottom: 16px;
}

.timeline-dot {
    position: absolute;
    left: -17px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--border);
}

.timeline-dot-appel { background: #8b5cf6; }
.timeline-dot-reunion { background: #06b6d4; }
.timeline-dot-email { background: #3b82f6; }
.timeline-dot-livraison { background: #22c55e; }

.timeline-content {
    padding-left: 4px;
}

.timeline-content strong {
    font-size: 13px;
    color: var(--text-primary);
    display: block;
}

.timeline-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.timeline-content small {
    font-size: 11px;
    color: var(--text-muted);
}

/* Documents inline */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.doc-item:hover { background: var(--bg-hover); }

.doc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.doc-info span { font-size: 13px; color: var(--text-primary); }
.doc-info small { font-size: 11px; color: var(--text-muted); }

.doc-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* File upload */
.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.file-upload-zone:hover, .file-upload-zone.drag-over {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.file-upload-zone .icon-lg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
}

.file-browse {
    color: var(--primary-light);
    cursor: pointer;
    font-weight: 500;
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    margin-top: 12px;
    font-size: 13px;
}

/* ─── SETTINGS ─── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-light);
}

/* ─── MODALS ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: scaleUp 0.2s ease;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

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

.modal-body {
    padding: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* ─── TOAST notifications ─── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    border-left: 3px solid var(--primary-light);
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ─── ICONS ─── */
.icon    { width: 20px; height: 20px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 32px; height: 32px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .sidebar-close-mobile {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 16px;
    }

    .top-header {
        padding: 12px 16px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-form {
        flex-direction: column;
    }

    .filter-input {
        width: 100%;
    }

    .user-name {
        display: none;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .global-progress {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── NEXT ACTION ─── */
.next-action-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.next-action-date {
    font-size: 13px;
    color: var(--text-muted);
}

/* ─── PRINT ─── */
@media print {
    .sidebar, .top-header, .sidebar-overlay {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
}
