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

:root {
    --bg-primary: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);
    
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;

    --sidebar-width: 260px;
    --mobile-topbar-height: 58px;
    --bottom-bar-height: 64px;
    --touch-target-min: 44px;
    --touch-target-large: 48px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

/* Accessibility - Focus visible indicator (WCAG 2.1 SC 2.4.7 Focus Visible) */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible {
    outline: none !important; /* Programmatic focus targets should not draw focus rings */
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
    outline: none;
}

body {

    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Shared admin drawers, confirmations and password controls. */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    animation: drawerBackdropFadeIn 0.2s ease-out;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 300;
    animation: drawerBackdropFadeIn 0.15s ease-out;
}

.modal-dialog-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
    z-index: 301;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

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

.modal-body {
    padding: 1.25rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

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

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 600px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    z-index: 201;
    display: flex;
    flex-direction: column;
    animation: drawerSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

@keyframes drawerSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-panel .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
    flex-shrink: 0;
}

.drawer-panel .drawer-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drawer-panel .btn-drawer-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.drawer-panel .btn-drawer-close:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.drawer-panel .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.drawer-panel .drawer-section {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drawer-panel .drawer-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #818cf8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-panel .drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-password-wrapper input {
    padding-right: 3.5rem;
}

.btn-toggle-eye {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-toggle-eye:hover { color: var(--text-primary); }

.badge-role {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
}

.badge-role-admin { background: rgba(99, 102, 241, 0.16); color: #c7d2fe; }
.badge-role-curator { background: rgba(6, 182, 212, 0.14); color: #67e8f9; }
.badge-role-member { background: rgba(148, 163, 184, 0.14); color: var(--text-primary); }
.badge-disabled { color: var(--text-secondary); }

/* ==========================================================================
   Segmented Control Primitive (Shared Design Token)
   ========================================================================== */
.segmented-control {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    gap: 2px;
}

.segment-btn {
    height: 32px;
    padding: 0 0.75rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.segment-btn:hover {
    color: #f8fafc;
}

.segment-btn.active {
    background: #334155;
    color: #f8fafc;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.05);
}

.segment-count {
    font-size: 0.75rem;
    opacity: 0.85;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    line-height: 1.2;
}

@media (max-width: 768px) {
    .drawer-panel {
        width: 100vw !important;
        height: 100dvh !important;
        inset: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
    }
    .drawer-panel .drawer-header {
        min-height: 56px;
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .drawer-panel .drawer-body {
        padding: 1rem;
        padding-bottom: calc(80px + var(--safe-area-bottom));
    }
    .drawer-panel .drawer-body .form-control {
        font-size: 16px !important;
        min-height: 48px;
    }
    .drawer-panel .drawer-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + var(--safe-area-bottom));
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        z-index: 10;
    }
    .drawer-panel .drawer-footer .btn {
        flex: 1;
        min-height: 48px;
        font-size: 0.95rem;
        font-weight: 700;
    }
}

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

.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar-desktop {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 2rem 0 2rem;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-badge-compact {
    display: none;
}

/* Sidebar Header & Toggle Button */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    min-width: 0;
}

.brand-header:hover {
    opacity: 0.9;
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.sidebar-toggle-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Sidebar Icon Rail (68px) */
.sidebar.sidebar-collapsed {
    width: 68px;
}

.sidebar.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    padding: 1rem 0.35rem;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.sidebar.sidebar-collapsed .brand-header {
    padding: 0;
    justify-content: center;
}

.sidebar.sidebar-collapsed .brand-title {
    display: none;
}

.sidebar.sidebar-collapsed .sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.sidebar.sidebar-collapsed .sidebar-toggle-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.sidebar.sidebar-collapsed .nav-list {
    padding: 1rem 0.35rem;
    align-items: center;
}

.sidebar.sidebar-collapsed .nav-item-link {
    justify-content: center;
    padding: 0.65rem;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    position: relative;
}

.sidebar.sidebar-collapsed .nav-item-text {
    display: none;
}

.sidebar.sidebar-collapsed .nav-section-title {
    padding: 0.5rem 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar.sidebar-collapsed .nav-section-title .nav-section-text {
    display: none;
}

.sidebar.sidebar-collapsed .nav-section-title .nav-section-divider {
    display: block;
    width: 32px;
    height: 1px;
    background: var(--border-color);
}

.sidebar.sidebar-collapsed .nav-badge {
    display: none;
}

.sidebar.sidebar-collapsed .nav-badge-compact {
    display: flex;
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 9999px;
    padding: 0 4px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-list {
    list-style: none;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.925rem;
    transition: all 0.2s ease;
}

.nav-item-link:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-item-link.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1.25rem 1rem 0.5rem 1rem;
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* UI Cards & Panels */
.card-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.925rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Utility globale : portée notamment par <InputText> / <InputTextArea> (champs
   User-Agent & Cookies anti-bot), qui ne reçoivent pas d'attribut de scope CSS.
   Doit donc rester globale — ne pas déplacer dans un fichier .razor.css. */
.font-monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.custom-table th {
    background: var(--bg-surface);
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.custom-table th.th-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.custom-table th.th-sortable:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.custom-table th.th-sortable:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: -2px;
}

.custom-table th.th-sortable.th-active-sort {
    color: var(--accent-cyan);
}

.th-content {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    line-height: 1;
}

.sort-indicator.active {
    color: var(--accent-cyan);
    font-weight: bold;
}

.sort-indicator.inactive {
    color: var(--text-muted);
    opacity: 0.35;
    font-size: 0.7rem;
    transition: opacity 0.15s ease;
}

.custom-table th.th-sortable:hover .sort-indicator.inactive {
    opacity: 0.75;
    color: var(--text-secondary);
}

.mobile-sort-bar {
    display: none;
    margin-bottom: 1rem;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .mobile-sort-bar {
        display: flex;
    }
}

.custom-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.custom-table tbody tr {
    transition: background 0.15s ease;
}

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

/* Badges & Buttons */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-priority {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Design System Primitives : Buttons (Solid, Outline & Utilities)
   ========================================================================== */

/* 1. Base universelle sécurisée (neutralise le fond blanc natif buttonface) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: var(--radius-md);
    border: 1px solid transparent; /* Prévient tout décalage dimensionnel entre solid et outline */
    background: transparent;       /* Neutralise buttonface (fond blanc UA) */
    color: var(--text-primary);   /* Neutralise buttontext (texte noir UA) */
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* État désactivé global unifié */
.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
}

/* Modificateur de taille compact */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

/* 2. Boutons Solides (CTA majeurs & actions d'engagement) */
.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
    color: #ffffff;
    box-shadow: 0 6px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(0);
}

.btn-danger {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0);
}

/* 3. Boutons Outline / Glassmorphism Subtil (Actions secondaires & contextuelles) */

/* Outline Primaire (Indigo) : Actions d'en-tête, resynchronisations, envois immédiats */
.btn-outline-primary {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #818cf8;
}

.btn-outline-primary:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(99, 102, 241, 0.65);
    color: #ffffff;
    box-shadow: 0 2px 10px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-outline-primary:active:not(:disabled) {
    background: rgba(99, 102, 241, 0.32);
    transform: translateY(0);
}

.btn-outline-primary:disabled,
.btn-outline-primary[disabled] {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.15);
    color: rgba(129, 140, 248, 0.45);
}

/* Outline Secondaire (Slate) : Actions d'utilité technique unitaire (Tester, Modifier) */
.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
    color: #cbd5e1;
}

.btn-outline-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.30);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.btn-outline-secondary:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(0);
}

