:root {
    --bg: #050505;
    --accent: #a855f7;
    --accent-dim: #9333ea;
    --accent-soft: rgba(168, 85, 247, 0.12);
    --gold: var(--accent);
    --gold-dim: var(--accent-dim);
    --panel: #0a0a0a;
    --text: #f5f5f5;
    --muted: #9ca3af;
    --btn: #5b21b6;
    --btn-hover: #6d28d9;
    --error: #ef4444;
    --success: #22c55e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: "Geist Sans", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg);
    color: var(--text);
}

.app-main,
.sidebar-nav,
.db-search-dropdown,
.mdt-profile-dialog,
.annuaire-column {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.55) rgba(255, 255, 255, 0.04);
}

.app-main::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.db-search-dropdown::-webkit-scrollbar,
.mdt-profile-dialog::-webkit-scrollbar,
.annuaire-column::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.app-main::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
.db-search-dropdown::-webkit-scrollbar-track,
.mdt-profile-dialog::-webkit-scrollbar-track,
.annuaire-column::-webkit-scrollbar-track {
    margin: 6px 2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
}

.app-main::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.db-search-dropdown::-webkit-scrollbar-thumb,
.mdt-profile-dialog::-webkit-scrollbar-thumb,
.annuaire-column::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(168, 85, 247, 0.42),
        rgba(91, 33, 182, 0.58) 48%,
        rgba(168, 85, 247, 0.38)
    );
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: 9999px;
}

.app-main::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.db-search-dropdown::-webkit-scrollbar-thumb:hover,
.mdt-profile-dialog::-webkit-scrollbar-thumb:hover,
.annuaire-column::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(192, 132, 252, 0.58),
        rgba(109, 40, 217, 0.72) 48%,
        rgba(168, 85, 247, 0.52)
    );
}

.app-main::-webkit-scrollbar-button:single-button,
.sidebar-nav::-webkit-scrollbar-button:single-button,
.db-search-dropdown::-webkit-scrollbar-button:single-button,
.mdt-profile-dialog::-webkit-scrollbar-button:single-button,
.annuaire-column::-webkit-scrollbar-button:single-button {
    display: block;
    height: 10px;
    background: transparent;
}

.app-main::-webkit-scrollbar-button:single-button:vertical:decrement,
.sidebar-nav::-webkit-scrollbar-button:single-button:vertical:decrement,
.db-search-dropdown::-webkit-scrollbar-button:single-button:vertical:decrement,
.mdt-profile-dialog::-webkit-scrollbar-button:single-button:vertical:decrement,
.annuaire-column::-webkit-scrollbar-button:single-button:vertical:decrement {
    background: linear-gradient(
        180deg,
        transparent 35%,
        rgba(168, 85, 247, 0.35) 35%,
        rgba(168, 85, 247, 0.35) 65%,
        transparent 65%
    );
}

.app-main::-webkit-scrollbar-button:single-button:vertical:increment,
.sidebar-nav::-webkit-scrollbar-button:single-button:vertical:increment,
.db-search-dropdown::-webkit-scrollbar-button:single-button:vertical:increment,
.mdt-profile-dialog::-webkit-scrollbar-button:single-button:vertical:increment,
.annuaire-column::-webkit-scrollbar-button:single-button:vertical:increment {
    background: linear-gradient(
        180deg,
        transparent 35%,
        rgba(168, 85, 247, 0.35) 35%,
        rgba(168, 85, 247, 0.35) 65%,
        transparent 65%
    );
}

.app-main::-webkit-scrollbar-corner,
.sidebar-nav::-webkit-scrollbar-corner,
.db-search-dropdown::-webkit-scrollbar-corner,
.mdt-profile-dialog::-webkit-scrollbar-corner,
.annuaire-column::-webkit-scrollbar-corner {
    background: transparent;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid rgba(168, 85, 247, 0.22);
    border-radius: 10px;
    padding: 36px 32px 28px;
    box-shadow: none;
}

