/* =============================================================================
 * Portal_Interventions — Thème AOTech 2026 (moderne)
 * =============================================================================
 */

:root {
    /* Palette */
    --blue: #1B3B5F;
    --blue-dark: #0f2742;
    --blue-mid: #2a5488;
    --blue-soft: #3f6ba3;
    --blue-light: #e8eef5;
    --blue-tint: #f0f5fb;

    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.25);

    --bg-page: #f6f8fb;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.78);

    --border: #e2e8f0;
    --border-subtle: rgba(15, 39, 66, 0.08);
    --border-hover: rgba(27, 59, 95, 0.22);

    --text: #0f1929;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    --success: #059669;
    --success-bg: #d1fae5;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;

    --shadow-soft: 0 2px 12px rgba(15, 39, 66, 0.05), 0 1px 3px rgba(15, 39, 66, 0.04);
    --shadow-lift: 0 10px 30px -8px rgba(15, 39, 66, 0.20), 0 4px 8px rgba(15, 39, 66, 0.06);
    --shadow-glow: 0 10px 40px rgba(27, 59, 95, 0.35);

    --gradient-hero: linear-gradient(135deg, #0f2742 0%, #1B3B5F 50%, #2a5488 100%);
    --gradient-cta: linear-gradient(135deg, #1B3B5F 0%, #2a5488 100%);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Gradient ambient subtil sur toute la page */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 800px 400px at 50% -100px, rgba(27, 59, 95, 0.08), transparent 60%),
        radial-gradient(ellipse 600px 400px at 85% 40%, rgba(59, 130, 246, 0.04), transparent 70%);
}

a { color: var(--blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-mid); }

/* ── HEADER ───────────────────────────────────────────────────────── */
.ao-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-glass);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.ao-logo-wrap { display: flex; align-items: center; gap: 12px; }
.ao-logo-badge {
    width: 38px; height: 38px;
    background: var(--gradient-cta);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(27, 59, 95, 0.25);
}
.ao-logo-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    letter-spacing: -0.01em;
}
.ao-logo-sep { width: 1px; height: 22px; background: var(--border); margin: 0 10px; }
.ao-header-sub {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}
.ao-header-right {
    display: flex; align-items: center; gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}
.ao-header-right a { color: var(--text-muted); }
.ao-header-right a:hover { color: var(--blue); }

@media (max-width: 720px) {
    .ao-header { padding: 0 20px; height: 60px; }
    .ao-header-right { display: none; }
}

/* ── HERO ─────────────────────────────────────────────────────────── */
.ao-hero {
    position: relative;
    background: var(--gradient-hero);
    padding: 72px 32px 80px;
    overflow: hidden;
    color: #fff;
}
.ao-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 300px at 30% 10%, rgba(255,255,255,0.12), transparent 60%),
        radial-gradient(ellipse 600px 300px at 80% 90%, rgba(59, 130, 246, 0.22), transparent 70%);
    pointer-events: none;
}
.ao-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent 80%);
    pointer-events: none;
}
.ao-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.ao-hero-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.ao-hero-label::before {
    content: '';
    width: 28px; height: 1px;
    background: rgba(255,255,255,0.5);
}

.ao-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(28px, 4.2vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #d6e1ed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ao-hero p {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin-bottom: 26px;
    font-weight: 400;
}
.ao-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ao-htag {
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.15s, transform 0.15s;
}
.ao-htag:hover { background: rgba(255,255,255,0.16); transform: translateY(-1px); }

@media (max-width: 720px) {
    .ao-hero { padding: 48px 20px 60px; }
    .ao-hero p { font-size: 15px; }
}

/* ── PROGRESS BAR ─────────────────────────────────────────────────── */
.ao-progress-bar { background: rgba(15, 39, 66, 0.06); height: 3px; overflow: hidden; }
.ao-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue-mid), var(--blue-soft));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* ── MAIN ─────────────────────────────────────────────────────────── */
.ao-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 96px;
    width: 100%;
    flex: 1;
}

