/* Bitasyon Bio premium UI layer. Functional styles remain in styles.css. */
:root {
  --forest: #1f5b3a;
  --forest-2: #347a50;
  --forest-deep: #173f2a;
  --leaf: #eef5e9;
  --paper: #f7f2df;
  --canvas: #f5f4ee;
  --vanilla: #fff2cc;
  --cacao: #4b2f20;
  --cinnamon: #b87333;
  --ink: #292720;
  --muted: #6f6b61;
  --line: #ddd9cb;
  --white: #fffefb;
  --danger: #a83228;
  --info: #2d6680;
  --radius-sm: 9px;
  --radius: 14px;
  --control-height: 44px;
  --shadow: 0 10px 28px rgba(31, 54, 39, 0.07);
  --shadow-raised: 0 22px 56px rgba(22, 46, 31, 0.15);
}

* { scrollbar-color: #a9bcae transparent; }

html { background: var(--canvas); }

body {
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 246, 240, .96), rgba(247, 246, 240, .96)),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(31, 91, 58, .025) 45px);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }

:focus-visible {
  outline: 3px solid rgba(184, 115, 51, .42);
  outline-offset: 2px;
}

.app-shell { grid-template-columns: 248px minmax(0, 1fr); }

.sidebar {
  gap: 20px;
  padding: 22px 16px;
  background: var(--forest-deep);
  border-right: 1px solid rgba(255,255,255,.08);
}

.brand { padding: 0 7px 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand > div:last-child strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }

.bitasyon-logo .logo-leaf {
  position: relative;
  overflow: hidden;
  border-radius: 50% 50% 50% 18%;
  transform: rotate(-7deg);
}
.bitasyon-logo .logo-leaf span { color: inherit; font-size: 1rem; transform: rotate(7deg); }
.bitasyon-logo.compact .logo-leaf { border-radius: 50% 50% 50% 14%; }

.nav-list { gap: 4px; }
.nav-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 7px;
  align-items: center;
  min-height: 48px;
  border-radius: var(--radius);
  padding: 7px 10px;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.nav-item i {
  grid-row: 1 / 3;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07);
  color: #e8d9a6;
  font-style: normal;
  font-weight: 850;
}
.nav-item:hover { background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.active { border-color: rgba(255, 242, 204, .34); background: rgba(255, 242, 204, .12); }
.nav-item.active i { background: #f0e1aa; color: var(--forest-deep); }
.nav-item small { font-size: .7rem; }
.nav-more > summary { border-radius: var(--radius); }
.nav-more > summary::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -2px;
  background: linear-gradient(currentColor,currentColor) center / 12px 2px no-repeat,
              linear-gradient(currentColor,currentColor) center / 2px 12px no-repeat;
}
.nav-more[open] > summary::before {
  content: "";
  background: linear-gradient(currentColor,currentColor) center / 12px 2px no-repeat;
}
.sidebar-note { margin-top: auto; padding: 12px; background: rgba(4, 25, 14, .28); }
.school-nav-button { min-height: 42px; }

.workspace { width: 100%; max-width: 1680px; margin: 0 auto; padding: 22px clamp(18px, 2.4vw, 38px) 46px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: 66px;
  margin: -22px calc(clamp(18px, 2.4vw, 38px) * -1) 24px;
  padding: 12px clamp(18px, 2.4vw, 38px);
  border-bottom: 1px solid rgba(221, 217, 203, .88);
  background: rgba(247, 246, 240, .94);
  backdrop-filter: blur(12px);
}
.topbar-title { min-width: 185px; }
.topbar h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 1.7vw, 1.8rem); }
.topbar-title .eyebrow { font-size: .65rem; }
.topbar-actions { flex: 1; }

.topbar-search { width: min(520px, 42vw); margin-right: auto; }
.topbar-search .search-symbol {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  color: var(--forest-2);
  font-size: 1.25rem;
  transform: translateY(-53%);
  pointer-events: none;
}
.topbar-search input {
  min-height: 42px;
  padding: 0 14px 0 38px;
  border-color: #d2d8cc;
  background: rgba(255,255,255,.9);
}
.topbar-search input:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(61,139,91,.1); }
.topbar-search-results { top: calc(100% + 9px); border-radius: var(--radius); box-shadow: var(--shadow-raised); }
.topbar-search-results button { min-height: 52px; padding: 9px 12px; }

.user-session { min-width: 0; }
.user-session > span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { min-width: 105px; }

.dashboard-grid { align-items: start; }
.dashboard-welcome {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(540px, 1.6fr);
  align-items: center;
  gap: 28px;
  min-height: 186px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid #cfdccf;
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(238,245,233,.98), rgba(255,254,251,.94)),
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(31,91,58,.05) 23px);
  box-shadow: var(--shadow);
}
.dashboard-welcome::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -96px;
  width: 230px;
  height: 230px;
  border: 34px solid rgba(61,139,91,.07);
  border-radius: 50% 50% 46% 18%;
  pointer-events: none;
}
.dashboard-welcome-copy { position: relative; z-index: 1; }
.dashboard-welcome h2 { margin: 7px 0 5px; color: var(--cacao); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3vw, 3rem); font-weight: 600; }
.dashboard-welcome p { margin: 0; color: var(--forest); font-size: 1.05rem; font-weight: 750; }
.dashboard-quick-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-action {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid #d7ddcf;
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 6px 16px rgba(31,91,58,.05);
}
.quick-action:hover { border-color: var(--forest-2); transform: translateY(-1px); }
.quick-action i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--leaf); color: var(--forest); font-style: normal; font-weight: 900; }
.quick-action span { display: grid; gap: 3px; min-width: 0; }
.quick-action strong { color: var(--cacao); font-size: .87rem; }
.quick-action small { color: var(--muted); font-size: .72rem; }
.quick-action.primary { border-color: var(--forest); background: var(--forest); color: white; }
.quick-action.primary i { background: rgba(255,255,255,.16); color: white; }
.quick-action.primary strong, .quick-action.primary small { color: white; }
.quick-action.primary small { opacity: .75; }

.metrics-row { gap: 10px; }
.metric-card { position: relative; gap: 5px; min-height: 112px; padding: 16px 18px; box-shadow: none; }
.metric-card::before { content: ""; position: absolute; top: 16px; right: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--forest-2); }
.metric-card strong { font-size: 1.75rem; font-variant-numeric: tabular-nums; }

.panel, .recipe-card, .metric-card { border-color: #dfddd3; background: rgba(255,254,251,.96); }
.panel { box-shadow: 0 5px 18px rgba(54,42,25,.045); }
.panel-head h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.22rem; font-weight: 600; }
.panel-head .eyebrow { margin-bottom: 3px; }