.auth-card--unified {
    position: relative;
    overflow: hidden;
    transition: max-height 0.45s ease, transform 0.45s ease;
}

.auth-card--register {
    max-width: 460px;
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-logo {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.auth-panels {
    position: relative;
}

.auth-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateX(24px);
    pointer-events: none;
    position: absolute;
    inset: 0;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        visibility 0.35s ease;
}

.auth-panel.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
}

.auth-body--switching .auth-card--unified {
    transform: scale(0.985);
}

.auth-subtitle {
    margin: -12px 0 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-title {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 28px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    padding: 12px 42px 12px 14px;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-wrap input:focus {
    border-color: var(--gold-dim);
}

.input-wrap input.is-invalid,
.input-wrap select.is-invalid,
.select-field.is-invalid {
    border-color: rgba(239, 68, 68, 0.65);
}

.field-tooltip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    z-index: 30;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    width: max-content;
    max-width: min(100%, 280px);
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 8px;
    background: #121212;
    color: #fecaca;
    font-size: 0.82rem;
    line-height: 1.45;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.field-tooltip::before,
.field-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--arrow-left, 24px);
    transform: translateX(-50%);
    border: 7px solid transparent;
    pointer-events: none;
}

.field-tooltip::before {
    border-top-color: rgba(239, 68, 68, 0.35);
}

.field-tooltip::after {
    margin-top: -1px;
    border-top-color: #121212;
}

.field-tooltip-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.input-wrap--date input[type="date"] {
    padding-right: 44px;
    color-scheme: dark;
}

.input-wrap--date::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.input-wrap--date input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0;
}

.input-wrap--date input[type="date"]::-webkit-datetime-edit {
    padding-right: 4px;
}

.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 0.9rem;
    pointer-events: none;
}

.btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    border: none;
    border-radius: 4px;
    background: var(--btn);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--btn-hover);
}

.btn-secondary {
    background: #2e1065;
}

.btn-secondary:hover {
    background: #4c1d95;
}

.alert {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
}

.auth-footer a {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.88rem;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid #222;
    background: #0a0a0a;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--gold);
}

.dashboard-brand h1 {
    font-size: 1.1rem;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--muted);
}

.dashboard-user strong {
    color: var(--text);
}

.dashboard-main {
    flex: 1;
    padding: 32px 28px;
}

.welcome-box {
    max-width: 720px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 28px;
    background: var(--panel);
}

