/* =============================================
   La Route — Back-office CSS
   ============================================= */

:root {
    --brand:    #0097B2;
    --brand-dk: #007A92;
    --dark:     #1A1714;
    --mid:      #3D3830;
    --muted:    #6B6560;
    --light:    #9A948F;
    --bg:       #F5F2EC;
    --bg-alt:   #EDEAE3;
    --white:    #FFFFFF;
    --border:   #E0DCD4;
    --warn:     #E8650A;
    --success:  #2A9D5C;
    --error:    #C0392B;

    --radius:   8px;
    --radius-sm:4px;
    --shadow:   0 2px 12px rgba(0,0,0,.07);
    --shadow-lg:0 4px 24px rgba(0,0,0,.10);

    --sidebar-w: 220px;
    --topbar-h:  60px;

    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-base: 14px;
}

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

html { font-size: var(--font-size-base); }

body {
    font-family: var(--font);
    color: var(--dark);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

/* ─── Login layout ─────────────────────────── */

.layout-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}
.login-logo img { height: 72px; }

.login-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    margin-bottom: 4px;
}

.login-sub {
    font-size: .875rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 28px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.field__password-wrap { position: relative; }
.field__password-wrap .field__input { padding-right: 46px; }
.field__eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark);
    padding: 6px;
    display: flex;
    align-items: center;
    opacity: 0.6;
}
.field__eye:hover { opacity: 1; }
.field__eye svg { width: 20px; height: 20px; display: block; }

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: .8125rem;
    color: var(--muted);
}

/* ─── Admin layout ─────────────────────────── */

.layout-admin {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar__brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__logo { height: 64px; display: block; }
.sidebar__label {
    display: block;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    margin-top: 6px;
}

.sidebar__nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.65);
    font-size: .875rem;
    border-radius: 0;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__link:hover { background: rgba(255,255,255,.06); color: var(--white); text-decoration: none; }
.sidebar__link.active { background: rgba(0,151,178,.2); color: var(--brand); }

.sidebar__user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { display: block; font-size: .875rem; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { display: block; font-size: .75rem; color: rgba(255,255,255,.4); }
.sidebar__logout { color: rgba(255,255,255,.4); display: flex; }
.sidebar__logout svg { width: 18px; height: 18px; }
.sidebar__logout:hover { color: var(--white); text-decoration: none; }

/* Main content */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}
.topbar__title { font-size: 1rem; font-weight: 600; color: var(--dark); }
.topbar__date { font-size: .8125rem; color: var(--muted); }

.page-body { padding: 28px 32px; flex: 1; }

/* ─── Candidate layout ─────────────────────── */

.layout-candidate { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }

.cand-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.cand-header__logo img { height: 48px; display: block; }
.cand-nav { display: flex; gap: 4px; flex: 1; }
.cand-nav__link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: var(--mid);
    text-decoration: none;
    transition: background .15s, color .15s;
    position: relative;
}
.cand-nav__link:hover { background: var(--bg-alt); text-decoration: none; }
.cand-nav__link.active { color: var(--brand); font-weight: 500; }
.cand-header__logout { font-size: .8125rem; color: var(--muted); }
.cand-header__logout:hover { color: var(--dark); }

.cand-main { flex: 1; padding: 32px 28px; max-width: 860px; margin: 0 auto; width: 100%; }

.cand-footer {
    text-align: center;
    padding: 20px;
    font-size: .8125rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}
.cand-footer a { color: var(--muted); }
.cand-footer a:hover { color: var(--brand); }

/* ─── Public layout ────────────────────────── */

.layout-public { min-height: 100vh; background: var(--bg); }
.pub-header { background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 32px; }
.pub-header__logo { height: 32px; }

.pub-form-wrap { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }
.pub-form-intro { margin-bottom: 32px; }
.pub-form-intro__title { font-size: 1.75rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.pub-form-intro__sub { font-size: 1rem; color: var(--muted); line-height: 1.65; }

/* ─── Form primitives ──────────────────────── */

.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: .8125rem; font-weight: 500; color: var(--mid); }
.field__hint { font-size: .75rem; color: var(--muted); }
.field__static { font-size: .9375rem; color: var(--dark); padding: 8px 0; }
.field__checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: .875rem; color: var(--dark); cursor: pointer; line-height: 1.5; }
.field__checkbox input[type=checkbox] { margin-top: 3px; flex-shrink: 0; accent-color: var(--brand); width: 15px; height: 15px; }

