:root {
  --ink: #211735;
  --muted: #766f80;
  --line: #e9e5ee;
  --surface: #fff;
  --canvas: #f7f5f9;
  --purple: #6f3fc6;
  --purple-dark: #4c288d;
  --purple-soft: #f1eafd;
  --cyan: #0891b2;
  --cyan-soft: #e5f7fa;
  --orange: #f97316;
  --danger: #d14343;
  --shadow: 0 16px 50px rgba(50, 30, 76, .10);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 18px; color: #f9f5ff; background: linear-gradient(180deg, #35215c 0%, #24143f 100%); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 28px; font-size: 19px; letter-spacing: -.3px; }
.brand-mark { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #9b6ef3, #6037ab); font-family: Georgia, serif; font-size: 30px; box-shadow: 0 10px 24px rgba(24, 10, 48, .22); }
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 21px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; color: #cfc4df; background: transparent; text-align: left; }
.nav-item span { font-size: 19px; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.11); }
.sidebar-stores { margin-top: 32px; padding: 0 14px; display: grid; gap: 13px; color: #d8cee7; font-size: 13px; }
.sidebar-stores p { margin: 0 0 3px; color: #8f82a6; font-size: 10px; letter-spacing: 1.5px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; }
.dot.papeete { background: #a673f2; }
.dot.taravao { background: #22c1d6; }
.sidebar-profile { margin-top: auto; padding: 15px 9px 3px; border-top: 1px solid rgba(255,255,255,.11); display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.sidebar-profile small { display: block; margin-top: 2px; color: #a99dbb; }
.sidebar-logout-form { grid-column: 1 / -1; }
.sidebar-logout-button { width: 100%; min-height: 34px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #d9d0e5; background: rgba(255,255,255,.06); font-size: 11px; font-weight: 700; }
.sidebar-logout-button:hover { color: white; background: rgba(255,255,255,.12); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: white; font-size: 11px; font-weight: 800; }
.avatar.direction { background: #7651bd; }
.main-content { min-width: 0; }
.topbar { min-height: 104px; padding: 24px 34px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: white; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 5px; color: var(--purple); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.6px; }
.top-actions, .modal-actions, .toolbar-right, .toolbar-left, .week-nav, .legend { display: flex; align-items: center; gap: 10px; }
.button { min-height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 13px; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--purple); box-shadow: 0 7px 18px rgba(111, 63, 198, .2); }
.button-primary:hover { background: var(--purple-dark); }
.button-ghost { color: var(--ink); background: white; border-color: var(--line); }
.button-dark { color: white; background: #2e2140; }
.button-danger { color: #fff; background: var(--danger); }
.button-logout { color: #5c5265; background: #f5f2f7; border-color: var(--line); }
.button-wide { width: 100%; }
.view { display: none; padding: 24px 34px 40px; }
.view.active { display: block; }
.week-toolbar { min-height: 55px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.week-nav { justify-self: start; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.week-nav button { height: 31px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; }
.week-nav button:hover { background: var(--canvas); }
.view-switch { display: flex; padding: 3px; border-radius: 9px; background: #ebe7ef; }
.view-switch button { height: 31px; padding: 0 11px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.view-switch button.active { color: var(--ink); background: white; box-shadow: 0 2px 7px rgba(38,24,54,.08); }
.week-title-wrap { display: flex; align-items: center; gap: 10px; }
.week-title-wrap h2 { margin: 0; font-size: 17px; }
.status-pill { padding: 5px 9px; border-radius: 99px; color: #7a589c; background: var(--purple-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-pill.published { color: #087b61; background: #e1f8f0; }
.toolbar-right { justify-self: end; }
.legend { color: var(--muted); font-size: 11px; }
.metrics { margin: 14px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.metric small { color: var(--muted); }
.metric b { display: block; margin-top: 4px; font-size: 19px; }
.metric b.good { color: #078164; }
.metric b.warn { color: #c46a17; }
.alert { margin: 12px 0; padding: 11px 14px; border: 1px solid #f2d7ad; border-radius: 9px; color: #8c5317; background: #fff7e8; font-size: 12px; }
.simulation-banner { margin: 12px 0; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #c9b4ee; border-radius: 10px; background: #f4effd; }
.simulation-banner b, .simulation-banner span { display: block; }
.simulation-banner span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.schedule-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 4px 20px rgba(43, 27, 62, .04); }
.schedule-scroll { overflow-x: auto; }
.schedule-grid { min-width: 980px; display: grid; grid-template-columns: 176px repeat(6, minmax(130px, 1fr)); }
.grid-cell { min-height: 92px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.grid-cell:nth-child(7n) { border-right: 0; }
.grid-head { min-height: 62px; display: flex; flex-direction: column; justify-content: center; text-align: center; background: #fbfafc; }
.grid-head b { font-size: 12px; }
.grid-head span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.employee-cell { display: flex; align-items: center; gap: 9px; background: #fbfafc; }
.employee-cell b { display: block; font-size: 12px; }
.employee-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.day-cell { cursor: pointer; transition: background .15s; }
.day-cell:hover { background: #fdfbff; }
.shift-card { position: relative; margin-bottom: 6px; padding: 8px 8px 8px 11px; border: 1px solid transparent; border-radius: 8px; font-size: 10px; line-height: 1.35; overflow: hidden; }
.shift-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: currentColor; }
.shift-card.papeete { color: #6231ad; background: #f3edfd; border-color: #e4d8f8; }
.shift-card.taravao { color: #087e93; background: #eaf8fa; border-color: #d3f0f4; }
.shift-card.suggested { border-style: dashed; }
.shift-card b { display: block; color: var(--ink); font-size: 11px; }
.shift-card span { display: block; margin-top: 2px; color: currentColor; }
.shift-card.manual::after { content: "modifié"; position: absolute; right: 5px; top: 4px; color: var(--muted); font-size: 8px; }
.off-card { margin-bottom: 6px; padding: 8px; border: 1px dashed #d8d2df; border-radius: 8px; color: #756c7f; background: #f7f5f8; font-size: 10px; line-height: 1.35; }
.off-card b { display: block; color: #504758; font-size: 11px; }
.off-card span { display: block; margin-top: 2px; }
.absence-chip { padding: 7px; border-radius: 7px; color: #ad4444; background: #fff0f0; font-size: 10px; font-weight: 700; }
.add-hint { opacity: 0; padding-top: 8px; color: var(--purple); text-align: center; font-size: 11px; }
.day-cell:hover .add-hint { opacity: 1; }
.helper-text { margin: 11px 2px; color: var(--muted); font-size: 11px; }
.hours-summary { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.hours-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.hours-card-head { display: flex; align-items: center; gap: 9px; }
.hours-card-head b, .hours-card-head small { display: block; }
.hours-card-head small { margin-top: 2px; color: var(--muted); }
.hours-progress { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: #eeeaf1; }
.hours-progress i { display: block; height: 100%; border-radius: inherit; background: var(--purple); }
.week-breakdown { margin-top: 10px; display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.week-breakdown span { display: flex; justify-content: space-between; }
.month-grid { min-width: 900px; display: grid; grid-template-columns: repeat(7, minmax(125px, 1fr)); }
.month-head { min-height: 42px; padding: 12px; color: var(--muted); background: #fbfafc; text-align: center; font-size: 11px; font-weight: 800; }
.month-day { min-height: 132px; padding: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: white; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day.outside { background: #faf9fb; }
.month-day-number { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.month-shift { margin-bottom: 4px; padding: 5px 6px; border-radius: 6px; font-size: 9px; line-height: 1.3; }
.month-shift.papeete { color: #6231ad; background: #f3edfd; }
.month-shift.taravao { color: #087e93; background: #eaf8fa; }
.month-shift.suggested { border: 1px dashed currentColor; opacity: .82; }
.section-heading { margin-bottom: 20px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 0 0 5px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.employee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 15px; }
.employee-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.employee-card { position: relative; }
.employee-edit { position: absolute; right: 13px; top: 13px; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 8px; color: var(--purple); background: white; }
.employee-card-head { display: flex; align-items: center; gap: 12px; }
.employee-card-head .avatar { width: 43px; height: 43px; }
.employee-card h3 { margin: 0; font-size: 16px; }
.employee-card .role { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.employee-meta { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.employee-meta div { padding: 10px; border-radius: 8px; background: var(--canvas); }
.employee-meta small { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.employee-meta b { display: block; margin-top: 3px; font-size: 12px; }
.employee-note { min-height: 48px; margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.tag { display: inline-flex; margin-top: 12px; padding: 4px 8px; border-radius: 99px; color: #5b4c69; background: var(--purple-soft); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.tag.planned { color: #9a641e; background: #fff4dc; }
.tag.inactive { color: #786f7e; background: #eeeaf0; }
.tag.simulation { color: #6231ad; background: #f1eafd; }
.list-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.list-row { min-height: 64px; padding: 12px 16px; display: grid; grid-template-columns: 1.1fr 1fr 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.list-row:last-child { border: 0; }
.list-row small { display: block; color: var(--muted); font-size: 10px; }
.list-row b { font-size: 12px; }
.list-row.publication-row { grid-template-columns: 1.1fr 1fr 1fr auto auto; }
.preview-email-button { min-height: 32px; padding: 0 11px; font-size: 11px; white-space: nowrap; }
.icon-button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 7px; color: var(--danger); background: white; }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }
.modal { padding: 0; border: 0; border-radius: 16px; color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(25, 16, 38, .55); backdrop-filter: blur(2px); }
.modal-card { position: relative; width: min(520px, calc(100vw - 30px)); padding: 28px; }
.modal-card h2 { margin: 4px 0 8px; font-size: 23px; }
.modal-card > p:not(.eyebrow):not(.form-error) { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-close { position: absolute; right: 15px; top: 12px; border: 0; color: var(--muted); background: none; font-size: 25px; }
.modal-icon { float: left; margin: -2px 12px 15px 0; width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; color: var(--purple); background: var(--purple-soft); }
label { display: grid; gap: 6px; margin-top: 14px; color: #4b4353; font-size: 11px; font-weight: 700; }
input, select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #dcd6e2; border-radius: 8px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.variant-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.variant-options label { cursor: pointer; }
.variant-options input { display: none; }
.variant-options span { min-height: 76px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.variant-options input:checked + span { border-color: var(--purple); background: var(--purple-soft); }
.variant-options b, .variant-options small { display: block; }
.variant-options small { margin-top: 5px; color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check-line { grid-template-columns: auto 1fr; align-items: start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.check-line input { width: 17px; height: 17px; margin-top: 1px; }
.check-line b, .check-line small { display: block; }
.check-line small { margin-top: 3px; color: var(--muted); font-weight: 400; line-height: 1.4; }
.store-checks { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.store-checks legend { padding: 0 5px; color: #4b4353; font-size: 11px; font-weight: 700; }
.store-checks > div { display: flex; gap: 18px; }
.store-checks label { display: flex; align-items: center; gap: 7px; margin: 0; }
.store-checks input { width: 16px; height: 16px; }
.modal-actions { justify-content: flex-end; margin-top: 24px; }
.modal-actions.split { display: grid; grid-template-columns: auto 1fr auto auto; }
.form-error { margin: 12px 0 0; color: var(--danger); font-size: 11px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 12px 16px; border-radius: 9px; color: white; background: #2b2038; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 20%, #60458c, #2a193f 58%, #1c112b); }
.login-card { width: min(420px, 100%); padding: 42px; border-radius: 20px; background: rgba(255,255,255,.98); box-shadow: 0 30px 80px rgba(10, 4, 20, .3); }
.login-card .brand-mark { margin-bottom: 24px; }
.login-card h1 { margin: 0; font-size: 31px; }
.login-copy { margin: 8px 0 25px; color: var(--muted); }
.login-help { margin: 20px 0 0; color: #9d96a4; text-align: center; font-size: 10px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 72px 1fr; }
  .sidebar { padding: 20px 10px; }
  .brand span, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item span { font-size: 20px; }
  .sidebar-stores, .sidebar-profile div:not(.avatar), .sidebar-profile form { display: none; }
  .sidebar-profile { display: block; }
  .topbar, .view { padding-left: 20px; padding-right: 20px; }
  .topbar { align-items: flex-start; }
  .top-actions .button-ghost { display: none; }
  .week-toolbar { grid-template-columns: 1fr auto; }
  .week-title-wrap { grid-row: 1; grid-column: 1 / -1; justify-content: center; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .legend { display: none; }
}
@media (max-width: 600px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 10; top: auto; bottom: 0; width: 100%; height: 64px; padding: 7px 10px; flex-direction: row; }
  .brand, .sidebar-profile, .sidebar-stores { display: none; }
  .sidebar nav { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); }
  .nav-item { display: grid; gap: 1px; place-items: center; font-size: 9px !important; }
  .nav-item span { font-size: 18px; }
  .main-content { padding-bottom: 70px; }
  .topbar { min-height: 88px; }
  .topbar h1 { font-size: 21px; }
  .top-actions .button { padding: 0 11px; font-size: 11px; }
  .view { padding: 16px 12px 26px; }
  .metrics { gap: 7px; }
  .metric { padding: 10px; }
  .toolbar-right .button { padding: 0 11px; }
  .list-row.publication-row { grid-template-columns: 1fr 1fr; }
  .list-row.publication-row > div:first-child { grid-column: 1 / -1; }
  .preview-email-button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}
