:root {
    --app-bg: #f6f7fb;
    --app-surface: #ffffff;
    --app-surface-soft: #f9fafb;
    --app-text: #111827;
    --app-muted: #667085;
    --app-border: #e5e7eb;
    --app-primary: #2563eb;
    --app-primary-dark: #1d4ed8;
    --app-primary-soft: #dbeafe;
    --app-accent: #0f766e;
    --app-accent-soft: #ccfbf1;
    --app-warning: #f59e0b;
    --app-warning-soft: #fef3c7;
    --app-danger: #dc2626;
    --app-danger-soft: #fee2e2;
    --app-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --app-radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--app-text);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, .05), transparent 340px),
        var(--app-bg);
    font-family: "Manrope", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

.app-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.app-shell-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(229, 231, 235, .8);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(16px);
}

.app-shell-bar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-link,
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0f766e);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}

.brand-icon svg {
    width: 21px;
    height: 21px;
}

.brand-title {
    font-weight: 800;
    font-size: 1.08rem;
    letter-spacing: 0;
}

.brand-subtitle {
    display: block;
    color: var(--app-muted);
    font-size: .72rem;
    font-weight: 700;
    margin-top: -2px;
}

.nav-buttons,
.public-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn,
.app-nav-link,
.app-btn,
.auth-submit {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.nav-btn,
.app-nav-link {
    color: #334155;
    background: transparent;
}

.nav-btn:hover,
.app-nav-link:hover {
    color: var(--app-primary);
    background: #eef4ff;
}

.app-btn,
.auth-submit,
.app-btn-primary {
    color: #fff;
    background: var(--app-primary);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

.app-btn:hover,
.auth-submit:hover,
.app-btn-primary:hover {
    background: var(--app-primary-dark);
    transform: translateY(-1px);
}

.app-btn-secondary {
    color: #1f2937;
    background: #fff;
    border-color: var(--app-border);
    box-shadow: none;
}

.app-btn-secondary:hover {
    color: var(--app-primary);
    border-color: #bfdbfe;
    background: #eff6ff;
}

.app-btn-quiet {
    color: #475467;
    background: #f3f4f6;
    box-shadow: none;
}

.app-btn-danger {
    color: #b91c1c !important;
    background: var(--app-danger-soft) !important;
}

.hamburger {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    background: #1f2937;
    border-radius: 2px;
}

.app-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 56px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 20px;
}

.eyebrow {
    color: var(--app-accent);
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.page-title,
.dashboard-hero h1,
.landing-title {
    margin: 6px 0 0;
    color: #0f172a;
    font-size: clamp(2rem, 4vw, 4.4rem);
    line-height: .98;
    font-weight: 900;
    letter-spacing: 0;
}

.page-lead,
.dashboard-hero p,
.landing-lead {
    color: var(--app-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin: 12px 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.stat-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .86);
    padding: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

.stat-label {
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
}

.stat-value {
    margin-top: 4px;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
}

.toolbar-card,
.panel-card,
.auth-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--app-shadow);
}

.toolbar-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    padding: 14px;
    margin-bottom: 18px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.app-input,
.app-select,
.app-textarea,
.auth-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    padding: 11px 12px;
    font-size: .93rem;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus,
.auth-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.applications-list {
    display: grid;
    gap: 12px;
}

.application-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    padding: 18px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .055);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.application-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 18px 38px rgba(15, 23, 42, .09);
}

.application-card.is-muted {
    opacity: .58;
}

.application-top,
.application-meta,
.application-footer,
.auth-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.application-title {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 900;
}

.application-subtitle,
.application-detail,
.meta-pill {
    color: var(--app-muted);
    font-size: .88rem;
}

.application-meta {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 14px;
}

.application-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.status-pill,
.date-pill,
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 800;
    line-height: 1;
}

.status-pill {
    color: #fff;
    font-size: .78rem;
}

.status-rejected { background: var(--app-danger); }
.status-admitted { background: #16a34a; }
.status-shortlisted { background: var(--app-primary); }
.status-waiting { background: var(--app-warning); }

.date-pill {
    background: #f8fafc;
    color: #475467;
    border: 1px solid var(--app-border);
    font-size: .78rem;
}

.progress-stack {
    display: grid;
    gap: 9px;
    min-width: min(100%, 340px);
}

.progress-row {
    display: grid;
    grid-template-columns: 92px minmax(120px, 1fr) 44px;
    align-items: center;
    gap: 10px;
    color: #475467;
    font-size: .82rem;
    font-weight: 800;
}

.progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--app-primary);
}

.progress-fill.intent {
    background: var(--app-danger);
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    padding: 34px;
    text-align: center;
    color: var(--app-muted);
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(8px);
}

.app-modal.hidden {
    display: none;
}

.app-modal-card {
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

#notes-btn {
    position: fixed;
    z-index: 50;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(15, 118, 110, .16);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--app-shadow);
}

#notes-panel {
    z-index: 1000;
    border-left: 1px solid var(--app-border);
}

.landing-body {
    background: #f6f7fb;
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid rgba(229, 231, 235, .85);
    backdrop-filter: blur(16px);
}

.landing-hero {
    min-height: calc(100vh - 140px);
    display: grid;
    align-items: center;
    padding: 54px 0 40px;
}

.landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .88fr);
    gap: clamp(28px, 6vw, 80px);
    align-items: center;
}

.landing-title {
    max-width: 760px;
}

.landing-lead {
    max-width: 620px;
    font-size: 1.12rem;
}

.landing-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.product-preview {
    border: 1px solid rgba(203, 213, 225, .78);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .14);
    overflow: hidden;
}

.preview-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid var(--app-border);
    padding: 12px;
    background: #f8fafc;
}

.preview-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #cbd5e1;
}