.welcome-box h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.welcome-box p {
    color: var(--muted);
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.stat-card {
    border: 1px solid #333;
    border-radius: 4px;
    padding: 18px;
    background: #111;
}

.stat-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-card strong {
    font-size: 1.5rem;
    color: var(--gold);
}

.btn-logout {
    width: auto;
    padding: 8px 16px;
    margin: 0;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid #444;
}

.btn-logout:hover {
    border-color: var(--gold);
    background: rgba(168, 85, 247, 0.08);
}

.install-box {
    max-width: 520px;
    margin: 0 auto;
}

.install-box h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.install-note {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 16px;
    line-height: 1.5;
}

.auth-card .btn-secondary {
    text-align: center;
    text-decoration: none;
    display: block;
    margin-top: 10px;
}

.admin-page {
    max-width: 980px;
}

.admin-box {
    max-width: none;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-tab {
    padding: 10px 16px;
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-tab.active,
.admin-tab:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.empty-state {
    margin-top: 20px;
    color: var(--muted);
}

.badge-summary-plain {
    margin: 16px 0 28px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
}

.badge-summary-plain strong {
    color: var(--gold);
    font-size: 1rem;
}

.badge-groups {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.badge-group-label {
    margin-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.badge-chip--available {
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
}

.badge-grid--muted .badge-chip--taken,
.badge-chip--taken {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
}

.badge-taken-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.badge-taken-section h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
}

.badge-taken-note {
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.inline-form {
    display: inline;
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.table-muted {
    color: var(--muted);
    font-size: 0.82rem;
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.pending-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr auto;
    gap: 16px;
    align-items: start;
    padding: 18px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #111;
}

.pending-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pending-info span {
    color: var(--muted);
    font-size: 0.9rem;
}

.pending-badge strong {
    color: var(--gold);
}

.pending-info small {
    color: #666;
    font-size: 0.8rem;
}

.pending-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pending-form .field {
    margin-bottom: 0;
}

.pending-actions {
    grid-column: 1 / -1;
}

.select-field {
    width: 100%;
    padding: 12px 42px 12px 14px;
    background-color: #111;
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--text);
    font-size: 0.95rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    cursor: pointer;
}

.select-field:focus {
    outline: none;
    border-color: var(--gold-dim);
}

.btn-approve {
    margin-top: 0;
    background: #14532d;
}

.btn-approve:hover {
    background: #166534;
}

.btn-reject {
    margin-top: 0;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.btn-reject:hover {
    background: rgba(239, 68, 68, 0.1);
}

.table-wrap {
    margin-top: 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #333;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    color: var(--gold);
    font-weight: 600;
}

@media (max-width: 860px) {
    .pending-card {
        grid-template-columns: 1fr;
    }

    .pending-form {
        grid-template-columns: 1fr;
    }
}

/* App shell + sidebar */
body:has(.app-shell) {
    overflow: hidden;
    height: 100vh;
}

.app-shell {
    height: 100vh;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    background: var(--bg);
}

.app-sidebar {
    width: 280px;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #1a1a1a;
    background:
        linear-gradient(180deg, rgba(168, 85, 247, 0.05), transparent 120px),
        #080808;
}

.sidebar-profile {
    min-height: 78px;
    flex-shrink: 0;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #1a1a1a;
    box-sizing: border-box;
}

.sidebar-profile-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(168, 85, 247, 0.08);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-profile-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.sidebar-profile-badge {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-profile-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    line-height: 1.2;
}

.sidebar-profile-menu-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-profile-menu-btn svg {
    width: 16px;
    height: 16px;
}

.sidebar-profile-menu-btn:hover,
.sidebar-profile-menu-btn:focus-visible {
    color: rgba(255, 255, 255, 0.85);
    outline: none;
}

.sidebar-profile-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px 20px;
}

.sidebar-link,
.sidebar-group-toggle,
.sidebar-sublink {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: visible;
    transition: color 0.25s ease;
}

.sidebar-link-text {
    min-width: 0;
    flex: 1;
}

.sidebar-link,
.sidebar-group-toggle {
    padding: 10px 12px;
    margin-bottom: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.sidebar-sublink {
    padding: 8px 12px 8px 38px;
    margin-bottom: 2px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.sidebar-link-icon,
.sidebar-sublink-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: rgba(168, 85, 247, 0.55);
    opacity: 1;
    transition: color 0.25s ease, filter 0.25s ease;
}

.sidebar-link-icon svg,
.sidebar-sublink-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-link:hover,
.sidebar-group-toggle:hover,
.sidebar-sublink:hover,
.sidebar-link.is-active,
.sidebar-sublink.is-active {
    color: var(--gold);
    background: transparent;
    border-color: transparent;
}

.sidebar-link:hover .sidebar-link-icon,
.sidebar-group-toggle:hover .sidebar-link-icon,
.sidebar-sublink:hover .sidebar-sublink-icon,
.sidebar-link.is-active .sidebar-link-icon,
.sidebar-sublink.is-active .sidebar-sublink-icon {
    color: var(--gold);
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.35));
}

.nav-link-indicator {
    position: absolute;
    left: 2.5rem;
    right: 0.75rem;
    bottom: 0.2rem;
    height: 1px;
    border-radius: 999px;
    opacity: 0;
    transform: scaleX(0.45);
    transform-origin: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
    background: var(--gold);
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.45);
    pointer-events: none;
}

.sidebar-sublink .nav-link-indicator {
    left: 3.2rem;
}

.sidebar-link:hover .nav-link-indicator:not(.nav-link-indicator--active),
.sidebar-group-toggle:hover .nav-link-indicator:not(.nav-link-indicator--active),
.sidebar-sublink:hover .nav-link-indicator:not(.nav-link-indicator--active) {
    opacity: 0.85;
    transform: scaleX(1);
}

.nav-link-indicator--active {
    opacity: 1;
    transform: scaleX(1);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

.sidebar-group {
    margin-bottom: 4px;
}

.sidebar-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.25);
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-chevron svg {
    width: 12px;
    height: 12px;
}

.sidebar-group-toggle:hover .sidebar-chevron {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-group.is-open .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-group-items {
    display: none;
    padding-top: 2px;
    padding-bottom: 4px;
}

.sidebar-group.is-open .sidebar-group-items {
    display: block;
}

.sidebar-divider {
    height: 1px;
    background: #1a1a1a;
    margin: 10px 4px 14px;
}

.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.15);
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
}

.app-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 78px;
    flex-shrink: 0;
    padding: 0 28px;
    border-bottom: 1px solid #1a1a1a;
    background: rgba(10, 10, 10, 0.95);
    box-sizing: border-box;
}

.app-topbar-brand {
    min-width: 0;
}

.app-topbar-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.2;
}

