/* ============================================
   🍎 iOS DESIGN SYSTEM - COMPLETE STYLESHEET
   ============================================ */

/* --- VARIABLES & TOKENS --- */
:root {
    /* Couleurs principales iOS */
    --ios-bg: #F2F2F7;
    --ios-bg-secondary: #EFEFF4;
    --ios-card: #FFFFFF;
    --ios-blue: #007AFF;
    --ios-blue-light: rgba(0, 122, 255, 0.12);
    --ios-green: #34C759;
    --ios-red: #FF3B30;
    --ios-orange: #FF9500;
    --ios-yellow: #FFCC00;
    --ios-purple: #AF52DE;
    --ios-teal: #5AC8FA;
    --ios-text: #000000;
    --ios-text-secondary: #3C3C43;
    --ios-text-muted: #8E8E93;
    --ios-text-placeholder: #C7C7CC;
    --ios-border: rgba(60, 60, 67, 0.12);
    --ios-separator: rgba(60, 60, 67, 0.08);
    --ios-fill: rgba(120, 120, 128, 0.08);
    --ios-fill-secondary: rgba(120, 120, 128, 0.12);
    --ios-fill-tertiary: rgba(120, 120, 128, 0.16);

    /* Glassmorphism */
    --ios-glass: rgba(255, 255, 255, 0.72);
    --ios-glass-border: rgba(255, 255, 255, 0.5);

    /* Ombres iOS */
    --ios-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04),
                     0 1px 2px rgba(0, 0, 0, 0.06);
    --ios-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08),
                     0 2px 6px rgba(0, 0, 0, 0.04);
    --ios-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12),
                     0 4px 12px rgba(0, 0, 0, 0.06);
    --ios-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15),
                     0 8px 20px rgba(0, 0, 0, 0.08);

    /* Dimensions */
    --ios-radius-sm: 8px;
    --ios-radius-md: 12px;
    --ios-radius-lg: 16px;
    --ios-radius-xl: 20px;
    --ios-radius-full: 9999px;

    /* Animations */
    --ios-spring: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ios-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ios-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ios-duration: 0.3s;
    --ios-duration-fast: 0.15s;
}

/* --- RESET & BASE --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                 "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--ios-bg);
    color: var(--ios-text);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.47059;
    letter-spacing: -0.022em;
    font-size: 17px;
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes ios-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ios-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ios-scale-in {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ios-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes ios-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes ios-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes ios-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   📦 CONTENEURS
   ============================================ */
.ios-container {
    background-color: var(--ios-card);
    width: 100%;
    max-width: 420px;
    border-radius: var(--ios-radius-xl);
    padding: 28px;
    box-shadow: var(--ios-shadow-lg);
    animation: ios-scale-in 0.5s var(--ios-spring) both;
    position: relative;
    overflow: hidden;
}

.ios-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 100%
    );
    pointer-events: none;
    border-radius: var(--ios-radius-xl) var(--ios-radius-xl) 0 0;
}

.ios-container-large {
    background-color: var(--ios-card);
    width: 100%;
    max-width: 940px;
    border-radius: var(--ios-radius-xl);
    padding: 28px;
    box-shadow: var(--ios-shadow-lg);
    animation: ios-fade-in 0.5s var(--ios-spring) both;
    position: relative;
    overflow: hidden;
}

.ios-container-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.06) 0%,
        transparent 100%
    );
    pointer-events: none;
    border-radius: var(--ios-radius-xl) var(--ios-radius-xl) 0 0;
}

/* ============================================
   📝 TYPOGRAPHIE
   ============================================ */
h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0.37px;
    line-height: 1.2;
    margin-bottom: 8px;
}

h2 {
    text-align: center;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.35px;
    margin-top: 0;
    margin-bottom: 28px;
    color: var(--ios-text);
}

h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.38px;
}

.subtitle {
    font-size: 15px;
    color: var(--ios-text-muted);
    text-align: center;
    margin-top: -20px;
    margin-bottom: 24px;
}