.btn-outline-secondary:disabled,
.btn-outline-secondary[disabled] {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

/* Outline Danger (Rouge) : Actions sensibles réversibles ou de régénération de clé */
.btn-outline-danger {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.btn-outline-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.65);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.btn-outline-danger:active:not(:disabled) {
    background: rgba(239, 68, 68, 0.32);
    transform: translateY(0);
}

.btn-outline-danger:disabled,
.btn-outline-danger[disabled] {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.15);
    color: rgba(248, 113, 113, 0.4);
}

/* 4. Variantes Outline d'Appoint (Exhaustivité Design System : Success, Warning, Info) */
.btn-outline-success {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.btn-outline-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.65);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-outline-warning {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.btn-outline-warning:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.65);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
    transform: translateY(-1px);
}

.btn-outline-info {
    background: rgba(6, 182, 212, 0.10);
    border-color: rgba(6, 182, 212, 0.35);
    color: #22d3ee;
}

.btn-outline-info:hover:not(:disabled) {
    background: rgba(6, 182, 212, 0.22);
    border-color: rgba(6, 182, 212, 0.65);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.25);
    transform: translateY(-1px);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #22d3ee;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

fieldset:disabled {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}

/* Nav Badge */
.nav-badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

/* Filters Bar */
/* Filters Bar & Controls */
.filters-bar {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.filters-main-row {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-group.flex-2 {
    flex: 2;
    min-width: 260px;
}

.filter-group.flex-1 {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    font-size: 0.775rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input, .form-select, .form-control {
    width: 100%;
    height: 42px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 0 0.85rem;
    color: #f8fafc;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.form-input::placeholder {
    color: #64748b;
}

.form-input:focus, .form-select:focus, .form-control:focus {
    outline: none !important;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: #1e293b;
}

/* Readonly & Immutable Inputs */
.form-input[readonly],
.form-input-readonly {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    cursor: default;
    user-select: text;
}

.form-input[readonly]:focus,
.form-input-readonly:focus {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
    outline: none !important;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.2rem;
    appearance: none;
}

.form-select option {
    background: #0f172a;
    color: #f8fafc;
    padding: 0.5rem;
}

.free-group {
    display: flex;
    align-items: center;
    height: 42px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0 0.25rem;
    height: 42px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1;
    user-select: none;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #ffffff;
}


.checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #6366f1;
    cursor: pointer;
}

/* Category Tag Pills */
.category-filter-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.category-tags-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 0.45rem 1.15rem;
    border-radius: 9999px; /* Fully rounded pill */
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-pill:hover {
    border-color: #818cf8;
    color: #ffffff;
    transform: translateY(-1px);
}

.tag-pill.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
    font-weight: 700;
}

.tag-pill-free {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-pill-free:hover {
    border-color: rgba(16, 185, 129, 0.45);
    color: #e2e8f0;
}

.tag-pill-free.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.55);
    color: #6ee7b7;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
    font-weight: 700;
}

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