.preview-body {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.preview-row {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.feature-band {
    padding: 54px 0;
    background: #fff;
    border-top: 1px solid var(--app-border);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 22px;
    background: #fff;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--app-primary);
    background: var(--app-primary-soft);
    margin-bottom: 16px;
}

.auth-side {
    display: flex;
    flex-direction: column;
    color: #fff;
}

.auth-side p {
    color: #cbd5e1;
    line-height: 1.7;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.auth-panel {
    min-height: 100vh;
}

.admin-login-card {
    width: min(100%, 420px) !important;
}

.auth-title {
    font-size: 1.7rem;
    font-weight: 900;
}

.auth-link {
    color: var(--app-primary);
    font-weight: 800;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.alert {
    border-radius: 8px;
    padding: 11px 12px;
    font-size: .9rem;
    line-height: 1.5;
}

.alert-error {
    color: #991b1b;
    background: var(--app-danger-soft);
}

.alert-success {
    color: #166534;
    background: #dcfce7;
}

@media (max-width: 900px) {
    .app-shell-bar,
    .dashboard-hero,
    .toolbar-card,
    .landing-grid,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .app-shell-bar {
        min-height: 66px;
    }

    .hamburger {
        display: inline-flex;
    }

    .nav-buttons {
        display: none;
        position: absolute;
        top: 68px;
        right: 16px;
        width: min(320px, calc(100vw - 32px));
        padding: 10px;
        border: 1px solid var(--app-border);
        border-radius: 8px;
        background: #fff;
        box-shadow: var(--app-shadow);
        align-items: stretch;
        flex-direction: column;
    }

    .nav-buttons.active {
        display: flex;
    }

    .nav-btn {
        width: 100%;
        justify-content: flex-start;
    }

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

    .auth-side {
        display: none;
    }
}

@media (max-width: 640px) {
    .app-container,
    .app-main {
        width: min(1180px, calc(100% - 22px));
    }

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

    .application-top,
    .application-footer,
    .auth-meta-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .application-actions,
    .form-actions,
    .landing-actions {
        width: 100%;
    }

    .application-actions .app-btn,
    .form-actions .app-btn,
    .landing-actions .app-btn {
        width: 100%;
    }

    .progress-row {
        grid-template-columns: 82px minmax(80px, 1fr) 38px;
    }

    #notes-btn {
        left: auto;
        right: 14px;
        top: auto;
        bottom: 16px;
    }
}

/* Legacy overrides */
body.bg-gray-50, body.bg-gray-100 { background: var(--app-bg) !important; }
body.p-6 { padding: 0 !important; }
.w-full.bg-white.shadow-md.p-4 { position: sticky !important; top: 0 !important; z-index: 40 !important; border-bottom: 1px solid rgba(229,231,235,.85) !important; background: rgba(255,255,255,.9) !important; box-shadow: none !important; backdrop-filter: blur(16px) !important; }
.nav-btn { min-height: 40px !important; border-radius: 8px !important; padding: 9px 13px !important; background: transparent !important; color: #334155 !important; font-weight: 800 !important; width: auto !important; }
.nav-btn:hover { color: var(--app-primary) !important; background: #eef4ff !important; }
.nav-btn.bg-red-50, .app-btn-danger { color: #b91c1c !important; background: var(--app-danger-soft) !important; }
#notes-btn { top: auto !important; bottom: 20px !important; left: 20px !important; transform: none !important; border-radius: 8px !important; background: #fff !important; color: var(--app-accent) !important; }
#notes-btn:hover { transform: translateY(-2px) !important; }
.close-btn { border-radius: 8px !important; font-weight: 800 !important; }

.landing-footer { background: #0f172a; color: #e5e7eb; }
.landing-footer a { color: #cbd5e1; text-decoration: none; }
.landing-footer a:hover { color: #fff; }
.auth-shell .brand-icon { box-shadow: none; }
.auth-card form { display: grid; gap: 14px; }
.required::after { content: " *"; color: var(--app-danger); }

.auth-submit { width: 100%; }
.dashboard-page .app-main { padding-top: 34px; }
.pagination-modern a, .pagination-modern span { border-radius: 8px; margin: 0 3px; }

/* Broad legacy page polish */
body.bg-gradient-to-br { background: var(--app-bg) !important; padding: 0 !important; }
.bg-white.rounded-xl.shadow-md,
.bg-white.rounded-xl.shadow-lg,
.bg-white.p-6.rounded-xl.shadow-md,
.bg-white.p-6.rounded-xl.shadow-lg {
    border: 1px solid var(--app-border) !important;
    border-radius: 8px !important;
    box-shadow: var(--app-shadow) !important;
}
.rounded-lg, .rounded-xl { border-radius: 8px !important; }
.bg-blue-500, .bg-blue-600 { background-color: var(--app-primary) !important; }
.text-blue-500, .text-blue-600 { color: var(--app-primary) !important; }
.hover\:bg-blue-700:hover, .hover\:bg-blue-600:hover { background-color: var(--app-primary-dark) !important; }
.max-w-7xl.mx-auto, .max-w-6xl.mx-auto, .max-w-5xl.mx-auto { width: min(1180px, calc(100% - 32px)); }

/* Product refresh pass */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 52vw) minmax(420px, 1fr) !important;
    background: var(--app-bg);
}
.auth-side {
    min-height: 100vh;
    justify-content: space-between;
    padding: clamp(28px, 4vw, 52px) !important;
    background: linear-gradient(145deg, rgba(37, 99, 235, .18), transparent 44%), #0f172a !important;
}
.auth-panel {
    min-width: 0;
    flex-direction: column;
    padding: clamp(22px, 5vw, 64px) !important;
}
.auth-card {
    width: min(100%, 430px) !important;
    padding: clamp(24px, 3vw, 36px) !important;
}
.auth-title { margin: 0 0 8px !important; }
.auth-card__header { margin-bottom: 22px; }
.auth-card__lead, .auth-legal { color: var(--app-muted); font-size: .92rem; line-height: 1.65; }
.auth-legal { margin: 18px 0 0; text-align: center; }
.auth-side__content { max-width: 720px; }
.auth-side__metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.auth-side__metric { border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 14px; background: rgba(255,255,255,.06); }
.auth-side__metric strong { display: block; color: #fff; font-size: 1.5rem; line-height: 1; }
.auth-side__metric span { display: block; color: #cbd5e1; font-size: .78rem; font-weight: 800; margin-top: 6px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label { color: #344054; font-size: .9rem; font-weight: 850; }
.landing-footer { padding: 48px 0 28px !important; }
.landing-footer__grid { display: grid; grid-template-columns: 1.3fr .9fr .9fr; gap: 34px; align-items: start; }
.landing-footer__title { color: #fff; font-size: .95rem; font-weight: 900; margin: 0 0 14px; }
.landing-footer__text, .landing-footer li, .landing-footer__bottom { color: #cbd5e1; font-size: .9rem; line-height: 1.7; }
.landing-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.landing-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 38px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.dashboard-main-column, .dashboard-side-column { display: grid; gap: 14px; }
.dashboard-insight { position: sticky; top: 92px; border: 1px solid var(--app-border); border-radius: 8px; background: #fff; padding: 18px; box-shadow: var(--app-shadow); }
.dashboard-insight h2 { margin: 0; color: #0f172a; font-size: 1rem; font-weight: 900; }
.dashboard-insight p { margin: 8px 0 0; color: var(--app-muted); font-size: .9rem; line-height: 1.65; }
.application-card__header, .application-card__body, .application-card__footer { display: flex; justify-content: space-between; gap: 18px; }
.application-card__header { align-items: flex-start; }
.application-card__body { align-items: flex-end; margin-top: 18px; }
.application-card__footer { align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--app-border); }
.application-card__school { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; color: #0f172a; font-size: 1.08rem; font-weight: 900; }
.application-card__program { margin: 7px 0 0; color: #475467; font-size: .92rem; line-height: 1.5; }
.application-card__controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.application-card__dates { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.tick-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--app-muted); font-size: .82rem; font-weight: 800; }
.quick-link { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--app-border); border-radius: 8px; padding: 8px 10px; color: #344054; background: #fff; font-size: .82rem; font-weight: 850; text-decoration: none; }
.quick-link:hover { color: var(--app-primary); border-color: #bfdbfe; background: #eff6ff; }
.quick-link button { all: unset; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.todo-popover { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; border: 1px solid var(--app-border); border-radius: 8px; background: #fff; box-shadow: var(--app-shadow); z-index: 50; }
.todo-popover__inner { padding: 14px; }
.todo-popover h3 { margin: 0 0 10px; color: #0f172a; font-size: .92rem; font-weight: 900; }
.app-page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 58px; }
.app-page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.app-panel { border: 1px solid var(--app-border); border-radius: 8px; background: #fff; padding: 20px; box-shadow: var(--app-shadow); }
.app-panel h2, .app-panel h3 { color: #0f172a; }
@media (max-width: 1100px) { .dashboard-layout { grid-template-columns: 1fr; } .dashboard-insight { position: static; } }
@media (max-width: 900px) {
 .auth-side { min-height: auto; gap: 36px; } .landing-footer__grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .application-card__header, .application-card__body, .application-card__footer { flex-direction: column; align-items: stretch; } .application-card__controls, .application-card__dates { justify-content: flex-start; } .app-page-grid { grid-template-columns: 1fr; } .landing-footer__bottom { align-items: flex-start; flex-direction: column; } .auth-side__metric-row { grid-template-columns: 1fr; } }

/* Table polish */
.app-panel table { border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 8px; }
.app-panel thead tr { background: #0f172a !important; }
.app-panel th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.app-panel tbody tr:hover { background: #f8fafc !important; }
.editor-container { border: 1px solid var(--app-border); border-radius: 8px; box-shadow: var(--app-shadow) !important; }

/* Compact dashboard filters */
.toolbar-card--filters {
    grid-template-columns: minmax(280px, 1fr) minmax(360px, 520px) !important;
    align-items: end;
    gap: 12px;
    padding: 12px;
    margin-bottom: 20px;
}

.toolbar-card--filters .filter-group {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.toolbar-field {
    display: grid;
    gap: 6px;
    margin: 0;
    min-width: 0;
}

.toolbar-field > span {
    color: #667085;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.toolbar-field input,
.toolbar-field select {
    height: 46px;
    min-height: 46px;
    padding: 0 13px;
    color: #111827;
    font-size: .92rem;
    font-weight: 750;
}

.toolbar-field input::placeholder {
    color: #98a2b3;
    font-weight: 650;
}

.toolbar-field--search input {
    background: #fff;
}

@media (max-width: 900px) {
    .toolbar-card--filters {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .toolbar-card--filters .filter-group {
        grid-template-columns: 1fr;
    }
}

/* Header refresh */
.app-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, .045), transparent 320px),
        var(--app-bg);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    border-bottom: 1px solid rgba(226, 232, 240, .86);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(18px);
}

.app-topbar__inner {
    width: min(1220px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.app-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 178px;
    text-decoration: none;
}

.app-topbar__brand .brand-title {
    display: block;
    color: #0f172a;
    font-size: 1.04rem;
    line-height: 1.1;
}

.app-topbar__brand .brand-subtitle {
    color: #64748b;
}

.app-topbar__navwrap {
    flex: 1;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.app-topbar__nav,
.app-topbar__actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-topbar__actions {
    flex: 0 0 auto;
}

.app-topbar .nav-btn {
    width: auto !important;
    min-width: 40px;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    color: #475467 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .86rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none;
    white-space: nowrap;
}

.app-topbar .nav-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.app-topbar .nav-btn:hover,
.app-topbar .nav-btn.is-active {
    color: var(--app-primary) !important;
    border-color: #dbeafe !important;
    background: #eff6ff !important;
    transform: none !important;
}

.app-topbar .nav-btn--icon,
.app-topbar #notification-btn,
.app-topbar .nav-btn--danger {
    width: 40px !important;
    padding: 0 !important;
}

.app-topbar .nav-btn--danger {
    color: #b91c1c !important;
    border-color: #fee2e2 !important;
    background: #fff5f5 !important;
}

.app-topbar .nav-btn--danger:hover {
    color: #991b1b !important;
    border-color: #fecaca !important;
    background: #fee2e2 !important;
}

.profile-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #0f172a;
    font-size: .75rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.app-menu-button {
    display: none !important;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    color: #0f172a;
    background: #fff;
}

.app-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.app-topbar #notes-btn {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    color: #475467 !important;
    border-color: transparent !important;
    background: transparent !important;
}

.app-topbar #notes-btn:hover {
    color: var(--app-primary) !important;
    border-color: #dbeafe !important;
    background: #eff6ff !important;
    transform: none !important;
}

#notification-count {
    top: 4px !important;
    right: 4px !important;
    min-width: 18px;
    height: 18px;
    padding: 0 5px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: .66rem !important;
    font-weight: 900;
    line-height: 1;
    transform: translate(35%, -35%) !important;
}

@media (max-width: 1080px) {
    .app-topbar__brand {
        min-width: auto;
    }

    .app-topbar .nav-btn {
        padding-inline: 10px !important;
    }
}

@media (max-width: 900px) {

    .app-menu-button {
        display: inline-flex !important;
    }

    .app-topbar__navwrap.nav-buttons {
        display: none !important;
        position: absolute;
        width: auto;
        flex-direction: column;
        align-items: stretch;
        border: 1px solid var(--app-border);
        background: #fff;
        box-shadow: var(--app-shadow);
    }

    .app-topbar__navwrap.nav-buttons.active {
        display: flex !important;
    }

    .app-topbar__nav,
    .app-topbar__actions {
        width: 100%;
        display: grid;
        gap: 6px;
    }

    .app-topbar .nav-btn,
    .app-topbar .nav-btn--icon,
    .app-topbar #notification-btn,
    .app-topbar .nav-btn--danger {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 0 12px !important;
    }

    .app-topbar #notification-btn::after {
        content: "Notifications";
    }

    .app-topbar #notes-btn::after {
        content: "Bloc-notes";
    }

    .app-topbar .nav-btn--danger::after {
        content: "Déconnexion";
    }
}

@media (max-width: 560px) {
    .app-topbar__inner {
        width: min(1220px, calc(100% - 22px));
    }

    .app-topbar__brand .brand-subtitle {
        display: none;
    }

    .app-drawer,
    #notification-panel {
        width: min(100vw, 420px) !important;
    }
}

/* Header refinements */
.app-body {
    display: flex;
    flex-direction: column;
}

.app-topbar__nav {
    padding: 4px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 8px;
    background: #f8fafc;
}

.app-topbar__actions {
    padding: 4px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 8px;
    background: #fff;
}

.app-topbar .nav-btn--profile {
    padding-right: 13px !important;
    background: #f8fafc !important;
    border-color: #edf2f7 !important;
}

.app-topbar .nav-btn--profile:hover,
.app-topbar .nav-btn--profile.is-active {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
}

@media (max-width: 900px) {
    .app-topbar__nav,
    .app-topbar__actions {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .app-topbar .nav-btn--profile {
        padding-right: 12px !important;
    }
}

/* Platform badges */
.platform-badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 3px 8px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    color: var(--app-primary);
    background: #eff6ff;
    font-size: .7rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
}

.platform-badge img {
    width: auto;
    height: 15px;
    display: block;
}

.platform-badge--parcoursup {
    color: #0f766e;
    border-color: #ccfbf1;
    background: #f0fdfa;
}

/* Admin surface */
.admin-body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-text);
    background: #f5f7fb;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(226, 232, 240, .92);
    backdrop-filter: blur(18px);
}

.admin-topbar__inner {
    width: min(1220px, calc(100% - 32px));
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 auto;
}

.admin-topbar .app-topbar__brand {
    min-width: 210px;
}

.admin-topbar .brand-icon {
    color: #fff;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: 0;
}

.admin-nav {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    padding: 4px;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 8px;
    background: #f8fafc;
    scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar {
    display: none;
}

.admin-nav__link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #475467;
    font-size: .88rem;
    font-weight: 850;
    text-decoration: none;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.admin-nav__link:hover,
.admin-nav__link.is-active {
    color: #0f172a;
    border-color: rgba(191, 219, 254, .92);
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

.admin-main {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 68px;
}

.admin-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-section-head h1 {
    margin: 5px 0 0;
    color: #0f172a;
    font-size: clamp(1.8rem, 2.5vw, 2.55rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0;
}

.admin-section-head p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--app-muted);
    font-size: .98rem;
    line-height: 1.6;
}

.admin-table-wrap {
    padding: 0 !important;
    overflow: auto;
}

.admin-table {
    width: 100%;
    min-width: 880px;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table th,
.admin-table td {
    padding: 15px 18px;
    border-bottom: 1px solid rgba(226, 232, 240, .78);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: #667085;
    background: #f8fafc;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.admin-table td {
    color: #0f172a;
    font-size: .92rem;
    font-weight: 720;
}

.admin-table td span {
    color: #667085;
    font-weight: 650;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.admin-table .auth-link + .auth-link {
    margin-left: 10px;
}

.text-red-600 {
    color: #dc2626 !important;
}

@media (max-width: 960px) {
    .admin-topbar__inner {
        align-items: stretch;
        flex-direction: column;
        padding: 12px 0;
    }

    .admin-topbar .app-topbar__brand,
    .admin-topbar .app-btn {
        width: 100%;
    }

    .admin-nav {
        width: 100%;
    }

    .admin-section-head {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .admin-main,
    .admin-topbar__inner {
        width: min(1220px, calc(100% - 22px));
    }

    .admin-main {
        padding-top: 22px;
    }

    .admin-section-head h1 {
        font-size: 1.75rem;
    }
}

.platform-logo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.platform-logo-row img {
    width: auto;
    height: 28px;
    max-width: 138px;
    object-fit: contain;
    opacity: .84;
}

/* Admin, drawers and account refinements */
.section-heading {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.18rem;
    font-weight: 950;
    letter-spacing: 0;
}

.section-heading p {
    max-width: 720px;
    margin: 0;
    color: var(--app-muted);
    font-size: .94rem;
    line-height: 1.6;
}

.app-topbar .nav-btn--admin {
    color: #0f766e !important;
    border-color: #ccfbf1 !important;
    background: #f0fdfa !important;
}

.app-topbar .nav-btn--admin:hover,
.app-topbar .nav-btn--admin.is-active {
    color: #0f766e !important;
    border-color: #99f6e4 !important;
    background: #ccfbf1 !important;
}

.admin-topbar {
    background: rgba(255, 255, 255, .92) !important;
}

.admin-topbar__navwrap {
    flex: 1;
}

.admin-actions {
    padding: 4px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 8px;
    background: #fff;
}

.admin-actions .nav-btn--dashboard {
    color: #2563eb !important;
    border-color: #dbeafe !important;
    background: #eff6ff !important;
}

.admin-actions .nav-btn--dashboard:hover {
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
    background: #dbeafe !important;
}

.notification-trigger {
    position: relative !important;
}

.notification-count {
    position: absolute;
    top: 4px !important;
    right: 4px !important;
    min-width: 18px;
    height: 18px;
    padding: 0 5px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #dc2626;
    font-size: .66rem !important;
    font-weight: 950;
    line-height: 1;
    transform: translate(35%, -35%) !important;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 18px;
    align-items: start;
}

.profile-card,
.profile-share-card,
.analytics-card,
.analytics-deadlines {
    background: rgba(255, 255, 255, .92) !important;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-meta-card {
    min-height: 76px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 8px;
    background: #f8fafc;
}

.profile-meta-card span,
.share-state span {
    color: var(--app-muted);
    font-size: .74rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.profile-meta-card strong {
    color: #0f172a;
    font-size: .95rem;
    font-weight: 900;
}

.profile-share-card {
    position: sticky;
    top: 92px;
}

.share-state {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 8px;
    background: #f8fafc;
}

.share-state--active {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.share-state--expired {
    border-color: #fde68a;
    background: #fffbeb;
}

.share-state a {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #2563eb;
    font-size: .88rem;
    font-weight: 850;
    text-decoration: none;
}

.share-state small,
.share-state strong {
    color: #334155;
    font-size: .9rem;
    font-weight: 800;
}

.profile-share-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 14px;
}

.analytics-shell {
    display: grid;
    gap: 18px;
}

.analytics-hero,
.analytics-stats {
    margin-bottom: 0;
}

.analytics-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-deadline-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.analytics-deadline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 8px;
    background: #f8fafc;
}

.analytics-deadline-item strong,
.analytics-deadline-item span,
.analytics-deadline-item small {
    display: block;
}

.analytics-deadline-item strong {
    color: #0f172a;
    font-weight: 900;
}

.analytics-deadline-item span,
.analytics-deadline-item small {
    color: var(--app-muted);
    font-size: .86rem;
    font-weight: 750;
}

.analytics-empty {
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--app-muted);
    background: #f8fafc;
    list-style: none;
}

.analytics-grid {
    align-items: stretch;
}

.analytics-card {
    min-height: 360px;
}

.analytics-card--wide {
    grid-column: 1 / -1;
}

.analytics-chart {
    height: 280px;
    width: 100%;
}

@media (max-width: 980px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-share-card {
        position: static;
    }

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

@media (max-width: 640px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .analytics-deadline-item {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Strong drawer rebuild and admin weight tuning */
.admin-body {
    font-family: "Manrope", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
}

.admin-body .brand-title,
.admin-body .admin-section-head h1,
.admin-body .dashboard-hero h1 {
    font-weight: 740 !important;
}

.admin-body .app-panel h2,
.admin-body .app-panel h3,
.admin-body .stat-value {
    font-weight: 560 !important;
}

.admin-body .admin-nav__link,
.admin-body .nav-btn,
.admin-body .app-btn,
.admin-body .auth-link {
    font-weight: 600 !important;
}

.admin-body .admin-table th {
    font-weight: 620 !important;
    letter-spacing: .03em;
}

.admin-body .admin-table td {
    font-weight: 400 !important;
}

.admin-body .admin-table td strong {
    font-weight: 660 !important;
}

.admin-body .admin-table td span,
.admin-body p,
.admin-body .brand-subtitle {
    font-weight: 400 !important;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 980;
    background: rgba(248, 250, 252, .72);
}

#notes-panel.drawer-panel,
#notification-panel.drawer-panel {
    position: fixed !important;
    inset: 12px 12px 12px auto !important;
    z-index: 1000 !important;
    width: min(470px, calc(100vw - 24px)) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, .82) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: -24px 0 64px rgba(15, 23, 42, .14) !important;
    opacity: 1;
    transform: translateX(0) !important;
    transition: transform .28s ease, opacity .2s ease;
    will-change: transform;
}

#notification-panel.drawer-panel {
    width: min(430px, calc(100vw - 24px)) !important;
}

#notes-panel.drawer-panel.translate-x-full,
#notification-panel.drawer-panel.translate-x-full {
    pointer-events: none;
    opacity: 0;
    transform: translateX(calc(100% + 40px)) !important;
}

.drawer-panel__hero {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 20px;
    border-bottom: 1px solid rgba(226, 232, 240, .88);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(15, 118, 110, .08)),
        #ffffff;
}

.drawer-panel__icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #dbeafe;
}

.drawer-panel__icon svg,
.drawer-panel__close svg,
.notification-card__icon svg,
.notification-card__action svg {
    width: 20px;
    height: 20px;
}

.drawer-panel__hero h2 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.1;
}

.drawer-panel__hero p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.45;
}

.drawer-panel__close,
#close-notification-panel.drawer-panel__close,
.app-drawer #close-notes-btn.drawer-panel__close {
    width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 1px solid rgba(203, 213, 225, .9) !important;
    border-radius: 8px !important;
    color: #475467 !important;
    background: rgba(255, 255, 255, .82) !important;
    box-shadow: none !important;
    cursor: pointer;
}

.drawer-panel__close:hover,
#close-notification-panel.drawer-panel__close:hover,
.app-drawer #close-notes-btn.drawer-panel__close:hover {
    color: #0f172a !important;
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
}

.notes-form {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
}

.notes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 8px;
    color: #64748b;
    background: #fff;
    font-size: .78rem;
    font-weight: 680;
}

.notes-toolbar span:first-child {
    color: #0f766e;
}

.notes-textarea-wrap {
    min-height: 0;
    display: flex;
    flex: 1;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .03);
}

.notes-textarea-wrap textarea,
.app-drawer .notes-textarea-wrap textarea {
    min-height: 410px;
    width: 100%;
    flex: 1;
    padding: 16px;
    border: 0 !important;
    outline: 0;
    resize: none;
    color: #0f172a;
    background: transparent !important;
    font-size: .96rem;
    font-weight: 480;
    line-height: 1.72;
}

.notes-textarea-wrap textarea::placeholder {
    color: #94a3b8;
}

.notes-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.notes-save-pill {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    background: #fff;
    font-size: .82rem;
    font-weight: 680;
}

.notes-save-pill.is-success {
    color: #0f766e;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.notes-save-pill.is-error {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff5f5;
}

.notes-save-pill.is-saving {
    color: #92400e;
    border-color: #fde68a;
    background: #fffbeb;
}

.notes-save-btn {
    min-width: 132px;
}

.notification-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 16px 0;
    padding: 12px 14px;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 8px;
    color: #475467;
    background: #f8fafc;
    font-size: .84rem;
    font-weight: 640;
}

.notification-summary strong {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: #2563eb;
    font-weight: 760;
}

.notification-summary--empty {
    color: #0f766e;
    border-color: #ccfbf1;
    background: #f0fdfa;
}

.notification-summary--empty strong {
    color: #0f766e;
    background: #ccfbf1;
}

#notification-list.notification-list {
    min-height: 0;
    display: grid;
    gap: 12px;
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.notification-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.notification-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 8px 0 0 8px;
    background: #64748b;
}

.notification-card--red::before { background: #dc2626; }
.notification-card--blue::before { background: #2563eb; }
.notification-card--orange::before { background: #f59e0b; }
.notification-card--green::before { background: #0f766e; }

.notification-card__icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #dbeafe;
}

.notification-card--red .notification-card__icon {
    color: #dc2626;
    background: #fff5f5;
    box-shadow: inset 0 0 0 1px #fecaca;
}

.notification-card--orange .notification-card__icon {
    color: #b45309;
    background: #fffbeb;
    box-shadow: inset 0 0 0 1px #fde68a;
}

.notification-card--green .notification-card__icon {
    color: #0f766e;
    background: #f0fdfa;
    box-shadow: inset 0 0 0 1px #99f6e4;
}

.notification-card__content {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding-right: 74px;
}

.notification-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-card__meta span {
    color: #0f172a;
    font-size: .82rem;
    font-weight: 720;
}

.notification-card__meta small {
    color: #64748b;
    font-size: .78rem;
    font-weight: 520;
}

.notification-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: .98rem;
    font-weight: 720;
    line-height: 1.28;
}

.notification-card p,
.notification-card strong {
    margin: 0;
    color: #64748b;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.45;
}

.notification-card strong {
    color: #334155;
    font-weight: 620;
}

.notification-card__action {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 56px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 8px;
    color: #475467;
    background: #fff;
    font-size: .76rem;
    font-weight: 680;
    cursor: pointer;
}

.notification-card__action:hover {
    color: #0f766e;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.notification-card__action svg {
    width: 15px;
    height: 15px;
}

.notification-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    margin: auto 0;
    padding: 30px 24px;
    border: 1px solid rgba(204, 251, 241, .95);
    border-radius: 8px;
    color: #64748b;
    background:
        radial-gradient(circle at 50% 0, rgba(204, 251, 241, .55), transparent 52%),
        linear-gradient(180deg, #ffffff, #f8fafc);
    text-align: center;
}

.notification-empty__icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #0f766e;
    background: #ccfbf1;
    box-shadow: inset 0 0 0 1px #99f6e4;
}

.notification-empty__icon svg {
    width: 26px;
    height: 26px;
}

.notification-empty strong {
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 760;
}

.notification-empty p {
    max-width: 300px;
    margin: 0;
    font-size: .9rem;
    line-height: 1.55;
}

.notification-empty small {
    color: #0f766e;
    font-size: .78rem;
    font-weight: 720;
}

@media (max-width: 640px) {
    #notes-panel.drawer-panel,
    #notification-panel.drawer-panel {
        inset: 8px !important;
        width: auto !important;
    }

    #notes-panel.drawer-panel.translate-x-full,
    #notification-panel.drawer-panel.translate-x-full {
        transform: translateX(calc(100% + 32px)) !important;
    }

    .notification-card__content {
        padding-right: 0;
    }

    .notification-card__action {
        position: static;
        grid-column: 2;
        justify-self: start;
    }
}

/* Dashboard utilities migrated from dashboard.css */
.hidden {
    display: none !important;
}

.opacity-50 {
    opacity: .5;
}

.status-cell {
    white-space: nowrap;
}

.auth-field {
    position: relative;
}

#suggestions,
#master_suggestions,
#parcours_suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1001;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .10);
}

#suggestions div,
#master_suggestions div,
#parcours_suggestions div {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, .8);
    color: #334155;
    cursor: pointer;
}

#suggestions div:last-child,
#master_suggestions div:last-child,
#parcours_suggestions div:last-child {
    border-bottom: 0;
}

#suggestions div:hover,
#master_suggestions div:hover,
#parcours_suggestions div:hover {
    color: #0f172a;
    background: #f8fafc;
}


/* Responsive consolidation */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
canvas {
    max-width: 100%;
}

@media (max-width: 900px) {
    .app-topbar {
        z-index: 120;
    }

    .app-topbar__inner {
        width: min(1220px, calc(100% - 22px));
        min-height: 64px;
        gap: 10px;
    }

    .app-topbar__brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .app-topbar__brand > span:last-child {
        min-width: 0;
    }

    .app-topbar__brand .brand-title,
    .app-topbar__brand .brand-subtitle {
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-menu-button {
        flex: 0 0 40px;
    }

    .app-topbar__navwrap.nav-buttons {
        top: 70px;
        left: 11px;
        right: 11px;
        max-height: calc(100dvh - 84px);
        overflow: auto;
        padding: 10px;
        border-radius: 8px;
    }

    .app-topbar__nav,
    .app-topbar__actions {
        grid-template-columns: 1fr;
    }

    .app-topbar .nav-btn,
    .app-topbar .nav-btn--icon,
    .app-topbar #notification-btn,
    .app-topbar #notes-btn,
    .app-topbar .nav-btn--danger {
        min-height: 44px !important;
        height: auto !important;
    }

    .app-topbar .nav-btn svg {
        width: 19px;
        height: 19px;
    }

    .notification-count,
    #notification-count {
        top: 50% !important;
        right: 14px !important;
        transform: translateY(-50%) !important;
    }

    .admin-topbar__inner {
        width: min(1220px, calc(100% - 22px));
        min-height: auto;
        align-items: stretch;
        gap: 10px;
        padding: 10px 0;
    }

    .admin-topbar .app-topbar__brand {
        width: 100%;
        min-width: 0;
    }

    .admin-topbar__navwrap {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .admin-nav {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .admin-nav__link {
        flex: 0 0 auto;
        min-width: max-content;
        scroll-snap-align: start;
        font-size: .82rem !important;
    }

    .admin-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .admin-actions .nav-btn--dashboard {
        width: 100% !important;
        justify-content: center !important;
    }

    .admin-actions .nav-btn--danger {
        width: 44px !important;
        min-width: 44px !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    .auth-shell {
        min-height: 100dvh;
        grid-template-columns: 1fr !important;
    }

    .auth-panel {
        min-height: 100dvh;
        padding: 22px !important;
    }

    .auth-card {
        width: min(100%, 440px) !important;
    }
}

@media (max-width: 760px) {
    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    .app-container,
    .app-main,
    .app-page,
    .admin-main {
        width: min(1220px, calc(100% - 22px));
    }

    .app-main,
    .app-page,
    .admin-main {
        padding-top: 20px;
        padding-bottom: 42px;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        align-items: start;
        margin-bottom: 16px;
    }

    .dashboard-hero h1,
    .page-title,
    .landing-title {
        font-size: clamp(1.85rem, 11vw, 2.55rem);
        line-height: 1.04;
    }

    .dashboard-hero p,
    .page-lead,
    .landing-lead {
        font-size: .96rem;
        line-height: 1.58;
    }

    .dashboard-hero .app-btn,
    .dashboard-hero button,
    .admin-section-head .app-btn {
        width: 100%;
    }

    .stats-grid,
    .analytics-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 14px 0;
    }

    .stat-card {
        min-width: 0;
        padding: 13px;
    }

    .stat-label {
        font-size: .72rem;
    }

    .stat-value {
        font-size: 1.45rem;
    }

    .toolbar-card,
    .toolbar-card--filters {
        grid-template-columns: 1fr !important;
        gap: 10px;
        padding: 12px;
        margin-bottom: 14px;
    }

    .filter-group,
    .toolbar-card--filters .filter-group {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .toolbar-field input,
    .toolbar-field select,
    .app-input,
    .app-select,
    .auth-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    input[type="date"],
    select,
    textarea {
        min-height: 46px;
    }

    .application-card {
        padding: 14px;
    }

    .application-card:hover {
        transform: none;
    }

    .application-card__header,
    .application-card__body,
    .application-card__footer,
    .application-top,
    .application-meta,
    .application-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .application-card__body {
        margin-top: 14px;
    }

    .application-card__footer {
        margin-top: 14px;
    }

    .application-card__school {
        align-items: flex-start;
        flex-direction: column;
        font-size: 1rem;
    }

    .platform-badge {
        margin-left: 0;
    }

    .application-card__controls,
    .application-card__dates,
    .application-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .application-card__controls .app-btn,
    .application-card__controls .quick-link {
        flex: 1 1 145px;
    }

    .application-card__controls > .relative,
    .application-card__controls > .relative .quick-link {
        width: 100%;
    }

    .progress-stack {
        width: 100%;
        min-width: 0;
    }

    .progress-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .progress-row strong {
        justify-self: start;
    }

    .date-pill,
    .status-pill,
    .meta-pill {
        max-width: 100%;
        white-space: normal;
        line-height: 1.35;
    }

    .dashboard-layout,
    .profile-layout,
    .profile-grid,
    .app-page-grid,
    .analytics-grid,
    .landing-grid,
    .landing-footer__grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-insight,
    .profile-card,
    .profile-share-card,
    .analytics-card,
    .analytics-deadlines,
    .app-panel {
        padding: 16px;
    }

    .profile-share-card {
        position: static;
    }

    .profile-share-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        gap: 9px;
    }

    .profile-share-actions .app-btn,
    .form-actions .app-btn,
    .form-actions button,
    .form-actions a,
    .landing-actions .app-btn {
        width: 100%;
    }

    .analytics-card {
        min-height: 300px;
    }

    .analytics-chart {
        height: 240px;
    }

    .analytics-deadline-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .app-modal-card {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 18px;
    }

    .pagination-modern {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .pagination-modern a,
    .pagination-modern span {
        flex: 0 0 auto;
    }

    .todo-popover {
        left: 0;
        right: auto;
        width: min(280px, calc(100vw - 44px));
    }

    .admin-section-head {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .admin-section-head h1 {
        font-size: 1.7rem;
        line-height: 1.08;
    }

    .admin-table-wrap,
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table-wrap {
        padding: 0 !important;
    }

    .admin-table {
        min-width: 760px;
    }

    .admin-table th,
    .admin-table td {
        padding: 12px 14px;
        font-size: .84rem;
    }

    .table-container {
        margin-inline: -16px;
        padding-inline: 16px;
    }

    .table-container table {
        min-width: 980px !important;
    }

    .editor-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }

    #editor {
        min-height: 520px;
        height: 64dvh !important;
        padding: 16px !important;
    }

    .fr-box,
    .fr-wrapper,
    .fr-toolbar,
    .fr-second-toolbar {
        max-width: 100% !important;
    }

    .fr-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-panel > .flex.justify-between,
    .app-panel > .flex.justify-end,
    .app-panel > .flex.justify-between > .flex,
    .app-panel > .flex.justify-end > .flex,
    .app-panel .flex.items-center:has(.app-btn) {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .app-panel > .flex.justify-between .app-btn,
    .app-panel > .flex.justify-end .app-btn,
    .app-panel > .flex.justify-between button,
    .app-panel > .flex.justify-end button {
        width: 100%;
    }

    .fixed.inset-0.bg-black.bg-opacity-50.flex.justify-center.items-center.z-50 {
        align-items: flex-end !important;
        padding: 12px;
    }

    .fixed.inset-0.bg-black.bg-opacity-50.flex.justify-center.items-center.z-50 > .bg-white {
        max-height: calc(100dvh - 24px);
        overflow: auto;
        padding: 20px !important;
    }

    .share-state a,
    .alert a,
    .admin-table a,
    .table-container a {
        overflow-wrap: anywhere;
    }

    .auth-side {
        display: none;
    }

    body.auth-panel {
        min-height: 100dvh !important;
        align-items: flex-start;
        padding: 18px !important;
        background:
            linear-gradient(180deg, rgba(37, 99, 235, .08), transparent 260px),
            var(--app-bg);
    }

    body.auth-panel > .auth-card {
        width: min(100%, 460px) !important;
        margin: 0 auto;
    }
}

@media (max-width: 520px) {
    .brand-icon {
        width: 36px;
        height: 36px;
    }

    .app-topbar__brand .brand-title {
        max-width: 54vw;
        font-size: .98rem;
    }

    .app-topbar__brand .brand-subtitle {
        display: none;
    }

    .app-topbar__navwrap.nav-buttons {
        left: 8px;
        right: 8px;
    }

    .admin-actions {
        grid-template-columns: 1fr;
    }

    .admin-actions .nav-btn--danger {
        width: 100% !important;
    }

    .admin-actions .nav-btn--danger::after {
        content: "Déconnexion";
    }

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

    .stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .stat-value {
        margin-top: 0;
    }

    .application-card__controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .application-card__controls .app-btn,
    .application-card__controls .quick-link {
        width: 100%;
    }

    .table-container table {
        min-width: 860px !important;
    }

    .app-panel h1,
    .app-panel h2,
    .section-heading h2,
    .application-title {
        overflow-wrap: anywhere;
    }

    .fr-toolbar .fr-btn-grp {
        margin-right: 4px !important;
    }

    .empty-state {
        padding: 24px 16px;
    }

    .auth-panel {
        padding: 14px !important;
    }

    .auth-card {
        padding: 20px !important;
    }

    .auth-title {
        font-size: 1.45rem;
    }

    #notes-panel.drawer-panel,
    #notification-panel.drawer-panel {
        inset: 0 !important;
        width: 100vw !important;
        max-width: none !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    #notes-panel.drawer-panel.translate-x-full,
    #notification-panel.drawer-panel.translate-x-full {
        transform: translateX(calc(100% + 32px)) !important;
    }

    .drawer-panel__hero {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        gap: 10px;
        padding: 16px;
    }

    .drawer-panel__icon {
        width: 36px;
        height: 36px;
    }

    .drawer-panel__hero h2 {
        font-size: 1.12rem;
    }

    .drawer-panel__hero p {
        font-size: .82rem;
    }

    .drawer-panel__close,
    #close-notification-panel.drawer-panel__close,
    .app-drawer #close-notes-btn.drawer-panel__close {
        width: 36px !important;
        height: 36px !important;
    }

    .notes-form {
        gap: 12px;
        padding: 12px;
    }

    .notes-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .notes-textarea-wrap textarea,
    .app-drawer .notes-textarea-wrap textarea {
        min-height: calc(100dvh - 258px);
        padding: 14px;
        font-size: .94rem;
        line-height: 1.62;
    }

    .notes-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-save-pill,
    .notes-save-btn {
        width: 100%;
        justify-content: center;
    }

    .notification-summary {
        margin: 12px 12px 0;
    }

    #notification-list.notification-list {
        gap: 10px;
        padding: 12px;
    }

    .notification-card {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .notification-card__icon {
        width: 34px;
        height: 34px;
    }

    .notification-card__content {
        padding-right: 0;
    }

    .notification-card__action {
        grid-column: 1 / -1;
        width: 100%;
        justify-self: stretch;
    }

    .notification-empty {
        min-height: 220px;
        padding: 24px 16px;
    }
}

@media (max-width: 390px) {
    .app-topbar__brand .brand-title {
        max-width: 46vw;
    }

    .dashboard-hero h1,
    .page-title,
    .landing-title {
        font-size: 1.78rem;
    }

    .admin-nav__link,
    .app-topbar .nav-btn {
        font-size: .8rem !important;
    }
}

/* Tablet burger navigation */
@media (max-width: 1180px) {
    .app-topbar__inner,
    .admin-topbar__inner {
        position: relative;
        width: min(1220px, calc(100% - 22px));
        min-height: 64px;
        gap: 10px;
        flex-direction: row !important;
        align-items: center !important;
    }

    .app-topbar__brand,
    .admin-topbar .app-topbar__brand {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
    }

    .app-topbar__brand > span:last-child {
        min-width: 0;
    }

    .app-topbar__brand .brand-title,
    .app-topbar__brand .brand-subtitle {
        max-width: 52vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-menu-button,
    .admin-menu-button {
        display: inline-flex !important;
        flex: 0 0 42px;
    }

    .app-topbar__navwrap.nav-buttons,
    .admin-topbar__navwrap.nav-buttons {
        display: none !important;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        z-index: 140;
        width: auto;
        max-height: calc(100dvh - 86px);
        overflow: auto;
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        border: 1px solid var(--app-border);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 24px 70px rgba(15, 23, 42, .16);
    }

    .app-topbar__navwrap.nav-buttons.active,
    .admin-topbar__navwrap.nav-buttons.active {
        display: flex !important;
    }

    .app-topbar__nav,
    .app-topbar__actions,
    .admin-nav,
    .admin-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 0;
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .admin-nav {
        scroll-snap-type: none;
    }

    .app-topbar .nav-btn,
    .app-topbar .nav-btn--icon,
    .app-topbar #notification-btn,
    .app-topbar #notes-btn,
    .app-topbar .nav-btn--danger,
    .admin-nav__link,
    .admin-actions .nav-btn {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: flex-start !important;
        padding: 0 12px !important;
    }

    .app-topbar #notification-btn::after {
        content: "Notifications";
    }

    .app-topbar #notes-btn::after {
        content: "Bloc-notes";
    }

    .app-topbar .nav-btn--danger::after,
    .admin-actions .nav-btn--danger::after {
        content: "Déconnexion";
    }

    .admin-actions .nav-btn--dashboard {
        justify-content: flex-start !important;
    }
}

@media (min-width: 1181px) {
    .app-topbar__navwrap.nav-buttons,
    .admin-topbar__navwrap.nav-buttons {
        display: flex !important;
    }
}

@media (max-width: 520px) {
    .app-topbar__brand .brand-title {
        max-width: 54vw;
    }

    .app-topbar__brand .brand-subtitle {
        display: none;
    }
}

/* Drawer geometry final guard */
#notification-overlay.drawer-backdrop,
#notes-overlay.drawer-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 980 !important;
    background: rgba(248, 250, 252, .76) !important;
    backdrop-filter: none !important;
}

#notes-panel.drawer-panel,
#notification-panel.drawer-panel {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    left: auto !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform: translate3d(0, 0, 0) !important;
}