.app-topbar-logout {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 6px 0;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
}

.app-topbar-logout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.2s;
}

.app-topbar-logout-icon svg {
    width: 18px;
    height: 18px;
}

.app-topbar-logout-indicator {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.15rem;
    height: 1px;
    border-radius: 999px;
    opacity: 0;
    transform: scaleX(0.45);
    transform-origin: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.45);
    pointer-events: none;
}

.app-topbar-logout:hover,
.app-topbar-logout:focus-visible {
    color: #fca5a5;
    outline: none;
}

.app-topbar-logout:hover .app-topbar-logout-icon,
.app-topbar-logout:focus-visible .app-topbar-logout-icon {
    color: #fca5a5;
}

.app-topbar-logout:hover .app-topbar-logout-indicator,
.app-topbar-logout:focus-visible .app-topbar-logout-indicator {
    opacity: 0.85;
    transform: scaleX(1);
}

.app-main {
    flex: 1;
    min-height: 0;
    padding: 28px;
    overflow-y: auto;
}

.content-panel,
.welcome-box {
    max-width: 960px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 8px;
    padding: 28px;
    background: var(--panel);
}

.content-panel h2,
.welcome-box h2 {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
}

.content-panel p,
.welcome-box p {
    color: var(--muted);
    line-height: 1.6;
}

.placeholder-box {
    margin-top: 24px;
    padding: 28px;
    border: 1px dashed #333;
    border-radius: 8px;
    text-align: center;
    color: var(--muted);
    background: #0d0d0d;
}

.search-form {
    margin-top: 24px;
    max-width: 420px;
}

.btn-inline {
    width: auto;
    display: inline-block;
    margin-top: 0;
    padding-inline: 22px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.settings-card {
    padding: 16px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #101010;
}

.settings-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.settings-card strong {
    color: var(--text);
}

.empty-row {
    text-align: center;
    color: var(--muted);
    padding: 28px 14px !important;
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        height: auto;
        max-height: 42vh;
        border-right: none;
        border-bottom: 1px solid #1a1a1a;
    }

    .sidebar-nav {
        max-height: none;
        overflow-y: auto;
    }

    .app-content {
        flex: 1;
        min-height: 0;
    }
}

/* Census form */
.census-panel {
    max-width: 1100px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 10px;
    background: var(--panel);
    overflow: hidden;
}

.census-header {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
}

.census-header h2 {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.75);
}

.census-header-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.census-header-btn svg {
    width: 16px;
    height: 16px;
}