/* ============================================
   📋 FORMULAIRES
   ============================================ */
.form-group {
    margin-bottom: 20px;
    animation: ios-fade-in 0.4s var(--ios-spring) both;
}

.form-group:nth-child(1) { animation-delay: 0.05s; }
.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.15s; }
.form-group:nth-child(4) { animation-delay: 0.2s; }
.form-group:nth-child(5) { animation-delay: 0.25s; }
.form-group:nth-child(6) { animation-delay: 0.3s; }

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
select {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: var(--ios-radius-md);
    font-size: 17px;
    font-family: inherit;
    box-sizing: border-box;
    background-color: var(--ios-fill);
    color: var(--ios-text);
    transition: all var(--ios-duration) var(--ios-ease);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    letter-spacing: -0.01em;
}

input::placeholder {
    color: var(--ios-text-placeholder);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
select:focus {
    background-color: var(--ios-fill-secondary);
    box-shadow: 0 0 0 4px var(--ios-blue-light);
}

input.error {
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.12);
    animation: ios-shake 0.5s var(--ios-ease);
}

/* --- Grouped inputs (style réglages iOS) --- */
.ios-grouped-fields {
    background-color: var(--ios-fill);
    border-radius: var(--ios-radius-md);
    overflow: hidden;
}

.ios-grouped-fields .form-group {
    margin-bottom: 0;
    animation: none;
}

.ios-grouped-fields input {
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid var(--ios-separator);
    padding: 14px 16px;
}

.ios-grouped-fields .form-group:last-child input {
    border-bottom: none;
}

.ios-grouped-fields input:focus {
    background-color: var(--ios-fill-secondary);
    box-shadow: none;
}

/* ============================================
   ✅ CHECKBOX → STYLE TOGGLE iOS
   ============================================ */
.checkbox-group {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    color: var(--ios-text);
    font-size: 17px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.checkbox-group input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-group input[type="checkbox"] + .toggle-track,
.checkbox-group label::before {
    content: '';
    display: inline-block;
    width: 51px;
    height: 31px;
    background-color: var(--ios-fill-tertiary);
    border-radius: var(--ios-radius-full);
    margin-right: 12px;
    position: relative;
    transition: background-color var(--ios-duration) var(--ios-ease);
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-group label::after {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    background: white;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    left: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15),
                0 1px 1px rgba(0, 0, 0, 0.06);
    transition: transform var(--ios-duration) var(--ios-bounce),
                left var(--ios-duration) var(--ios-bounce);
}

.checkbox-group label {
    position: relative;
    padding-left: 63px;
}

.checkbox-group label::before {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.checkbox-group label:has(input:checked)::before {
    background-color: var(--ios-green);
}

.checkbox-group label:has(input:checked)::after {
    left: 22px;
}

/* Version compatible tous navigateurs */
.ios-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 17px;
    font-weight: 400;
    color: var(--ios-text);
    user-select: none;
    padding-left: 63px;
    min-height: 31px;
}

.ios-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-toggle .toggle-track {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 51px;
    height: 31px;
    background-color: var(--ios-fill-tertiary);
    border-radius: var(--ios-radius-full);
    transition: background-color var(--ios-duration) var(--ios-ease);
}

.ios-toggle .toggle-track::after {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15),
                0 1px 1px rgba(0, 0, 0, 0.06);
    transition: transform var(--ios-duration) var(--ios-bounce);
}

.ios-toggle input:checked + .toggle-track {
    background-color: var(--ios-green);
}

.ios-toggle input:checked + .toggle-track::after {
    transform: translateX(20px);
}

/* ============================================
   🔘 BOUTONS
   ============================================ */
button,
.btn {
    width: 100%;
    background-color: var(--ios-blue);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: var(--ios-radius-md);
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 12px;
    transition: all var(--ios-duration-fast) var(--ios-ease);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

button:active,
.btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

button:hover,
.btn:hover {
    filter: brightness(1.08);
}

button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--x, 50%) var(--y, 50%),
        rgba(255, 255, 255, 0.25) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.4s;
}