#notes-panel.drawer-panel {
    width: min(470px, calc(100vw - 24px)) !important;
}

#notification-panel.drawer-panel {
    width: min(430px, calc(100vw - 24px)) !important;
}

#notes-panel.drawer-panel.translate-x-full,
#notification-panel.drawer-panel.translate-x-full {
    pointer-events: none !important;
    opacity: 0 !important;
    transform: translate3d(calc(100% + 44px), 0, 0) !important;
}

#notes-panel.drawer-panel:not(.translate-x-full),
#notification-panel.drawer-panel:not(.translate-x-full) {
    pointer-events: auto !important;
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
}

#notification-panel .drawer-panel__hero,
#notes-panel .drawer-panel__hero {
    flex: 0 0 auto;
}

#notification-panel .notification-summary {
    flex: 0 0 auto;
}

#notification-panel #notification-list.notification-list {
    flex: 1 1 auto;
    min-height: 0 !important;
    overflow: auto !important;
}

#notification-panel .notification-empty {
    margin: 0;
    min-height: min(360px, calc(100dvh - 240px));
}

@media (max-width: 700px) {
    #notes-panel.drawer-panel,
    #notification-panel.drawer-panel {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    #notes-panel.drawer-panel.translate-x-full,
    #notification-panel.drawer-panel.translate-x-full {
        transform: translate3d(calc(100% + 32px), 0, 0) !important;
    }
}