.census-header-btn:hover {
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.03);
}

.census-form {
    padding: 24px;
}

.census-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.census-column .field {
    margin-bottom: 14px;
}

.census-photo-note {
    margin: 8px 0 12px;
    font-size: 0.82rem;
    color: var(--gold);
    line-height: 1.5;
}

.census-photo-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 440 / 600;
    border: 1px dashed rgba(168, 85, 247, 0.45);
    border-radius: 8px;
    background: #0d0d0d;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.census-photo-upload:hover {
    border-color: var(--gold);
    background: rgba(168, 85, 247, 0.05);
}

.census-photo-placeholder {
    padding: 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.census-photo-placeholder small {
    display: block;
    margin-top: 8px;
    color: #666;
}

.census-photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.census-photo-preview.is-hidden,
.census-photo-placeholder.is-hidden {
    display: none;
}

.field-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--gold);
    line-height: 1.4;
}

.census-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #222;
}

.census-matricule {
    text-align: right;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 14px;
}

.census-matricule strong {
    color: var(--gold);
    font-family: Consolas, Monaco, monospace;
    letter-spacing: 0.04em;
}

.census-submit {
    margin-top: 0;
    background: linear-gradient(180deg, #7c3aed, #5b21b6);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.census-submit:hover {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}

.content-panel--wide {
    max-width: 1100px;
}

.search-form--wide {
    max-width: 560px;
}

.citizen-results {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.citizen-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #0a0a0a;
    overflow: hidden;
}

.citizen-card-link {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.citizen-card-link:hover {
    background: rgba(255, 255, 255, 0.03);
}

.citizen-card-photo {
    width: 110px;
    aspect-ratio: 440 / 600;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 6px;
    overflow: hidden;
    background: #0a0a0a;
}

.citizen-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.citizen-card-no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
}

.citizen-card-body h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.citizen-card-body p {
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 4px;
}

.citizen-card-body span {
    display: inline-block;
    min-width: 92px;
    color: var(--muted);
}

.census-panel .alert {
    margin: 16px 24px 0;
}

@media (max-width: 900px) {
    .census-grid {
        grid-template-columns: 1fr;
    }

    .census-photo-upload {
        max-width: 100%;
    }

    .citizen-card {
        grid-template-columns: 1fr;
    }

    .citizen-card-photo {
        width: 100%;
        max-width: 220px;
    }
}

/* Database search */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.db-search-page {
    max-width: 920px;
    margin: 0 auto;
}

.db-search-shell {
    position: relative;
    padding: 8px 0;
}

.db-search-close,
.dossier-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.db-search-close svg,
.dossier-close svg {
    width: 16px;
    height: 16px;
}

.db-search-close:hover,
.dossier-close:hover {
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.03);
}

.db-search-box {
    position: relative;
}

.db-search-input,
.dossier-search-readonly {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid rgba(168, 85, 247, 0.55);
    border-radius: 8px;
    background: #0a0a0a;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.db-search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.db-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 8px;
    background: #101010;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    z-index: 20;
}

.db-search-dropdown.is-hidden {
    display: none;
}

.db-search-result {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: var(--text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.db-search-result-label,
.db-result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

.db-search-result-meta,
.db-result-meta {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.45;
}

.db-search-empty {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: default;
    color: var(--muted);
}

.db-search-result:last-child {
    border-bottom: 0;
}

.db-search-result strong {
    color: var(--gold);
    font-weight: 700;
}

.db-search-result:hover,
.db-search-result.is-active {
    background: rgba(168, 85, 247, 0.08);
}

.db-results-panel {
    margin-top: 22px;
}

.db-results-panel.is-hidden {
    display: none;
}

.db-results-count {
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.42);
}

.db-results-empty {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #0a0a0a;
    color: var(--muted);
    text-align: center;
}

.db-results-list {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    overflow: hidden;
    background: #0a0a0a;
}

.db-result-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: background 0.2s ease;
}

.db-result-row:last-child {
    border-bottom: 0;
}

.db-result-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.db-search-hint {
    margin-top: 16px;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Citizen dossier */
.dossier-page {
    max-width: 1180px;
}

.dossier-topbar {
    margin-bottom: 22px;
}

.dossier-search-readonly {
    display: block;
    margin-top: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.dossier-search-readonly:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.dossier-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 22px;
}

.dossier-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dossier-card {
    border: 1px solid rgba(168, 85, 247, 0.28);
    border-radius: 8px;
    background: #0a0a0a;
    padding: 18px;
}

.dossier-card h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--gold);
}