/* ── SECTIONS (cards glass avec numéro flottant) ─────────────────── */
.ao-section {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 32px 32px 28px;
    margin-bottom: 20px;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
    animation: aoFadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.ao-section:hover { box-shadow: var(--shadow-lift); }
.ao-section:nth-child(2) { animation-delay: 0.05s; }
.ao-section:nth-child(3) { animation-delay: 0.1s; }
.ao-section:nth-child(4) { animation-delay: 0.15s; }
.ao-section:nth-child(5) { animation-delay: 0.2s; }

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

.ao-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
}
.ao-section-num {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--gradient-cta);
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(27, 59, 95, 0.35);
}
.ao-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.ao-section-body { display: flex; flex-direction: column; gap: 18px; }
.ao-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ao-grid3 { display: grid; grid-template-columns: 1fr 2fr 2fr; gap: 16px; }
@media (max-width: 640px) {
    .ao-grid2, .ao-grid3 { grid-template-columns: 1fr; }
    .ao-section { padding: 24px 20px 22px; }
}

/* ── FIELDS / INPUTS ──────────────────────────────────────────────── */
.ao-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.ao-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ao-required::after { content: '*'; color: var(--danger); margin-left: 2px; font-weight: 700; }
.ao-hint { font-size: 12px; color: var(--text-faint); }

.ao-input,
.ao-textarea,
.ao-select {
    width: 100%;
    font-family: 'Noto Sans', sans-serif;
    /* 16px minimum pour empêcher iOS Safari de zoomer au focus */
    font-size: 16px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ao-input::placeholder,
.ao-textarea::placeholder { color: var(--text-faint); }

.ao-input:hover,
.ao-textarea:hover,
.ao-select:hover { border-color: var(--border-hover); }

.ao-input:focus,
.ao-textarea:focus,
.ao-select:focus {
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 3px rgba(27, 59, 95, 0.12);
    background: #fff;
}

.ao-textarea { min-height: 110px; resize: vertical; font-family: inherit; }

.ao-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%231B3B5F' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

.ao-input-error { border-color: var(--danger); background: #fef7f7; }
.ao-field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ao-field-error::before { content: '⚠'; font-size: 11px; }

/* ── GRAVITE (pastilles modernes avec focus ring) ────────────────── */
.ao-sev-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 500px) { .ao-sev-grid { grid-template-columns: 1fr 1fr; } }
.ao-sev-btn {
    position: relative;
    padding: 16px 10px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}
.ao-sev-btn:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.ao-sev-btn input { position: absolute; opacity: 0; pointer-events: none; }
.ao-sev-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(15, 39, 66, 0.04);
}
.ao-sev-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.ao-sev-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
    padding: 0 2px;
    margin-top: 2px;
}
.ao-sev-btn[data-val="low"] .ao-sev-dot { background: #f59e0b; }
.ao-sev-btn[data-val="normal"] .ao-sev-dot { background: #f97316; }
.ao-sev-btn[data-val="high"] .ao-sev-dot { background: #ef4444; }
.ao-sev-btn[data-val="urgent"] .ao-sev-dot { background: #991b1b; }
.ao-sev-btn.is-active {
    border-color: var(--blue-mid);
    background: var(--blue-tint);
    box-shadow: 0 0 0 3px rgba(27, 59, 95, 0.1);
}
.ao-sev-btn.is-active .ao-sev-dot { box-shadow: 0 0 0 5px rgba(255,255,255,0.8), 0 0 0 7px currentColor; }

/* ── FILEDROP ─────────────────────────────────────────────────────── */
.ao-filedrop {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    background: var(--bg-page);
    font-size: 13px;
    color: var(--text-muted);
    transition: border-color 0.15s, background 0.15s;
}
.ao-filedrop:hover { border-color: var(--blue-mid); background: var(--blue-tint); }
.ao-filedrop strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.ao-filedrop input[type="file"] {
    display: block;
    margin-top: 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-muted);
}
.ao-filedrop input[type="file"]::file-selector-button {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    background: var(--surface);
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    margin-right: 10px;
    transition: border-color 0.15s, background 0.15s;
}
.ao-filedrop input[type="file"]::file-selector-button:hover {
    border-color: var(--blue-mid);
    background: var(--blue-tint);
}

/* ── CONSENT ──────────────────────────────────────────────────────── */
.ao-consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 22px;
    background: var(--blue-tint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ao-consent:hover { border-color: var(--border-hover); }
.ao-consent input {
    margin-top: 3px;
    accent-color: var(--blue);
    flex-shrink: 0;
    width: 18px; height: 18px;
    cursor: pointer;
}
.ao-consent a { color: var(--blue); text-decoration: underline; text-decoration-color: rgba(27,59,95,0.3); }

/* ── CONTACT BOX ──────────────────────────────────────────────────── */
.ao-contact-box {
    background: var(--gradient-cta);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(27, 59, 95, 0.2);
}
.ao-contact-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
}
.ao-contact-info { font-size: 13px; color: rgba(255,255,255,0.8); line-height: 1.5; }
.ao-contact-info strong {
    color: #fff;
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    margin-bottom: 2px;
}
.ao-contact-info a { color: inherit; text-decoration: none; }
.ao-contact-info a:hover { color: #fff; }

/* ── BOUTONS ─────────────────────────────────────────────────────── */
.ao-submit-wrap { text-align: center; margin-top: 12px; }
.ao-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--gradient-cta);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 15px 36px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(27, 59, 95, 0.25);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.ao-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.14), transparent 50%);
    pointer-events: none;
}
.ao-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(27, 59, 95, 0.35);
}
.ao-btn:active { transform: translateY(0); }
.ao-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: var(--shadow-soft);
}