/* Compact notification drawer final tuning */
#notification-panel.drawer-panel {
    width: min(380px, calc(100vw - 20px)) !important;
}

#notification-panel .drawer-panel__hero {
    grid-template-columns: 38px minmax(0, 1fr) 36px !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 14px 16px !important;
}

#notification-panel .drawer-panel__icon {
    width: 38px !important;
    height: 38px !important;
}

#notification-panel .drawer-panel__hero .eyebrow {
    font-size: .68rem !important;
    letter-spacing: .09em !important;
}

#notification-panel .drawer-panel__hero h2 {
    margin-top: 2px !important;
    font-size: 1.22rem !important;
    line-height: 1.08 !important;
}

#notification-panel .drawer-panel__hero p {
    margin-top: 4px !important;
    font-size: .82rem !important;
}

#notification-panel #close-notification-panel.drawer-panel__close {
    width: 36px !important;
    height: 36px !important;
}

#notification-panel .notification-summary {
    margin: 10px 12px 0 !important;
    padding: 9px 10px !important;
    font-size: .8rem !important;
}

#notification-panel .notification-summary strong {
    width: 26px !important;
    height: 26px !important;
    border-radius: 8px !important;
    font-size: .82rem !important;
}

#notification-panel #notification-list.notification-list {
    align-content: start !important;
    align-items: start !important;
    grid-auto-rows: max-content !important;
    gap: 10px !important;
    padding: 12px !important;
}