button:active::after {
    opacity: 1;
}

.btn-secondary {
    background-color: var(--ios-fill-secondary);
    color: var(--ios-blue);
}

.btn-destructive {
    background-color: var(--ios-red);
    color: white;
}

.btn-success {
    background-color: var(--ios-green);
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: var(--ios-blue);
    border: 1.5px solid var(--ios-blue);
}

.btn-ghost {
    background: transparent;
    color: var(--ios-blue);
    padding: 10px 16px;
}

.btn-ghost:hover {
    background-color: var(--ios-blue-light);
}

.btn-small {
    width: auto;
    padding: 10px 18px;
    margin-top: 0;
    font-size: 15px;
    border-radius: var(--ios-radius-sm);
}

.btn-pill {
    border-radius: var(--ios-radius-full);
    padding: 12px 24px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    margin: 0;
    font-size: 20px;
}

button:disabled,
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ios-spin 0.8s linear infinite;
}

/* ============================================
   🔔 ALERTES
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--ios-radius-md);
    margin-bottom: 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    animation: ios-slide-up 0.4s var(--ios-spring) both;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.12);
    color: var(--ios-green);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.alert-success::before {
    content: '✓';
    font-weight: 800;
    font-size: 16px;
    width: 24px;
    height: 24px;
    background: var(--ios-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-error {
    background-color: rgba(255, 59, 48, 0.12);
    color: var(--ios-red);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.alert-error::before {
    content: '!';
    font-weight: 800;
    font-size: 14px;
    width: 24px;
    height: 24px;
    background: var(--ios-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-warning {
    background-color: rgba(255, 149, 0, 0.12);
    color: var(--ios-orange);
    border: 1px solid rgba(255, 149, 0, 0.2);
}

.alert-info {
    background-color: var(--ios-blue-light);
    color: var(--ios-blue);
    border: 1px solid rgba(0, 122, 255, 0.2);
}

/* ============================================
   📊 TABLEAU
   ============================================ */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--ios-radius-md);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

th {
    padding: 12px 16px;
    text-align: left;
    color: var(--ios-text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background-color: var(--ios-fill);
    border-bottom: 1px solid var(--ios-separator);
}

th:first-child {
    border-radius: var(--ios-radius-sm) 0 0 0;
}

th:last-child {
    border-radius: 0 var(--ios-radius-sm) 0 0;
}

td {
    padding: 14px 16px;
    font-size: 15px;
    vertical-align: middle;
    border-bottom: 1px solid var(--ios-separator);
    transition: background-color var(--ios-duration-fast);
}

tr {
    transition: background-color var(--ios-duration-fast);
}

tbody tr:hover {
    background-color: var(--ios-fill);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    animation: ios-fade-in 0.3s var(--ios-spring) both;
}

tbody tr:nth-child(1) { animation-delay: 0.02s; }
tbody tr:nth-child(2) { animation-delay: 0.04s; }
tbody tr:nth-child(3) { animation-delay: 0.06s; }
tbody tr:nth-child(4) { animation-delay: 0.08s; }
tbody tr:nth-child(5) { animation-delay: 0.1s; }
tbody tr:nth-child(6) { animation-delay: 0.12s; }
tbody tr:nth-child(7) { animation-delay: 0.14s; }
tbody tr:nth-child(8) { animation-delay: 0.16s; }
tbody tr:nth-child(9) { animation-delay: 0.18s; }
tbody tr:nth-child(10) { animation-delay: 0.2s; }

/* ============================================
   🔗 LIENS D'ACTIONS
   ============================================ */
.action-links {
    display: flex;
    gap: 6px;
}

.action-links a {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-blue);
    padding: 6px 12px;
    border-radius: var(--ios-radius-sm);
    transition: all var(--ios-duration-fast) var(--ios-ease);
    white-space: nowrap;
}

.action-links a:hover {
    background-color: var(--ios-blue-light);
}