.alert-card, .today-action, .compact-list-action { transition: border-color .16s ease, background-color .16s ease, transform .16s ease; }
.alert-card.clickable:hover, .today-action:hover, .compact-list-action:hover { transform: translateY(-1px); border-color: #aebead; }

.button { min-height: var(--control-height); border-radius: var(--radius); transition: background-color .15s ease, border-color .15s ease, transform .1s ease; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--forest); box-shadow: 0 5px 13px rgba(31,91,58,.18); }
.button.primary:hover { background: var(--forest-deep); }
.button.secondary:hover { border-color: var(--forest-2); background: #e5f0e3; }

input, select, textarea { border-radius: var(--radius-sm) !important; }
input:not([type="checkbox"]):not([type="radio"]), select { min-height: var(--control-height); }
textarea { min-height: 88px; }
.form-grid > *, .field, .field > * { min-width: 0; max-width: 100%; }
.field input, .field select, .field textarea { width: 100%; }

.production-header-card {
  border-left-width: 1px;
  border-top: 4px solid var(--forest);
  box-shadow: 0 5px 18px rgba(54,42,25,.05);
}
.production-context-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-content: start;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.production-context-meta > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.production-context-meta strong { overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .production-context-meta { padding-left: 0; border-left: 0; }
}
.step-progress-item { min-height: 54px; }
.step-progress-item.current { border-color: var(--forest); box-shadow: 0 4px 14px rgba(31,91,58,.09); }
.active-step-card { border: 1px solid #c9d6ca; border-top: 5px solid var(--forest); box-shadow: 0 12px 30px rgba(31,91,58,.08); }
.active-step-card h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
.step-do { border-left-color: var(--cinnamon); background: #fff9eb; }
.step-timer strong { font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.inline-control input, .main-quantity-field input, .conditioning-fields input { font-size: 1.08rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.measure-field { border-color: #d6c98d; background: var(--vanilla); }
.step-main-actions .button.primary { box-shadow: 0 7px 18px rgba(31,91,58,.2); }
.production-details { background: rgba(255,254,251,.62); }
.production-details > summary { min-height: 48px; display: flex; align-items: center; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.data-table thead { background: #f0f3eb; }
.data-table th { color: var(--forest-deep); font-size: .72rem; }
.data-table tbody tr:hover { background: #fafbf7; }

.proposal-readable-list { display: grid; gap: 5px; margin: 6px 0 0; padding-left: 19px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.proposal-readable-list a { color: var(--forest); font-weight: 750; overflow-wrap: anywhere; }

.status-chip { min-height: 24px; }
.empty-state { min-height: 72px; display: grid; place-items: center; background: #fbfaf5; text-align: center; }

.login-screen {
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, .95fr);
  gap: 0;
  padding: 0;
  background: var(--canvas);
}
.login-story {
  align-self: stretch;
  display: grid;
  align-content: space-between;
  min-height: 100vh;
  padding: clamp(34px, 6vw, 78px);
  color: white;
  background:
    linear-gradient(145deg, rgba(23,63,42,.96), rgba(31,91,58,.9)),
    repeating-linear-gradient(45deg, transparent 0 36px, rgba(255,255,255,.03) 37px);
}
.login-story .bitasyon-logo strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.login-story > div:last-child { max-width: 650px; }
.login-story .eyebrow { color: #dfcd96; }
.login-story h2 { margin: 16px 0; max-width: 620px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 5vw, 4.7rem); font-weight: 500; line-height: 1.03; }
.login-story p { max-width: 560px; color: rgba(255,255,255,.78); font-size: 1.04rem; line-height: 1.65; }
.login-panel { justify-self: center; margin: 28px; border-color: #dcd8ca; background: var(--white); box-shadow: var(--shadow-raised); }
.login-panel h1 { font-size: 1.8rem; }
.login-logo { border-radius: 50% 50% 50% 18%; }

.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { position: sticky; height: 100vh; }
  .nav-list { grid-template-columns: 1fr; }
  .nav-item small { display: none; }
  .nav-item { grid-template-rows: auto; }
  .nav-item i { grid-row: 1; }
  .dashboard-welcome { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { padding-bottom: 92px; }
  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(23,63,42,.97);
    box-shadow: 0 12px 32px rgba(23,63,42,.3);
    backdrop-filter: blur(12px);
  }
  .mobile-nav button { display: grid; place-items: center; gap: 2px; min-width: 0; min-height: 54px; border: 0; border-radius: 6px; background: transparent; color: rgba(255,255,255,.7); }
  .mobile-nav button i { font-style: normal; font-size: 1.12rem; font-weight: 850; line-height: 1; }
  .mobile-nav button span { overflow: hidden; width: 100%; font-size: .66rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav button.active { background: rgba(255,242,204,.15); color: #fff4cf; }
  .topbar { top: 0; }
  .dashboard-welcome { min-height: 0; }
}

@media (max-width: 760px) {
  .workspace { padding: 12px 12px 94px; }
  .topbar { margin: -12px -12px 16px; padding: 10px 12px; }
  .topbar-title { min-width: 0; }
  .topbar-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .topbar-search { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .save-state { min-width: 0; }
  .user-session { justify-self: end; }
  .dashboard-welcome { padding: 22px 18px; }
  .dashboard-welcome h2 { font-size: 2rem; }
  .dashboard-quick-actions { grid-template-columns: 1fr; }
  .quick-action { min-height: 70px; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 98px; padding: 14px; }
  .metric-card strong { font-size: 1.5rem; }
  .panel { padding: 15px; }
  .form-grid { min-width: 0; }
  .production-header-card { grid-template-columns: 1fr; }
  .step-progress-item { flex-basis: 132px; }
  .active-step-card { padding: 14px; }
  .step-main-actions { bottom: 72px; }
  .login-screen { display: block; min-height: 100vh; padding: 0; }
  .login-story { min-height: 210px; padding: 26px 22px; align-content: space-between; }
  .login-story h2 { margin: 12px 0 0; font-size: 2rem; }
  .login-story p { display: none; }
  .login-panel { width: auto; margin: -14px 12px 20px; padding: 26px 20px; position: relative; z-index: 2; }
}

@media (max-width: 430px) {
  .topbar-actions { grid-template-columns: 1fr; }
  .user-session, .save-state { justify-self: stretch; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .mobile-nav { right: 6px; left: 6px; }
  .mobile-nav button span { font-size: .61rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .mobile-nav, .topbar, .sidebar { display: none !important; }
  .workspace { max-width: none; padding: 0; }
  .panel, .recipe-card, .metric-card { box-shadow: none; }
}


/* Production: genuine measurements and explicit conflict recovery. */
.save-conflict { padding: 16px; margin: 12px; border: 2px solid var(--danger, #9d342b); border-radius: 12px; background: #fff8ec; }
.save-conflict button { margin: 4px; min-height: 44px; }
.measurement-receipt { display: grid; gap: 6px; margin: 6px 0 16px; }
.measurement-receipt small { overflow-wrap: anywhere; }
.measurement-receipt select { width: 100%; min-height: 44px; }
.pause-dialog .form-grid input, .pause-dialog .form-grid select { min-width: 0; max-width: 100%; }

.production-interaction { border: 0; padding: 0; margin: 0; min-width: 0; }

.sanitary-panel > details { padding: 12px 0; border-bottom: 1px solid var(--line, #ddd); }
.sanitary-panel summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.sanitary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.sanitary-field { min-width: 0; }
.sanitary-field small { display: block; overflow-wrap: anywhere; }
.sanitary-grid input, .sanitary-grid select { width: 100%; min-height: 44px; }
.sanitary-instructions { background: #fff8e7; padding: 10px !important; border-radius: 8px; }
@media (max-width: 760px) { .sanitary-grid { grid-template-columns: minmax(0, 1fr); } }

/* Labo 1: declared operations remain distinct from instructions and expectations. */
.cleaning-panel { min-width:0; }
.cleaning-cards,.cleaning-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:14px;margin:16px 0; }
.cleaning-cards article,.cleaning-form { border:1px solid var(--border,#d9e2dc);border-radius:16px;padding:16px;min-width:0;overflow-wrap:anywhere; }
.cleaning-panel input,.cleaning-panel select { width:100%;min-width:0;min-height:44px; }
.cleaning-panel details { margin:12px 0; }
.cleaning-panel summary { cursor:pointer;padding:10px 0;min-height:44px; }
.cleaning-panel dt { font-weight:600; }.cleaning-panel dd { margin:0 0 10px; }
.cleaning-panel button { min-height:44px;white-space:normal; }
.cleaning-error { color:#8c2424;background:#fff0ec;padding:12px; }
.mobile-more { position:relative; }.mobile-more summary { min-height:48px;display:flex;align-items:center;justify-content:center;cursor:pointer;list-style:none; }
.mobile-more-menu { position:absolute;bottom:100%;right:0;width:230px;max-width:calc(100vw - 32px);background:#fff;border:1px solid #d9e2dc;border-radius:14px;box-shadow:0 4px 24px #0002;padding:8px; }
.mobile-more-menu button { width:100%;min-height:44px; }
@media(max-width:600px){.cleaning-grid,.cleaning-cards {grid-template-columns:1fr;}.cleaning-form{padding:12px;}.cleaning-panel .button-row{flex-wrap:wrap;}}
.mobile-more summary { color:#fff4cf;font-size:.8rem; }
.mobile-more-menu button { color:#173f2a; }
.mobile-more-menu { max-height:65vh; overflow-y:auto; overscroll-behavior:contain; }
.mobile-more-menu button[aria-current="page"], .topbar-search-results button[aria-selected="true"] { background:var(--leaf, #e7f0e8); font-weight:700; }
.reception-fields { min-width:0; margin:0; padding:0; border:0; }
.reception-batch-option { display:flex; align-items:center; gap:10px; margin:16px 0 8px; min-height:44px; }
.reception-batch-option input { width:20px; height:20px; flex:0 0 auto; }
/* Traçabilité : sélection lisible sur tablette, sans débordement sur téléphone. */
.trace-panel{border:1px solid #d2ddcf;border-radius:14px;background:#f9fbf6;padding:16px;margin:18px 0;min-width:0}
.trace-panel label{display:block;margin:10px 0;max-width:100%}
.trace-panel input{display:block;box-sizing:border-box;width:100%;max-width:100%;margin-top:6px}
.trace-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:8px;max-height:280px;overflow:auto}
.trace-choices button{text-align:left;background:#fff;border:1px solid #c8d8c7;border-radius:10px;padding:10px;color:#1d3327;overflow-wrap:anywhere}
.trace-choices button.selected{border:2px solid #1f5b3a}
.trace-choices strong,.trace-choices span{display:block;margin:3px 0}
.trace-results article{background:#fff;border:1px solid #d2ddcf;border-radius:10px;padding:10px;margin:8px 0;overflow-wrap:anywhere}
.trace-dispatch{margin-top:16px;max-width:550px}
@media(max-width:600px){.trace-panel{padding:11px}.trace-choices{max-height:220px}}

/* Aide guidée intégrée : garde le contexte de l’étape sans bloquer la page. */
.school-coach > .school-coach-hints { display: grid; gap: 8px; }
.school-coach .school-hint-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.school-coach .school-hint-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 11px 12px; border: 1px solid #d1ad45; border-radius: 8px; background: rgba(255, 255, 255, .8); }
.school-coach .school-hint-detail p { margin-top: 4px; line-height: 1.45; }
.school-coach button.school-hint-close { min-height: 36px; align-self: start; }
@media (max-width: 540px) {
  .school-coach .school-hint-detail { grid-template-columns: 1fr; }
}

/* Proposition et choix réel de lot visibles séparément, même sur petit écran. */
.operator-lot-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.operator-lot-summary > div { display: grid; gap: 3px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.operator-lot-summary span { color: var(--muted); font-size: .71rem; font-weight: 800; text-transform: uppercase; }
.operator-lot-summary strong, .operator-lot-summary small { overflow-wrap: anywhere; }
.operator-lot-summary small { color: var(--muted); font-size: .76rem; }
.operator-lot-selected { border-left: 3px solid var(--forest-2) !important; background: #f4f8f1 !important; }
.operator-lot-warning { margin: 0; padding: 9px 10px; border-left: 3px solid var(--danger); background: #fff1ef; color: #8f241b; font-size: .8rem; font-weight: 750; }
@media (max-width: 540px) {
  .operator-lot-summary { grid-template-columns: 1fr; }
}


/* ---------------------------------------------------------------------------
   P2.5 · Bitasyon Bio Atelier / édition de terrain
   Accueil → Produire → Réceptions. Palette issue de la marque : forêt,
   cacao et vanille. Aucun réseau, image générique, icône externe ou police web.
   L'état sanitaire, la sauvegarde et le bandeau École restent prioritaires.
   --------------------------------------------------------------------------- */
:root {
  --ui-surface: #fffefb;
  --ui-surface-soft: #f9f8f2;
  --ui-divider: #d8e0d4;
  --ui-elevated: 0 14px 38px rgba(23, 63, 42, .075);
  --ui-caption: #5b665c;
}
html { scroll-padding-top: 104px; }
body {
  background:
    radial-gradient(ellipse at 96% -14%, rgba(173, 191, 153, .2), transparent 45%),
    linear-gradient(180deg, #f7f8f3 0%, #f3f4ed 80%, #f7f4ed 100%);
  line-height: 1.5;
}
.workspace { max-width: 1540px; }
.topbar {
  border-bottom-color: rgba(31, 91, 58, .13);
  background: rgba(250, 250, 246, .97);
  box-shadow: 0 4px 22px rgba(23, 63, 42, .035);
}
.topbar h1 { letter-spacing: -.025em; }
.topbar-title .eyebrow { letter-spacing: .14em; }
.sidebar {
  background: linear-gradient(170deg, #183f2d, #143626 64%, #102d21);
}
.nav-item.active { box-shadow: inset 3px 0 0 #dfc788; }
.nav-item:focus-visible,
.mobile-nav button:focus-visible,
.mobile-more summary:focus-visible {
  outline: 3px solid #ead18c;
  outline-offset: -3px;
}

/* Surfaces and type: quiet hierarchy, clear information density. */
.panel, .recipe-card, .metric-card {
  border-color: var(--ui-divider);
  background: var(--ui-surface);
}
.panel { box-shadow: var(--ui-elevated); }
.panel-head { align-items: center; gap: 12px 18px; }
.panel-head h2 {
  color: var(--forest-deep);
  font-size: clamp(1.13rem, 1.5vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: -.014em;
}
.panel-head .eyebrow { color: #63735f; letter-spacing: .11em; }
.panel p, .recipe-card p { line-height: 1.58; }
.panel, .recipe-card, .form-grid, .panel-head { min-width: 0; }
.button {
  padding-inline: 17px;
  font-weight: 760;
  letter-spacing: .004em;
}
.button.primary { background: #1f5b3a; border-color: #1f5b3a; color: #fffefa; }
.button.primary:hover { background: #17432c; border-color: #17432c; }
.button.secondary { border-color: #b6cdbc; background: #eef5ed; color: #194b32; }
.button.ghost { border-color: #d6dfd4; background: #fffefa; color: #234631; }
.button.danger { color: #fff; }
.button:disabled, .quick-action:disabled { opacity: .65; cursor: not-allowed; }
:where(button, a, input, select, textarea, summary, [role="button"]):focus-visible {
  outline: 3px solid #b87333;
  outline-offset: 3px;
}
.field { gap: 7px; }
.field > span { color: #385341; font-weight: 760; line-height: 1.35; }
.field :is(input, select, textarea) {
  background: #fffefa;
  border-color: #b9cabb;
  color: #233127;
}
.field :is(input, select, textarea):focus {
  border-color: #1f5b3a;
  box-shadow: 0 0 0 3px rgba(31, 91, 58, .14);
}
.field :is(input, select, textarea):disabled { background: #f2f3ee; color: #5b665c; }
.table-wrap { border-color: var(--ui-divider); scrollbar-color: #a6b8a6 transparent; }
.data-table { font-variant-numeric: tabular-nums; }
.data-table th { letter-spacing: .035em; }
.data-table td { vertical-align: middle; line-height: 1.48; }
.data-table tbody tr:focus-within:not(.row-danger):not(.row-warning) { background: #f1f7ee; }
.status-chip { font-weight: 800; line-height: 1.35; }
.empty-state { border-radius: var(--radius-sm); }

/* ACCUEIL — signature végétale & cacao, sans image de stock. */
.dashboard-grid { gap: clamp(13px, 1.7vw, 22px); }
.dashboard-welcome {
  isolation: isolate;
  gap: clamp(22px, 3vw, 46px);
  min-height: 238px;
  padding: clamp(26px, 3.6vw, 52px);
  border: 1px solid #2c6246;
  border-radius: 22px;
  background:
    radial-gradient(circle at 96% -15%, rgba(220, 205, 151, .19), transparent 42%),
    linear-gradient(116deg, #173f2c 0%, #1f593d 60%, #2d6b4a 100%);
  box-shadow: 0 18px 44px rgba(16, 52, 31, .17);
}
.dashboard-welcome::after {
  right: -38px;
  bottom: -102px;
  width: 250px;
  height: 250px;
  border-color: rgba(253, 241, 203, .1);
}
.dashboard-welcome .eyebrow {
  color: #e8d5a1;
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .11em;
}
.dashboard-welcome h2 {
  margin-block: 12px 9px;
  color: #fff9e9;
  font-size: clamp(2.1rem, 3.4vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -.04em;
}
.dashboard-welcome p {
  color: #e3efe0;
  font-size: clamp(.96rem, 1.2vw, 1.12rem);
  font-weight: 560;
  line-height: 1.5;
}
.dashboard-quick-actions { gap: 11px; }
.quick-action {
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(255, 253, 239, .29);
  border-radius: 14px;
  background: rgba(255, 255, 255, .115);
  color: #fff8e8;
  box-shadow: none;
  transition: background-color .16s ease, transform .16s ease;
}
.quick-action strong { color: #fffdf5; font-size: .93rem; line-height: 1.3; }
.quick-action small { color: #d8e6d8; font-size: .78rem; line-height: 1.42; }
.quick-action i { background: rgba(255, 255, 255, .16); color: #f8e4b5; }
.quick-action:hover { border-color: rgba(255,255,255,.75); background: rgba(255,255,255,.2); }
.quick-action.primary {
  border-color: #f6eacb;
  background: #f6eacb;
  color: #153d2b;
}
.quick-action.primary :is(strong,small) { color: #153d2b; opacity: 1; }
.quick-action.primary i { background: #e5e8d4; color: #1f5b3a; }
.quick-action.primary:hover { border-color: #fff9e5; background: #fff9e5; }
.quick-action:focus-visible { outline-color: #f7d58a; outline-offset: 3px; }
.metrics-row { gap: clamp(9px, 1.2vw, 16px); }
.metric-card {
  min-height: 124px;
  padding: clamp(15px, 1.8vw, 22px);
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(28, 65, 44, .05);
}
.metric-card::before { width: 6px; height: 6px; background: #c19b5c; }
.metric-card > span { color: #516253; font-size: .83rem; font-weight: 650; }
.metric-card strong {
  color: #1d5135;
  font-size: clamp(1.6rem, 2.15vw, 2.25rem);
  line-height: 1.14;
  letter-spacing: -.04em;
}
.metric-card small { color: #5d6a5d; line-height: 1.42; }
.today-actions { gap: 10px; }
.today-action, .alert-card, .compact-list-action {
  border-radius: 11px;
  min-height: 60px;
}
.today-action { padding: 12px 13px; background: #fffefa; }
.today-action strong { color: #2c3b2c; }
.today-action small { font-size: .78rem; line-height: 1.43; }
.today-action:hover { background: #f3f8ef; }
/* Severity/status semantic colors stay visible: no warning/critical overrides. */

/* Alert headings can reflow without squeezing a short severity label. */
.dashboard-grid .alert-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
}
.alert-card-head { flex-wrap: wrap; align-items: flex-start; }
.alert-card-head > .status-chip { flex: 0 0 auto; }
.alert-card-head > strong { flex: 1 1 12ch; min-width: 0; }
.alert-card-head > .status-chip > span { color: inherit; overflow-wrap: normal; }
.alert-card-head > .status-chip > b { color: inherit; background: transparent; }

/* Long material/lot names must not size a compact stock button beyond its panel. */
.compact-list-action { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.compact-list-action > :is(strong, span) { min-width: 0; overflow-wrap: anywhere; }

/* PRODUIRE — identity, next step, measurements and confirmation. */
.production-workflow { max-width: 1340px; gap: clamp(12px, 1.4vw, 19px); }
.production-header-card {
  gap: 14px;
  padding: clamp(16px, 2vw, 24px);
  border-color: #c9dbce;
  border-left: 5px solid #2f7952;
  border-radius: 16px;
  background: linear-gradient(130deg, #fffefa, #f5f9f2);
  box-shadow: 0 8px 26px rgba(31, 91, 58, .075);
}
.production-header-card :is(strong,select) { font-variant-numeric: tabular-nums; }
.production-header-card strong { color: #2e382b; }
.production-context-meta {
  border-left-color: #b8d2c0;
  gap: 12px;
}
.production-context-meta > div {
  padding-block: 3px;
  min-width: 0;
}
.production-context-meta span { color: #526453; font-size: .77rem; }
.production-context-meta strong { line-height: 1.4; }
.production-header-card .status-chip { max-width: 100%; white-space: normal; }
.preflight-sheet {
  gap: 16px;
  border-color: #bad4bf;
  border-radius: 15px;
  background: #f0f6ed;
}
.preflight-groups > div { border-color: #cdddcf; border-radius: 11px; }
.step-progress-item {
  min-height: 60px;
  gap: 4px 9px;
  padding: 10px;
  border-radius: 11px;
  background: #f6f7f2;
}
.step-progress-item.current {
  background: #edf6ed;
  box-shadow: inset 0 0 0 1px #a2c4a9, 0 6px 18px rgba(31, 91, 58, .075);
}
.step-progress-item span { white-space: normal; line-height: 1.33; }
.active-step-card {
  gap: clamp(14px, 1.8vw, 23px);
  padding: clamp(17px, 2.1vw, 30px);
  border-color: #b7cfbd;
  border-top: 6px solid #2f7952;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(21, 69, 39, .1);
}
.active-step-card > header { align-items: center; flex-wrap: wrap; }
.active-step-card h2 {
  color: #22442e;
  font-size: clamp(1.42rem, 2vw, 1.85rem);
  line-height: 1.18;
  letter-spacing: -.025em;
}
.step-count { color: #306d4a; letter-spacing: .09em; }
.step-do {
  padding: clamp(14px, 1.6vw, 21px);
  border-left-width: 5px;
  border-left-color: #b77b3e;
  border-radius: 0 12px 12px 0;
  background: #fbf6e9;
}
.step-do p { max-width: 74ch; font-size: 1.055rem; line-height: 1.6; }
.step-inputs, .step-equipment { border-top-color: #e1e8df; }
.step-timer { min-width: 0; }
.step-timer strong { font-size: 1.22rem; }
.measure-field { border-color: #d8be71; background: #fff6d9; }
.main-quantity-field > div { border-radius: 11px; }
.main-quantity-field input { font-variant-numeric: tabular-nums; }
.step-main-actions { gap: 12px; }
.step-main-actions .button.primary { min-height: 52px; font-weight: 800; }
.step-validation-error, .save-conflict {
  border-left-color: var(--danger);
  background: #fff3ed;
  color: #76241f;
}
/* Keep errors and autosave conflict visible, not hidden by a "cleaner" UI. */

/* RÉCEPTIONS — an easy scan from supplier to material, lot, amount, QC. */
.reception-fields {
  gap: 15px 18px;
  padding: 19px;
  border: 1px solid #d2e0d3;
  border-radius: 15px;
  background: #f8faf6;
}
.reception-fields .field { align-content: start; }
.reception-fields .field :is(input,select) {
  min-height: 48px;
  background: #fffefa;
}
.reception-fields .field :is(input,select):focus {
  border-color: #23704c;
  box-shadow: 0 0 0 3px rgba(35, 112, 76, .14);
}
.reception-batch-option {
  padding: 11px 12px;
  border: 1px solid #dce5d5;
  border-radius: 10px;
  background: #f4f8ef;
  color: #244630;
  font-size: .89rem;
  font-weight: 650;
  line-height: 1.42;
}
.reception-batch-option input { accent-color: #1f5b3a; }
/* :has enhances reception cards where supported; other browsers retain base. */
.page-stack:has(.reception-fields) .card-grid { gap: 14px; }
.page-stack:has(.reception-fields) .recipe-card {
  padding: 17px;
  border-color: #d5e0d3;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 5px 16px rgba(23, 63, 42, .045);
}
.page-stack:has(.reception-fields) .recipe-card:focus-within {
  border-color: #579a6f;
  box-shadow: 0 0 0 2px rgba(35, 112, 76, .14);
}
.page-stack:has(.reception-fields) .recipe-card .action-row { gap: 8px; flex-wrap: wrap; }
.page-stack:has(.reception-fields) .recipe-card .action-row .button { min-height: 44px; }
.page-stack:has(.reception-fields) .recipe-top { flex-wrap: wrap; gap: 9px; }

/* Contrôles responsables : jamais masquer libérer / bloquer / refuser. */
@media (max-width: 1180px) {
  .dashboard-welcome { border-radius: 18px; }
  .dashboard-quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .production-header-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-context-meta { grid-column: 1 / -1; }
  .reception-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .workspace { max-width: none; }
  .mobile-nav button { min-height: 58px; }
}
@media (max-width: 760px) {
  .workspace { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  .dashboard-grid { gap: 12px; }
  .dashboard-welcome {
    gap: 20px;
    min-height: 0;
    padding: 24px 19px;
    border-radius: 17px;
  }
  .dashboard-welcome h2 { font-size: clamp(2rem, 8vw, 2.65rem); }
  .dashboard-quick-actions { grid-template-columns: 1fr; }
  .quick-action { min-height: 72px; padding: 12px 14px; }
  .quick-action strong { font-size: .95rem; }
  .metric-card { min-height: 112px; }
  .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-head { flex-wrap: wrap; }
  .panel-head > * { min-width: 0; }
  .today-actions { grid-template-columns: 1fr; }
  .production-header-card { padding: 16px; border-radius: 14px; }
  .active-step-card { border-radius: 15px; }
  .active-step-card > header { align-items: start; }
  .step-timer { text-align: left; width: 100%; }
  .step-main-actions { flex-wrap: wrap; }
  .step-main-actions .button { min-height: 48px; flex: 1 1 155px; }
  .step-main-actions .button.primary { flex-basis: 100%; min-width: 0; }
  .reception-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding: 13px;
  }
  .reception-fields .field:first-child { grid-column: auto; }
  .reception-batch-option { align-items: flex-start; }
  .page-stack:has(.reception-fields) .recipe-card .action-row .button {
    flex: 1 1 116px;
  }
  /* The base stylesheet hides .save-state below 760px. Restore this status,
     wrapping it rather than removing proof of unsaved/offline changes. */
  .topbar .save-state {
    display: inline-flex;
    white-space: normal;
    min-width: 0;
    max-width: 100%;
    font-size: .74rem;
  }
}
@media (max-width: 430px) {
  .dashboard-welcome { padding: 22px 16px; }
  .dashboard-welcome h2 { font-size: 2.05rem; }
  .metric-card { padding: 15px 13px; }
  .metric-card strong { font-size: 1.55rem; }
  .active-step-card { padding: 16px 13px; }
  .step-main-actions .button { flex-basis: 100%; }
  .reception-fields { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .quick-action, .today-action, .alert-card, .compact-list-action, .button {
    transition-duration: .01ms !important;
  }
  :is(.quick-action,.today-action,.alert-card,.compact-list-action,.button):is(:hover,:active) {
    transform: none !important;
  }
}
@media print {
  body { background: #fff !important; color: #111; }
  .dashboard-welcome, .panel, .recipe-card, .metric-card,
  .production-header-card, .active-step-card {
    box-shadow: none !important;
    background: #fff !important;
    color: #111 !important;
    border-color: #777 !important;
  }
  .dashboard-welcome::after { display: none; }
  .dashboard-welcome :is(h2,p,.eyebrow),
  .dashboard-welcome .quick-action :is(strong,small) { color: #111 !important; }
  .quick-action { border-color: #777; background: #fff !important; box-shadow: none; }
  .step-do, .preflight-sheet, .reception-fields { background: #fff; }
  .step-validation-error, .save-conflict, .status-chip.critical {
    border: 2px solid #a83228 !important;
    color: #6c201d !important;
    background: #fff !important;
  }
  .page-stack:has(.reception-fields) .recipe-card { break-inside: avoid; }
}

/* P2.5b — Finishing pass: calm interactions and iPhone-safe operator actions.
   Stacked on #205; CSS only, no DOM/data/status/permission change. */
.panel-head h2 { text-wrap: balance; }
.panel-head, .panel-head > * { min-width: 0; }
.dashboard-welcome-copy, .dashboard-quick-actions, .quick-action > span {
  min-width: 0;
}
.quick-action strong, .quick-action small, .metric-card strong,
.today-action strong, .reception-fields .field > span {
  overflow-wrap: anywhere;
}
.metric-card strong, .step-timer strong, .lot-display strong {
  font-variant-numeric: tabular-nums;
}
.step-progress-item { min-width: 0; }
.step-progress-item span { overflow-wrap: anywhere; }
.topbar .save-state { min-width: 0; gap: 8px; }
.topbar .save-state small { min-width: 0; overflow-wrap: anywhere; }
.reception-fields .field { min-width: 0; }
.reception-fields :is(input,select,textarea) { max-width: 100%; }
.page-stack:has(.reception-fields) .recipe-card {
  min-width: 0;
  overflow-wrap: anywhere;
}
:where(.quick-action,.today-action,.reception-batch-option):focus-within {
  outline: 3px solid #bd8b26;
  outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .dashboard-welcome .quick-action:hover {
    border-color: #d0b777;
    box-shadow: 0 13px 30px rgba(10, 39, 24, .15);
  }
  .metric-card:hover { border-color: #afcbb6; }
}
@media (max-width: 900px) {
  /* Fixed navigation is taller than the historical workspace bottom padding. */
  .workspace { padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav { border-radius: 15px; }
  .mobile-nav button:focus-visible,
  .mobile-nav summary:focus-visible {
    outline: 3px solid #f2da90;
    outline-offset: -2px;
  }
}
@media (max-width: 760px) {
  /* Existing stylesheet sets sticky controls bottom:72px, but a 58px nav +
     chrome + iPhone safe-area may reach >100px above the device bottom.
     Keep the REAL Continue/Pause/Validate controls ABOVE the navigation. */
  .step-main-actions {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    z-index: 24;
    margin: 0 -15px -15px;
    padding: 12px 15px;
    border-top: 1px solid #cedbd0;
    border-radius: 0 0 14px 14px;
    background: #fffefa;
    box-shadow: 0 -7px 24px rgba(23, 63, 42, .09);
  }
  /* Room to scroll to the last control, including iPhone home indicator. */
  .workspace { padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px)); }
  .topbar .save-state {
    align-items: flex-start;
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
  }
  .step-validation-error { flex-basis: 100%; }
  .reception-batch-option { overflow-wrap: anywhere; }
}
@media (max-width: 430px) {
  /* Primary next-step action full-width; preserve remaining real actions,
     preferably paired rather than three giant rows on small phones. */
  .step-main-actions .button.primary { flex: 1 1 100%; }
  .step-main-actions .button:not(.primary) { flex: 1 1 132px; min-width: 0; }
  .topbar .save-state { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .metric-card, .quick-action { transition: none !important; }
}
@media print {
  .step-main-actions {
    position: static !important;
    bottom: auto !important;
    box-shadow: none !important;
    background: #fff !important;
    border-radius: 0;
  }
}

/* P2.5c — Navigation/recherche : long French labels, explicit selected state.
   No route, action, permission, status, or menu logic is modified. */
.topbar-search-results {
  max-width: min(100%, 520px);
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.topbar-search-results button {
  min-width: 0;
  width: 100%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: 9px;
}
.topbar-search-results button[aria-selected="true"] {
  background: #e9f3e8;
  color: #1b442e;
  box-shadow: inset 3px 0 #1f5b3a;
}
.topbar-search-results button:focus-visible {
  outline: 3px solid #b87333;
  outline-offset: -3px;
}
.topbar-search-results :is(strong,small) { min-width: 0; overflow-wrap: anywhere; }
.topbar-search-results small { color: #4d6052; line-height: 1.4; }

.mobile-more-menu {
  width: min(286px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(65dvh, 460px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #c7d7c8;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 16px 38px rgba(8, 38, 24, .22);
  overscroll-behavior: contain;
}
.mobile-more-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 48px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  color: #244a33;
  font-size: .87rem;
  font-weight: 690;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.mobile-more-menu button:hover { background: #edf4e9; }
.mobile-more-menu button[aria-current="page"] {
  background: #eaf3e8;
  color: #16442e;
  box-shadow: inset 3px 0 #24714d;
}
.mobile-more-menu button:focus-visible {
  outline: 3px solid #b87333;
  outline-offset: -3px;
}
.mobile-more > summary { min-width: 0; border-radius: 9px; }
@media (max-width: 900px) {
  .mobile-nav button[aria-current="page"] {
    background: rgba(249, 233, 179, .16);
    color: #fff4cf;
  }
  .mobile-more > summary[aria-current="page"] {
    background: rgba(249, 233, 179, .16);
    color: #fff4cf;
  }
}
@media (max-width: 430px) {
  .topbar-search-results { left: 0; right: auto; width: 100%; max-width: 100%; }
  .mobile-more-menu { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar-search-results button, .mobile-more-menu button { transition: none !important; }
}

/* P2.5d — Finition premium : coherent cacao/forest/vanilla interactions.
   Animate the composited surfaces only; never animate layout, data or warnings. */
:root {
  --ui-motion-fast: 140ms;
  --ui-motion-smooth: 240ms;
  --ui-motion-ease: cubic-bezier(.22, 1, .36, 1);
  --ui-brand-cream: #f6eacb;
  --ui-brand-green: #1f5b3a;
  --ui-brand-line: #d8e0d4;
  --ui-button-shadow: 0 6px 16px rgba(23,63,42,.08);
}
.button {
  min-width: 0;
  max-width: 100%;
  border-radius: 12px;
  transition:
    background-color var(--ui-motion-smooth) ease,
    border-color var(--ui-motion-smooth) ease,
    color var(--ui-motion-fast) ease,
    box-shadow var(--ui-motion-smooth) ease,
    transform var(--ui-motion-fast) var(--ui-motion-ease);
}
.button.primary {
  border-color: var(--ui-brand-green);
  background: var(--ui-brand-green);
  color: #fffefa;
  box-shadow: 0 6px 18px rgba(31,91,58,.16);
}
.button.secondary {
  border-color: #b6cdbc;
  background: #eef5ed;
  color: #194b32;
}
.button.ghost {
  border-color: var(--ui-brand-line);
  background: #fffefa;
  color: #234631;
}
.button:is(:disabled,[aria-disabled="true"]) {
  box-shadow: none;
  transform: none;
}
:where(.button,.quick-action,.mobile-nav button,.mobile-more summary):focus-visible {
  outline: 3px solid #bb852d;
  outline-offset: 3px;
}
.dashboard-welcome .quick-action:focus-visible,
.mobile-nav button:focus-visible,
.mobile-more summary:focus-visible {
  outline-color: #f6eacb;
  outline-offset: -3px;
}
.panel, .metric-card, .recipe-card {
  border-color: var(--ui-brand-line);
}
.login-panel, .pause-dialog {
  border-color: #d4dfd2;
  border-radius: 18px;
  background: #fffefa;
  box-shadow: 0 26px 68px rgba(16,52,31,.13);
}
.account-dialog {
  background: #fffefa;
  border-color: #d4dfd2;
}
.modal-backdrop {
  background: rgba(16,40,26,.55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
:where(.account-dialog,.pause-dialog,.login-panel) {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.topbar-actions > *, .reception-fields > *, .step-main-actions > * {
  min-width: 0;
}
@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):not([aria-disabled="true"]):hover {
    box-shadow: 0 9px 21px rgba(18,58,36,.13);
    transform: translateY(-1px);
  }
  .button.primary:not(:disabled):hover {
    box-shadow: 0 10px 24px rgba(31,91,58,.25);
  }
  .button:not(:disabled):not([aria-disabled="true"]):active {
    transform: scale(.987);
    box-shadow: var(--ui-button-shadow);
  }
  .nav-item:hover {
    transform: none;
    background: rgba(255,255,255,.10);
  }
  .quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(8,33,22,.15);
  }
}
@media (hover: none), (pointer: coarse) {
  .button:active, .quick-action:active { transform: none; }
  .nav-item:hover, .quick-action:hover,
  .alert-card.clickable:hover, .today-action:hover,
  .compact-list-action:hover { transform: none; }
}
@keyframes bb-premium-arrive {
  from { opacity: .94; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bb-dialog-arrive {
  from { opacity: .96; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .dashboard-welcome {
    animation: bb-premium-arrive 420ms var(--ui-motion-ease) both;
  }
}
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .modal-backdrop > :is(.pause-dialog,.account-dialog) {
    animation: bb-dialog-arrive 220ms var(--ui-motion-ease) both;
  }
}
@media (max-width: 430px) {
  .dashboard-welcome h2 { font-size: clamp(1.8rem, 7.8vw, 2.05rem); }
}
@media (max-width: 760px) and (max-height: 600px) {
  /* iPhone landscape / 200% zoom: no giant sticky validation bar
     over the measurement fields; scrolling always reaches the actions. */
  .step-main-actions {
    position: static;
    bottom: auto;
    margin: 0 -15px -15px;
  }
  .mobile-more-menu { max-height: min(55dvh, 300px); }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-welcome,
  .modal-backdrop > :is(.pause-dialog,.account-dialog) {
    animation: none !important;
  }
  .button, .quick-action, .nav-item, .metric-card {
    transition: none !important;
  }
  .button:is(:hover,:active),
  .quick-action:is(:hover,:active),
  .nav-item:hover { transform: none !important; }
}
@media print {
  .dashboard-welcome,
  .modal-backdrop > :is(.pause-dialog,.account-dialog) {
    animation: none !important;
    transform: none !important;
  }
  .panel, .recipe-card, .metric-card { box-shadow: none !important; }
}

/* P2.5f — Modal touch targets and dynamic-height safe area.
   The existing account close control is 38 × 38 px in styles.css. */
.account-dialog .icon-close {
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 12px;
  line-height: 1;
}
.account-dialog .icon-close:focus-visible {
  outline: 3px solid #a56a17;
  outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .account-dialog .icon-close:hover {
    border-color: #a9c5ae;
    background: #eef5ed;
  }
}
@media (max-width: 760px) {
  /* Preserve the original full-screen account dialog, with the browser's
     *visible* viewport instead of fixed 100vh under iPhone browser chrome. */
  .account-dialog {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: 100vh;
    max-height: 100dvh;
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }
  .pause-dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

/* P2.5g — Ingredient lot actions and traceable stock tables.
   Enlarge genuine operator controls without changing stock selection logic. */
.ingredient-table .lot-picker,
.ingredient-table .ingredient-qty-edit {
  min-width: 0;
}
.ingredient-table .lot-picker select {
  min-width: 0;
  width: 100%;
  min-height: 48px;
}
.ingredient-table .ingredient-qty-edit input {
  min-width: 0;
  min-height: 48px;
}
.ingredient-table :is(.lot-picker,.ingredient-qty-edit) .small-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #b9d1bc;
  border-radius: 10px;
  background: #f1f7ee;
  color: #194b32;
  font-size: .875rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.ingredient-table :is(.lot-picker,.ingredient-qty-edit) .small-link:focus-visible {
  outline: 3px solid #a56a17;
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .ingredient-table :is(.lot-picker,.ingredient-qty-edit) .small-link:hover {
    background: #e6f1e4;
    border-color: #6e9d7a;
  }
}
/* Keep the existing horizontal scroll — never squeeze 8-column stock tables
   or hide supplier IDs; highlight exact routed lots without erasing risks. */
.table-wrap { border-radius: 14px; }
.table-wrap:focus-within {
  border-color: #a9c9ad;
  box-shadow: 0 0 0 2px rgba(31,91,58,.09);
}
.data-table th {
  background: #f2f6ef;
  color: #244b31;
  line-height: 1.45;
}
.data-table td code {
  white-space: normal;
  overflow-wrap: anywhere;
  color: #324b37;
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr[aria-current="location"]:not(.row-danger):not(.row-warning) > td {
  background: #e9f3e9;
}
.data-table tbody tr[aria-current="location"]:not(.row-danger):not(.row-warning) > td:first-child {
  box-shadow: inset 4px 0 #2f7952;
}
@media (max-width: 760px) {
  .ingredient-table .lot-picker { gap: 9px; }
  .ingredient-table :is(.lot-picker,.ingredient-qty-edit) .small-link {
    justify-content: center;
  }
}
@media print {
  .table-wrap:focus-within { border-color: #777; box-shadow: none !important; }
  .data-table th { background: #fff !important; color: #111 !important; }
  .data-table tbody tr[aria-current="location"] > td { background: #fff !important; }
  .data-table tbody tr[aria-current="location"] > td:first-child { box-shadow: none; }
}

/* P2.5h — iOS input zoom: do not let sub-16px editable text magnify the
   viewport unexpectedly when an operator taps a measurement or login field.
   Do not disable user pinch-to-zoom or modify the viewport meta tag. */
@media (max-width: 900px) {
  .password-form textarea,
  .topbar-search input,
  .login-panel input,
  .field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
  .ingredient-table :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    font-size: max(16px, 1em);
  }
  .password-form textarea {
    min-height: 110px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }
  /* Keep long date, lot, and instrument values inside native controls. */
  .field :is(input, select, textarea),
  .ingredient-table :is(input, select) {
    box-sizing: border-box;
    max-width: 100%;
  }
}

/* P2.5i — Legible bottom navigation: avoid 0.61rem/9.8px labels on small
   phones, and reserve enough room for 2 lines and the real production CTA. */
@media (max-width: 900px) {
  .mobile-nav button {
    min-height: 66px;
    padding: 7px 3px;
    grid-template-rows: 22px auto;
    align-content: center;
    gap: 3px;
    line-height: 1.2;
  }
  .mobile-nav button span {
    display: block;
    width: 100%;
    font-size: .75rem;
    font-weight: 750;
    line-height: 1.18;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    text-overflow: clip;
  }
  .mobile-more summary {
    min-height: 66px;
    padding: 8px 3px;
    font-size: .75rem;
    line-height: 1.25;
    font-weight: 750;
    text-align: center;
    white-space: normal;
  }
  /* The mobile footer is also present on tablets: keep production actions
     above it at 820px, not only below the historical 760px breakpoint. */
  .step-main-actions {
    position: sticky;
    bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 760px) {
  /* Full 66px button + 12px padding + fixed nav bottom safe area. */
  .step-main-actions {
    bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }
  .workspace {
    padding-bottom: calc(172px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 760px) and (max-height: 600px) {
  /* Keep the short-height/zoom fallback established in P2.5d. */
  .step-main-actions { position: static; bottom: auto; }
  .topbar { position: static; }
}



/* P2.5 STOCK iPhone — cartes de lots et mouvements.
   Les deux tables réelles de StockPage sont les seules concernées.
   Pas de suppression de champs, d'édition, de droits, de statuts, ni de stock. */
.stock-workspace {
  min-width: 0;
  max-width: 100%;
}
.stock-workspace > .panel {
  min-width: 0;
  max-width: 100%;
}
.stock-lots-panel .stock-filters select {
  min-height: 48px;
  border-radius: 11px;
  font-size: 1rem;
}
.stock-lots-panel .stock-filters .muted {
  overflow-wrap: anywhere;
}
.stock-workspace > .button,
.stock-workspace .edit-actions .button {
  min-height: 44px;
}
/* The direct History button is outside .edit-actions. */
.stock-workspace > .button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media screen and (max-width: 760px) {
  .stock-workspace {
    gap: 15px;
  }
  .stock-workspace > .panel {
    padding: 17px 13px;
    border-radius: 17px;
  }
  .stock-workspace .panel-head {
    gap: 12px;
    align-items: flex-start;
  }
  .stock-workspace .edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    min-width: 0;
    width: 100%;
  }
  .stock-workspace .edit-actions .button {
    flex: 1 1 130px;
    min-width: 0;
    white-space: normal;
  }
  .stock-lots-panel .stock-filters {
    align-items: stretch;
    gap: 10px;
  }
  .stock-lots-panel .stock-filters > label {
    flex: 1 1 100%;
  }
  .stock-lots-panel .stock-filters > .muted {
    display: block;
    width: 100%;
    font-size: .82rem;
  }

  /* Preserve the real HTML tables and headers for assistive technologies.
     Only their visual layout changes on narrow screens. */
  .stock-lots-panel .table-wrap,
  .stock-movements-panel .table-wrap {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .stock-lots-panel .data-table,
  .stock-movements-panel .data-table {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-collapse: separate;
  }
  .stock-lots-panel .data-table thead,
  .stock-movements-panel .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .stock-lots-panel .data-table tbody,
  .stock-movements-panel .data-table tbody {
    display: grid;
    gap: 13px;
    min-width: 0;
  }
  .stock-lots-panel .data-table tbody tr,
  .stock-movements-panel .data-table tbody tr {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid #cdddcf;
    border-left: 4px solid #49805a;
    border-radius: 15px;
    background: #fffefa;
    box-shadow: 0 5px 15px rgba(18, 56, 32, .065);
  }
  .stock-lots-panel .data-table tbody tr.row-danger {
    border-color: #daa6a1;
    border-left-color: #a83228;
  }
  .stock-lots-panel .data-table tbody tr.row-warning {
    border-color: #e5c47e;
    border-left-color: #986515;
  }
  .stock-lots-panel .data-table tbody tr.row-info {
    border-left-color: #ac7b21;
  }
  .stock-lots-panel .data-table tbody tr.row-muted {
    border-left-color: #8d958b;
  }
  .stock-lots-panel .data-table tbody tr > td,
  .stock-movements-panel .data-table tbody tr > td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid rgba(46, 80, 52, .10);
    /* No cell background override: main styles.css owns row-danger/warning. */
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    font-variant-numeric: tabular-nums;
  }
  .stock-lots-panel .data-table tbody tr > td::before,
  .stock-movements-panel .data-table tbody tr:not(.stock-empty-row) > td::before {
    display: block;
    margin-bottom: 1px;
    color: #47634f;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .055em;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .stock-lots-panel .data-table tbody td:first-child,
  .stock-lots-panel .data-table tbody td:last-child,
  .stock-movements-panel .data-table tbody td:nth-child(3),
  .stock-movements-panel .data-table tbody td:nth-child(4) {
    grid-column: 1 / -1;
  }
  .stock-lots-panel .data-table tbody td:first-child {
    padding: 14px 12px 12px;
    border-bottom: 1px solid rgba(46,80,52,.16);
  }
  .stock-lots-panel .data-table tbody td:first-child strong {
    color: #18482d;
    font-size: 1.06rem;
    line-height: 1.38;
    overflow-wrap: anywhere;
  }
  .stock-lots-panel .data-table tbody tr.row-danger td:first-child strong {
    color: #852820;
  }
  .stock-lots-panel .data-table tbody td:nth-child(4) {
    font-size: 1.04rem;
    font-weight: 800;
    color: #194b32;
  }
  .stock-lots-panel .data-table tbody tr.row-danger td:nth-child(4) {
    color: #852820;
  }
  .stock-lots-panel .data-table tbody td:last-child {
    padding-bottom: 14px;
    border-bottom: 0;
  }
  .stock-lots-panel .data-table tbody tr > td::before {
    content: "";
  }
  .stock-lots-panel .data-table tbody td:nth-child(1)::before { content: "Ingrédient"; }
  .stock-lots-panel .data-table tbody td:nth-child(2)::before { content: "Fournisseur"; }
  .stock-lots-panel .data-table tbody td:nth-child(3)::before { content: "N° lot"; }
  .stock-lots-panel .data-table tbody td:nth-child(4)::before { content: "Stock restant"; }
  .stock-lots-panel .data-table tbody td:nth-child(5)::before { content: "Seuil mini"; }
  .stock-lots-panel .data-table tbody td:nth-child(6)::before { content: "Prix"; }
  .stock-lots-panel .data-table tbody td:nth-child(7)::before { content: "DLC / DDM"; }
  .stock-lots-panel .data-table tbody td:nth-child(8)::before { content: "Statut"; }
  .stock-movements-panel .data-table tbody td:nth-child(1)::before { content: "Date"; }
  .stock-movements-panel .data-table tbody td:nth-child(2)::before { content: "Type"; }
  .stock-movements-panel .data-table tbody td:nth-child(3)::before { content: "Ingrédient"; }
  .stock-movements-panel .data-table tbody td:nth-child(4)::before { content: "Lot"; }
  .stock-movements-panel .data-table tbody td:nth-child(5)::before { content: "Quantité"; }
  .stock-movements-panel .data-table tbody td:nth-child(6)::before { content: "Production"; }
  .stock-movements-panel .data-table tbody tr.stock-empty-row td {
    grid-column: 1 / -1;
    min-height: 64px;
    border-bottom: 0;
  }
  .stock-lots-panel .data-table td :is(input, select),
  .stock-lots-panel .data-table td .compact-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 16px;
  }
  .stock-lots-panel .data-table td input:disabled {
    background: rgba(238, 243, 233, .75);
    color: #264b34;
    -webkit-text-fill-color: #264b34;
    opacity: 1;
  }
  .stock-lots-panel .data-table .status-chip {
    max-width: 100%;
    white-space: normal;
    line-height: 1.3;
  }
  .stock-lots-panel .data-table .status-chip > span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .stock-lots-panel .data-table .status-chip > b {
    flex: 0 0 auto;
  }
  .stock-workspace .data-table td code,
  .stock-workspace .data-table td small {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .stock-workspace .data-table td code {
    font-size: .83rem;
    white-space: normal;
  }
}

/* P2.5 Stock small-screen fallback: no cramped half-width fields at 320px.
   390px / 430px continue to show the compact two-column cards. */
@media screen and (max-width: 359px) {
  .stock-lots-panel .data-table tbody tr,
  .stock-movements-panel .data-table tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }
  .stock-lots-panel .data-table tbody tr > td,
  .stock-movements-panel .data-table tbody tr > td {
    grid-column: 1 / -1;
  }
}

/* P2.5j — Brand, iconography & owner-photo hooks.
   Source: native Bitasyon classes. CSS only — no remote assets, dependency,
   third-party font, React change, JavaScript, or altered business control. */
:root {
  --bb-cacao-deep: #4b2f20;
  --bb-leaf-dark: #143d29;
  --bb-vanilla-light: #fbf3dd;
  --bb-brand-outline: rgba(233,210,151,.54);
  --bb-card-radius: 18px;
  --bb-card-elevation: 0 12px 34px rgba(24,49,33,.085);
  /* Replace these gradients with a SELF-HOSTED approved image in a later
     asset-specific PR. No broken image path or third-party hotlink today. */
  --bb-hero-photo: linear-gradient(124deg,#e3f0dc,#f4ebd7);
  --bb-login-photo: linear-gradient(130deg,#143e2b,#386142);
  --bb-glyph-dashboard: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-production: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M12%207v10M7%2012h10%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-planning: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%203v4M17%203v4M3%2010h18M8%2015h3M14%2015h3%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-recipes: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%205.5A2.5%202.5%200%200%201%206.5%203H20v17H6.5A2.5%202.5%200%200%201%204%2017.5z%22%2F%3E%3Cpath%20d%3D%22M4%2017.5A2.5%202.5%200%200%201%206.5%2015H20M8%207h8M8%2011h6%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-stock: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%207%209-4%209%204-9%204zM3%207v10l9%204%209-4V7M12%2011v10%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-quality: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%202%204%206v6c0%205%203.3%208.2%208%2010%204.7-1.8%208-5%208-10V6z%22%2F%3E%3Cpath%20d%3D%22m8.5%2012%202.5%202.5%204.5-5%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-organisation: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%228%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M3%2020v-2a6%206%200%200%201%2012%200v2M17%205a3%203%200%200%201%200%206M17%2014a5%205%200%200%201%204%205%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-receptions: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%203h16v13h-4l-2%203h-4l-2-3H4zM8%209h8M12%206v6%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-actionStart: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2012h14M12%205v14%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-actionResume: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m8%205%2011%207-11%207z%22%2F%3E%3C%2Fsvg%3E");
  --bb-glyph-actionCalendar: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%203v4M17%203v4M3%2010h18M8%2015h3M14%2015h3%22%2F%3E%3C%2Fsvg%3E");
}

/* The current B/leaf is an intentional fallback, NOT presented as the
   real-world official logo. Supports actual <img> once Cloud adds an asset. */
.bitasyon-logo {
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.bitasyon-logo .logo-leaf {
  width: 46px;
  height: 46px;
  min-width: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244,232,196,.52);
  border-radius: 55% 50% 55% 21%;
  background: linear-gradient(142deg,#398e54 0%,#1f5b3a 52%,#633c25 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.18),0 5px 17px rgba(0,24,14,.23);
}
.bitasyon-logo .logo-leaf span {
  font-family: Georgia,"Times New Roman",serif;
  font-weight: 750;
  font-size: 1.42rem;
  line-height: 1;
  color: #fff5d5;
}
.bitasyon-logo > .bb-official-logo {
  display: block;
  width: auto;
  height: 54px;
  max-width: min(100%,200px);
  object-fit: contain;
  object-position: left center;
}
.bitasyon-logo:has(> .bb-official-logo) > .logo-leaf { opacity: 0; position: absolute; }
.bitasyon-logo > div:last-child { min-width: 0; }
.bitasyon-logo > div:last-child strong {
  font-family: Georgia,"Times New Roman",serif;
  font-weight: 650;
  letter-spacing: -.025em;
}

/* High quality self-contained outline icons. DOM glyphs stay as a fallback
   in engines lacking CSS masking. The buttons already expose readable text. */
@supports ((mask-image: none) or (-webkit-mask-image: none)) {
  :is(.nav-item,.mobile-nav button)[data-module] > i,
  .quick-action > i {
    position: relative;
    font-size: 0;
    line-height: 0;
  }
  :is(.nav-item,.mobile-nav button)[data-module] > i::before,
  .quick-action > i::before {
    content: "";
    display: block;
    width: 21px;
    height: 21px;
    margin: auto;
    background: currentColor;
    -webkit-mask-image: var(--bb-ui-glyph);
    mask-image: var(--bb-ui-glyph);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
  }
  :is(.nav-item,.mobile-nav button)[data-module="dashboard"] > i,
  .mobile-more-menu button[data-module="dashboard"] { --bb-ui-glyph: var(--bb-glyph-dashboard); }
  :is(.nav-item,.mobile-nav button)[data-module="production"] > i,
  .mobile-more-menu button[data-module="production"] { --bb-ui-glyph: var(--bb-glyph-production); }
  :is(.nav-item,.mobile-nav button)[data-module="planning"] > i,
  .mobile-more-menu button[data-module="planning"] { --bb-ui-glyph: var(--bb-glyph-planning); }
  :is(.nav-item,.mobile-nav button)[data-module="recipes"] > i,
  .mobile-more-menu button[data-module="recipes"] { --bb-ui-glyph: var(--bb-glyph-recipes); }
  :is(.nav-item,.mobile-nav button)[data-module="stock"] > i,
  .mobile-more-menu button[data-module="stock"] { --bb-ui-glyph: var(--bb-glyph-stock); }
  :is(.nav-item,.mobile-nav button)[data-module="quality"] > i,
  .mobile-more-menu button[data-module="quality"] { --bb-ui-glyph: var(--bb-glyph-quality); }
  :is(.nav-item,.mobile-nav button)[data-module="organisation"] > i,
  .mobile-more-menu button[data-module="organisation"] { --bb-ui-glyph: var(--bb-glyph-organisation); }
  :is(.nav-item,.mobile-nav button)[data-module="receptions"] > i,
  .mobile-more-menu button[data-module="receptions"] { --bb-ui-glyph: var(--bb-glyph-receptions); }
  .quick-action:first-child > i { --bb-ui-glyph: var(--bb-glyph-actionStart); }
  .quick-action:nth-child(2) > i { --bb-ui-glyph: var(--bb-glyph-actionResume); }
  .quick-action:nth-child(3) > i { --bb-ui-glyph: var(--bb-glyph-actionCalendar); }
  .mobile-more-menu button[data-module="receptions"]::before {
    content: "";
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    background: currentColor;
    -webkit-mask: var(--bb-glyph-receptions) center / contain no-repeat;
    mask: var(--bb-glyph-receptions) center / contain no-repeat;
  }
}

/* Brand photos are decorative backgrounds, never container text or alerts.
   A near-opaque overlay keeps text legible even over high-contrast images. */
.dashboard-welcome {
  isolation: isolate;
  border-color: #bfd3bd;
  border-radius: var(--bb-card-radius);
  background-image:
    linear-gradient(112deg,rgba(247,250,244,.99) 0%,rgba(247,250,244,.96) 50%,rgba(246,248,239,.88) 100%),
    var(--bb-hero-photo);
  background-size: cover;
  background-position: center;
}
.dashboard-welcome h2 { color: var(--bb-cacao-deep); letter-spacing: -.035em; }
.dashboard-welcome .eyebrow { color: #275538; letter-spacing: .09em; }
.dashboard-quick-actions { min-width: 0; }
.quick-action {
  min-width: 0;
  border-radius: 14px;
  border-color: #d4e0d0;
  box-shadow: 0 6px 20px rgba(29,65,42,.055);
}
.quick-action > i { flex-shrink: 0; }
.quick-action.primary {
  background: linear-gradient(140deg,#1d5c3b,#17432e);
  border-color: #17432e;
}
.metric-card { border-radius: 15px; }
.metric-card strong { letter-spacing: -.035em; }
.login-story {
  background-image:
    linear-gradient(135deg,rgba(12,46,29,.94),rgba(22,70,43,.89)),
    var(--bb-login-photo);
  background-size: cover;
  background-position: center;
}
.production-header-card,
.active-step-card,
.page-stack:has(.reception-fields) > .panel {
  border-radius: var(--bb-card-radius);
}
.active-step-card { border-color: #bad0bd; }
.reception-fields {
  border-radius: 14px;
  border: 1px solid #dae3d5;
  background: linear-gradient(145deg,#f5f9f2,#fffefa);
}
.reception-fields .field > span { color: #284735; font-weight: 740; }
.reception-fields :is(input,select,textarea) { background: #fffefa; }
:where(.reception-fields,.active-step-card,.dashboard-welcome) :is(.button,input,select,textarea):focus-visible {
  outline: 3px solid #ad7b24;
  outline-offset: 2px;
}

/* Brand enhancements must never erase critical statuses or local-save proofs. */
:is(.save-conflict,.step-validation-error,.alert-card,.school-banner,.save-state) {
  position: relative;
}
@media (min-width: 1200px) {
  .dashboard-welcome { min-height: 214px; }
  .quick-action { min-height: 98px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .dashboard-welcome { padding: 24px; }
  .quick-action { padding: 12px; gap: 8px; }
}
@media (max-width: 760px) {
  .dashboard-welcome { background-position: 65% center; }
  .quick-action { min-height: 76px; }
  .bitasyon-logo > .bb-official-logo { height: 48px; max-width: 168px; }
  .reception-fields { padding: 12px; }
}
@media (max-width: 430px) {
  .bitasyon-logo .logo-leaf { width: 42px; height: 42px; min-width: 42px; }
  .dashboard-welcome { padding: 22px 16px; }
  .quick-action > i { width: 36px; height: 36px; }
}
@media (forced-colors: active) {
  .quick-action, .reception-fields, .dashboard-welcome {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  .quick-action > i, .nav-item > i { forced-color-adjust: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .quick-action, .dashboard-welcome { animation: none; transition: none; }
}
@media print {
  .dashboard-welcome, .login-story, .reception-fields, .quick-action {
    background-image: none !important;
    color: #111 !important;
    box-shadow: none !important;
  }
  .dashboard-welcome::after { content: none !important; }
  .quick-action > i { color: #111; }
}

/* P2.5k — Bitasyon Atelier / botanical quiet-luxury finishing.
   An additive CSS-only layer. Genuine actions/statuses stay fully visible.
   No asset, font, JS, scroll hijacking or data-dependent animation. */
:root {
  --bb-atelier-night: #183d2d;
  --bb-atelier-forest: #23573f;
  --bb-atelier-moss: #e9f1e7;
  --bb-atelier-cream: #fbf8ee;
  --bb-atelier-ivory: #fffef9;
  --bb-atelier-cacao: #503829;
  --bb-atelier-copy: #26382d;
  --bb-atelier-muted: #536658;
  --bb-atelier-stroke: #d7e0d3;
  --bb-atelier-copper: #b48751;
  --bb-atelier-ease: cubic-bezier(.22, 1, .36, 1);
  --bb-atelier-ambient-shadow: 0 2px 7px rgba(31, 53, 37, .035),
    0 17px 42px rgba(31, 53, 37, .065);
}

/* Reduce visual noise during long laboratory shifts. Leave alert and
   status colour ownership with styles.css; no contrast-diluting overlays. */
html { background-color: #f5f6f0; }
body {
  color: var(--bb-atelier-copy);
  background:
    radial-gradient(ellipse 75% 390px at 87% -110px, rgba(182, 204, 165, .18), transparent 85%),
    radial-gradient(ellipse 58% 360px at -15% 45%, rgba(197, 171, 122, .065), transparent 88%),
    #f6f7f1;
}
::selection { background: #d3e5ca; color: #173b2a; }
.workspace { max-width: 1720px; }
.topbar {
  border-bottom-color: rgba(94, 125, 101, .2);
  background: rgba(250, 250, 245, .96);
  box-shadow: 0 1px 3px rgba(29, 52, 36, .035);
}
.topbar h1 {
  color: var(--bb-atelier-night);
  letter-spacing: -.035em;
  text-wrap: balance;
}
.topbar-title .eyebrow {
  color: #4d6956;
  letter-spacing: .12em;
}

/* Reception, production and home share the same tactile vocabulary:
   crisp edges, deep soft shadows, a restrained material rather than glass. */
.dashboard-grid { row-gap: clamp(14px, 1.8vw, 27px); }
.dashboard-welcome {
  border-color: #37664c;
  border-radius: clamp(19px, 2.1vw, 27px);
  background:
    radial-gradient(ellipse 64% 105% at 4% 110%, rgba(176, 153, 94, .16), transparent 78%),
    radial-gradient(ellipse 55% 120% at 101% -10%, rgba(224, 220, 158, .13), transparent 76%),
    linear-gradient(118deg, #173c2c 0%, #215741 64%, #2c684c 100%);
  box-shadow: 0 2px 2px rgba(16, 47, 30, .10),
    0 23px 51px rgba(16, 47, 30, .16);
}
.dashboard-welcome::before {
  content: "";
  position: absolute;
  inset: -70% -14% auto auto;
  width: min(42vw, 510px);
  aspect-ratio: 1;
  border: 1px solid rgba(244, 231, 196, .16);
  border-radius: 43% 57% 52% 48%;
  transform: rotate(-24deg);
  z-index: 0;
}
.dashboard-welcome .eyebrow {
  color: #f3dda6;
  letter-spacing: .13em;
}
.dashboard-welcome h2 {
  max-width: 13ch;
  color: #fffaf0;
  line-height: 1.03;
  letter-spacing: -.047em;
  text-wrap: balance;
}
.dashboard-welcome p {
  color: #e2f0de;
  line-height: 1.48;
  font-weight: 600;
}
.dashboard-quick-actions { align-content: center; }
.dashboard-welcome .quick-action {
  border: 1px solid rgba(222, 231, 213, .94);
  border-radius: 17px;
  background: #fcfdf9;
  box-shadow: 0 8px 24px rgba(11, 36, 22, .095);
}
.dashboard-welcome .quick-action strong {
  color: #274632;
  letter-spacing: -.016em;
  font-weight: 800;
}
.dashboard-welcome .quick-action small { color: #536456; }
.dashboard-welcome .quick-action.primary {
  border-color: #efe0b5;
  background: #f7ecd3;
  box-shadow: 0 9px 25px rgba(8, 31, 19, .16);
}
.dashboard-welcome .quick-action.primary :is(strong,small) {
  color: #263d2a;
  opacity: 1;
}
.dashboard-welcome .quick-action.primary i {
  background: #e5d3aa;
  color: #214931;
}

/* KPI blocks read as precise instruments: generous numbers, calm captions. */
.metrics-row { gap: clamp(10px, 1.2vw, 17px); }
.metrics-row .metric-card {
  min-width: 0;
  border: 1px solid var(--bb-atelier-stroke);
  border-radius: 19px;
  background: linear-gradient(155deg, #fffefa 0%, #f7faf5 100%);
  box-shadow: 0 8px 25px rgba(27, 50, 34, .045);
}
.metrics-row .metric-card strong {
  color: #1c4632;
  line-height: 1.04;
  letter-spacing: -.036em;
  font-size: clamp(1.6rem, 2vw, 2.15rem);
  font-variant-numeric: tabular-nums;
}
.metrics-row .metric-card small {
  color: var(--bb-atelier-muted);
  font-weight: 650;
  line-height: 1.4;
}
.panel {
  border-radius: 19px;
  border-color: var(--bb-atelier-stroke);
  background: var(--bb-atelier-ivory);
  box-shadow: var(--bb-atelier-ambient-shadow);
}
.panel-head h2 {
  color: #25432f;
  line-height: 1.16;
  letter-spacing: -.026em;
  text-wrap: balance;
}
.panel-head .eyebrow {
  color: #5e735e;
  font-weight: 800;
  letter-spacing: .11em;
}

/* A clear choreography for Produce: context -> active step -> controls. */
.production-header-card {
  border-color: #c9dbc8;
  border-top-color: #286746;
  border-radius: 20px;
  background: linear-gradient(130deg, #fffef9, #f1f7ef);
  box-shadow: var(--bb-atelier-ambient-shadow);
}
.production-context-meta {
  border-left-color: #c9d9c7;
  row-gap: 12px;
}
.production-context-meta strong {
  color: #264533;
  font-variant-numeric: tabular-nums;
}
.step-progress-item {
  border-radius: 13px;
  transition: border-color .19s ease, box-shadow .19s ease,
    background-color .19s ease;
}
.step-progress-item.current {
  border-color: #2e7050;
  box-shadow: 0 0 0 2px rgba(49, 116, 77, .13);
}
.active-step-card {
  border-color: #c9dbc8;
  border-top-color: #286746;
  border-radius: 20px;
  background: linear-gradient(170deg, #fffefa 0%, #fbfcf9 100%);
  box-shadow: 0 12px 38px rgba(28, 68, 41, .085);
}
.active-step-card h2 {
  color: #1e4631;
  letter-spacing: -.026em;
  line-height: 1.17;
}
.step-do { border-left-width: 4px; border-radius: 11px; }
.step-timer strong { font-variant-numeric: tabular-nums; }
.step-main-actions {
  border-radius: 13px;
  border-color: #d5e1d4;
}

/* Reception is a real workstation form; never hide pending/blocked states. */
.reception-fields { gap: clamp(11px, 1.55vw, 19px); }
.reception-fields .field > span {
  color: #365440;
  line-height: 1.35;
  font-weight: 750;
}
.reception-fields :is(input,select,textarea) {
  border-color: #bfcfc1;
  background-color: #fffefa;
}
.page-stack:has(.reception-fields) .recipe-card {
  border-radius: 17px;
  border-color: #d2e0d3;
  box-shadow: 0 6px 20px rgba(24, 53, 36, .045);
}
.page-stack:has(.reception-fields) .recipe-card:focus-within {
  border-color: #428362;
  box-shadow: 0 0 0 2px rgba(35, 112, 76, .13);
}

/* Make form feedback and keyboard focus deliberate, not just decorative. */
:where(.reception-fields,.active-step-card,.production-header-card)
  .field:focus-within > span { color: #205c3d; }
:where(.reception-fields,.active-step-card,.production-header-card)
  :is(input,select,textarea):focus-visible {
  outline: 3px solid #a7793f;
  outline-offset: 2px;
}
:where(.dashboard-welcome,.active-step-card,.reception-fields)
  :is(.button,.quick-action):focus-visible {
  outline: 3px solid #b98236;
  outline-offset: 3px;
}

/* Restraint matters: only pointer-fine, never layout-shifting gestures. */
@media (hover: hover) and (pointer: fine) {
  .metrics-row .metric-card {
    transition: box-shadow .23s var(--bb-atelier-ease),
      border-color .23s ease, transform .23s var(--bb-atelier-ease);
  }
  .metrics-row .metric-card:hover {
    border-color: #a4c4a8;
    box-shadow: 0 13px 32px rgba(24, 55, 34, .085);
    transform: translateY(-2px);
  }
  .dashboard-welcome .quick-action:not(:disabled):hover {
    border-color: #acd0b1;
    box-shadow: 0 14px 32px rgba(8, 31, 19, .17);
  }
}

/* A subtle welcome reveal only; scrolling and form values never animate. */
@keyframes bb-atelier-quiet-reveal {
  from { opacity: .96; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .dashboard-welcome {
    animation: bb-atelier-quiet-reveal 470ms var(--bb-atelier-ease) both;
  }
}

/* 390px phone, 820px tablet, 1440px desktop — use real flexible content. */
@media (min-width: 761px) and (max-width: 1040px) {
  .dashboard-welcome { gap: 21px; padding: clamp(21px, 2.6vw, 32px); }
  .dashboard-welcome h2 { font-size: clamp(2rem, 3vw, 2.8rem); }
  .dashboard-quick-actions { min-width: 0; }
  .dashboard-welcome .quick-action {
    min-width: 0; padding: 11px; gap: 8px; border-radius: 14px;
  }
  .dashboard-welcome .quick-action strong { overflow-wrap: anywhere; }
}
@media (max-width: 760px) {
  .dashboard-welcome { padding: 21px 17px; border-radius: 19px; }
  .dashboard-welcome::before {
    width: 215px; right: -65px; top: -80px;
  }
  .dashboard-welcome h2 { max-width: none; font-size: clamp(1.85rem, 7.4vw, 2.45rem); }
  .dashboard-welcome .quick-action { border-radius: 13px; }
  .metrics-row .metric-card { padding: 14px; border-radius: 15px; }
  .metrics-row .metric-card strong { font-size: clamp(1.48rem, 6vw, 1.85rem); }
  .production-header-card, .active-step-card { border-radius: 16px; }
  .production-context-meta { border-left: 0; }
  .reception-fields { gap: 12px; }
  .panel { border-radius: 15px; }
}
@media (max-width: 390px) {
  .dashboard-welcome h2 { font-size: clamp(1.68rem, 7.2vw, 2rem); }
  .dashboard-quick-actions { grid-template-columns: 1fr; }
  .dashboard-welcome .quick-action { min-height: 65px; }
  .metrics-row .metric-card { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-welcome { animation: none !important; }
  .metrics-row .metric-card,
  .dashboard-welcome .quick-action,
  .step-progress-item { transition: none !important; }
  .metrics-row .metric-card:hover { transform: none !important; }
}
@media (forced-colors: active) {
  .dashboard-welcome, .dashboard-welcome .quick-action,
  .metrics-row .metric-card, .active-step-card, .production-header-card {
    border: 1px solid CanvasText;
    box-shadow: none;
  }
  :focus-visible { outline: 3px solid Highlight; }
}
@media print {
  html, body { background: #fff !important; }
  .dashboard-welcome, .metrics-row .metric-card,
  .panel, .production-header-card, .active-step-card,
  .page-stack:has(.reception-fields) .recipe-card {
    animation: none !important;
    transform: none !important;
    box-shadow: none !important;
    background: #fff !important;
    border-color: #888 !important;
  }
  .dashboard-welcome::before { content: none; }
  .dashboard-welcome :is(h2,p,.eyebrow),
  .dashboard-welcome .quick-action :is(strong,small) { color: #111 !important; }
}

/* P2.5l · unified editorial finish across operational modules.
   Stacked on P2.5k, never replaces alerts, statuses or functional layouts. */
:root {
  --bb-workflow-outline: #d5e2d5;
  --bb-workflow-surface: #fffef9;
  --bb-workflow-soft: #f3f8f1;
  --bb-workflow-ink: #1d4932;
  --bb-workflow-ease: cubic-bezier(.2,.75,.25,1);
}
:where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
  .exports-layout,.page-grid,.page-stack) {
  min-width: 0;
}
:where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
  .exports-layout) .panel {
  min-width: 0;
  border: 1px solid var(--bb-workflow-outline);
  background: var(--bb-workflow-surface);
  box-shadow: 0 12px 38px rgba(21,50,34,.048);
}
:where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
  .exports-layout) .panel-head {
  min-width: 0;
  gap: clamp(9px,1.2vw,16px);
}
:where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
  .exports-layout) .panel-head h2 {
  font-size: clamp(1.08rem,1.35vw,1.4rem);
  letter-spacing: -.026em;
  color: var(--bb-workflow-ink);
  overflow-wrap: anywhere;
}
:where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
  .exports-layout) :is(input,select,textarea):focus-visible {
  outline: 3px solid #b38442;
  outline-offset: 2px;
}
:where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
  .exports-layout) :is(.button,button):focus-visible {
  outline: 3px solid #b38442;
  outline-offset: 3px;
}
/* Planning: an ordered operations board, with calm hierarchy and legible decisions. */
.planning-layout :is(.plan-list,.planning-form-panel) {
  min-width: 0;
}
.planning-layout .planning-tools {
  border-radius: 16px;
  background: var(--bb-workflow-soft);
  padding: clamp(10px,1.2vw,17px);
  border: 1px solid #e0e9de;
}
.planning-layout .plan-list > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.planning-layout .plan-actions {
  gap: 9px;
  flex-wrap: wrap;
}
.planning-layout .planning-form :is(input,select,textarea) {
  border-color: #c6d7c7;
  background: #fffefb;
}
/* Recipes: discovery → formulation → traceability; not a wall of inputs. */
.recipe-workspace .recipe-finder,
.recipe-workspace .recipe-detail-panel {
  min-width: 0;
}
.recipe-workspace .recipe-search-panel {
  border-color: #d5e2d5;
  background: linear-gradient(145deg,#fffef9 0%,#f5f9f3 100%);
}
.recipe-workspace :is(.recipe-meta,.recipe-result-grid,.recipe-detail-panel) {
  overflow-wrap: anywhere;
}
.recipe-workspace .recipe-tabs {
  gap: 8px;
}
.recipe-workspace .recipe-tabs button {
  min-height: 44px;
  border-radius: 12px;
}
.recipe-workspace .protocol-accordion {
  border-radius: 15px;
  border-color: #d7e2d7;
}
.recipe-workspace .recipe-actions { flex-wrap: wrap; gap: 9px; }
/* Stock: show safety first, never mute or mask blocked/expired rows. */
.stock-workspace .stock-filters {
  background: var(--bb-workflow-soft);
  border: 1px solid #dbe7da;
  border-radius: 15px;
  padding: clamp(9px,1.2vw,16px);
  gap: 10px;
}
.stock-workspace .data-table {
  font-variant-numeric: tabular-nums;
}
.stock-workspace .data-table thead th {
  color: #345c44;
  font-size: .78rem;
  letter-spacing: .015em;
}
.stock-workspace .data-table :is(th,td) {
  overflow-wrap: anywhere;
}
.stock-workspace .table-wrap {
  border-radius: 14px;
}
/* HACCP / Quality: high-contrast headings, accessible forms, preserved severity. */
.haccp-workspace .haccp-cat-select {
  background: #f5f9f3;
  border-radius: 14px;
  padding: 10px;
}
.haccp-workspace .haccp-steps,
.page-stack .allergen-grid,
.page-stack .quality-list {
  min-width: 0;
}
.haccp-workspace .haccp-steps > *,
.page-stack .quality-list > * {
  overflow-wrap: anywhere;
}
.page-stack .quality-list {
  gap: 10px;
}
.page-stack .quality-list :is(button,input,select) {
  min-height: 44px;
}
/* Analysis, history and exports: quieter tables, stronger scan paths. */
.page-grid .wide-panel {
  min-width: 0;
}
.page-grid .table-wrap {
  border: 1px solid #dce6d9;
  border-radius: 14px;
}
.page-grid .data-table thead th {
  color: #345a43;
  background: #f0f6ed;
}
.page-grid .data-table tbody tr:not(.row-danger):not(.row-warning):not(.row-info) {
  background: #fffefa;
}
.page-grid .data-table tbody tr:not(.row-danger):not(.row-warning):not(.row-info):nth-child(even) {
  background: #f9fbf6;
}
.exports-layout .export-actions {
  gap: 10px;
  flex-wrap: wrap;
}
.exports-layout .export-actions :is(.button,button) {
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.exports-layout .data-map {
  border: 1px solid #dce6d9;
  background: #f6faf4;
  border-radius: 15px;
  padding: clamp(10px,1.3vw,18px);
}
/* Global overflow hardening without clipping content or overriding business warnings. */
:where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
  .exports-layout,.page-grid) :is(.panel,.panel-head,.wide-panel,.table-wrap) {
  max-width: 100%;
}
@media (hover:hover) and (pointer:fine) {
  .planning-layout .plan-list > *,
  .recipe-workspace .recipe-search-panel,
  .exports-layout .export-actions .button {
    transition: border-color .22s ease,box-shadow .22s var(--bb-workflow-ease);
  }
}
@media (max-width: 760px) {
  :where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
    .exports-layout) .panel-head h2 {font-size:1.08rem;}
  .planning-layout .planning-tools {padding:10px;}
  .recipe-workspace .recipe-tabs {flex-wrap:wrap;}
  .recipe-workspace .recipe-tabs button {white-space:normal;overflow-wrap:anywhere;}
  .stock-workspace .stock-filters {padding:10px;}
  .exports-layout .export-actions {display:grid;grid-template-columns:minmax(0,1fr);}
  .exports-layout .export-actions :is(.button,button) {width:100%;}
}
@media (max-width:390px) {
  :where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
    .exports-layout) .panel-head {flex-wrap:wrap;}
  .recipe-workspace .recipe-actions {display:grid;grid-template-columns:minmax(0,1fr);}
  .recipe-workspace .recipe-actions :is(button,.button) {width:100%;}
}
@media (prefers-reduced-motion:reduce) {
  .planning-layout .plan-list > *,
  .recipe-workspace .recipe-search-panel,
  .exports-layout .export-actions .button {transition:none!important;}
}
@media (forced-colors:active) {
  :where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
    .exports-layout) .panel {border:1px solid CanvasText;box-shadow:none;}
}
@media print {
  :where(.planning-layout,.recipe-workspace,.haccp-workspace,.stock-workspace,
    .exports-layout) .panel,
  .planning-layout .planning-tools,
  .recipe-workspace .recipe-search-panel,
  .stock-workspace .stock-filters,
  .exports-layout .data-map {background:#fff!important;box-shadow:none!important;}
}

/* Integration: compact navigation labels remain on one line at 320px. */
@media screen and (max-width:390px) {
  .mobile-nav > button {padding-left:0;padding-right:0;}
  .mobile-nav > button > span {white-space:nowrap;overflow-wrap:normal;font-size:11px;letter-spacing:0;line-height:1.3;}
}

/* Identité officielle : provenance et autorisation dans assets/bitasyon-brand-credits.json. */
.planning-recipe-reference,.planning-allocation {grid-column:1/-1;min-width:0;display:grid;gap:8px;padding:12px 14px;border:1px solid #d5e2d5;border-radius:12px;background:#f5f8ef;overflow-wrap:anywhere;}
.planning-recipe-reference .small-link {justify-self:start;text-align:left;white-space:normal;}
.planning-allocation small {display:block;}
.stock-filter-panel {margin:0 0 12px;}
.stock-filter-panel > summary {min-height:44px;cursor:pointer;padding:12px;border:1px solid #d5e2d5;border-radius:11px;background:#f5f8ef;overflow-wrap:anywhere;}
.stock-filter-panel[open] > summary {margin-bottom:8px;}
/* Stock compact: retain traceability, expiry and safety status at first glance.
   Secondary fields remain available with the explicit Details toggle or Edit.
   Screen-only: the complete eight-column table is preserved for printing. */
@media screen and (max-width:900px) {
  .stock-workspace .stock-filters select,
  .stock-workspace .data-table :is(input,select,textarea) {font-size:16px;}
}
@media screen and (max-width:760px) {
  .stock-overview .stock-lots-panel .data-table :is(th,td):is(:nth-child(2),:nth-child(5),:nth-child(6)) {display:none;}
  .stock-overview .stock-lots-panel .data-table tbody tr {grid-template-columns:repeat(2,minmax(0,1fr));gap:0;}
  .stock-overview .stock-lots-panel .data-table tbody tr > td {padding:8px 10px;}
  .stock-overview .stock-lots-panel .data-table tbody td:first-child {grid-column:1/-1;padding:11px 10px;}
  .stock-overview .stock-lots-panel .data-table tbody td:last-child {grid-column:1/-1;padding:7px 10px;}
  .stock-overview .stock-lots-panel .data-table tbody td:first-child::before,
  .stock-overview .stock-lots-panel .data-table tbody td:last-child::before {display:none;}
  .stock-overview .stock-lots-panel .data-table tbody td:nth-child(4) {grid-column:2;grid-row:2;}
  .stock-overview .stock-lots-panel .data-table tbody td:nth-child(7) {grid-column:1/-1;}
  .stock-overview .stock-lots-panel .data-table td input:disabled {width:100%;min-height:0;padding:0;border:0;background:transparent;border-radius:0;font-weight:800;}
  .stock-overview .stock-lots-panel .data-table td:nth-child(4) {gap:2px;}
  .stock-workspace .stock-filters .small-link {text-align:left;white-space:normal;min-height:44px;}
}
.bitasyon-logo > .bb-official-logo {display:block;object-fit:contain;width:63px;height:77px;max-width:100%;border-radius:8px;background:#fff;padding:4px;}
.login-story .bitasyon-logo > .bb-official-logo {width:94px;height:115px;}
.login-official-logo {display:block;object-fit:contain;border-radius:8px;background:#fff;}
.dashboard-welcome {background-image:linear-gradient(95deg,rgba(14,45,31,.98),rgba(14,45,31,.86) 54%,rgba(14,45,31,.72)),url('./assets/bitasyon-cacao.webp');background-size:cover;background-position:center 64%;}
.login-story {background-image:linear-gradient(110deg,rgba(14,45,31,.95),rgba(14,45,31,.78)),url('./assets/bitasyon-cacao.webp');background-size:cover;background-position:center;}
@media(max-width:430px) {.login-story .bitasyon-logo > .bb-official-logo {width:55px;height:67px;} }
@media print {.dashboard-welcome,.login-story {background-image:none;} }

/* P2.5 Dashboard data visualisation — calculated solely from existing live dossiers.
   Zero new dependencies, no stock/HACCP mutation; semantic equivalents accompany charts. */
.dashboard-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: clamp(13px, 1.6vw, 22px);
  min-width: 0;
  align-items: stretch;
}
.dashboard-insights .bb-insight-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 335px;
  box-sizing: border-box;
  padding: clamp(19px, 2.1vw, 28px);
  border-radius: clamp(18px, 2vw, 24px);
  overflow: hidden;
  isolation: isolate;
}
.dashboard-insights .bb-insight-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.dashboard-insights .bb-insight-eyebrow {
  display: block;
  margin-bottom: 7px;
  font-size: .7rem;
  letter-spacing: .12em;
  font-weight: 800;
  text-transform: uppercase;
}
.dashboard-insights .bb-insight-head h3 {
  margin: 0;
  font-size: clamp(1.12rem, 1.6vw, 1.48rem);
  line-height: 1.25;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.dashboard-insights .bb-trend-card {
  border: 1px solid #366b50;
  background:
    radial-gradient(circle at 97% 2%, rgba(180, 222, 172, .2), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(223, 198, 132, .12), transparent 38%),
    linear-gradient(132deg, #103c2a 0%, #1d5841 72%, #286249 100%);
  box-shadow: 0 19px 40px rgba(18, 63, 38, .16);
  color: #f9fff3;
}
.dashboard-insights .bb-trend-card .bb-insight-eyebrow {color:#e4d3a2;}
.dashboard-insights .bb-trend-card .bb-insight-head h3 {color:#fafff2;}
.dashboard-insights .bb-insight-period {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(223, 242, 213, .3);
  border-radius: 999px;
  color: #ecf8e9;
  font-size: .75rem;
  font-weight: 750;
  white-space: nowrap;
}
.dashboard-insights .bb-trend-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 5px;
}
.dashboard-insights .bb-trend-total strong {
  color: #fff7d7;
  font-size: clamp(2.5rem, 4vw, 3.55rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.055em;
}
.dashboard-insights .bb-trend-total span {
  max-width: 20ch;
  font-size: .79rem;
  line-height: 1.5;
  color: #dce9dc;
}
.dashboard-insights .bb-trend-chart {
  display: block;
  width: 100%;
  height: auto;
  flex: 1 1 auto;
  min-height: 135px;
  max-height: 240px;
  overflow: visible;
}
.dashboard-insights .bb-trend-axis {
  fill: #e5f0e3;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.dashboard-insights .bb-trend-empty {
  margin: 3px 0;
  color: #e2e9dd;
  font-size: .86rem;
}
.dashboard-insights .bb-insight-footnote {
  color: #c7ddc9;
  font-size: .72rem;
  line-height: 1.5;
  margin: auto 0 0;
}
.dashboard-insights .bb-product-card {
  border: 1px solid #ddd5c2;
  background:
    radial-gradient(ellipse at 95% 3%, rgba(238, 225, 184, .5), transparent 50%),
    linear-gradient(145deg, #fffefa, #f6f2e6);
  box-shadow: 0 16px 34px rgba(70, 55, 35, .06);
}
.dashboard-insights .bb-product-card .bb-insight-eyebrow {color:#735d38;}
.dashboard-insights .bb-product-card h3 {color:#284a33;}
.dashboard-insights .bb-product-count {
  padding: 7px 10px;
  border-radius: 10px;
  background: #eaf1e3;
  color: #31553c;
  font-size: .74rem;
  font-weight: 850;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dashboard-insights .bb-product-bars {
  display: grid;
  gap: clamp(16px, 2vw, 23px);
  align-content: center;
  flex: 1 1 auto;
  min-width: 0;
  margin: 21px 0;
}
.dashboard-insights .bb-product-bar {min-width:0;}
.dashboard-insights .bb-product-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 7px;
  color: #2c4934;
  font-size: .84rem;
}
.dashboard-insights .bb-product-label strong {
  overflow-wrap: anywhere;
  min-width: 0;
  font-weight: 800;
}
.dashboard-insights .bb-product-label > span {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}
.dashboard-insights .bb-product-track {
  height: 10px;
  border-radius: 999px;
  background: #e0e8d9;
  overflow: hidden;
}
.dashboard-insights .bb-product-track > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2c8058 0%, #77b17c 100%);
  border-radius: inherit;
}
.dashboard-insights .bb-product-empty {
  color: #526556;
  font-size: .86rem;
  line-height: 1.5;
}
.dashboard-insights .bb-product-caption {
  margin: auto 0 0;
  color: #526556;
  font-size: .73rem;
  line-height: 1.45;
}
.dashboard-insights .bb-trend-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
  clip-path: inset(50%);
}
@media (max-width: 960px) {
  .dashboard-insights { grid-template-columns: minmax(0, 1fr); }
  .dashboard-insights .bb-insight-card { min-height: 280px; }
}
@media (max-width: 430px) {
  .dashboard-insights .bb-insight-card { padding: 18px 15px; border-radius: 16px; min-height: 265px; }
  .dashboard-insights .bb-insight-head h3 { font-size: 1.15rem; }
  .dashboard-insights .bb-trend-total strong { font-size: 2.55rem; }
  .dashboard-insights .bb-insight-period { padding: 6px 9px; }
  /* With the 760-unit SVG scaled onto a 320px screen, 16-unit dates become
     around 6px. Enlarge just the date ticks and retain three nonoverlapping. */
  .dashboard-insights .bb-trend-chart .bb-trend-date-tick { font-size: 32px; }
  .dashboard-insights .bb-trend-chart .bb-trend-date-tick:not(.bb-trend-mobile-tick) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-insights *, .dashboard-insights *::before, .dashboard-insights *::after {animation:none!important;transition:none!important;}
}
@media (forced-colors: active) {
  .dashboard-insights .bb-insight-card { background: Canvas; color: CanvasText; border: 1px solid CanvasText; box-shadow: none; }
  .dashboard-insights .bb-trend-card :is(h3,span,p,strong) { color: CanvasText; }
  .dashboard-insights .bb-product-track { border: 1px solid CanvasText; }
  .dashboard-insights .bb-product-track > span { background: Highlight; }
}
@media print {
  .dashboard-insights .bb-insight-card { background: #fff!important; color: #111!important; box-shadow: none!important; border-color: #777!important; break-inside: avoid; }
  .dashboard-insights .bb-trend-card :is(h3,span,p,strong) { color: #111!important; }
  .dashboard-insights .bb-trend-axis { fill: #111; }
  /* Keep the actual data stroke readable on white paper. */
  .dashboard-insights .bb-trend-chart path[stroke] { stroke: #173d2b; }
  .dashboard-insights .bb-trend-chart circle { fill: #fff; stroke: #173d2b; }
  .dashboard-insights .bb-trend-chart path[fill] { fill: none; }
}
@media (forced-colors: active) {
  .dashboard-insights .bb-trend-chart path[stroke],
  .dashboard-insights .bb-trend-chart circle { stroke: CanvasText; }
  .dashboard-insights .bb-trend-chart circle { fill: Canvas; }
  .dashboard-insights .bb-trend-axis { fill: CanvasText; }
}

/* P2.5 — Long School help text: keep the grid inside the viewport even when
   a real lot, instruction or translated term has no natural break points.
   Do not clip, truncate, or hide the guidance and its close action. */
.school-coach { min-width: 0; }
.school-coach > .school-coach-hints { min-width: 0; }
.school-coach .school-hint-detail {
  min-width: 0;
  overflow-wrap: anywhere;
}
.school-coach .school-hint-detail > * { min-width: 0; }

/* P2.5 — School coach: reliably tappable controls and visible keyboard focus.
   Retain all real help actions and their aria-expanded state. */
.school-coach button {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.school-coach button.school-hint-close { min-height: 44px; }
.school-coach button:focus-visible {
  outline: 3px solid #b87333;
  outline-offset: 2px;
}
.school-coach .school-hint-actions > button { max-width: 100%; }

/* P2.5k — School banner: both .school-banner and .topbar have sticky top:0
   in the original cascade. Keep the non-production warning sticky and allow
   the regular topbar to scroll instead of covering the warning on mobile. */
.school-mode .topbar {
  position: relative;
  top: auto;
  z-index: auto;
  margin-top: 0;
}
.school-mode .school-banner {
  z-index: 45;
  margin-left: 0;
  margin-right: 0;
}
.school-mode .school-banner button {
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  padding: 9px 12px;
  line-height: 1.35;
}
.school-mode .school-banner button:focus-visible {
  outline: 3px solid #6a4e0b;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .school-mode .school-banner {
    align-items: center;
    min-width: 0;
    gap: 6px 10px;
    grid-template-columns: minmax(0, 1fr);
  }
  .school-mode .school-banner :is(strong,span) {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .school-mode .school-banner button {
    max-width: 100%;
    white-space: normal;
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
}

/* P2.5m — Status and HACCP wrapping. A long status or a technical error
   must never cause the mobile document to overflow or erase risk colours. */
@media (max-width: 760px) {
  .status-chip {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }
  .status-chip > span {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .status-chip > b {
    flex: 0 0 auto;
  }
  :is(.step-validation-error,.save-conflict,.warning-banner) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

/* P2.5n — Password visibility buttons: base styles set button height 30px
   but the later .login-panel button rule forces 50px inside a 48px input.
   Target only the existing show/hide controls, never login submit buttons. */
.password-field > div {
  min-width: 0;
}
.password-field > div > input {
  min-width: 0;
  max-width: 100%;
  padding-right: 104px;
}
.password-field > div > button[type="button"] {
  z-index: 1;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  min-width: 76px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #194b32;
  box-shadow: none;
  font-size: .875rem;
  font-weight: 750;
  line-height: 1.1;
}
.password-field > div > button[type="button"]:focus-visible {
  outline: 3px solid #a56a17;
  outline-offset: -2px;
}
@media (hover: hover) and (pointer: fine) {
  .password-field > div > button[type="button"]:hover {
    background: #e9f3e7;
    border-color: #a9c9ad;
  }
}