#notification-panel .notification-card {
    width: 100%;
    align-self: start !important;
    gap: 10px !important;
    padding: 12px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .055) !important;
}

#notification-panel .notification-card__icon {
    width: 34px !important;
    height: 34px !important;
}

#notification-panel .notification-card__content {
    gap: 4px !important;
    padding-right: 58px !important;
}

#notification-panel .notification-card__meta {
    gap: 6px !important;
}

#notification-panel .notification-card__meta span {
    font-size: .78rem !important;
}

#notification-panel .notification-card__meta small {
    font-size: .76rem !important;
}

#notification-panel .notification-card h3 {
    font-size: .94rem !important;
    line-height: 1.25 !important;
}

#notification-panel .notification-card p,
#notification-panel .notification-card strong {
    font-size: .8rem !important;
    line-height: 1.38 !important;
}

#notification-panel .notification-card__action {
    top: 10px !important;
    right: 10px !important;
    min-width: 48px !important;
    height: 28px !important;
    padding: 0 7px !important;
    font-size: .72rem !important;
}

#notification-panel .notification-empty {
    min-height: 180px !important;
    padding: 22px 16px !important;
}

#notification-panel .notification-empty__icon {
    width: 44px !important;
    height: 44px !important;
}

#notification-panel .notification-empty strong {
    font-size: 1rem !important;
}

