/* ============================================
   ARMATIS - Design System 2026
   Minimalisme fonctionnel + glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700;900&display=swap');

:root {
    /* Couleurs principales */
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.7);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --line: #e2e8f0;

    /* Couleurs fonctionnelles */
    --accent: #3b82f6;
    --success: #0a7d2a;
    --warning: #ff9800;
    --error: #ef4444;

    /* Glassmorphism */
    --dash-glass-bg: rgba(255, 255, 255, 0.6);
    --dash-glass-border: rgba(255, 255, 255, 0.2);
    --dash-glass-shadow: 0 10px 24px rgba(15, 15, 15, 0.08);

    /* Ombres */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);

    /* Rayons */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 264px;
    --sidebar-width-mobile: 280px;
    --header-height: 72px;

    /* Compatibilité anciennes variables */
    --ios-blue: var(--accent);
    --ios-blue-light: #60a5fa;
    --ios-blue-dark: #1d4ed8;
    --ios-green: var(--success);
    --ios-orange: var(--warning);
    --ios-red: var(--error);
    --ios-purple: #7c3aed;
    --ios-pink: #db2777;

    --bg-primary: var(--surface);
    --bg-secondary: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(245,246,250,0.95) 100%);
    --bg-secondary-solid: var(--bg);
    --bg-tertiary: var(--surface);
    --bg-glass: var(--dash-glass-bg);

    --text-tertiary: #94a3b8;
    --text-white: #ffffff;
    --text-white-secondary: rgba(255, 255, 255, 0.8);

    --accent-primary: var(--accent);
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.12);

    --glass-bg: var(--dash-glass-bg);
    --glass-border: var(--dash-glass-border);
    --glass-shadow: var(--dash-glass-shadow);
    --glass-blur: blur(18px) saturate(140%);
    --glass-blur-strong: blur(24px) saturate(160%);
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.55;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface-soft);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow), transform var(--transition-slow);
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    min-height: 76px;
}

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

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
}

.sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-toggle {
    margin-top: 12px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.02);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.5rem 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.sidebar-link:hover {
    background: rgba(15, 23, 42, 0.04);
}

.sidebar-link.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--text-primary);
}

.sidebar-icon {
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.04);
}

.sidebar-footer {
    padding: 1rem 0.75rem 1.25rem;
    border-top: 1px solid var(--line);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    margin-bottom: 0.75rem;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.sidebar-user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-logout {
    color: var(--error);
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-user-details,
.sidebar.collapsed .nav-section-label {
    display: none;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
}

/* ============================================
   HEADER
   ============================================ */

.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    z-index: 999;
    transition: left var(--transition-slow);
}

.sidebar.collapsed ~ .top-header {
    left: 80px;
}

.header-content {
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.02);
    cursor: pointer;
    transition: all var(--transition);
}

.header-icon-btn:hover {
    background: rgba(59, 130, 246, 0.08);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding-top: var(--header-height);
    transition: margin-left var(--transition-slow);
}

.main-content.with-sidebar.collapsed {
    margin-left: 80px;
}

.page-header,
.dashboard-header {
    padding: 2rem 2.5rem;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.page-header h1,
.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header p,
.dashboard-header p {
    margin-top: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.period-selector {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--line);
}

.period-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.period-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-xs);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 0 2.5rem 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.25);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* KPI cards */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 0 2.5rem 2rem;
}

.stat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 255, 0.9));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
}

.stat-icon.green { background: rgba(10, 125, 42, 0.12); color: var(--success); }
.stat-icon.orange { background: rgba(255, 152, 0, 0.14); color: var(--warning); }
.stat-icon.purple { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    gap: 8px;
}