.ao-btn--ghost {
    background: transparent;
    color: var(--blue);
    border: 1.5px solid var(--border);
    box-shadow: none;
}
.ao-btn--ghost::before { display: none; }
.ao-btn--ghost:hover {
    border-color: var(--blue-mid);
    background: var(--blue-tint);
    box-shadow: var(--shadow-soft);
}

/* ── ALERTS ──────────────────────────────────────────────────────── */
.ao-alert {
    padding: 14px 18px 14px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    border-left-width: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.55;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: aoFadeUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.ao-alert--success { background: var(--success-bg); border-color: var(--success); color: #065f46; }
.ao-alert--danger  { background: var(--danger-bg);  border-color: var(--danger);  color: #991b1b; }
.ao-alert--warning { background: var(--warning-bg); border-color: var(--warning); color: #92400e; }

/* ── ÉCRAN SUCCÈS ────────────────────────────────────────────────── */
.ao-success-screen {
    text-align: center;
    padding: 56px 28px;
    max-width: 560px;
    margin: 60px auto;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lift);
    animation: aoFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.ao-success-icon {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.25);
}
.ao-success-icon svg {
    width: 44px; height: 44px;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: aoCheckmark 0.6s 0.3s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
@keyframes aoCheckmark {
    to { stroke-dashoffset: 0; }
}

.ao-success-screen h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.015em;
}
.ao-success-screen p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}
.ao-success-reference {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--blue);
    background: var(--blue-tint);
    padding: 12px 26px;
    border-radius: var(--radius);
    margin: 20px 0;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px var(--border-subtle);
}

/* ── FOOTER ──────────────────────────────────────────────────────── */
.ao-footer {
    background: var(--blue-dark);
    padding: 22px 32px;
    margin-top: auto;
    color: rgba(255,255,255,0.6);
    position: relative;
    overflow: hidden;
}
.ao-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 600px 200px at 50% 0%, rgba(59, 130, 246, 0.1), transparent 70%);
    pointer-events: none;
}
.ao-footer-items {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    justify-content: center;
    align-items: center;
}
.ao-footer-item {
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
}
.ao-footer-item a { color: inherit; text-decoration: none; transition: color 0.15s; }
.ao-footer-item a:hover { color: #fff; }

/* ── UTILS / RESPONSIVE ──────────────────────────────────────────── */

/* Wrapper réutilisable pour rendre n'importe quelle table scrollable
   horizontalement sur mobile sans casser le layout flex/grid parent. */
.ao-tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
    /* Toute carte qui contient une table devient scrollable horizontalement */
    .ao-card:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 640px) {
    .ao-main { padding: 32px 16px 80px; }
    .ao-hero h1 { font-size: 28px; }
}