.field__input,
.field__select,
.field__textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9375rem;
    font-family: var(--font);
    color: var(--dark);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,151,178,.12);
}
.field__textarea { resize: vertical; min-height: 80px; }
.field__select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B6560'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 8px; padding-right: 32px; }

.field-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .9rem;
    color: var(--mid);
    line-height: 1.6;
    cursor: pointer;
}
.field-check input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--brand);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.req { color: var(--brand); }

.form-grid { display: grid; gap: 16px; }
.form-grid--1 { grid-template-columns: 1fr; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }
.form-grid--full { grid-column: 1 / -1; }

.form-section {
    border: none;
    padding: 0;
    margin-bottom: 32px;
}
.form-section__title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.form-actions { display: flex; gap: 12px; align-items: center; padding-top: 8px; }

.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: var(--shadow);
}

.form-page__title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 24px;
}
.form-page__hint { font-size: .875rem; color: var(--muted); margin-top: 16px; }

/* ─── Buttons ──────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: .9375rem;
    font-weight: 500;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn--primary  { background: var(--brand); color: var(--white); }
.btn--dark     { background: var(--dark); color: var(--white); }
.btn--ghost    { background: var(--bg-alt); color: var(--mid); border: 1px solid var(--border); }
.btn--sm       { padding: 6px 13px; font-size: .8125rem; }
.btn--lg       { padding: 14px 28px; font-size: 1rem; }
.btn--full     { width: 100%; }

/* ─── Alerts ───────────────────────────────── */

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 20px;
    line-height: 1.55;
}
.alert--success { background: #D4EDDA; color: #155724; }
.alert--error   { background: #FDECEA; color: var(--error); }
.alert--info    { background: #D6EFF5; color: #0A5265; }
.alert--warn    { background: #FFF3CD; color: #7B5E0A; }

/* ─── Cards ────────────────────────────────── */

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card__title {
    font-size: .8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 14px;
}
.card__hint { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.card__badge-row { margin-bottom: 14px; }
.card--messages { padding-bottom: 0; }

/* ─── Stats grid ───────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    border-left: 3px solid transparent;
}
.stat-card--accent { border-left-color: var(--brand); }
.stat-card--warn   { border-left-color: var(--warn); }
.stat-card__value  { font-size: 2rem; font-weight: 700; color: var(--dark); line-height: 1; margin-bottom: 4px; }
.stat-card__label  { font-size: .8125rem; color: var(--muted); }

/* ─── Tables ───────────────────────────────── */

.table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.table--full { width: 100%; }

.table thead { background: var(--bg); }
.table th {
    padding: 10px 14px;
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--bg-alt);
    color: var(--dark);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FAFAF8; }
.tr-link { cursor: pointer; }
.td-name { font-weight: 500; }
.td-date { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.td-empty { text-align: center; color: var(--muted); padding: 28px !important; }

/* ─── Dashboard layout ─────────────────────── */

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}
.dash-block {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.dash-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-alt);
}
.dash-block__title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--dark);
}
.link-small { font-size: .8125rem; color: var(--brand); }
.link-action { font-size: .8125rem; color: var(--brand); white-space: nowrap; }
.link-action:hover { text-decoration: underline; }

/* Message list (dashboard) */
.msg-list { display: flex; flex-direction: column; }
.msg-item {
    display: block;
    padding: 14px 20px;
    border-bottom: 1px solid var(--bg-alt);
    text-decoration: none;
    transition: background .12s;
}
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: var(--bg); text-decoration: none; }
.msg-item--unread { background: #F0F9FB; }
.msg-item__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.msg-item__who   { font-size: .8125rem; font-weight: 600; color: var(--dark); }
.msg-item__project { font-size: .75rem; color: var(--muted); }
.msg-item__date  { font-size: .75rem; color: var(--light); margin-left: auto; }
.msg-item__preview { font-size: .8125rem; color: var(--muted); line-height: 1.4; }

/* ─── Filters bar ──────────────────────────── */

.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filters-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.filter-select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: var(--font);
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
}
.filter-search { display: flex; gap: 6px; }
.filter-input {
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: var(--font);
    width: 200px;
}
.filter-input:focus { outline: none; border-color: var(--brand); }
.filters-count { font-size: .8125rem; color: var(--muted); white-space: nowrap; }