.search-input-wrapper input {
    width: 100%;
    padding-right: 2.2rem;
}

.btn-clear-search {
    position: absolute;
    right: 0.65rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-clear-search:hover {
    color: var(--text-primary);
}


.events-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* En-tête de popover partagé par EventFilterToolbar (popovers Lieux / Catégories)
   et NotificationPopover : reste global (règle §7.1 — 2 consommateurs ou plus).
   EventFilterToolbar surcharge border-bottom / padding-bottom dans sa feuille scopée
   mais s'appuie sur ce bloc pour padding et background. */
.popover-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.4);
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

/* Ilot global: appartient a EventFilterToolbar.razor - partage, ne pas deplacer dans EventCard.razor.css */
.status-pill-accepted.active {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
}

.status-pill-maybe.active {
    background: rgba(6, 182, 212, 0.25) !important;
    color: #67e8f9 !important;
    border-color: rgba(6, 182, 212, 0.5) !important;
}


/* Ilot global: partage avec AdminSources.razor - ne pas deplacer dans EventCard.razor.css */
.source-link {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.source-link:hover {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
    text-decoration: none;
}

/* Ilot global: partage avec AdminSources.razor et EventCard - ne pas deplacer */
.btn-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 38px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Empty State & Loading */
.loading-container {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.8s linear infinite;
}

.spinner.large {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
}

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

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Page Header with Action Button */
.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Notifications Page */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification-card {
    position: relative;
    border-left: 4px solid var(--accent-primary);
}

.notification-card.unread {
    border-left-color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.04);
}

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