@media (max-width: 700px) {
    #notification-panel.drawer-panel {
        top: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        left: 10px !important;
        width: auto !important;
        height: calc(100dvh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        border: 1px solid rgba(203, 213, 225, .82) !important;
        border-radius: 8px !important;
    }

    #notification-panel .drawer-panel__hero {
        grid-template-columns: 36px minmax(0, 1fr) 34px !important;
        padding: 12px 14px !important;
    }

    #notification-panel .drawer-panel__icon {
        width: 36px !important;
        height: 36px !important;
    }

    #notification-panel .drawer-panel__hero h2 {
        font-size: 1.1rem !important;
    }

    #notification-panel .drawer-panel__hero p {
        font-size: .78rem !important;
    }

    #notification-panel .notification-card {
        grid-template-columns: 32px minmax(0, 1fr) !important;
    }

    #notification-panel .notification-card__content {
        padding-right: 0 !important;
    }

    #notification-panel .notification-card__action {
        position: static !important;
        grid-column: 2 !important;
        justify-self: start !important;
        width: auto !important;
        margin-top: 4px !important;
    }
}

/* Calendar, letters and announcements */
.app-announcements {
    width: min(1220px, calc(100% - 32px));
    margin: 14px auto 0;
    display: grid;
    gap: 10px;
}