.dossier-card--status {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dossier-status-text {
    font-size: 1.05rem;
    line-height: 1.5;
}

.dossier-status-wanted {
    color: #fca5a5;
    font-weight: 700;
}

.dossier-link-btn {
    align-self: flex-end;
    padding: 8px 14px;
    border: 1px solid #333;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    cursor: not-allowed;
}

.license-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.license-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.license-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: 700;
}

.license-badge--ok {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.license-badge--na {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.dossier-note,
.dossier-subtitle {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
}

.dossier-subtitle {
    margin-top: 0;
    margin-bottom: 12px;
}

.ppa-toggle {
    display: flex;
    gap: 8px;
}

.ppa-pill {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.45;
}

.ppa-pill--valid {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
    color: #86efac;
}

.ppa-pill.is-active {
    opacity: 1;
}

.ppa-status-label {
    margin-top: 14px;
    font-size: 2rem;
    font-weight: 700;
    color: #fca5a5;
}

.ppa-status-label.is-valid {
    color: #86efac;
}

.dossier-stack {
    display: grid;
    gap: 14px;
}

.dossier-card--action,
.dossier-card--mini {
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.dossier-card--action p,
.dossier-card--mini p {
    color: var(--muted);
    font-size: 0.82rem;
}

.dossier-card-icon {
    font-size: 1.4rem;
    opacity: 0.8;
}

.dossier-id-actions {
    display: flex;
    justify-content: flex-end;
}

.dossier-edit-btn {
    padding: 10px 16px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 6px;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.2s, border-color 0.2s;
}

.dossier-edit-btn:hover {
    background: rgba(168, 85, 247, 0.08);
    border-color: var(--gold);
}

.id-card {
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #101010, #080808);
}

.id-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.05);
}

.id-card-header strong {
    display: block;
    font-size: 1rem;
}

.id-card-header span {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.id-card-seal {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.id-card-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    padding: 16px;
}

.id-card-photo-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.id-card-photo {
    width: 100%;
    aspect-ratio: 440 / 600;
    object-fit: cover;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 6px;
    background: #111;
}

.id-card-photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.id-card-fingerprint {
    height: 56px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    background:
        radial-gradient(circle at 20% 50%, #333 0 2px, transparent 3px),
        radial-gradient(circle at 40% 30%, #333 0 2px, transparent 3px),
        radial-gradient(circle at 60% 60%, #333 0 2px, transparent 3px),
        radial-gradient(circle at 75% 40%, #333 0 2px, transparent 3px),
        #0d0d0d;
}

.id-card-details p {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.id-card-details span {
    color: var(--muted);
}

.id-accent {
    color: #7dd3fc !important;
}

.id-card-footer {
    padding: 10px 16px;
    border-top: 1px solid #1a1a1a;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.72rem;
    color: var(--gold);
    letter-spacing: 0.05em;
    word-break: break-all;
}

.dossier-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 980px) {
    .dossier-grid {
        grid-template-columns: 1fr;
    }

    .id-card-body {
        grid-template-columns: 1fr;
    }

    .id-card-photo-wrap {
        max-width: 220px;
    }
}

/* Confirm modal — style idrabot */
body.mdt-modal-open {
    overflow: hidden;
}

.mdt-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mdt-confirm-overlay.is-hidden {
    display: none;
}

.mdt-confirm-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.mdt-confirm-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: #0b0b0b;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.mdt-confirm-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.mdt-confirm-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
}

.mdt-confirm-icon svg {
    width: 20px;
    height: 20px;
}

.mdt-confirm-icon--danger {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.mdt-confirm-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.mdt-confirm-description {
    margin-top: 6px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.45);
}

.mdt-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.mdt-confirm-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mdt-confirm-btn--ghost {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
}

.mdt-confirm-btn--ghost:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.mdt-confirm-btn--danger {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.mdt-confirm-btn--danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.mdt-confirm-btn:not(.mdt-confirm-btn--danger) {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
}

.mdt-confirm-btn:not(.mdt-confirm-btn--danger):hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.07);
}

/* Profile modal */
.mdt-profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mdt-profile-overlay.is-hidden {
    display: none;
}

.mdt-profile-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.mdt-profile-dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: #0b0b0b;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.mdt-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
}

.mdt-profile-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

.mdt-profile-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.mdt-profile-close svg {
    width: 18px;
    height: 18px;
}

.mdt-profile-close:hover,
.mdt-profile-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.mdt-profile-alert {
    margin: 16px 22px 0;
}

.mdt-profile-tabs {
    display: flex;
    gap: 8px;
    padding: 0 22px;
    margin-top: 16px;
}

.mdt-profile-tab {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.mdt-profile-tab:hover,
.mdt-profile-tab:focus-visible {
    color: rgba(255, 255, 255, 0.85);
    outline: none;
}

.mdt-profile-tab.is-active {
    color: #fff;
    border-color: rgba(168, 85, 247, 0.35);
    background: rgba(168, 85, 247, 0.08);
}

.mdt-profile-panel {
    display: none;
}

.mdt-profile-panel.is-active {
    display: block;
}

.mdt-profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 20px 22px 22px;
}

.mdt-profile-stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.mdt-profile-stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.mdt-profile-stat-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.4;
}

.mdt-profile-code {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #fecaca;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    word-break: break-word;
}

.mdt-profile-form {
    padding: 20px 22px 22px;
}

.mdt-profile-avatar-field {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.mdt-profile-avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.mdt-profile-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(168, 85, 247, 0.08);
}

.mdt-profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mdt-profile-avatar-label {
    font-size: 0.82rem;
    color: var(--gold);
}

.mdt-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mdt-profile-field-full {
    grid-column: 1 / -1;
}

.mdt-profile-form input[readonly] {
    opacity: 0.65;
    cursor: not-allowed;
}

.mdt-profile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 520px) {
    .mdt-profile-grid {
        grid-template-columns: 1fr;
    }

    .mdt-profile-stats {
        grid-template-columns: 1fr;
    }
}

/* Divisions SASP */
.divisions-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 0 40px;
    text-align: center;
}