.action-links a:active {
    transform: scale(0.95);
}

.action-links a.btn-delete {
    color: var(--ios-red);
}

.action-links a.btn-delete:hover {
    background-color: rgba(255, 59, 48, 0.1);
}

/* ============================================
   🏷️ BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ios-blue);
    color: white;
    padding: 3px 10px;
    border-radius: var(--ios-radius-full);
    font-size: 13px;
    font-weight: 600;
    margin-right: 4px;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.badge-success { background-color: var(--ios-green); }
.badge-error { background-color: var(--ios-red); }
.badge-warning { background-color: var(--ios-orange); }
.badge-info { background-color: var(--ios-teal); }
.badge-purple { background-color: var(--ios-purple); }

.badge-outline {
    background: transparent;
    border: 1.5px solid var(--ios-blue);
    color: var(--ios-blue);
}

.badge-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
}

/* ============================================
   📐 HEADER & NAVIGATION
   ============================================ */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-actions h2 {
    margin-bottom: 0;
    text-align: left;
}

/* --- Segmented Control iOS --- */
.nav-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    padding: 3px;
    background-color: var(--ios-fill);
    border-radius: var(--ios-radius-sm);
    border: none;
    position: relative;
}

.nav-tabs a {
    text-decoration: none;
    color: var(--ios-text);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 7px;
    transition: all var(--ios-duration) var(--ios-ease);
    flex: 1;
    text-align: center;
    z-index: 1;
    position: relative;
}

.nav-tabs a.active {
    background-color: var(--ios-card);
    color: var(--ios-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08),
                0 1px 2px rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.nav-tabs a:hover:not(.active) {
    color: var(--ios-text-secondary);
}

.nav-tabs a:active:not(.active) {
    transform: scale(0.97);
    opacity: 0.7;
}

/* ============================================
   🃏 CARTES MODULES
   ============================================ */
.module-card {
    background-color: var(--ios-fill);
    border: none;
    border-radius: var(--ios-radius-md);
    padding: 18px;
    margin-bottom: 12px;
    position: relative;
    transition: all var(--ios-duration) var(--ios-ease);
    animation: ios-fade-in 0.4s var(--ios-spring) both;
}

.module-card:hover {
    background-color: var(--ios-fill-secondary);
}

.btn-add-module {
    background: transparent;
    color: var(--ios-blue);
    border: 2px dashed rgba(0, 122, 255, 0.3);
    font-weight: 600;
    transition: all var(--ios-duration) var(--ios-ease);
}

.btn-add-module:hover {
    border-color: var(--ios-blue);
    background-color: var(--ios-blue-light);
    filter: none;
}

.btn-add-module:active {
    transform: scale(0.98);
}

.btn-remove-module {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(255, 59, 48, 0.1);
    color: var(--ios-red);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: all var(--ios-duration-fast) var(--ios-ease);
}

.btn-remove-module:hover {
    background: rgba(255, 59, 48, 0.2);
    transform: scale(1.1);
}

.btn-remove-module:active {
    transform: scale(0.9);
}

/* ============================================
   📝 TEXTAREA
   ============================================ */
textarea,
textarea.paste-zone {
    width: 100%;
    min-height: 150px;
    padding: 14px 16px;
    border: none;
    border-radius: var(--ios-radius-md);
    font-family: "SF Mono", SFMono-Regular, "Cascadia Code",
                 Menlo, Consolas, monospace;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
    background-color: var(--ios-fill);
    color: var(--ios-text);
    transition: all var(--ios-duration) var(--ios-ease);
    outline: none;
    line-height: 1.6;
}

textarea:focus,
textarea.paste-zone:focus {
    background-color: var(--ios-fill-secondary);
    box-shadow: 0 0 0 4px var(--ios-blue-light);
}

/* ============================================
   📱 SESSION CARDS
   ============================================ */
.session-card {
    background: var(--ios-card);
    border: 1px solid var(--ios-separator);
    padding: 18px 20px;
    border-radius: var(--ios-radius-md);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--ios-duration) var(--ios-ease);
    animation: ios-fade-in 0.4s var(--ios-spring) both;
}