@media (max-width: 480px) {
    /* Stat cards 4-col → 2-col déjà géré ailleurs, on bascule en 1-col sous 480px */
    .ao-stat-grid,
    .ao-tech-stat-grid { grid-template-columns: 1fr !important; }
}

/* =============================================================================
 * APP SHELL — Sidebar fixe + topbar (admin / technicien) — pattern parking, light
 * =============================================================================
 */

:root {
    --sidebar-width: 248px;
    --sidebar-bg: #ffffff;
    --sidebar-border: rgba(15, 39, 66, 0.08);
    --sidebar-link: #475569;
    --sidebar-link-hover-bg: #f0f5fb;
    --sidebar-link-active-bg: #e8eef5;
    --sidebar-link-active: #1B3B5F;
    --sidebar-section: #94a3b8;
    --topbar-height: 60px;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    background: #f6f8fb;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 50;
    display: flex; flex-direction: column;
}
.app-sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
}
.app-sidebar-brand img { height: 30px; width: auto; }
.app-sidebar-brand-tag {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: #64748b;
    padding: 3px 8px;
    background: #f0f5fb;
    border-radius: 4px;
}
.app-nav { padding: 12px 0; flex-grow: 1; }
.app-nav-section {
    padding: 14px 20px 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--sidebar-section);
}
.app-nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 20px;
    color: var(--sidebar-link);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    margin-left: 0; padding-left: 17px;
    transition: background 0.12s, color 0.12s;
}
.app-nav-link:hover {
    background: var(--sidebar-link-hover-bg);
    color: var(--sidebar-link-active);
}
.app-nav-link.is-active {
    background: var(--sidebar-link-active-bg);
    color: var(--sidebar-link-active);
    border-left-color: var(--blue);
    font-weight: 600;
}
.app-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }
.app-nav-link-badge {
    margin-left: auto;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 100px;
    line-height: 1.4;
}
.app-sidebar-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 12px;
    color: #94a3b8;
}

