/* ── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.5;
}

body { background: #f0f3f8; color: #0f172a; }

/* ── CSS VARIABLES ───────────────────────────────────────────────────────── */
:root {
    --c-sidebar-bg:          #0f1829;
    --c-sidebar-border:      #1a2840;
    --c-sidebar-text:        rgba(255,255,255,0.45);
    --c-sidebar-text-active: #e2e8f0;
    --c-sidebar-item-active: rgba(59,130,246,0.18);
    --c-sidebar-accent:      #3b82f6;

    --c-bg:            #f0f3f8;
    --c-surface:       #ffffff;
    --c-border:        #e8edf4;
    --c-border-hover:  #d1d9e6;

    --c-primary:       #2563eb;
    --c-primary-hover: #1d4ed8;
    --c-primary-light: #eff6ff;
    --c-accent:        #d97706;
    --c-accent-light:  #fffbeb;

    --c-text:          #0f172a;
    --c-text-secondary:#475569;
    --c-text-muted:    #94a3b8;

    --c-success:       #059669;
    --c-success-light: #ecfdf5;
    --c-warning:       #d97706;
    --c-warning-light: #fffbeb;
    --c-danger:        #dc2626;
    --c-danger-light:  #fef2f2;

    --shadow-sm: 0 1px 3px rgba(15,24,41,0.06), 0 1px 2px rgba(15,24,41,0.04);
    --shadow-md: 0 4px 12px rgba(15,24,41,0.08), 0 2px 4px rgba(15,24,41,0.05);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
}

/* ── TYPOGRAPHY ──────────────────────────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; }
h1:focus { outline: none; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: 'DM Mono', monospace; }

/* ── SCROLLBARS ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ── INTERACTIVE ─────────────────────────────────────────────────────────── */
button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* ── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1;   }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spin-ring {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff; border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── APP SHELL ───────────────────────────────────────────────────────────── */
#app { height: 100vh; }

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    background: #f0f3f8;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #0f1829;
    border-right: 1px solid #1a2840;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-logo {
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-text .name {
    font-size: 15px; font-weight: 700;
    color: #e2e8f0; line-height: 1.1; letter-spacing: -0.01em;
}
.sidebar-logo-text .sub {
    font-size: 10.5px; font-weight: 500;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.1em; text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

.sidebar-section {
    padding: 10px 20px 4px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(255,255,255,0.2);
}

.sidebar-sep { height: 6px; }

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin: 1px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
    font-size: 13.5px;
    transition: all 0.1s ease;
    position: relative;
    user-select: none;
    text-decoration: none;
    background: transparent;
    border: none;
    width: calc(100% - 16px);
    text-align: left;
    font-family: inherit;
}
.sidebar-item:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.05);
    text-decoration: none;
}
.sidebar-item.active {
    color: #e2e8f0;
    background: rgba(59,130,246,0.18);
    font-weight: 500;
}
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: -8px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    border-radius: 0 3px 3px 0;
    background: #3b82f6;
}

.sidebar-user {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .name {
    font-size: 13px; font-weight: 500;
    color: #cbd5e1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .role {
    font-size: 11px;
    color: rgba(255,255,255,0.28);
}

/* ── AVATAR ──────────────────────────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
.topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e8edf4;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
}

.topbar-breadcrumb .season {
    font-size: 13px; color: #94a3b8; letter-spacing: -0.01em;
}
.topbar-breadcrumb .page {
    font-size: 13px; font-weight: 500; color: #0f172a;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switcher {
    display: flex;
    border-radius: 5px;
    border: 1px solid #e8edf4;
    overflow: hidden;
    background: #f8fafc;
}
.lang-switcher button {
    padding: 4px 10px;
    font-size: 11.5px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.topbar-bell {
    background: none; border: none; cursor: pointer;
    padding: 4px; color: #94a3b8; position: relative;
}
.topbar-bell .dot {
    position: absolute; top: 2px; right: 2px;
    width: 7px; height: 7px; border-radius: 50%;
    background: #ef4444; border: 1.5px solid #fff;
}

.topbar-user {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.topbar-user .name {
    font-size: 13.5px; font-weight: 500; color: #1e293b;
}

.topbar-signout {
    display: flex; align-items: center; gap: 5px;
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 13px; font-family: inherit; padding: 4px;
}
.topbar-signout:hover { color: #64748b; }

/* ── EMPTY LAYOUT ────────────────────────────────────────────────────────── */
.empty-layout {
    min-height: 100vh;
    overflow-y: auto;
}

/* ── ERROR UI ────────────────────────────────────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: #fef2f2;
    color: #991b1b;
    bottom: 0; left: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.1);
    box-sizing: border-box;
    display: none;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "Une erreur s'est produite."; }

/* ── FORM UTILITIES ──────────────────────────────────────────────────────── */
.field-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid #d1d9e6;
    border-radius: 7px;
    outline: none;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s;
}
.field-input:focus { border-color: #2563eb; }
.field-label {
    display: block;
    font-size: 12.5px; font-weight: 600;
    color: #374151; margin-bottom: 6px;
    letter-spacing: 0.015em;
}
.validation-message { color: #dc2626; font-size: 12px; margin-top: 4px; }

/* ── ASSIGNATION CHIP HOVER ─────────────────────────────────────────────── */
.chip-assignable:hover {
    background: #f8fafc !important;
    border-color: #d1d9e6 !important;
}

/* ── LIST ROW HOVER ──────────────────────────────────────────────────────── */
.list-row:hover { background: #f8fafc; }

/* ── LANDING PAGE CARD ANIMATIONS ───────────────────────────────────────── */
@keyframes slideInLeft {
    from { opacity: 0; transform: rotate(-3deg) translateY(40px) translateX(-40px); }
    to   { opacity: 0.75; transform: rotate(-3deg) translateY(20px) translateX(0); }
}
@keyframes slideInUp {
    from { opacity: 0; transform: rotate(1deg) translateY(60px); }
    to   { opacity: 1; transform: rotate(1deg) translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateY(80px) translateX(60px); }
    to   { opacity: 1; transform: translateY(0) translateX(0); }
}

/* ── LOADING PLACEHOLDER ─────────────────────────────────────────────────── */
.loading-placeholder {
    color: #94a3b8;
    font-size: 14px;
    padding: 40px;
    text-align: center;
}