.notification-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.notification-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.notification-footer {
    margin-top: 0.75rem;
    text-align: right;
}

.btn-text-read {
    background: none;
    border: none;
    color: var(--accent-info);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-text-read:hover {
    text-decoration: underline;
}

/* Mobile Top Header & Responsive Layout */
.mobile-top-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 200;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.mobile-brand:hover {
    opacity: 0.9;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Mobile Bottom Navigation Bar (Persistent) */
.mobile-bottom-nav {
    display: none;
}

/* Bottom Sheet Drawer & Backdrop */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 190;
    animation: fadeIn 0.2s ease-out;
}

.bottom-sheet-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    z-index: 200;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1rem 1.25rem calc(var(--safe-area-bottom) + 1.5rem) 1.25rem;
    animation: slideUpBottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet-drag-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 0 auto 0.75rem auto;
}

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

.bottom-sheet-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon-close,
.bottom-sheet-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    padding: 0;
}

.btn-icon-close:hover,
.bottom-sheet-close-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    transform: scale(1.06);
}

.btn-icon-close:active,
.bottom-sheet-close-btn:active {
    transform: scale(0.94);
}

.mobile-only-inline {
    display: none;
}

.bottom-sheet-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bottom-sheet-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    min-height: var(--touch-target-large);
    transition: all 0.15s ease;
}

.bottom-sheet-nav-link:hover, .bottom-sheet-nav-link.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

@keyframes slideUpBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

/* ==========================================================================
   Responsive Laptop Ergonomics (769px – 1280px)
   ========================================================================== */
