:root {
    --ink: #0f1e2e;
    --ink-2: #182838;
    --muted: #6b7280;
    --line: #e5e7eb;
    --cream: #f5f1ea;
    --paper: #fafaf7;
    --white: #ffffff;
    --orange: #ff6b35;
    --green: #00c896;
    --red: #ff3b30;
    --yellow: #ffb800;
    --blue: #2563eb;
    font-family: Manrope, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.bp-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.bp-app.is-guest {
    display: block;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgb(255 107 53 / 14%), transparent 28%),
        linear-gradient(135deg, #f7f3ec 0%, #eef4f7 100%);
}

.bp-app.is-guest .bp-sidebar,
.bp-app.is-guest .bp-topbar,
.bp-app.is-guest .mobile-nav {
    display: none;
}

.bp-app.is-guest .bp-main {
    width: min(100%, 980px);
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 28px;
}

.bp-app.is-guest .auth-screen.active {
    width: 100%;
}

.bp-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #0b1724;
    color: var(--paper);
    border-right: 1px solid rgb(255 255 255 / 8%);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 8px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: .01em;
}

.bp-brand::before {
    content: "";
    width: 10px;
    height: 24px;
    border-radius: 999px;
    background: var(--orange);
}

.bp-brand span { color: var(--orange); }
.bp-brand.large { font-size: 38px; }
.login-hero .bp-brand::before { display: none; }

.bp-side-nav button {
    position: relative;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #b8c4d2;
    min-height: 40px;
    text-align: left;
    padding: 0 12px 0 18px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 820;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.bp-side-nav button::before {
    content: "";
    position: absolute;
    left: 8px;
    width: 3px;
    height: 16px;
    border-radius: 999px;
    background: transparent;
    transition: background .16s ease, height .16s ease;
}

.bp-side-nav button.active {
    background: rgb(255 255 255 / 11%);
    color: white;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%);
}

.bp-side-nav button.active::before {
    background: var(--orange);
    height: 22px;
}

.bp-side-nav button:hover {
    background: rgb(255 255 255 / 8%);
    color: white;
}

.bp-side-nav {
    display: grid;
    gap: 2px;
    overflow-y: auto;
}
.nav-group {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-top: 1px solid rgb(255 255 255 / 8%);
}

.nav-group:first-child {
    border-top: 0;
    padding-top: 0;
}

.nav-group summary {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    color: #93a4b7;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 0 12px;
    border-radius: 10px;
}