.divisions-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 42px;
}

.division-block {
    margin-bottom: 52px;
}

.division-block:last-child {
    margin-bottom: 0;
}

.division-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 700;
    color: var(--division-color);
    text-decoration: underline;
    text-underline-offset: 6px;
}

.division-emoji {
    font-size: 1.15em;
    text-decoration: none;
}

.division-role {
    margin-bottom: 18px;
}

.division-role:last-child {
    margin-bottom: 0;
}

.division-role-label {
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.division-members {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.8;
    font-weight: 500;
    color: var(--division-color);
}

/* Procédures SASP */
.procedure-page {
    max-width: 820px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #0a0a0a;
    overflow: hidden;
}

.procedure-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.18);
    background: rgba(168, 85, 247, 0.04);
}

.procedure-title {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.92);
}

.procedure-subtitle {
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
}

.procedure-body {
    padding: 28px 32px 36px;
}

.procedure-heading {
    margin: 28px 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold);
}

.procedure-heading:first-child {
    margin-top: 0;
}

.procedure-text {
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.75;
    font-size: 0.92rem;
}

.procedure-roles {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.procedure-role {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: baseline;
}

.procedure-role dt {
    font-weight: 700;
    color: var(--gold);
}

.procedure-role dd {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.55;
}

.procedure-list,
.procedure-steps {
    margin: 0 0 18px;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    font-size: 0.92rem;
}

.procedure-list li,
.procedure-steps li {
    margin-bottom: 10px;
}

.procedure-steps li strong,
.procedure-list li strong {
    color: rgba(255, 255, 255, 0.92);
}

.procedure-steps li p {
    margin: 6px 0 0;
}

.procedure-sublist {
    margin: 8px 0 0;
    padding-left: 1.1rem;
    list-style: disc;
}

.procedure-sublist li {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.68);
}