.session-card:hover {
    box-shadow: var(--ios-shadow-md);
    transform: translateY(-1px);
}

.session-card:active {
    transform: scale(0.99);
}

.status-active {
    color: var(--ios-green);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-active::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--ios-green);
    border-radius: 50%;
    display: inline-block;
    animation: ios-pulse 2s ease-in-out infinite;
}

.status-closed {
    color: var(--ios-red);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-closed::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--ios-red);
    border-radius: 50%;
    display: inline-block;
}

/* ============================================
   🌐 COMPOSANTS UTILITAIRES
   ============================================ */
.ios-divider {
    height: 1px;
    background-color: var(--ios-separator);
    margin: 20px 0;
    border: none;
}

.ios-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--ios-fill-tertiary);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: ios-spin 0.8s linear infinite;
    margin: 20px auto;
}

.ios-skeleton {
    background: linear-gradient(
        90deg,
        var(--ios-fill) 25%,
        var(--ios-fill-secondary) 50%,
        var(--ios-fill) 75%
    );
    background-size: 200% 100%;
    animation: ios-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--ios-radius-sm);
    height: 16px;
    margin-bottom: 8px;
}

.ios-progress {
    width: 100%;
    height: 4px;
    background-color: var(--ios-fill);
    border-radius: var(--ios-radius-full);
    overflow: hidden;
}

.ios-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ios-blue), #5AC8FA);
    border-radius: var(--ios-radius-full);
    transition: width 0.6s var(--ios-spring);
}

.ios-tooltip {
    position: relative;
}

.ios-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 8px 14px;
    background: var(--ios-text);
    color: var(--ios-card);
    border-radius: var(--ios-radius-sm);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--ios-duration) var(--ios-ease);
}

.ios-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ios-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

/* Liste style réglages iOS */
.ios-list {
    background: var(--ios-card);
    border-radius: var(--ios-radius-md);
    overflow: hidden;
}

.ios-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ios-separator);
    cursor: pointer;
    transition: background-color var(--ios-duration-fast);
}

.ios-list-item:last-child {
    border-bottom: none;
}

.ios-list-item:hover {
    background-color: var(--ios-fill);
}

.ios-list-item:active {
    background-color: var(--ios-fill-secondary);
}

.ios-chevron::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--ios-text-placeholder);
    border-bottom: 2px solid var(--ios-text-placeholder);
    transform: rotate(-45deg);
    display: inline-block;
    flex-shrink: 0;
}

.ios-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--ios-fill);
    border-radius: var(--ios-radius-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text);
    transition: all var(--ios-duration-fast);
}

.ios-chip:hover {
    background: var(--ios-fill-secondary);
}

.ios-chip-active {
    background: var(--ios-blue-light);
    color: var(--ios-blue);
}

.ios-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ios-text-muted);
}

.ios-empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.ios-empty-state h3 {
    color: var(--ios-text);
    margin-bottom: 8px;
}

.ios-empty-state p {
    font-size: 15px;
    max-width: 280px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================
   🖼️ MODAL / DIALOG iOS
   ============================================ */
.ios-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: ios-fade-bg 0.3s ease both;
}

@keyframes ios-fade-bg {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ios-modal {
    background: var(--ios-card);
    border-radius: 14px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    overflow: hidden;
    animation: ios-scale-in 0.35s var(--ios-spring) both;
    box-shadow: var(--ios-shadow-xl);
}

.ios-modal-body {
    padding: 24px 20px 16px;
}

.ios-modal-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ios-modal-message {
    font-size: 14px;
    color: var(--ios-text-secondary);
    line-height: 1.5;
}

.ios-modal-actions {
    border-top: 1px solid var(--ios-separator);
    display: flex;
}

.ios-modal-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    background: transparent;
    font-size: 17px;
    font-weight: 400;
    color: var(--ios-blue);
    cursor: pointer;
    margin: 0;
    border-radius: 0;
    transition: background var(--ios-duration-fast);
}