/* ─── Entrepreneur avatar ──────────────────── */

.entrepreneur-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.entrepreneur-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.entrepreneur-name { font-size: 1rem; font-weight: 600; color: var(--dark); }
.entrepreneur-city { font-size: .8125rem; color: var(--muted); margin-top: 2px; }

/* ─── Project detail layout ────────────────── */

.back-link { margin-bottom: 20px; font-size: .875rem; }
.back-link a { color: var(--muted); }
.back-link a:hover { color: var(--brand); }

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    align-items: start;
}
.detail-left, .detail-right { display: flex; flex-direction: column; gap: 0; }

/* Info list */
.info-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.info-list--spacious { gap: 12px 16px; }
.info-list dt { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.info-list dd { font-size: .9rem; color: var(--dark); }
.initial-msg { background: var(--bg); border-left: 3px solid var(--brand); padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; }

/* Statut form */
.status-form { margin-top: 12px; }
.status-form .field__select { margin-top: 6px; }

/* Tags */
.tags-current { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tags-edit summary { cursor: pointer; list-style: none; font-size: .8125rem; color: var(--brand); }
.tags-form { margin-top: 12px; }
.tags-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tag-check { display: flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--mid); cursor: pointer; }
.tag-check input { accent-color: var(--brand); }

/* ─── Badges ───────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 500;
    background: var(--bg-alt);
    color: var(--mid);
    white-space: nowrap;
}
.badge--lg { font-size: .875rem; padding: 5px 12px; }
.badge--inline { position: absolute; top: -5px; right: -8px; }
.badge--private { background: #FFF0E8; color: var(--warn); }
.badge--unread  { background: var(--warn); color: var(--white); }

/* Statut badges */
.badge--candidature_recue     { background: #D6EFF5; color: #0A5265; }
.badge--a_qualifier            { background: #FFF3CD; color: #7B5E0A; }
.badge--premier_echange_prevu  { background: #E8F4FD; color: #1A5276; }
.badge--en_analyse             { background: #E8F6F0; color: #1A6640; }
.badge--accompagnement_actif   { background: #D5F0E3; color: var(--success); font-weight: 600; }
.badge--en_pause               { background: var(--bg-alt); color: var(--muted); }
.badge--non_retenu             { background: #FDECEA; color: var(--error); }
.badge--archive                { background: var(--bg-alt); color: var(--light); }

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 50px;
    font-size: .75rem;
    background: var(--bg);
    color: var(--mid);
    border: 1px solid var(--border);
}

/* ─── Thread / Messages ────────────────────── */

.thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 0;
    max-height: 420px;
    overflow-y: auto;
}
.thread--full { max-height: none; padding: 0; margin-bottom: 24px; }

.bubble { max-width: 88%; }
.bubble--admin   { align-self: flex-start; }
.bubble--candidat { align-self: flex-end; }

.bubble__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.bubble__who  { font-size: .75rem; font-weight: 600; color: var(--muted); }
.bubble__date { font-size: .75rem; color: var(--light); }
.bubble__read   { font-size: .7rem; color: var(--success); margin-left: auto; }
.bubble__unread { font-size: .7rem; color: var(--muted); margin-left: auto; }

.bubble__content {
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: .9rem;
    line-height: 1.6;
}
.bubble--admin .bubble__content  { background: var(--bg-alt); color: var(--dark); }
.bubble--candidat .bubble__content { background: var(--brand); color: var(--white); }

.thread-empty { text-align: center; padding: 32px 20px; color: var(--muted); }
.thread-empty p { margin-bottom: 6px; }

.send-form {
    border-top: 1px solid var(--border);
    padding: 16px 0 20px;
    margin-top: 8px;
}

.reply-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    margin-top: 24px;
}

/* ─── Candidate home cards ─────────────────── */

.cand-home { display: flex; flex-direction: column; gap: 28px; }
.cand-welcome__title { font-size: 1.5rem; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.cand-welcome__sub { color: var(--muted); }

.cand-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.cand-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
}
.cand-card--alert { border-left: 3px solid var(--warn); }
.cand-card__label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.cand-card__value { font-size: 1.1rem; font-weight: 600; color: var(--dark); margin-bottom: 8px; }

.cand-nav-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.cand-nav-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: box-shadow .15s, transform .12s;
    position: relative;
}
.cand-nav-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); text-decoration: none; }
.cand-nav-card--alert { border-left: 3px solid var(--warn); }
.cand-nav-card__icon { width: 44px; height: 44px; color: var(--brand); position: relative; }
.cand-nav-card__icon svg { width: 100%; height: 100%; }
.cand-nav-card__label { font-size: .9rem; font-weight: 500; color: var(--dark); }

/* Messages page */
.messages-page { display: flex; flex-direction: column; }

/* ─── Crop modal ───────────────────────────── */

#crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.72);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.crop-box {
    background: var(--white);
    border-radius: 14px;
    width: min(580px, 100%);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow: hidden;
}