/* ── Content shell ───────────────────────────────────────────────── */
.app-main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex; flex-direction: column;
}
.app-topbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0 32px;
    height: var(--topbar-height);
    display: flex; align-items: center; justify-content: space-between;
}
.app-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--text-muted);
}
.app-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.app-breadcrumb a:hover { color: var(--blue); }
.app-breadcrumb-sep { color: #cbd5e1; }
.app-breadcrumb-current { color: var(--text); font-weight: 600; }

.app-topbar-actions { display: flex; align-items: center; gap: 12px; }
.app-user-pill {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 12px;
    border-radius: 100px;
    background: #f0f5fb;
    font-size: 13px;
    color: var(--text);
}
.app-user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--gradient-cta);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 11px;
}
.app-icon-btn {
    background: none; border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px; height: 36px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.app-icon-btn:hover { background: #f0f5fb; color: var(--blue); border-color: var(--blue-light); }
.app-icon-btn svg { width: 16px; height: 16px; stroke-width: 1.8; }

.app-content {
    padding: 28px 32px 80px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
}
.app-pagehead {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.app-pagehead h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px; font-weight: 700;
    color: var(--text); letter-spacing: -0.015em;
    margin: 0 0 4px;
}
.app-pagehead p {
    margin: 0; font-size: 14px; color: var(--text-muted);
}

/* ── KPI cards (icon + label + value) ────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 980px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: 0 1px 3px rgba(15,39,66,0.04);
    transition: box-shadow 0.15s, transform 0.15s;
}
.kpi-card:hover { box-shadow: 0 4px 14px rgba(15,39,66,0.07); transform: translateY(-1px); }
.kpi-icon-wrap {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kpi-icon-wrap svg { width: 20px; height: 20px; stroke-width: 2; }
.kpi-icon-wrap--blue { background: #dbeafe; color: #1e40af; }
.kpi-icon-wrap--green { background: #d1fae5; color: #065f46; }
.kpi-icon-wrap--amber { background: #fef3c7; color: #92400e; }
.kpi-icon-wrap--red { background: #fee2e2; color: #991b1b; }
.kpi-icon-wrap--violet { background: #ede9fe; color: #5b21b6; }
.kpi-icon-wrap--slate { background: #f1f5f9; color: #475569; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 2px;
}
.kpi-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px; font-weight: 700;
    color: var(--text); letter-spacing: -0.015em;
    line-height: 1.1;
}
.kpi-value--muted { color: var(--text-faint); }
.kpi-value--warn { color: var(--danger); }

/* ── Soft badges (pills) ─────────────────────────────────────────── */
.badge-soft {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
}
.badge-soft--primary { background: #dbeafe; color: #1e40af; }
.badge-soft--success { background: #d1fae5; color: #065f46; }
.badge-soft--warning { background: #fef3c7; color: #92400e; }
.badge-soft--danger  { background: #fee2e2; color: #991b1b; }
.badge-soft--info    { background: #cffafe; color: #155e75; }
.badge-soft--violet  { background: #ede9fe; color: #5b21b6; }
.badge-soft--slate   { background: #f1f5f9; color: #475569; }

/* ── Soft buttons ────────────────────────────────────────────────── */
.btn-soft {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px; font-weight: 600;
    border: none; cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, color 0.12s, transform 0.08s;
}
.btn-soft svg { width: 14px; height: 14px; stroke-width: 2; }
.btn-soft:active { transform: translateY(0.5px); }
.btn-soft--primary { background: #dbeafe; color: #1e40af; }
.btn-soft--primary:hover { background: #bfdbfe; color: #1e3a8a; }
.btn-soft--success { background: #d1fae5; color: #065f46; }
.btn-soft--success:hover { background: #a7f3d0; color: #064e3b; }
.btn-soft--danger  { background: #fee2e2; color: #991b1b; }
.btn-soft--danger:hover { background: #fecaca; color: #7f1d1d; }
.btn-soft--neutral { background: #f1f5f9; color: #334155; }
.btn-soft--neutral:hover { background: #e2e8f0; color: #0f172a; }

/* ── Filled CTA button (matche .ao-btn mais avec icone) ───────────── */
.btn-cta {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px;
    border-radius: 9px;
    background: var(--gradient-cta);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px; font-weight: 600;
    border: none; cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(27,59,95,0.18);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(27,59,95,0.28); color: #fff; }
.btn-cta svg { width: 14px; height: 14px; stroke-width: 2; }

/* ── Section / panel wrappers ────────────────────────────────────── */
.panel {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15,39,66,0.04);
}
.panel + .panel { margin-top: 16px; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px; flex-wrap: wrap;
}
.panel-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px; font-weight: 600;
    color: var(--text);
    margin: 0;
    display: inline-flex; align-items: center; gap: 8px;
    letter-spacing: -0.005em;
}
.panel-title svg { width: 16px; height: 16px; stroke-width: 1.8; color: var(--text-muted); }
.panel-subtitle { font-size: 12px; color: var(--text-faint); font-weight: 500; }

/* ── Mobile sidebar toggle ───────────────────────────────────────── */
.app-sidebar-toggle {
    display: none;
    background: none; border: 1px solid var(--border);
    width: 36px; height: 36px; border-radius: 9px;
    align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted);
}
.app-sidebar-toggle svg { width: 18px; height: 18px; }

@media (max-width: 880px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
        box-shadow: 4px 0 18px rgba(15,39,66,0.12);
    }
    .app-shell.is-sidebar-open .app-sidebar { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .app-sidebar-toggle { display: inline-flex; }
    .app-sidebar-overlay {
        display: none;
        position: fixed; inset: 0; background: rgba(15,39,66,0.45); z-index: 40;
    }
    .app-shell.is-sidebar-open .app-sidebar-overlay { display: block; }
}

/* Logout button : label masqué en mobile (l'icône suffit). */
@media (max-width: 720px) { .app-logout-label { display: none; } }
/* User pill caché aussi en très petit écran pour libérer la place. */
@media (max-width: 600px) { .app-user-pill { display: none; } }

/* =============================================================================
 * UTILITAIRES PARTAGÉS — `.ao-card` / `.ao-tbl` / `.ao-badge` / `.ao-stat-*`
 * Auparavant inlined dans chaque layout. Consolidés ici pour cohérence.
 * =============================================================================
 */

.ao-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(15,39,66,0.04);
}

.ao-page-lead { color: var(--text-muted); font-size: 14px; margin: 0; }
.ao-admin-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
    margin: 0 0 4px;
}
.ao-admin-pagehead {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.ao-admin-pagehead .ao-page-lead { margin-top: 4px; }

.ao-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
@media (max-width: 980px) { .ao-stat-grid { grid-template-columns: repeat(2,1fr); } }
.ao-stat-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 4px;
    font-weight: 600;
}
.ao-stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.018em;
    line-height: 1.1;
}
.ao-stat-value--muted { color: var(--text-faint); }
.ao-stat-value--warn { color: var(--danger); }

/* ── Tables (utilitaire .ao-tbl) ─────────────────────────────────── */
.ao-tbl { width: 100%; border-collapse: collapse; }
.ao-tbl thead th {
    text-align: left;
    padding: 12px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-faint);
    background: #f9fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    white-space: nowrap;
}
.ao-tbl tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: var(--text);
    vertical-align: middle;
}
.ao-tbl tbody tr:last-child td { border-bottom: none; }
.ao-tbl tbody tr:hover td { background: #f9fafc; }
.ao-tbl a { color: var(--blue); text-decoration: none; font-weight: 600; }
.ao-tbl a:hover { text-decoration: underline; }
.ao-tbl code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #475569;
}

/* ── Badges legacy (.ao-badge--{etat}) ────────────────────────────── */
.ao-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
}
.ao-badge--open    { background: #dbeafe; color: #1e40af; }
.ao-badge--closed  { background: #d1fae5; color: #065f46; }
.ao-badge--failed  { background: #fee2e2; color: #991b1b; }
.ao-badge--pending { background: #fef3c7; color: #92400e; }
.ao-badge--low     { background: #fef3c7; color: #92400e; }
.ao-badge--normal  { background: #fed7aa; color: #9a3412; }
.ao-badge--high    { background: #fee2e2; color: #991b1b; }
.ao-badge--urgent  { background: #7f1d1d; color: #fecaca; }

/* ── Pagination ──────────────────────────────────────────────────── */
nav[role="navigation"] {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

/* ── Layout technicien (legacy, gardé pour ne pas casser les vues) ── */
.ao-tech-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
    margin: 0 0 4px;
}
.ao-tech-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px; font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
    margin: 0 0 12px;
}
.ao-tech-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
@media (max-width: 980px) { .ao-tech-stat-grid { grid-template-columns: repeat(2,1fr); } }
.ao-tech-stat-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 4px;
    font-weight: 600;
}
.ao-tech-stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.018em;
    line-height: 1.1;
}
.ao-tbl-scroll-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ao-tbl-scroll-wrap > table { min-width: 600px; }
.ao-tech-show-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.ao-tech-2col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 30px; }
@media (max-width: 800px) { .ao-tech-show-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ao-tech-2col-grid { grid-template-columns: 1fr; } }
.ao-crit { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 100px; letter-spacing: 0.02em; display: inline-block; }
.ao-crit--low    { background: #ecfdf5; color: #059669; }
.ao-crit--normal { background: #eff6ff; color: #1f6feb; }
.ao-crit--high   { background: #fff7ed; color: #c2410c; }
.ao-crit--urgent { background: #fef2f2; color: #b91c1c; }