@media (max-width: 1280px) {
    .main-content {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    /* 1. Restauration du défilement natif pleine page & Inertie tactile */
    html,
    body,
    .category-filter-section,
    .location-filter-section,
    .tags-container,
    .category-tags-bar,
    .table-container {
        scroll-behavior: auto !important;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
    }

    .app-container,
    .main-wrapper,
    .main-content {
        overflow-y: visible !important;
        height: auto !important;
    }

    /* 2. Suppression du flou dynamique lourd sur les cartes répétées & Fond solide optimisé #1e293b */
    .event-card,
    .card-panel,
    .rail-container {
        background: #1e293b !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .card-panel {
        box-shadow: none !important;
    }

    .mobile-top-bar {
        display: flex;
        z-index: 200;
    }

    .mobile-only-inline {
        display: inline-flex !important;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(var(--bottom-bar-height) + var(--safe-area-bottom));
        padding-bottom: var(--safe-area-bottom);
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-color);
        z-index: 150;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-nav-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        height: 100%;
        color: var(--text-secondary);
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.25rem;
        min-height: var(--touch-target-min);
        transition: color 0.15s ease, transform 0.15s ease;
        position: relative;
    }

    .mobile-nav-tab:hover, .mobile-nav-tab.active {
        color: #ffffff;
    }

    .mobile-nav-tab.active .mobile-nav-icon-wrapper {
        color: var(--accent-primary);
        filter: drop-shadow(0 0 8px var(--accent-glow));
    }

    .mobile-nav-tab.active .mobile-nav-label {
        color: #ffffff;
        font-weight: 700;
    }

    .mobile-nav-icon-wrapper {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-tab-badge {
        position: absolute;
        top: -6px;
        right: -10px;
        background: var(--accent-primary);
        color: #ffffff;
        font-size: 0.65rem;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        border-radius: 9999px;
        padding: 0 4px;
        text-align: center;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    }

    .mobile-tab-badge.badge-danger {
        background: var(--accent-danger);
    }

    .mobile-nav-label {
        font-size: 0.7rem;
        font-weight: 500;
        line-height: 1;
    }

    .main-content {
        padding: 1rem;
        padding-bottom: calc(var(--bottom-bar-height) + var(--safe-area-bottom) + 1.5rem);
    }

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

    /* Filters Bar & Horizontal Scrollable Chips on Mobile */
    .filters-bar {
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .filters-main-row {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .filters-main-row .search-group {
        flex: 1;
        min-width: 0;
    }

    .filters-main-row .free-group {
        flex: 0 0 auto;
        height: auto;
        padding-top: 0;
    }

    .category-filter-section,
    .location-filter-section,
    .tags-container,
    .category-tags-bar {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.35rem 0;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .category-filter-section::-webkit-scrollbar,
    .location-filter-section::-webkit-scrollbar,
    .tags-container::-webkit-scrollbar,
    .category-tags-bar::-webkit-scrollbar {
        display: none;
    }

    .tag-pill {
        flex-shrink: 0;
        padding: 0.45rem 0.9rem;
        min-height: 38px;
        font-size: 0.85rem;
    }

    .btn-action {
        min-height: var(--touch-target-large);
        font-size: 0.95rem;
        font-weight: 700;
        border-radius: var(--radius-md);
        padding: 0.65rem 0.75rem;
    }


    /* Horizontal Rail transformed to Vertical Accordion on Mobile */
    /* PIÈGE — ne pas déplacer ce bloc dans HorizontalEventRail.razor.css pour « appliquer »
       le piège 4 de UI_GUIDELINES §7.1. Les règles de base du rail étant désormais scopées
       (0,2,0), elles l'emportent déjà sur ces overrides globaux (0,1,0) — exactement comme
       avant le scoping, où elles gagnaient par ordre de déclaration. Les déclarations sans
       `!important` ci-dessous sont donc inertes depuis toujours : les relocaliser ici les
       ressusciterait et modifierait le rendu mobile. À traiter comme un changement UX
       délibéré (validation visuelle requise), jamais comme un refactor. */
    .rail-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .rail-header {
        padding: 0.25rem 0;
        cursor: pointer;
        user-select: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .rail-header-title-group {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .rail-toggle-chevron {
        font-size: 0.9rem;
        color: #38bdf8;
        display: inline-flex;
    }

    .rail-container.collapsed .rail-header {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .rail-wrapper {
        display: block;
        width: 100%;
        overflow: visible;
    }

    .rail-nav-btn {
        display: none !important;
    }

    .rail-scroll-content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        overflow-x: visible !important;
        overflow-y: visible !important;
        padding: 0.75rem 0 0 0;
        scroll-snap-type: none !important;
        width: 100%;
    }

    .rail-card-wrapper {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        scroll-snap-align: none !important;
    }

}

/* Inline Editing & Table Row Styles */
.custom-table tr.editing-row {
    background: rgba(6, 182, 212, 0.08) !important; /* Highlight active editing row */
    border-left: 3px solid #06b6d4;
}

.table-input, .table-select {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: #ffffff;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.table-input:focus, .table-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.action-buttons-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-icon-success:hover {
    background: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.btn-icon-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-icon-secondary:hover {
    background: rgba(148, 163, 184, 0.3);
}

.btn-icon-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Collapsible Creation Panel */
.collapsible-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 16px);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.25s ease;
}

.collapsible-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.collapsible-card-header:hover {
    background: rgba(30, 41, 59, 0.8);
}

.collapsible-card-body {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hints-accordion-row td {
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

/* Reset Filters Button (US-15 CA-15.1) */
.btn-reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--accent-info);
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.1);
    transition: all 0.2s ease;
}

.btn-reset-filters:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.5);
    color: #38bdf8;
}

/* Blazor Error UI Dark Theme Styling (US-15 CA-15.3) */
#blazor-error-ui {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-top: 2px solid var(--accent-danger);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem;
    padding: 0.85rem 1.25rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#blazor-error-ui .reload {
    color: var(--accent-info);
    text-decoration: underline;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
}

#blazor-error-ui .dismiss:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Sources Admin: Desktop 4-col, Mobile Cards & Slide-Over Drawer (US-34)
   ========================================================================== */

.desktop-sources-view {
    display: block;
}

.mobile-sources-view {
    display: none;
}

@media (max-width: 768px) {
    .desktop-sources-view {
        display: none !important;
    }

    .mobile-sources-view {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
    }
}

/* Interactive Status Dot Button (Tout à gauche, taille confortable 28px avec dot 13px) */
.status-dot-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
    user-select: none;
}