.nav-group summary:hover,
.nav-group[open] summary {
    color: white;
    background: rgb(255 255 255 / 6%);
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group summary::after {
    content: "";
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgb(255 255 255 / 8%);
    background-image:
        linear-gradient(45deg, transparent 47%, #9fb0c3 48%, #9fb0c3 56%, transparent 57%),
        linear-gradient(-45deg, transparent 47%, #9fb0c3 48%, #9fb0c3 56%, transparent 57%);
    background-position: 7px 5px, 7px 9px;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    transform: rotate(0deg);
    transition: transform .16s ease, background .16s ease;
}

.nav-group[open] summary::after {
    transform: rotate(90deg);
}
.bp-main {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 24px 28px 96px;
}

.bp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.bp-topbar p { margin: 0 0 4px; color: var(--orange); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.bp-topbar .app-message {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}
.bp-topbar h1 { margin: 0; font-size: 30px; line-height: 1.05; }

.workflow-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.workflow-breadcrumb[hidden] {
    display: none;
}

.workflow-breadcrumb i {
    color: #9ca3af;
    font-style: normal;
}

.workflow-breadcrumb .current {
    color: var(--ink);
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 1px 3px rgb(15 30 46 / 8%);
}

.screen { display: none; }
.screen.active { display: block; animation: rise .15s ease-out; }

@keyframes rise {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel,
.card,
.profile-card,
.pointage-card,
.detail-hero,
.hero-panel,
.map-panel,
.thread-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgb(15 30 46 / 7%);
}

.auth-screen {
    max-width: 760px;
    margin: 40px auto;
}

.login-hero {
    background: var(--ink);
    color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 14px;
}
.login-hero h2 { max-width: 520px; margin: 16px 0 8px; font-size: 28px; }
.login-hero p { color: #cbd5e1; margin: 0; }
.invite-note {
    margin-top: 12px !important;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgb(255 107 53 / 18%);
    color: white !important;
    font-weight: 800;
}

.auth-compact {
    grid-template-columns: 1fr;
}

.guided-form {
    padding: 0;
    display: grid;
    gap: 0;
    overflow: hidden;
}

.guided-form fieldset {
    border: 0;
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 18px;
}

.guided-form legend {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 900;
    padding: 0 0 12px;
}

.guided-form legend span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: white;
    font-size: 13px;
}

.form-grid.no-panel {
    padding: 0;
}

.choice-card {
    min-height: 112px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    padding: 14px;
    display: grid;
    align-content: start;
    gap: 6px;
    cursor: pointer;
}

.choice-card input {
    width: auto;
    min-height: 0;
}

.choice-card:has(input:checked) {
    border-color: var(--orange);
    box-shadow: 0 0 0 2px rgb(255 107 53 / 16%);
}

.choice-card strong {
    font-size: 15px;
}

.choice-card small {
    color: var(--muted);
    line-height: 1.35;
}

.guided-form > .button-row,
.guided-form > .status {
    padding: 16px 18px;
}

.form-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 800;
}

.form-grid .wide { grid-column: 1 / -1; }

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    min-height: 44px;
}

textarea { min-height: 108px; resize: vertical; }

.button-row,
.quick-actions,
.sticky-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-row { grid-column: 1 / -1; }

.button-row button,
.form-grid button,
.quick-actions button,
.sticky-actions button,
.action-btn,
.searchbar button {
    border: 0;
    border-radius: 8px;
    min-height: 44px;
    padding: 0 16px;
    background: var(--orange);
    color: white;
    font-weight: 900;
}

.button-row .secondary,
.quick-actions button:nth-child(n+2),
.sticky-actions button:first-child {
    background: var(--ink);
}

.status { color: var(--muted); font-size: 13px; margin: 0; grid-column: 1 / -1; }

.owner-note {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    margin: -4px 0 12px;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.section-title {
    margin: 6px 0 14px;
}
.section-title h2 { margin: 0 0 4px; font-size: 21px; }
.section-title p { margin: 0; color: var(--muted); }
.section-title.inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.section-title.inline button {
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    min-height: 38px;
    padding: 0 12px;
    font-weight: 800;
}

.hero-panel {
    background: var(--ink);
    color: white;
    padding: 24px;
    margin-bottom: 14px;
}
.hero-panel p, .hero-panel span { margin: 0; color: #cbd5e1; }
.hero-panel strong { display: block; font-size: 40px; margin: 6px 0; }

.kpi-grid,
.grid-list,
.choice-grid,
.template-grid {
    display: grid;
    gap: 12px;
}

.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.kpi-grid article {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}
.kpi-grid span { color: var(--muted); font-size: 13px; }
.kpi-grid strong { display: block; font-size: 26px; margin-top: 5px; }

.orientation-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.orientation-panel:empty {
    display: none;
}

.orientation-panel.compact {
    margin-bottom: 14px;
}

.orientation-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.orientation-head span {
    color: var(--orange);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.orientation-head strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.orientation-head p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.orientation-head button,
.module-map button {
    border: 0;
    border-radius: 8px;
    min-height: 42px;
    padding: 0 14px;
    background: var(--orange);
    color: white;
    font-weight: 900;
}

.module-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 8px;
}

.module-map button {
    min-height: 84px;
    padding: 12px;
    background: var(--ink);
    text-align: left;
    display: grid;
    align-content: start;
    gap: 5px;
}

.module-map small {
    color: #cbd5e1;
    line-height: 1.35;
}

.journey-panel {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.journey-panel:empty {
    display: none;
}

.journey-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--ink);
    color: white;
}

.journey-head span {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 900;
}

.journey-step {
    min-height: 70px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    padding: 12px;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 3px 10px;
    text-align: left;
    align-items: center;
}

.journey-step span {
    grid-row: 1 / 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff1c7;
    color: #7a5200;
    font-weight: 900;
}

.journey-step strong {
    font-size: 14px;
}

.journey-step small,
.journey-copy {
    color: var(--muted);
    line-height: 1.35;
}

.journey-step.done span {
    background: #d6f5ea;
    color: #047857;
}

.journey-step.blocked {
    opacity: .68;
}

.lock-panel,
.action-empty {
    display: grid;
    gap: 8px;
    align-items: start;
}

.lock-panel {
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    padding: 14px;
    margin-bottom: 14px;
}

.lock-panel p,
.action-empty span {
    margin: 0;
    color: inherit;
    line-height: 1.4;
}

.lock-panel button,
.action-empty button {
    width: fit-content;
    border: 0;
    border-radius: 8px;
    min-height: 38px;
    padding: 0 12px;
    background: var(--ink);
    color: white;
    font-weight: 900;
}

.grid-list { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); margin-bottom: 18px; }
.grid-list.compact { grid-template-columns: 1fr; }

.card,
.thread-card {
    padding: 15px;
    display: grid;
    gap: 8px;
}
.card h3, .thread-card h3 { margin: 0; font-size: 16px; }
.card p, .thread-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.card footer {
    display: grid;
    gap: 10px;
    align-items: stretch;
}

.card-actions {
    display: grid;
    grid-template-columns: minmax(0, max-content) minmax(112px, max-content);
    gap: 10px;
    align-items: center;
}

.card-actions:empty {
    display: none;
}

.candidate-list {
    display: grid;
    gap: 0;
}

.candidate-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 72px minmax(104px, max-content) minmax(0, max-content);
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
}

.candidate-row strong {
    min-width: 0;
}

.candidate-row span,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.candidate-status,
.candidate-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.candidate-action:empty {
    display: none;
}

.candidate-row .badge {
    white-space: nowrap;
}
.card button,
.thread-card button {
    border: 0;
    border-radius: 8px;
    min-height: 36px;
    padding: 0 12px;
    background: var(--ink);
    color: white;
    font-weight: 800;
}

.card button.favorite,
.detail-hero button.favorite {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.card button.favorite.active,
.detail-hero button.favorite.active {
    background: var(--orange);
    color: white;
    border-color: transparent;
}

.detail-hero button.favorite {
    min-height: 30px;
    border-radius: 999px;
    padding: 0 10px;
    font-weight: 900;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff1c7;
    color: #7a5200;
    font-size: 12px;
    font-weight: 900;
}
.badge.ok { background: #d6f5ea; color: #047857; }
.badge.danger { background: #ffe5e2; color: #b42318; }

meter { width: 100%; height: 8px; }

.searchbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) 110px;
    gap: 10px;
    margin-bottom: 14px;
}

.checkline {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink-2);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 800;
}

.checkline input {
    width: auto;
    min-height: 0;
}

.marketplace-summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    margin: -4px 0 12px;
}