.ios-modal-actions button:not(:last-child) {
    border-right: 1px solid var(--ios-separator);
}

.ios-modal-actions button:active {
    background: var(--ios-fill);
}

.ios-modal-actions button.btn-bold {
    font-weight: 600;
}

.ios-modal-actions button.btn-destructive {
    color: var(--ios-red);
    background: transparent;
}

/* ============================================
   📱 RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .ios-container,
    .ios-container-large {
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
        box-shadow: none;
        padding: 20px 16px;
    }

    h2 {
        font-size: 28px;
        font-weight: 700;
        text-align: left;
    }

    .header-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .header-actions .btn-small {
        width: 100%;
    }

    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs a {
        font-size: 12px;
        padding: 8px 12px;
        min-width: fit-content;
    }

    .action-links {
        flex-direction: column;
        gap: 4px;
    }

    .session-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .ios-container-large {
        max-width: 100%;
        margin: 0 12px;
    }
}

/* ============================================
   🎨 ANIMATIONS UTILITAIRES
   ============================================ */
.ios-lift {
    transition: transform var(--ios-duration) var(--ios-ease),
                box-shadow var(--ios-duration) var(--ios-ease);
}

.ios-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--ios-shadow-lg);
}

.ios-press {
    transition: transform var(--ios-duration-fast) var(--ios-ease);
}

.ios-press:active {
    transform: scale(0.96);
}

.ios-stagger > * {
    animation: ios-fade-in 0.4s var(--ios-spring) both;
}

.ios-stagger > *:nth-child(1) { animation-delay: 0.03s; }
.ios-stagger > *:nth-child(2) { animation-delay: 0.06s; }
.ios-stagger > *:nth-child(3) { animation-delay: 0.09s; }
.ios-stagger > *:nth-child(4) { animation-delay: 0.12s; }
.ios-stagger > *:nth-child(5) { animation-delay: 0.15s; }
.ios-stagger > *:nth-child(6) { animation-delay: 0.18s; }
.ios-stagger > *:nth-child(7) { animation-delay: 0.21s; }
.ios-stagger > *:nth-child(8) { animation-delay: 0.24s; }

/* Safe area pour les appareils avec encoche */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Accessibilité : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   🔍 SELECT DROPDOWN iOS
   ============================================ */
.ios-select-wrapper {
    position: relative;
}

.ios-select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--ios-text-muted);
    border-bottom: 2px solid var(--ios-text-muted);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.ios-select-wrapper select {
    padding-right: 40px;
}

/* ============================================
   📊 STAT CARDS
   ============================================ */
.ios-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.ios-stat-card {
    background: var(--ios-fill);
    border-radius: var(--ios-radius-md);
    padding: 16px;
    text-align: center;
    transition: all var(--ios-duration) var(--ios-ease);
}

.ios-stat-card:hover {
    background: var(--ios-fill-secondary);
    transform: translateY(-2px);
}

.ios-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--ios-blue);
    line-height: 1.2;
}

.ios-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ios-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============================================
   🔒 ÉCRAN DE CONNEXION
   ============================================ */
.login-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--ios-blue), #5856D6);
    border-radius: var(--ios-radius-lg);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

/* ============================================
   ✨ GLASSMORPHISM CARD
   ============================================ */
.ios-glass-card {
    background: var(--ios-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-xl);
    padding: 24px;
    box-shadow: var(--ios-shadow-lg);
}

/* ============================================
   🎯 SEARCH BAR iOS
   ============================================ */
.ios-search-bar {
    position: relative;
    margin-bottom: 20px;
}

.ios-search-bar input {
    padding-left: 40px;
    background-color: var(--ios-fill);
    border-radius: var(--ios-radius-sm);
}

.ios-search-bar::before {
    content: '⌕';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--ios-text-muted);
    pointer-events: none;
    z-index: 1;
}