:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --card: #fffdf9;
  --ink: #2e2430;
  --muted: #695f66;
  --line: #e8dfd8;
  --primary: #773a56;
  --primary-dark: #572841;
  --accent: #e9ad69;
  --rail: #291e2b;
  --rail-ink: #f8eaf2;
  --success: #225d45;
  --error: #982c43;
  --radius: 14px;
  --shadow: 0 2px 2px #4b263006, 0 12px 36px #4b263008;
  font-family: "Avenir Next", Avenir, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 300px; }
a { color: var(--primary-dark); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
img, video { display: block; max-width: 100%; }
button, a, input, textarea, select { -webkit-tap-highlight-color: #773a5620; }
:focus-visible { outline: 3px solid #b15b75; outline-offset: 3px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.027em; line-height: 1.18; }
h1 { font-size: clamp(2rem, 4vw, 3.15rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
h3 { font-size: 1.12rem; }
p + p { margin-top: .65em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
small { line-height: 1.4; }
.skip-link { position: fixed; z-index: 15; left: 1rem; top: -5rem; padding: .75rem 1rem; background: var(--card); }
.skip-link:focus { top: .75rem; }
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: .8rem; }
.brand-logo { background: var(--primary); color: white; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .75rem; font-family: Georgia, serif; font-size: 1.8rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand img { border-radius: 11px; flex-shrink: 0; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: .99rem; font-weight: 750; white-space: nowrap; letter-spacing: -.025em; }
.brand small { font-size: .72rem; opacity: .72; white-space: nowrap; }
.public-header { background: var(--card); border-bottom: 1px solid var(--line); }
.public-bar { min-height: 76px; padding: 0 clamp(18px, 4vw, 52px); max-width: 1530px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.public-nav, .public-actions { display: flex; align-items: center; gap: clamp(.6rem, 2.1vw, 1.9rem); }
.public-nav a { text-decoration: none; color: var(--muted); font-size: .93rem; font-weight: 600; padding: .65rem .2rem; white-space: nowrap; }
.public-nav a:hover, .public-nav [aria-current="page"] { color: var(--primary); text-decoration: underline; text-underline-offset: .45rem; }
.public-content { width: min(100%, 1530px); min-height: calc(100dvh - 205px); padding: clamp(18px, 4.2vw, 52px); margin: auto; }
.public-footer { border-top: 1px solid var(--line); display: flex; padding: 28px clamp(20px, 4vw, 52px); justify-content: space-between; gap: 1rem; align-items: center; font-size: .88rem; background: var(--card); }
.public-footer > div { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.public-footer > div > span { color: var(--muted); }
.public-footer > a { display: inline-flex; gap: .4rem; align-items: center; }
.language { display: inline-flex; gap: 2px; background: #eee6e0; border-radius: 9px; padding: 3px; color: #61545e; flex-shrink: 0; }
.language button { min-width: 36px; min-height: 32px; padding: 2px 7px; color: inherit; font-size: .74rem; font-weight: 750; border: none; background: none; border-radius: 7px; }
.language [aria-pressed="true"] { color: var(--primary-dark); background: var(--card); box-shadow: 0 1px 3px #2e243021; }
.workspace { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 27px; padding: 24px 16px 15px; background: var(--rail); color: var(--rail-ink); overflow: auto; }
.rail > .brand { margin: 0 3px; }
.rail-nav, .rail-group, .rail-bottom nav { display: grid; }
.rail-nav { gap: 24px; }
.rail-group, .rail-bottom nav { gap: 3px; }
.rail-group p { margin: 0 0 4px 10px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .64; font-weight: 650; }
.rail nav a { display: flex; align-items: center; gap: .7rem; min-height: 42px; padding: 8px 10px; text-decoration: none; color: #f3e6ed; font-size: .91rem; border-radius: 8px; }
.rail nav a svg { opacity: .73; flex-shrink: 0; }
.rail nav a:hover { background: #ffffff13; }
.rail nav [aria-current="page"] { background: #693c57; color: #fff9f3; font-weight: 700; }
.rail nav [aria-current="page"] svg { color: #ffd2a2; opacity: 1; }
.rail-bottom { margin-top: auto; }
.rail-profile { border-top: 1px solid #ffffff2b; margin-top: 13px; padding-top: 15px; display: grid; align-items: center; gap: 9px; grid-template-columns: 35px 1fr 32px; }
.rail-profile div { min-width: 0; }
.rail-profile strong, .rail-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-profile strong { font-size: .84rem; }
.rail-profile small { font-size: .68rem; color: #dec8d5; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #683d58; color: #ffe3c8; font-size: .76rem; font-weight: 750; }
.logout, .menu-button { color: inherit; border: 0; background: transparent; border-radius: 8px; padding: 7px; display: grid; place-items: center; }
.logout:hover { background: #ffffff1f; }
.workspace-bar { position: sticky; top: 0; z-index: 3; padding: 0 clamp(16px, 3.8vw, 48px); background: var(--card); min-height: 68px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.workspace-bar > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; color: var(--muted); font-size: .82rem; }
.workspace-bar strong { color: var(--ink); }
.menu-button { display: none; }
.workspace-content { max-width: 1560px; margin: 0 auto; padding: clamp(20px, 3.8vw, 48px); }
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 28px; }
.page-header p { color: var(--muted); margin-top: .5rem; max-width: 70ch; }
.page-header h1 + p { margin-top: .55rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 2.25vw, 26px); min-width: 0; }
.card h2 + p, .card h3 + p { margin-top: .65rem; }
.card p, .muted, .help { color: var(--muted); }
.card > h2:first-child, .card > h3:first-child { margin-bottom: .8rem; }
.stack, .grid, .form-grid { display: grid; gap: 1rem; min-width: 0; }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); align-items: end; }
.grid + .grid, .grid + .card, .card + .grid, .card + .card, section + .page-header { margin-top: 1.1rem; }
.row, .actions, .card-actions, .toolbar { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.row-between { justify-content: space-between; }
.btn { display: inline-flex; justify-content: center; gap: .45rem; align-items: center; padding: .63rem .95rem; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); background: var(--card); font-weight: 700; font-size: .88rem; line-height: 1.3; min-height: 40px; text-decoration: none; text-align: center; }
.btn:hover { background: #f4ebe8; }
.btn:disabled { opacity: .58; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline, .btn-secondary { color: var(--primary-dark); }
.btn-danger { color: var(--error); border-color: #e1b9c4; }
.btn-small, .btn-sm { padding: .38rem .68rem; min-height: 34px; font-size: .8rem; }
label { display: grid; gap: .35rem; font-size: .86rem; font-weight: 650; }
label:has(input[type="checkbox"]), label:has(input[type="radio"]) { display: flex; align-items: center; }
input, select, textarea { max-width: 100%; min-width: 0; border: 1px solid #d9ccc7; color: var(--ink); background: #fffefe; border-radius: 8px; padding: .62rem .72rem; }
input::placeholder, textarea::placeholder { color: #807680; opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 1.05rem; height: 1.05rem; margin: 0 .35rem 0 0; }
input[type="file"] { padding: .5rem; font-size: .84rem; width: 100%; }
input[type="file"]::file-selector-button { border: 0; background: #f1e5e9; color: var(--primary-dark); padding: .4rem .65rem; border-radius: 5px; margin-right: .6rem; cursor: pointer; font: inherit; }
textarea { resize: vertical; min-height: 90px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: .9rem; }
legend { padding: 0 .35rem; font-weight: 650; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .88rem; }
.table-wrap { overflow: auto; border-radius: 8px; max-width: 100%; }
thead { color: var(--muted); background: #f5efeb; font-size: .8rem; }
th, td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 750; }
tbody tr:hover { background: #faf4f0; }
details { padding: .75rem 0; }
summary { cursor: pointer; color: var(--primary-dark); font-weight: 700; }
details[open] summary { margin-bottom: .8rem; }
.badge { display: inline-block; background: #f2e6eb; color: #693653; border-radius: 99px; font-size: .76rem; font-weight: 700; padding: .22rem .6rem; }
.badge-success, .badge.good { background: #dceee3; color: var(--success); }
.badge-warning, .badge.warn { background: #fcf0d9; color: #754914; }
.message, .notice, .empty-state { color: var(--muted); border-radius: 8px; background: #f5eeeb; padding: .72rem .9rem; }
.message:empty { display: none; }
.error, .message-error { color: var(--error); }
.loading { padding: 1rem 0; color: var(--muted); }
.error-card { max-width: 48rem; }
.error-card .btn { margin-top: 1rem; }
.toast { position: fixed; z-index: 10; right: clamp(15px, 3vw, 35px); bottom: 22px; max-width: min(400px, calc(100vw - 30px)); border-radius: 9px; background: #224e3d; color: white; padding: .85rem 1rem; box-shadow: 0 14px 35px #27152925; }
.toast-error { background: #7d2738; }
pre { overflow: auto; padding: .75rem; background: #f5efeb; border-radius: 8px; font-size: .8rem; }
code { overflow-wrap: anywhere; }
@media (max-width: 850px) {
  .workspace { display: block; }
  .rail { display: none; position: fixed; top: 59px; left: 0; bottom: 0; height: auto; width: min(280px, 88vw); z-index: 6; }
  .rail.rail-open { display: flex; box-shadow: 15px 0 45px #26192755; }
  .menu-button { display: grid; }
  .workspace-bar { min-height: 59px; }
}
@media (max-width: 660px) {
  .public-bar { min-height: auto; padding: 12px 16px 6px; flex-wrap: wrap; gap: 8px; }
  .public-nav { order: 3; width: 100%; gap: 1.5rem; justify-content: center; border-top: 1px solid var(--line); }
  .public-nav a { padding: .5rem .12rem; }
  .public-footer { align-items: flex-start; flex-direction: column; }
  .public-actions { gap: 6px; }
  .account-link { padding: .45rem; min-width: 37px; min-height: 37px; }
  .account-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .workspace-name, .workspace-name + span { display: none; }
  th, td { padding: .58rem .65rem; }
}
.eyebrow { color: var(--primary); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; margin: 0 0 .5rem; }
.card-heading, .section-heading, .course-card-head, .page-actions {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.two-col, .report-grid, .settings-grid, .auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.settings-section { margin-top: 1.15rem; }
.auth-grid { max-width: 900px; margin: 0 auto; align-items: stretch; }
.auth-aside { background: #3c2537; color: #fff5ed; display: grid; align-content: center; gap: .65rem; padding: clamp(24px, 4vw, 46px); }
.auth-aside .eyebrow { color: #ffcda0; }
.auth-aside p { color: #f1dfeb; }
.auth-card { padding: clamp(22px, 3vw, 38px); }
.auth-card form { margin-top: 1rem; }
.auth-switch, .form-actions, .oauth-actions { margin-top: .9rem; }
.oauth-actions, .form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.oauth-divider { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .78rem; margin-top: 1.1rem; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.feature-list { display: grid; gap: .55rem; padding: 0; list-style: none; }
.feature-list li { display: flex; gap: .65rem; }
.feature-list li span { color: var(--accent); }
.single-column { max-width: 580px; margin: 0 auto; }
.link-button { background: transparent; color: var(--primary); border: none; padding: 0; text-decoration: underline; font-weight: 700; }
.btn-quiet, .btn-subtle { background: #f6eeef; border-color: #eadce1; color: var(--primary-dark); }
.settings-list, .data-list, .meta-list { margin: .7rem 0; }
.settings-list > div, .data-list > div { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.settings-list dt, .data-list dt { color: var(--muted); font-size: .8rem; }
.settings-list dd, .data-list dd { margin: .2rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; }
.metrics-grid, .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 1rem; }
.metric, .kpi-card { display: grid; gap: .45rem; align-content: start; }
.metric strong, .kpi-value { font-size: clamp(1.75rem, 3.3vw, 2.6rem); font-weight: 750; line-height: 1.1; letter-spacing: -.045em; }
.metric small { color: var(--muted); }
.metric-positive { border-top: 3px solid #74a28a; }
.metric-warning { border-top: 3px solid #d89143; }
.rewards-balance { display: grid; gap: .1rem; background: #f2e7ed; color: var(--primary-dark); border-radius: .6rem; padding: 1rem; margin: .9rem 0; }
.rewards-balance strong { font-size: 2.65rem; line-height: 1.1; }
.inventory-toolbar, .toolbar-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.product-cell { display: flex; align-items: center; gap: .65rem; min-width: 160px; }
.product-cell img, .product-placeholder { display: block; width: 42px; height: 42px; border-radius: .45rem; flex: 0 0 auto; object-fit: cover; background: #f3e6e8; }
.product-cell small, .person-cell small, .person-cell span { display: block; }
.order-request-card { display: grid; gap: .6rem; }
.calendar-list, .activity-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.calendar-list li, .activity-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.activity-dot { display: inline-block; width: .55rem; height: .55rem; background: #8d5470; border-radius: 50%; margin-right: .5rem; }
.section-block + .section-block { margin-top: 1.25rem; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.course-card { display: grid; gap: .9rem; align-content: start; }
.progress-row { display: grid; gap: .4rem; }
.progress-label { display: flex; justify-content: space-between; gap: .5rem; font-size: .83rem; }
progress, meter { width: 100%; accent-color: var(--primary); }
progress { height: .65rem; }
.modal-backdrop { display: grid; place-items: center; position: fixed; inset: 0; padding: 16px; z-index: 10; background: #261925a8; }
.modal { position: relative; width: min(100%, 700px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); border-radius: var(--radius); padding: clamp(18px, 4vw, 36px); box-shadow: var(--shadow); }
.modal h2 { margin: .3rem 2rem .85rem 0; }
.modal-close { display: grid; place-items: center; position: absolute; top: 12px; right: 12px; background: #f2e8eb; border: 0; border-radius: 8px; width: 38px; height: 38px; color: var(--primary-dark); font-size: 1.45rem; }
.modal form, .modal .message { margin-top: .9rem; }
.question-block { padding: .75rem 0; }
.question-block + .question-block { border-top: 1px solid var(--line); }
.question-block label { margin-top: .55rem; }
.media-list { display: grid; gap: .65rem; margin: .75rem 0; }
.media-list video { max-height: 52dvh; width: 100%; border-radius: 8px; background: var(--rail); }
.file-link { display: flex; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .75rem; }
.bar-chart { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.bar-item { flex: 1 1 54px; min-width: 0; font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 960px) {
  .workspace-content .two-col, .workspace-content .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .two-col, .report-grid, .settings-grid, .auth-grid { grid-template-columns: 1fr; }
}

/* Shared experience layer
   The suite is intentionally warm and quiet: plum for orientation, ivory for
   work surfaces, and the orange of a fresh bake for the one clear action. */
:root {
  --paper: #f8f4ee;
  --card: #fffdfa;
  --surface: #fffaf5;
  --surface-muted: #f5ede8;
  --ink: #30242e;
  --muted: #6f6269;
  --line: #e5dbd4;
  --line-strong: #d5c5bd;
  --primary: #74394f;
  --primary-dark: #57263f;
  --accent: #dc9962;
  --accent-soft: #f9e6d1;
  --rail: #291e2b;
  --rail-ink: #f8eaf2;
  --success: #225d45;
  --error: #982c43;
  --focus: #b55e79;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px #4b26300a, 0 12px 34px #4b26300d;
  --shadow-soft: 0 1px 2px #4b26300a, 0 6px 18px #4b263009;
  --shadow-lift: 0 16px 38px #4b26301a;
  --content-max: 1480px;
}

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 88% -10%, #f4dfd91f, transparent 31rem),
    radial-gradient(circle at -12% 22%, #e9ad6910, transparent 28rem),
    var(--paper);
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration-thickness: .08em; }
a:hover { color: var(--primary); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #b55e7926;
}

/* Public navigation remains usable when the customer adds more destinations. */
.public-header {
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 0 #4b26300a;
}
.public-bar { width: min(100%, var(--content-max)); }
.public-nav {
  min-width: 0;
  scrollbar-width: none;
}
.public-nav::-webkit-scrollbar { display: none; }
.public-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  transition: color .18s ease;
}
.public-nav a::after {
  content: '';
  position: absolute;
  left: .15rem;
  right: .15rem;
  bottom: .2rem;
  height: 2px;
  border-radius: 99px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}
.public-nav a:hover,
.public-nav [aria-current="page"] {
  text-decoration: none;
}
.public-nav a:hover::after,
.public-nav [aria-current="page"]::after { transform: scaleX(1); }
.public-actions { flex-shrink: 0; }
.language { border: 1px solid var(--line); }

/* Workspace shell */
.workspace {
  background: linear-gradient(110deg, #f7f1ed 0%, var(--paper) 38%, #fbf7f1 100%);
}
.workspace-panel {
  min-width: 0;
  min-height: 100dvh;
}
.rail {
  background: linear-gradient(165deg, #2d202f 0%, var(--rail) 58%, #211a26 100%);
  box-shadow: inset -1px 0 #ffffff08;
  scrollbar-color: #a26b86 transparent;
  scrollbar-width: thin;
}
.rail-nav { gap: 1.35rem; }
.rail-group p { color: #e8cad8; }
.rail nav a {
  position: relative;
  min-height: 44px;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.rail nav a::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity .18s ease;
}
.rail nav a:hover { border-color: #ffffff17; background: #ffffff10; }
.rail nav [aria-current="page"] {
  border-color: #f4c9a21c;
  background: linear-gradient(90deg, #75415d, #633750);
  box-shadow: 0 8px 20px #130d181f;
}
.rail nav [aria-current="page"]::before { opacity: 1; }
.rail-bottom { padding-top: .5rem; }
.rail-profile { border-top-color: #ffffff22; }
.workspace-bar {
  background: #fffdfaeb;
  box-shadow: 0 1px 0 #4b26300a;
  backdrop-filter: blur(14px) saturate(1.08);
}
.workspace-bar > div:first-child { min-width: 0; }
.workspace-bar strong { overflow-wrap: anywhere; }
.workspace-content {
  width: 100%;
  max-width: var(--content-max);
}

/* Page hierarchy and surfaces */
.page-header { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.page-header > div:first-child { min-width: min(100%, 28rem); }
.page-header p { line-height: 1.6; }
.page-actions { align-items: center; }
.card {
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.card-heading,
.section-heading,
.course-card-head,
.page-actions { margin-bottom: 1.2rem; }
.card-heading > div:first-child,
.section-heading > div:first-child,
.course-card-head > div:first-child { min-width: min(100%, 18rem); }
.card h2, .card h3 { text-wrap: balance; }
.stack, .grid, .form-grid { gap: 1.15rem; }
.section-block + .section-block { margin-top: 1.45rem; }

/* Buttons and controls use one interaction language across owner and customer tools. */
.btn {
  min-height: 44px;
  padding: .68rem 1rem;
  border-color: var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 1px 1px #4b26300a;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover {
  background: #f5ebe7;
  border-color: #c9b3b0;
  box-shadow: 0 5px 14px #4b263014;
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 7px 16px #57263f22;
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 9px 20px #57263f2b;
}
.btn-quiet, .btn-subtle {
  background: #f8eff0;
  border-color: #ead9df;
}
.btn-danger { background: #fff9f8; }
.btn-small, .btn-sm { min-height: 38px; border-radius: 9px; }
.link-button { min-height: 42px; }
button:disabled, .btn:disabled { box-shadow: none; transform: none; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  min-height: 44px;
  border-color: var(--line-strong);
  background: #fffefc;
  border-radius: 10px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
select:hover,
textarea:hover { border-color: #c9b4ae; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 4px #b55e791c;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 4px #982c4314;
}
input:disabled, select:disabled, textarea:disabled { background: #f4eeea; color: #85787b; }
textarea { min-height: 104px; }
input[type="checkbox"], input[type="radio"] { flex: 0 0 auto; }
input[type="file"] { min-height: 44px; border-radius: 10px; }
input[type="file"]::file-selector-button { min-height: 32px; }
label { line-height: 1.35; }
.form-help, .form-status { display: block; font-size: .82rem; line-height: 1.45; }
.form-status:empty { min-height: 1.2em; }
.form-actions { align-items: center; }
.checkline { min-height: 42px; padding: .45rem .6rem; border-radius: 9px; }
.checkline:hover, label:has(input[type="checkbox"]):hover, label:has(input[type="radio"]):hover { background: #f8f0ec; }
.file-input { align-content: start; }

/* Dense data is still easy to scan on narrow screens: the table keeps its
   columns and the wrapper provides an intentional horizontal scroll. */
.table-wrap {
  position: relative;
  border: 1px solid var(--line);
  background: #fffdfa;
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #ffffff;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #c7aab1 transparent;
}
.table-wrap table { min-width: 640px; }
thead { background: #f5ede8; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5ede8;
  white-space: nowrap;
}
th, td { border-bottom-color: var(--line); }
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: #fcf6f2; }
tbody tr:last-child td { border-bottom: 0; }
table caption { padding: .7rem .8rem; color: var(--muted); text-align: left; font-size: .8rem; }
.inventory-table input[type="number"] { width: 7rem; }

/* Status, feedback, and empty states */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-active, .badge-approved, .badge-completed, .badge-success, .badge.good {
  background: #e0f0e5;
  border-color: #c6e3d0;
  color: #205a41;
}
.badge-pending, .badge-requested, .badge-warning, .badge.warn {
  background: #fff1d9;
  border-color: #f0d9ad;
  color: #774b15;
}
.badge-paused, .badge-cancelled, .badge-neutral {
  background: #eee9e6;
  border-color: #ded3cd;
  color: #5b4f4d;
}
.badge-error, .badge-danger, .badge-denied {
  background: #fae4e5;
  border-color: #ecc6cc;
  color: #8d2c3e;
}
.message, .notice, .empty-state {
  border: 1px solid var(--line);
  line-height: 1.5;
}
.message-success, .notice-success { background: #eef8f0; border-color: #cce5d2; color: #205a41; }
.message-warning, .notice-warning { background: #fff6e5; border-color: #f1dcae; color: #744a18; }
.message-error, .message.error, .notice-error { background: #fff0f0; border-color: #ecc9cd; color: #8d2c3e; }
.empty-state { min-height: 7rem; display: grid; place-items: center; text-align: center; }
.loading {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.5rem;
}
.loading::before {
  content: '';
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid #e1cbd2;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: suite-spin .8s linear infinite;
}
@keyframes suite-spin { to { transform: rotate(360deg); } }
.toast {
  border: 1px solid #ffffff24;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 34px #2715292b;
}

/* Owner tools: toolbars, queues, and the new order workflow. */
.toolbar, .toolbar-actions, .inventory-toolbar {
  gap: .65rem;
  align-items: center;
}
.toolbar-actions { margin-bottom: .2rem; }
.toolbar-actions input[type="search"] { flex: 1 1 15rem; }
.toolbar-actions select { flex: 0 1 15rem; }
.order-request-card,
.orders-queue-card,
.orders-history-card { transition: box-shadow .18s ease, border-color .18s ease; }
.order-request-card:hover,
.orders-queue-card:hover,
.orders-history-card:hover { border-color: #d5bec0; box-shadow: var(--shadow-lift); }
.orders-account-banner {
  border: 0;
  background: linear-gradient(120deg, #3d2638, #5b304b);
  box-shadow: 0 14px 30px #3d26382b;
}
.orders-account-banner .btn-outline { border-color: #f1d6db55; color: #fff8f3; }
.orders-product-row {
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background-color .14s ease, border-color .14s ease;
}
.orders-product-row:hover { border-color: var(--line); background: #fff8f2; }
.orders-product-row:has(input:focus) { border-color: #d8b1bd; background: #fff8f2; }
.orders-choice { background: #fffdfa; transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease; }
.orders-choice:hover, .orders-choice:has(input:checked) {
  border-color: #c994a5;
  background: #fff8f4;
  box-shadow: 0 0 0 3px #b55e7912;
}
.orders-submit-card { border-top: 3px solid var(--accent); }
.orders-total { color: var(--primary-dark); }
.orders-history-card { background: #fffdfa; }

/* Attendance and physical counts */
[data-attendance-filter], [data-count-form] { align-items: end; }
[data-attendance-table] .message, [data-count-detail-panel] { margin-top: .85rem; }
[data-count-preview] { border-color: #e4c6ae; box-shadow: 0 9px 24px #b86d3420; }
[data-count-preview] .card-heading { align-items: center; }
[data-count-row] label { justify-items: start; }
[data-count-row] input[type="number"] { max-width: 8rem; }
[data-count-file] + span, [data-count-file] ~ span { pointer-events: none; }

/* Training builder and learning surfaces */
.builder-card { border-top: 3px solid var(--accent); }
.question-editor {
  border-color: var(--line-strong);
  background: #fffdfa;
  box-shadow: var(--shadow-soft);
}
.question-editor:focus-within { border-color: #d2a8b4; box-shadow: 0 0 0 3px #b55e7912; }
.question-options { background: #faf4ef; }
.training-material, .training-media { min-width: 0; }
.training-material:hover { border-color: #d8bec0; }
.progress-row progress { display: block; accent-color: var(--primary); }

/* Cake builder hooks. These shared primitives let the interactive cake game
   feel native to the suite while its canvas and controls remain component-owned. */
.cake-layout, .cake-builder-layout, .cake-builder-grid, .cake-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(19rem, .92fr);
  gap: 1.15rem;
  align-items: start;
}
.cake-panel, .cake-controls, .cake-preview-card, .cake-preview-panel,
.cake-summary, .cake-request-card, .cake-option-panel {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2.25vw, 26px);
}
.cake-preview-card, .cake-preview-panel { position: sticky; top: 88px; }
.cake-stage, .cake-canvas, .cake-preview {
  position: relative;
  min-height: 22rem;
  aspect-ratio: 1.08 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: calc(var(--radius) - 3px);
  background:
    radial-gradient(circle at 50% 35%, #fffdf9 0 13%, transparent 14%),
    linear-gradient(145deg, #fbf0e4, #ead8d0);
  border: 1px solid #ead8d0;
}
.cake-stage canvas, .cake-canvas canvas, .cake-preview canvas { max-width: 100%; height: auto; }
.cake-stepper, .cake-tabs, .cake-toolbar, .cake-preview-actions, .cake-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}
.cake-stepper { margin-bottom: 1.15rem; }
.cake-step, .cake-tab {
  min-height: 40px;
  padding: .52rem .75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}
.cake-step.is-active, .cake-tab.is-active, .cake-step[aria-current="step"], .cake-tab[aria-selected="true"] {
  border-color: #c995a6;
  background: #f5e5e9;
  color: var(--primary-dark);
}
.cake-option-grid, .cake-options, .cake-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: .6rem;
}
.cake-option, .cake-choice {
  min-width: 0;
  min-height: 4.2rem;
  display: grid;
  gap: .25rem;
  align-content: center;
  padding: .6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.cake-option:hover, .cake-choice:hover, .cake-option.is-selected,
.cake-choice.is-selected, .cake-option[aria-selected="true"], .cake-choice:has(input:checked) {
  border-color: #c995a6;
  background: #fff7f3;
  box-shadow: 0 0 0 3px #b55e7912;
  transform: translateY(-1px);
}
.cake-option small, .cake-choice small { color: var(--muted); }
.cake-swatch, .cake-option-swatch {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.cake-upload {
  display: grid;
  gap: .7rem;
  padding: .8rem;
  border: 1px dashed #cfaeb1;
  border-radius: 10px;
  background: #fff8f3;
}
.cake-price { color: var(--primary-dark); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
.cake-note { color: var(--muted); font-size: .82rem; }

/* Responsive behavior */
@media (max-width: 1120px) {
  .public-nav, .public-actions { gap: .75rem; }
  .workspace { grid-template-columns: 224px minmax(0, 1fr); }
  .rail { padding-inline: 13px; }
  .workspace-content { padding: clamp(18px, 3vw, 36px); }
}
@media (max-width: 960px) {
  .cake-layout, .cake-builder-layout, .cake-builder-grid, .cake-workbench { grid-template-columns: 1fr; }
  .cake-preview-card, .cake-preview-panel { position: static; }
  .orders-request-grid { grid-template-columns: 1fr; }
  .orders-submit-card { position: static; }
}
@media (max-width: 850px) {
  .rail { top: 59px; width: min(292px, 88vw); padding-top: 18px; }
  .workspace-content { padding: 24px clamp(16px, 4vw, 28px) 36px; }
  .workspace-bar { padding-inline: clamp(14px, 4vw, 28px); }
  .workspace-bar > div:first-child { gap: .45rem; }
}
@media (max-width: 700px) {
  .public-bar { align-items: center; flex-wrap: wrap; }
  .public-nav { justify-content: flex-start; overflow-x: auto; width: 100%; gap: .85rem; padding-bottom: .12rem; }
  .public-nav a { flex: 0 0 auto; }
  .public-nav a::after { bottom: .05rem; }
  .public-actions { margin-left: auto; }
  .page-header { align-items: flex-start; }
  .page-header .btn, .page-actions .btn { width: 100%; }
  .page-actions { width: 100%; }
  .table-wrap table { min-width: 580px; }
  .orders-toolbar, .orders-section-header, .orders-queue-head { align-items: stretch; flex-direction: column; }
  .orders-toolbar > *, .orders-search-field { width: 100%; min-width: 0; }
}
@media (max-width: 560px) {
  h1 { font-size: clamp(1.85rem, 9vw, 2.55rem); }
  .workspace-content { padding: 20px 14px 32px; }
  .card { padding: 16px; border-radius: 13px; }
  .card-heading, .section-heading { gap: .55rem; }
  .form-grid { grid-template-columns: 1fr; }
  .actions > .btn, .form-actions > .btn { flex: 1 1 100%; }
  .page-actions > .btn, .orders-submit-card > .btn, .cake-actions > .btn { width: 100%; }
  .btn-small, .btn-sm { width: auto; }
  .orders-product-row { padding-inline: .35rem; }
  .orders-product-identity { flex-basis: 100%; }
  .orders-product-row .orders-qty-label { margin-left: auto; }
  .cake-stage, .cake-canvas, .cake-preview { min-height: 17rem; }
  .cake-option-grid, .cake-options, .cake-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .public-bar { padding-inline: 12px; }
  .public-actions { gap: 4px; }
  .public-actions .language button { min-width: 27px; min-height: 32px; padding-inline: 4px; }
  .public-bar .brand { gap: .42rem; }
  .public-bar .brand img { width: 34px; height: 34px; }
  .public-bar .brand strong { font-size: .9rem; }
  .public-bar .brand small { font-size: .64rem; }
  .public-content { padding-inline: 14px; }
  .public-nav { gap: .7rem; }
  .workspace-bar { min-height: 56px; }
  .workspace-name, .workspace-name + span { display: none; }
  .table-wrap table { min-width: 520px; }
  .cake-option-grid, .cake-options, .cake-choice-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.cake-preview-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.mobile-rail-backdrop { display: none; }
@media (max-width: 850px) {
  .mobile-rail-backdrop {
    display: block;
    position: fixed;
    inset: 59px 0 0;
    z-index: 5;
    border: 0;
    background: rgb(36 25 36 / .35);
  }
}

@media (max-width: 680px) {
  .cake-preview-card .cake-summary { display: none; }
}