.segmented,
.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px;
    margin-bottom: 14px;
    background: #ece6da;
    border-radius: 8px;
}
.segmented button,
.tabs button {
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink-2);
    min-height: 36px;
    padding: 0 12px;
    font-weight: 800;
    white-space: nowrap;
}
.segmented button.active,
.tabs button.active {
    background: white;
    color: var(--ink);
}

.planning-board {
    display: grid;
    grid-template-columns: 92px repeat(5, minmax(72px, 1fr));
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 14px;
}
.planning-board > * {
    min-height: 46px;
    border-radius: 7px;
    padding: 8px;
    background: white;
    border: 1px solid var(--line);
    font-size: 12px;
}
.slot { color: white; background: var(--orange); border-color: transparent; }
.slot.external { background: var(--ink); }
.slot.green { background: var(--green); color: var(--ink); }

.detail-hero {
    background: var(--ink);
    color: white;
    padding: 22px;
    margin-bottom: 14px;
}
.detail-hero h2 { margin: 0 0 8px; }
.detail-hero p { color: #cbd5e1; margin: 0 0 10px; }
.detail-hero .meta-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chat-log {
    display: grid;
    gap: 10px;
    padding-bottom: 82px;
}
.bubble {
    width: fit-content;
    max-width: min(76%, 560px);
    padding: 12px 14px;
    border-radius: 8px;
    margin: 0;
}
.bubble.mine { justify-self: end; background: var(--orange); color: white; }
.bubble.theirs { background: white; border: 1px solid var(--line); }
.chat-input {
    position: sticky;
    bottom: 12px;
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 8px;
    background: var(--paper);
    padding-top: 10px;
}

.map-panel {
    min-height: 180px;
    margin-bottom: 14px;
    padding: 16px;
    display: grid;
    align-content: end;
    background:
        linear-gradient(135deg, rgb(255 107 53 / 12%), transparent),
        repeating-linear-gradient(45deg, #f8fafc, #f8fafc 12px, #eef2f7 12px, #eef2f7 24px);
}

.template-grid,
.choice-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 14px;
}
.template-grid button,
.choice-grid button,
.settings-list button {
    min-height: 86px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    text-align: left;
    padding: 14px;
    display: grid;
    gap: 5px;
}
.template-grid span,
.choice-grid span,
.settings-list span { color: var(--muted); font-size: 13px; }

.profile-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px;
    margin-bottom: 14px;
}
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: white;
    font-weight: 900;
}
.settings-list { display: grid; gap: 10px; }