.procedure-warning {
    margin-top: 24px;
    padding: 16px 18px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
    font-size: 0.9rem;
}

.procedure-warning strong {
    display: block;
    margin-bottom: 8px;
    color: #fcd34d;
}

.procedure-warning p {
    margin: 0 0 8px;
}

.procedure-diagram {
    margin: 24px 0 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #050505;
}

.procedure-diagram img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.procedure-diagram figcaption {
    margin-top: 10px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    text-align: center;
}

.procedure-page--miranda .procedure-header {
    text-align: center;
}

.procedure-miranda {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: center;
}

.procedure-miranda p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 720px) {
    .procedure-header,
    .procedure-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .procedure-role {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* Annuaire Service Public */
.annuaire-page {
    max-width: 1180px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #0a0a0a;
    overflow: hidden;
}

.annuaire-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.annuaire-title {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
}

.annuaire-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 420px;
}

.annuaire-column {
    padding: 22px 20px 28px;
    overflow-y: auto;
    max-height: 620px;
}

.annuaire-column:last-child {
    border-right: 0;
}

.annuaire-column-title {
    margin-bottom: 22px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--annuaire-accent);
    text-align: center;
}

.annuaire-section + .annuaire-section {
    margin-top: 24px;
}

.annuaire-section-title {
    margin-bottom: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.annuaire-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.annuaire-entry {
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}

.annuaire-empty {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.18);
}

@media (max-width: 960px) {
    .annuaire-grid {
        grid-template-columns: 1fr;
    }

    .annuaire-column {
        border-right: 0;
        border-bottom: 0;
        max-height: none;
    }

    .annuaire-column:last-child {
        border-bottom: 0;
    }
}

/* Communication / Codes 10 */
.communication-page {
    max-width: 1180px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #0a0a0a;
    overflow: hidden;
}

.communication-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.communication-title {
    display: inline-block;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 700;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 8px;
    text-decoration-color: rgba(168, 85, 247, 0.55);
}

.communication-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 0.85fr;
}

.communication-column {
    padding: 22px 18px 28px;
}

.communication-column:last-child {
    border-right: 0;
}

.communication-column--split {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.communication-block {
    width: 100%;
}

.communication-divider {
    height: 2px;
    margin: 18px 0;
    background: rgba(255, 255, 255, 0.12);
}

.communication-column-title {
    margin-bottom: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: underline;
    text-underline-offset: 5px;
}

.codes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.codes-line {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.84rem;
    line-height: 1.5;
}

.codes-line:last-child {
    border-bottom: 0;
}

.codes-line-code {
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
}

.codes-line-label {
    color: rgba(255, 255, 255, 0.82);
}

.codes-alphabet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.codes-alphabet-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.86rem;
}

.codes-alphabet-letter {
    width: 18px;
    font-weight: 700;
    color: var(--gold);
}

.codes-alphabet-word {
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 960px) {
    .communication-grid {
        grid-template-columns: 1fr;
    }

    .communication-column {
        border-right: 0;
        border-bottom: 0;
    }

    .communication-column:last-child {
        border-bottom: 0;
    }

    .codes-line {
        grid-template-columns: 64px 1fr;
    }
}