.btn-primary {
    background: #007AFF;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

.btn-primary:hover {
    background: #0051D5;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FORMS
   ============================================ */

.form-control,
.select-input,
.form-input,
.user-form-input,
.user-form-select {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: var(--surface-soft);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-control:focus,
.select-input:focus,
.form-input:focus,
.user-form-input:focus,
.user-form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
    transform: translateY(-1px);
}

.form-group label,
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ============================================
   TABLES
   ============================================ */

.appels-table-container,
.users-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.appels-table,
.users-table,
.rates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.appels-table th,
.users-table th,
.rates-table th {
    padding: 12px 16px;
    text-align: left;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 2px solid var(--line);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.appels-table td,
.users-table td,
.rates-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.appels-table tbody tr:hover,
.users-table tbody tr:hover,
.rates-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

.rates-table tbody tr.highlight-row {
    background: rgba(59, 130, 246, 0.08);
}

/* ============================================
   BADGES
   ============================================ */

.badge,
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-success { background: rgba(10, 125, 42, 0.15); color: var(--success); border-color: rgba(10, 125, 42, 0.3); }
.badge-warning { background: rgba(255, 152, 0, 0.15); color: var(--warning); border-color: rgba(255, 152, 0, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--error); border-color: rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--accent); border-color: rgba(59, 130, 246, 0.3); }

.role-badge.admin { background: rgba(124, 58, 237, 0.12); color: #7c3aed; border-color: rgba(124, 58, 237, 0.3); }
.role-badge.user { background: rgba(59, 130, 246, 0.12); color: var(--accent); border-color: rgba(59, 130, 246, 0.3); }

/* ============================================
   MODALS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content.has-rotelec-grid {
    max-width: 1600px;
}

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

.modal-body {
    padding: 2rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

.form-actions,
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   CHARTS
   ============================================ */

.charts-section {
    margin: 0 2.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.25rem;
}

.chart-card {
    padding: 1.5rem;
}

.chart-container {
    height: 320px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 0.75rem;
}

/* ============================================
   LAYOUT & SECTIONS
   ============================================ */

.dashboard,
.appels-page,
.admin-page,
.analyse-quantitative-page {
    padding-bottom: 2rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table-header,
.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.table-title-group p,
.chart-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.table-filters,
.chart-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--line);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.date-range-selector,
.agent-filter-selector {
    display: flex;
    align-items: center;
}

.chart-section,
.table-section {
    margin: 0 2.5rem 2rem;
}

.table-card,
.chart-card {
    margin: 0;
}

.table-title-group h2,
.chart-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.agent-selector {
    margin-bottom: 1rem;
}

.agents-list,
.weaknesses-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

.agent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    margin-bottom: 0.5rem;
    transition: all var(--transition);
}

.agent-item:hover {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
}

.agent-name {
    font-weight: 600;
}

.agent-rate {
    font-weight: 700;
    color: var(--accent);
    padding: 0.4rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-full);
}

/* ============================================
   ANALYSE QUANTITATIVE
   ============================================ */

.comparison-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.comparison-card .card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.comparison-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.02);
    border-radius: 12px;
    border: 1px solid var(--line);
}

.stat-item {
    text-align: center;
}

.stat-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================
   POPUP ANALYSE D'APPEL
   ============================================ */

.appel-details-modern {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-section-modern {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-xs);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    font-size: 18px;
}

.detail-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem 0.9rem;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.detail-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.kpi-item-detailed {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
}

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