.pointage-card {
    text-align: center;
    padding: 28px 18px;
    margin-bottom: 14px;
}
.pointage-card p { font-size: 46px; font-weight: 900; margin: 0 0 8px; }
.pointage-card span { color: var(--muted); }
.pointage-card button {
    display: block;
    width: min(220px, 100%);
    margin: 20px auto 0;
    min-height: 58px;
    border: 0;
    border-radius: 8px;
    background: var(--orange);
    color: white;
    font-weight: 900;
}

.timeline {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}
.timeline-item {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
}
.timeline-item i {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--orange);
    margin-top: 2px;
}

.timeline-item.done i { background: var(--green); }

.mini-lifecycle {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 2px;
}

.mini-lifecycle span {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 2px 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.mini-lifecycle span.done {
    border-color: transparent;
    background: #d6f5ea;
    color: #047857;
}

.quote-lines {
    display: grid;
    grid-template-columns: 1.5fr .6fr .7fr .8fr;
    gap: 8px;
}

.faq-list details {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
}
.faq-list summary { font-weight: 900; cursor: pointer; }
.faq-list p { color: var(--muted); }

.empty {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    color: var(--muted);
    background: rgb(255 255 255 / 55%);
}

.mobile-nav {
    display: none;
}

@media (max-width: 980px) {
    .bp-app { display: block; }
    .bp-sidebar { display: none; }
    .bp-main {
        width: 100%;
        padding: 16px 14px 92px;
    }
    .bp-topbar h1 { font-size: 25px; }
    .mobile-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 8px;
        background: var(--ink);
        border-radius: 8px;
        box-shadow: 0 12px 34px rgb(15 30 46 / 24%);
    }
    .mobile-nav button {
        min-height: 48px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #cbd5e1;
        font-size: 11px;
        font-weight: 900;
    }
    .mobile-nav button.active { background: var(--ink-2); color: white; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .searchbar { grid-template-columns: 1fr; }
    .orientation-head { grid-template-columns: 1fr; }
    .orientation-head button { width: 100%; }
}

@media (max-width: 560px) {
    .form-grid,
    .quote-lines {
        grid-template-columns: 1fr;
    }
    .card-actions {
        grid-template-columns: 1fr;
    }
    .candidate-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
    }
    .candidate-row > span:nth-child(2) {
        justify-self: end;
    }
    .candidate-status {
        justify-content: flex-start;
    }
    .candidate-action {
        justify-content: flex-end;
    }
    .quick-actions,
    .sticky-actions,
    .button-row {
        display: grid;
        grid-template-columns: 1fr;
    }
    .hero-panel strong { font-size: 34px; }
}