.crop-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.crop-box__title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--dark);
}

.crop-box__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    display: flex;
    border-radius: var(--radius-sm);
    transition: color .15s;
}
.crop-box__close:hover { color: var(--dark); }

.crop-canvas-wrap {
    flex: 1;
    height: 340px;
    overflow: hidden;
    background: #111;
    position: relative;
}

/* Circular mask overlay for square crops */
.crop-wrap--round .cropper-view-box,
.crop-wrap--round .cropper-face {
    border-radius: 50%;
}

.crop-hint {
    padding: 10px 20px 6px;
    font-size: .78rem;
    color: var(--muted);
    text-align: center;
    flex-shrink: 0;
}

.crop-zoom-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 20px 12px;
    flex-shrink: 0;
    color: var(--muted);
}

.crop-zoom-bar input[type="range"] {
    flex: 1;
    accent-color: var(--brand);
    cursor: pointer;
}

.crop-box__actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ─── Upload photo / logo ──────────────────── */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.upload-form {
    margin-top: 12px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.upload-label input[type="file"] {
    display: block;
    font-size: .85rem;
    color: var(--muted);
    cursor: pointer;
    padding: 8px 0;
}

.upload-hint {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.4;
}

.upload-preview-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.entrepreneur-avatar--lg {
    width: 80px;
    height: 80px;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.entrepreneur-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.logo-preview {
    margin-top: 12px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: inline-block;
}

.logo-preview__img {
    display: block;
    max-height: 100px;
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* ─── Delete button ────────────────────────── */

.btn--danger {
    background: var(--error);
    color: var(--white);
    border: none;
}

.btn--danger:hover {
    background: #a83226;
}

/* ─── Misc helpers ─────────────────────────── */

.text-muted { color: var(--muted); }
.badge--status { }

/* ─── Responsive ───────────────────────────── */

@media (max-width: 900px) {
    .layout-admin { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
    .detail-layout { grid-template-columns: 1fr; }
    .cand-cards, .cand-nav-cards { grid-template-columns: 1fr; }
    .form-grid--2 { grid-template-columns: 1fr; }
    .tags-checkboxes { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   SPRINT 2 — Styles
   ══════════════════════════════════════════════ */

[x-cloak] { display: none !important; }

/* ─── Flash messages ───────────────────────── */

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .875rem;
    font-weight: 500;
}
.flash--success { background: #d4edda; color: #155724; }
.flash--error   { background: #f8d7da; color: #721c24; }
.flash--info    { background: #d1ecf1; color: #0c5460; }
.flash--warn    { background: #fff3cd; color: #856404; }

/* ─── Projet tabs ──────────────────────────── */

.project-tabs-wrap { margin-top: 8px; }

.project-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
}
.project-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    background: none;
    border: none;
    padding: 10px 18px;
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-btn:hover { color: var(--dark); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }

.tab-count {
    background: var(--bg-alt);
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
}
.tab-btn.active .tab-count { background: var(--brand); color: #fff; }

.tab-content { }

/* ─── S2 Blocks (inline edit) ──────────────── */

.s2-block { margin-bottom: 20px; }

.s2-block__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.s2-subblock {
    position: relative;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.s2-subblock:first-of-type { border-top: none; }

.s2-subblock__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.s2-subblock__label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

/* ─── Edit icons ────────────────────────────── */

.btn-edit {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: color .15s, border-color .15s, background .15s;
    flex-shrink: 0;
}
.btn-edit:hover { color: var(--brand); border-color: var(--brand); background: rgba(0,151,178,.06); }

.btn-edit--float {
    position: absolute;
    top: 12px;
    right: 0;
}

.btn-delete {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    cursor: pointer;
    color: var(--error);
    font-size: 1rem;
    line-height: 1;
    transition: background .15s;
}
.btn-delete:hover { background: #fdf0ef; }

/* ─── Edit grid & actions ───────────────────── */

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 600px) { .edit-grid { grid-template-columns: 1fr; } }

.edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ─── info-list compact ─────────────────────── */

.info-list--compact dt { font-size: .8rem; }
.info-list--compact dd { margin-bottom: 10px; font-size: .875rem; }

/* ─── Priority badges ───────────────────────── */

.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 600;
}
.priority-low    { background: #e8f5e9; color: #2e7d32; }
.priority-medium { background: #fff8e1; color: #f57f17; }
.priority-high   { background: #fdecea; color: #c62828; }

.text-overdue { color: var(--error); font-weight: 600; font-size: .8rem; }

/* ─── Comptes-rendus ────────────────────────── */

.cr-new-wrap { margin-bottom: 20px; }

.cr-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.cr-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

.cr-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.cr-item--candidate { background: var(--white); }

.cr-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    gap: 8px;
    flex-wrap: wrap;
}
.cr-item__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-item__actions { display: flex; gap: 6px; }
.cr-item__body { padding: 12px 16px; font-size: .875rem; line-height: 1.6; }
.cr-item__body p { margin-bottom: 8px; }

.badge--vis { font-size: .68rem; }
.badge--internal { background: #f3f4f6; color: #6b7280; }
.badge--shared   { background: #dbeafe; color: #1d4ed8; }

/* ─── Documents ─────────────────────────────── */

.doc-upload-form { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }

.field__file {
    display: block;
    font-size: .875rem;
    color: var(--muted);
    padding: 8px 0;
    cursor: pointer;
}

.doc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.doc-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.doc-item__info { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.doc-item__name { font-weight: 500; color: var(--brand); }
.doc-item__name:hover { text-decoration: underline; }
.doc-item__actions { display: flex; gap: 6px; margin-top: 8px; }
.doc-edit-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ─── Profil public ─────────────────────────── */

.pp-status-bar { margin-bottom: 20px; }

.badge--pp-not_started          { background: #f3f4f6; color: #6b7280; }
.badge--pp-draft_candidate      { background: #fef3c7; color: #92400e; }
.badge--pp-submitted_for_review { background: #dbeafe; color: #1e40af; }
.badge--pp-needs_changes        { background: #fde8e8; color: #9b1c1c; }
.badge--pp-approved_internal    { background: #d1fae5; color: #065f46; }

.form-section { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-section__title { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; }

/* ─── Activité ──────────────────────────────── */

.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }

.activity-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    margin-top: 5px;
    flex-shrink: 0;
}
.activity-item__content { flex: 1; font-size: .875rem; }
.activity-item__label { color: var(--dark); }
.activity-item__time { display: block; font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ─── Projects list — priority & next action ── */

.col-priority { width: 80px; }
.col-action   { width: 200px; }

.next-action-cell { font-size: .8rem; }
.next-action-cell .due { font-size: .73rem; color: var(--muted); }
.next-action-cell .due.overdue { color: var(--error); font-weight: 600; }

/* ─── Topbar actions ────────────────────────── */

.topbar-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

/* ─── Form page sub ─────────────────────────── */

.form-page__sub { color: var(--muted); margin-bottom: 24px; margin-top: -8px; }


/* ─── Dashboard Sprint 2 additions ──────────── */

.stats-grid { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

.dash-block--alert { border: 1px solid #fde68a; background: #fffbeb; }
.dash-block--alert .dash-block__title { color: #92400e; }

.dash-alert-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dash-alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: .875rem;
    flex-wrap: wrap;
}
.dash-alert-item:hover { border-color: var(--brand); text-decoration: none; }