.status-dot-btn:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.06);
}

.status-dot-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.status-dot-indicator {
    width: 13px;
    height: 13px;
    border-radius: var(--radius-full);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Actif : Vert Émeraude vibrant avec halo glow */
.status-dot-btn.active .status-dot-indicator {
    background-color: var(--accent-success); /* #10b981 */
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.65);
}

/* En pause / Inactif : Gris ardoise sobre */
.status-dot-btn.inactive .status-dot-indicator {
    background-color: var(--text-muted); /* #64748b */
    opacity: 0.6;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}

/* Atténuation visuelle des lignes inactives (Sources, Lieux, Catégories) */
.source-row-inactive,
.location-row-inactive,
.category-row-inactive {
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.source-row-inactive:hover,
.location-row-inactive:hover,
.category-row-inactive:hover {
    opacity: 0.95;
}

/* Conteneur et alignement strict de la cellule Source */
.source-cell-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.source-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.source-name {
    color: var(--text-primary);
    font-size: 0.925rem;
    font-weight: 600;
}

.badge-city {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
    font-size: 0.725rem !important;
    padding: 0.15rem 0.45rem !important;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.source-meta-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 22px; /* Alignement optique sous le titre */
}

.source-location {
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.825rem;
}

.source-meta-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Override contextuel AdminSources : couleur indigo distincte du gris global */
.source-meta-row .source-link {
    color: #818cf8;
    font-size: 0.8rem;
    transition: color 0.15s ease;
}

.source-meta-row .source-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

/* Mobile Source Card Title Group */
.mobile-source-title-group {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    flex: 1;
}

/* Inactive Source Row visual attenuation */
.source-row-inactive {
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.source-row-inactive:hover {
    opacity: 0.95;
}

/* Amber Purge Events Button */
.btn-purge-events {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-purge-events:hover:not(:disabled) {
    background: var(--accent-warning);
    color: #0f172a;
    border-color: var(--accent-warning);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* --- Arbitrage Déduplication --- */
.source-cadence-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.775rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.source-arbitrage-text {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: help;
    transition: color 0.15s ease;
}

.source-arbitrage-text:hover {
    color: #a5b4fc;
}

/* --- Légende d'aide --- */
.sources-help-legend {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sources-help-legend strong {
    color: var(--text-secondary);
}

/* Mobile Source Card */
.mobile-source-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.mobile-source-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.mobile-source-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.mobile-source-card-badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.mobile-source-card-link {
    color: #818cf8;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.mobile-source-card-link:hover {
    background: var(--bg-surface-hover);
    color: #ffffff;
}

.mobile-source-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.4);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-source-card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Topbar Layout (US-06 / CA-6.3)
   Le centre de notifications associé vit dans
   Components/Shared/NotificationPopover.razor.css.
   ========================================================================== */

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.app-topbar-desktop {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: #0f172a;
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .app-topbar-desktop {
        display: none;
    }
}

/* Archives page container */
.notifications-page-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Fondu avec léger glissement, utilisé par le message « ✓ Copié ! » du bookmarklet
   (AdminSources.razor). Nom distinct de @keyframes fadeIn (plus haut, opacité seule,
   consommé par .bottom-sheet-backdrop) : les deux portaient auparavant le même nom,
   et cette définition écrasait silencieusement l'autre. Ne pas fusionner. */
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* LLM Cascade Touch Drag & Drop */
body.cascade-touch-active {
    user-select: none !important;
    -webkit-user-select: none !important;
    overflow-y: hidden !important;
}

.cascade-touch-ghost {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.5) !important;
    border: 1px solid #818cf8 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px);
    pointer-events: none !important;
    user-select: none !important;
    opacity: 0.92 !important;
    transform: scale(1.05);
}