.kpi-name-detailed {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.kpi-comment {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.kpi-empty {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 0.75rem 0;
}

.points-list {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.points-list li {
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.02);
    font-size: 0.9rem;
}

.points-list.points-forts li {
    border-left: 3px solid var(--success);
    background: rgba(10, 125, 42, 0.08);
}

.points-list.points-faibles li {
    border-left: 3px solid var(--warning);
    background: rgba(255, 152, 0, 0.08);
}

.commentaire-box {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.quality-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quality-score {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.quality-level {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.quality-criteria {
    display: grid;
    gap: 0.75rem;
}

.quality-criterion {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    background: rgba(15, 23, 42, 0.02);
}

.quality-criterion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.quality-criterion-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.quality-criterion-score {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.85rem;
}

.quality-criterion-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.quality-criterion-comment {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.quality-criterion-proof {
    list-style: disc;
    padding-left: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   ADMIN USERS
   ============================================ */

.user-modal-content {
    max-width: 680px;
}

.user-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-modal-subtitle,
.form-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.user-agents-container {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.02);
}

.user-agents-checkboxes label {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    margin-bottom: 0.5rem;
}

.user-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.user-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn.edit { color: var(--accent); border-color: rgba(59, 130, 246, 0.4); }
.action-btn.reset-password { color: var(--warning); border-color: rgba(255, 152, 0, 0.4); }
.action-btn.delete { color: var(--error); border-color: rgba(239, 68, 68, 0.4); }

.action-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}

/* ============================================
   PAGINATION & UTILS
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
}

.pagination-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.35);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.text-center { text-align: center; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ============================================
   LOGIN
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.08), transparent 50%),
                var(--bg);
}

.login-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.login-background-shapes {
    position: absolute;
    inset: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(80px);
}

.shape-1 {
    width: 320px;
    height: 320px;
    background: rgba(59, 130, 246, 0.5);
    top: -80px;
    right: -60px;
}

.shape-2 {
    width: 280px;
    height: 280px;
    background: rgba(124, 58, 237, 0.4);
    bottom: -100px;
    left: -60px;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: rgba(37, 99, 235, 0.35);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login-card {
    background: var(--surface-soft);
    backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 3rem 2.75rem;
    box-shadow: var(--shadow-lg);
}

.login-wrapper,
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    font-size: 16px;
}

.form-input {
    padding-left: 44px;
}

.form-toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.form-toggle-password:hover {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
}

.login-button {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    transition: all var(--transition);
}

.login-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.login-alert {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.login-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.login-alert-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.login-alert-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .page-header,
    .dashboard-header {
        padding: 1.5rem 1.5rem;
    }

    .card {
        margin: 0 1.5rem 1.5rem;
        padding: 1.5rem;
    }

    .stats-grid,
    .charts-section {
        margin: 0 1.5rem 1.5rem;
    }
}

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

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

    .top-header {
        left: 0;
    }

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

    .header-content {
        padding: 0 1rem;
    }

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

    .charts-section {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   GRILLE QUALITÉ ROTELEC - Design complet
   ============================================ */

.rotelec-evaluation-grid {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    animation: fadeInUp 0.5s ease-out;
}

.rotelec-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid #1a5f7a;
}

.rotelec-company-name {
    color: #57a6c1;
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.rotelec-title {
    color: #1a5f7a;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.rotelec-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.rotelec-dashboard {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
    .rotelec-dashboard {
        grid-template-columns: 1fr;
    }
}

.rotelec-main-grid {
    background: var(--surface);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.rotelec-criteria-header {
    display: grid;
    grid-template-columns: 50px 2fr 120px 150px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #1a5f7a;
    color: #ffffff;
    border-radius: 5px;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.rotelec-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rotelec-criteria-row {
    display: grid;
    grid-template-columns: 50px 2fr 120px 150px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1rem;
    border-bottom: 1px solid var(--line);
    transition: all var(--transition);
    background: var(--surface);
    opacity: 0;
    transform: translateY(8px);
    animation: rotelcRowIn 0.5s ease-out forwards;
}

.rotelec-criteria-row:nth-child(1) { animation-delay: 0.05s; }
.rotelec-criteria-row:nth-child(2) { animation-delay: 0.1s; }
.rotelec-criteria-row:nth-child(3) { animation-delay: 0.15s; }
.rotelec-criteria-row:nth-child(4) { animation-delay: 0.2s; }
.rotelec-criteria-row:nth-child(5) { animation-delay: 0.25s; }
.rotelec-criteria-row:nth-child(6) { animation-delay: 0.3s; }
.rotelec-criteria-row:nth-child(7) { animation-delay: 0.35s; }
.rotelec-criteria-row:nth-child(8) { animation-delay: 0.4s; }

.rotelec-criteria-row:hover {
    background-color: #f9f9f9;
    transform: translateY(-2px);
}

.rotelec-criteria-row.special-criteria {
    background-color: rgba(26, 95, 122, 0.05);
    border-left: 4px solid #1a5f7a;
}

.rotelec-criteria-number {
    background: #1a5f7a;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rotelec-criteria-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rotelec-criteria-name {
    font-weight: 600;
    color: #1a5f7a;
    font-size: 1rem;
}

.rotelec-criteria-description {
    color: #555;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.rotelec-criteria-weight {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.rotelec-criteria-rating {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rotelec-rating-stars {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.rotelec-rating-stars .star {
    color: #ddd;
    font-size: 1.2rem;
    cursor: default;
}

.rotelec-rating-stars .star.active {
    color: #f1c40f;
}

.rotelec-criteria-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.rotelec-score-display {
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.rotelec-score-display.poor { color: var(--error); }
.rotelec-score-display.average { color: var(--warning); }
.rotelec-score-display.good { color: #f1c40f; }
.rotelec-score-display.excellent { color: var(--success); }

.rotelec-criteria-progress {
    display: flex;
    align-items: center;
}

.rotelec-progress-container {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.rotelec-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--error), var(--warning), var(--success));
    border-radius: 10px;
    width: 0%;
    transition: width 1s ease;
    transform-origin: left;
    animation: rotelcProgress 1s ease-out;
}

.rotelec-criteria-comments {
    width: 100%;
}

.rotelec-comment-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
}

.rotelec-summary-panel {
    background: var(--surface);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-top: 5px solid #57a6c1;
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.rotelec-total-score {
    text-align: center;
    margin-bottom: 1.5rem;
}

.rotelec-score-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1a5f7a;
    margin-bottom: 0.5rem;
}

.rotelec-score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0%, var(--line) 0%);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 3px solid #1a5f7a;
    animation: rotelcScorePop 0.6s ease-out;
}

.rotelec-score-circle:hover {
    transform: scale(1.05);
}

.rotelec-header {
    animation: rotelcHeader 0.5s ease-out;
}

.rotelec-summary-panel {
    animation: fadeInUp 0.6s ease-out;
}

.audio-player-card {
    padding: 16px;
    background: rgba(0, 122, 255, 0.05);
    border-radius: 12px;
    margin-top: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.4s ease-out;
}

.audio-player-card audio {
    width: 100%;
}

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

@keyframes rotelcProgress {
    from { opacity: 0; transform: scaleX(0.2); }
    to { opacity: 1; transform: scaleX(1); }
}

@keyframes rotelcScorePop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

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

.rotelec-score-value {
    position: absolute;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rotelec-performance-level {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.rotelec-level-dot {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #ddd;
    cursor: default;
    transition: var(--transition);
}

.rotelec-level-dot.active {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.rotelec-level-dot:nth-child(1) { background: var(--error); }
.rotelec-level-dot:nth-child(2) { background: var(--warning); }
.rotelec-level-dot:nth-child(3) { background: #f1c40f; }
.rotelec-level-dot:nth-child(4) { background: var(--success); }

.rotelec-level-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.rotelec-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.rotelec-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.rotelec-legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .rotelec-dashboard {
        grid-template-columns: 1fr;
    }
    
    .rotelec-criteria-header {
        display: none;
    }
    
    .rotelec-criteria-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    .rotelec-criteria-number {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .rotelec-criteria-name {
        font-weight: 700;
        font-size: 1.1rem;
        padding-right: 50px;
    }
    
    .rotelec-criteria-rating,
    .rotelec-criteria-progress {
        margin-top: 0.5rem;
    }
    
    .rotelec-summary-panel {
        position: relative;
        top: auto;
    }
    
    .modal-content.has-rotelec-grid {
        max-width: 100%;
    }
}