.app-announcement {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(191, 219, 254, .95);
    border-radius: 8px;
    color: #1e3a8a;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.app-announcement strong { font-size: .92rem; }
.app-announcement p { margin: 0; color: #475467; font-size: .86rem; line-height: 1.5; }

.calendar-actions,
.letter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-toolbar {
    margin-bottom: 16px;
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.calendar-grid-panel {
    overflow: hidden;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    gap: 6px;
    margin-bottom: 8px;
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-weekdays span {
    padding: 0 4px;
}

.calendar-grid {
    gap: 6px;
}

.calendar-day {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, .94);
    border-radius: 8px;
    background: #fff;
}

.calendar-day--muted {
    background: #f8fafc;
    border-style: dashed;
}

.calendar-day--today {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.calendar-day__number {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #0f172a;
    font-size: .84rem;
    font-weight: 800;
}

.calendar-day--today .calendar-day__number {
    color: #fff;
    background: #2563eb;
}

.calendar-day__events {
    display: grid;
    gap: 5px;
}

.calendar-event {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid rgba(203, 213, 225, .86);
    color: #334155;
    background: #f8fafc;
    text-decoration: none;
    font-size: .76rem;
    line-height: 1.2;
}

.calendar-event span { font-weight: 800; }
.calendar-event strong { color: #64748b; font-size: .68rem; }
.calendar-event--date_limite { border-color: #fecaca; background: #fff5f5; color: #991b1b; }
.calendar-event--date_entretien { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.calendar-event--date_resultat { border-color: #99f6e4; background: #f0fdfa; color: #0f766e; }

.calendar-side .app-panel {
    position: sticky;
    top: 88px;
}

.calendar-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.calendar-list-item {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 8px;
    color: #0f172a;
    background: #fff;
    text-decoration: none;
}

.calendar-list-item span { color: #2563eb; font-size: .78rem; font-weight: 800; }
.calendar-list-item strong { font-size: .9rem; }
.calendar-list-item small { color: #64748b; font-size: .78rem; }

.letter-workspace {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.letter-sidebar {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 14px;
}

.letter-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.letter-stats span,
.letter-save-state {
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 8px;
    color: #64748b;
    background: #f8fafc;
    font-size: .8rem;
}

.letter-stats strong { display: block; color: #0f172a; font-size: 1.15rem; }
.letter-save-state.is-saving { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.letter-save-state.is-success { color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.letter-save-state.is-error { color: #991b1b; border-color: #fecaca; background: #fff5f5; }

.letter-template-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    color: #64748b;
    font-size: .84rem;
    font-weight: 800;
}

.letter-editor {
    min-height: 820px;
    max-width: 780px;
    margin: 0 auto;
    padding: 64px 70px;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 8px;
    color: #111827;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    font-family: "Times New Roman", Times, serif;
    font-size: 11pt;
    line-height: 1.35;
    outline: none;
}

.letter-editor:focus {
    border-color: #bfdbfe;
    box-shadow: 0 20px 50px rgba(37, 99, 235, .12);
}

.letter-editor p { margin: 0 0 10pt; }

.admin-announcement-form textarea {
    min-height: 150px;
}

@media (max-width: 980px) {
    .calendar-layout,
    .letter-workspace {
        grid-template-columns: 1fr;
    }

    .calendar-side .app-panel,
    .letter-sidebar {
        position: static;
    }
}

@media (max-width: 700px) {
    .calendar-actions,
    .letter-actions {
        justify-content: stretch;
    }

    .calendar-actions .app-btn,
    .letter-actions .app-btn {
        width: 100%;
    }

    .calendar-weekdays {
        display: none;
    }

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

    .calendar-day--muted {
        display: none;
    }

    .calendar-day {
        min-height: auto;
    }

    .letter-editor {
        min-height: 620px;
        padding: 32px 22px;
        font-size: 10.5pt;
    }
}

