:root {
  --brand: #157fb6;
  --brand-light: #7ccdf1;
  --brand-action: #0e668f;
  --brand-deep: #084a70;
  --brand-soft: #e9f7fd;
  --brand-mist: #f5fbfe;
  --ink: #16364a;
  --ink-soft: #587184;
  --line: #d6e8f2;
  --surface: #ffffff;
  --success: #247b62;
  --warning: #926114;
  --danger: #a83f3b;
  color: var(--ink);
  background: var(--brand-mist);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(124, 205, 241, .28), transparent 34%),
    linear-gradient(180deg, #f7fcff 0%, #eef8fc 100%);
}

button,
input,
select,
textarea {
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(21, 127, 182, .24);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 1040px);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 70px rgba(14, 102, 143, .13);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 76px;
  padding: 13px 28px;
  color: var(--ink);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid rgba(21, 127, 182, .16);
  box-shadow: 0 7px 24px rgba(14, 102, 143, .07);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-logo {
  display: block;
  width: 154px;
  max-width: 31vw;
  height: auto;
  object-fit: contain;
}

.header-title {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.header-title h1 {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.08;
}

.app-header .eyebrow {
  margin-bottom: 3px;
  color: var(--brand);
  font-size: 10px;
}

.header-actions {
  gap: 8px;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 1px solid #c8e8f7;
  font-weight: 750;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(124, 205, 241, .28);
}

.icon-button,
.back-button {
  color: var(--brand-action);
  background: var(--brand-soft);
  border: 1px solid #cfe8f4;
}

.icon-button:hover,
.back-button:hover {
  color: #fff;
  background: var(--brand-action);
  border-color: var(--brand-action);
}

main {
  padding: 30px 36px 48px;
}

.screen.is-active {
  animation: brandAppear .2s ease-out;
}

@keyframes brandAppear {
  from { opacity: .55; transform: translateY(5px); }
}

.eyebrow {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: .1em;
}

.login-screen {
  padding: 4px 0 20px;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 20px;
  max-width: 940px;
  margin: 0 auto;
}

.login-brand-panel,
.login-card {
  min-width: 0;
  border-radius: 28px;
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 48px);
  color: var(--ink);
  background: linear-gradient(145deg, #e8f7fd 0%, #f9fdff 60%, #dff3fc 100%);
  border: 1px solid #cce8f5;
}

.login-brand-panel::before,
.login-brand-panel::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.login-brand-panel::before {
  width: 260px;
  height: 260px;
  right: -110px;
  bottom: -90px;
  background: rgba(21, 127, 182, .1);
}

.login-brand-panel::after {
  width: 180px;
  height: 180px;
  right: -65px;
  bottom: -42px;
  border: 28px solid rgba(124, 205, 241, .22);
}

.login-brand-panel > * {
  position: relative;
  z-index: 1;
}

.login-logo {
  display: block;
  width: min(270px, 88%);
  height: auto;
  object-fit: contain;
  margin: 0 0 34px;
}

.mode-label {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(21, 127, 182, .2);
  border-radius: 999px;
  color: var(--brand-action);
  background: rgba(255, 255, 255, .74);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-brand-panel h2 {
  max-width: 520px;
  margin: 18px 0 12px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: -.035em;
}

.login-brand-panel > p {
  max-width: 520px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

.brand-benefits {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.brand-benefits span {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #35586d;
  font-size: 14px;
  font-weight: 700;
}

.brand-benefits strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 10px;
  color: #fff;
  background: var(--brand-action);
  font-size: 11px;
  letter-spacing: .06em;
}

.login-card {
  max-width: none;
  margin: 0;
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 22px 55px rgba(13, 82, 116, .11);
}

.login-card h2 {
  color: var(--ink);
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -.025em;
}

.login-copy {
  margin: 12px 0 20px;
  color: var(--ink-soft);
}

.login-copy strong {
  color: var(--ink);
}

.demo-steps {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 15px;
  border-radius: 18px;
  background: var(--brand-mist);
  border: 1px solid #deedf4;
}

.demo-steps > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
}

.demo-steps > div > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #fff;
  background: var(--brand-action);
  font-size: 12px;
  font-weight: 800;
}

.demo-steps p,
.demo-steps strong,
.demo-steps small {
  display: block;
  margin: 0;
}

.demo-steps strong {
  color: var(--ink);
  font-size: 13px;
}

.demo-steps small {
  margin-top: 3px;
  color: var(--ink-soft);
  line-height: 1.42;
}

.demo-role-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.role-preview-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid #cfe3ee;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 5px 15px rgba(13, 82, 116, .04);
}

.role-preview-card:hover,
.role-preview-card:focus-visible {
  border-color: var(--brand);
  background: #f4fbfe;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(13, 82, 116, .1);
}

.role-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--brand-action);
}

.role-manager {
  color: var(--brand-deep);
  background: var(--brand-light);
}

.role-copy {
  min-width: 0;
}

.role-copy strong {
  color: var(--ink);
  font-size: 16px;
}

.role-copy small {
  color: var(--ink-soft);
}

.role-arrow,
.action-arrow {
  color: var(--brand);
  font-size: 19px;
  font-weight: 800;
}

.safety-banner {
  margin-top: 18px;
  border-color: #efd89f;
  color: #6f4b12;
  background: #fff7df;
}

.domain-note {
  color: #738896;
}

.home-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-action) 0%, var(--brand) 72%, #3198c8 100%);
  box-shadow: 0 18px 38px rgba(14, 102, 143, .18);
}

.home-hero::after {
  position: absolute;
  right: -58px;
  bottom: -98px;
  width: 260px;
  height: 260px;
  border: 38px solid rgba(124, 205, 241, .23);
  border-radius: 50%;
  content: "";
}

.home-hero .welcome-row {
  position: relative;
  z-index: 1;
}

.home-hero .eyebrow {
  color: #cdeefa;
}

.home-hero h2 {
  color: #fff;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.welcome-copy {
  max-width: 610px;
  margin: 10px 0 0;
  color: #e5f6fd;
  line-height: 1.55;
}

.staff-switch {
  white-space: nowrap;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .36);
  backdrop-filter: blur(8px);
}

.action-heading,
.tool-heading {
  margin: 24px 0 12px;
}

.action-heading h3,
.tool-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.action-grid {
  gap: 13px;
  margin: 0 0 24px;
}

.action-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 108px;
  padding: 18px;
  border-color: var(--line);
  border-radius: 21px;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(13, 82, 116, .07);
}

.action-card:hover,
.action-card:focus-visible {
  border-color: var(--brand);
  background: #f8fdff;
  box-shadow: 0 13px 28px rgba(13, 82, 116, .12);
}

.action-card strong {
  color: var(--ink);
  font-size: 17px;
}

.action-card small {
  color: var(--ink-soft);
  line-height: 1.4;
}

.action-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  color: var(--brand-action);
  background: var(--brand-soft);
  font-size: 22px;
  font-weight: 850;
}

.action-sales .action-icon {
  color: var(--brand-deep);
  background: #dff3fc;
}

.action-receiving .action-icon {
  color: #12608c;
  background: #e6f6fd;
}

.action-waste .action-icon {
  color: var(--danger);
  background: #fff0ed;
}

.action-count .action-icon {
  color: var(--success);
  background: #e7f7f1;
}

.action-card:disabled {
  border-style: dashed;
  opacity: .55;
}

.read-only-links {
  gap: 12px;
}

.read-only-link {
  min-height: 74px;
  padding: 15px 17px;
  border-color: #d5e7f0;
  color: var(--ink);
  background: #f4fafe;
}

.read-only-link:hover,
.read-only-link:focus-visible {
  border-color: var(--brand);
  background: #eaf7fd;
}

.read-only-link small {
  color: var(--ink-soft);
}

.setup-banner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 13px;
  min-height: 78px;
  color: #fff;
  background: linear-gradient(110deg, var(--brand-deep), var(--brand-action));
  box-shadow: 0 12px 27px rgba(8, 74, 112, .2);
}

.setup-banner:hover,
.setup-banner:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(8, 74, 112, .25);
}

.manager-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--brand-deep);
  background: var(--brand-light);
  font-size: 20px;
}

.setup-copy strong,
.setup-copy small {
  display: block;
}

.setup-copy small {
  color: #d9f2fc;
}

.section-heading span,
.recent-item small,
.master-item small {
  color: var(--ink-soft);
}

.empty-state {
  border-color: #bfdce9;
  color: #6b8392;
  background: #fbfdff;
}

.recent-status {
  color: #12614e;
  background: #e4f5ef;
}

.screen-title {
  padding-bottom: 16px;
  border-bottom: 1px solid #e2eef4;
}

.screen-title h2,
.dialog-heading h2 {
  color: var(--ink);
  letter-spacing: -.025em;
}

.help-button {
  min-height: 40px;
  color: var(--brand-action);
  background: var(--brand-soft);
  border-color: #b9dff0;
}

.help-button:hover,
.help-button:focus-visible {
  color: #fff;
  background: var(--brand-action);
  border-color: var(--brand-action);
}

.category-button {
  min-height: 42px;
  border-color: var(--line);
  color: #456477;
}

.category-button.is-selected {
  color: #fff;
  background: var(--brand-action);
  border-color: var(--brand-action);
}

.product-card {
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(13, 82, 116, .05);
}

.product-card:hover:not(:disabled),
.product-card:focus-visible:not(:disabled) {
  border-color: var(--brand);
  background: #f7fcff;
}

.product-card small,
.cart-label {
  color: var(--ink-soft);
}

.product-card .quantity {
  color: var(--brand-action);
}

.cart-panel {
  border-color: #bfdde9;
  box-shadow: 0 15px 34px rgba(8, 74, 112, .18);
}

.quick-form {
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(13, 82, 116, .06);
}

label {
  color: #34566b;
  font-weight: 720;
}

input,
select,
textarea {
  min-height: 48px;
  border-color: #bad7e5;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 96px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #87bed8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(21, 127, 182, .13);
}

.field-error {
  border-color: var(--danger) !important;
  background: #fff7f6 !important;
  box-shadow: 0 0 0 4px rgba(168, 63, 59, .12) !important;
}

.has-field-error,
.error-eyebrow {
  color: var(--danger);
}

details {
  border-color: #dcebf2;
}

summary {
  min-height: 40px;
  color: var(--brand-action);
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 46px;
}

.primary-button {
  color: #fff;
  background: var(--brand-action);
  box-shadow: 0 8px 18px rgba(14, 102, 143, .18);
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled) {
  background: var(--brand-deep);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--brand-action);
  background: var(--brand-soft);
  border: 1px solid #c9e5f2;
}

.secondary-button:hover:not(:disabled),
.secondary-button:focus-visible:not(:disabled) {
  color: #fff;
  background: var(--brand-action);
  border-color: var(--brand-action);
}

.text-button {
  color: var(--brand-action);
}

.info-box,
.setup-intro {
  color: #365c72;
  background: var(--brand-soft);
  border: 1px solid #d2eaf5;
}

.setup-progress {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  box-shadow: 0 14px 30px rgba(14, 102, 143, .18);
}

.progress-heading .eyebrow,
.next-step {
  color: #d9f3fd;
}

.progress-track span {
  background: var(--brand-light);
}

.checklist-row,
.setup-card,
.stock-row,
.approval-row {
  border-color: var(--line);
  box-shadow: 0 6px 18px rgba(13, 82, 116, .045);
}

.checklist-icon {
  color: #657d8b;
  background: #edf5f8;
}

.checklist-row.is-complete .checklist-icon {
  color: #12614e;
  background: #e2f4ed;
}

.checklist-row.is-attention .checklist-icon {
  color: #80530f;
  background: #fff1cf;
}

.checklist-row small,
.setup-card p,
.setup-note,
.stock-row small,
.approval-row small,
.recipe-help {
  color: var(--ink-soft);
}

.setup-count {
  color: var(--brand-action);
}

.optional-card {
  background: #f8fcfe;
}

.stock-status {
  color: #12614e;
  background: #e2f4ed;
}

.stock-status.is-low {
  color: #7f491f;
  background: #ffead5;
}

.status-pending {
  color: #80530f;
  background: #fff1cf;
}

dialog {
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid #d3e7f0;
  box-shadow: 0 28px 90px rgba(8, 58, 86, .3);
}

dialog::backdrop {
  background: rgba(6, 39, 59, .58);
}

.dialog-heading .icon-button {
  color: var(--brand-action);
  background: var(--brand-soft);
}

.guidance-intro,
.guidance-steps li {
  color: #3e6073;
}

.guidance-tip {
  color: #684811;
  background: #fff4d7;
}

.validation-list li {
  border-left-color: var(--danger);
  background: #fff2f0;
}

.validation-list strong {
  color: #842f2b;
}

.test-plan-button {
  margin-top: 4px;
}

.uat-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0 26px;
  padding: 18px 20px;
  border: 1px solid #cce7f4;
  border-radius: 18px;
  background: linear-gradient(135deg, #eef9fe, #fff);
}

.uat-callout h3,
.uat-callout p {
  margin: 4px 0 0;
}

.uat-callout p:not(.eyebrow) {
  color: #486979;
}

.uat-dialog {
  width: min(94vw, 880px);
}

.uat-content {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.uat-mode-grid,
.uat-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.uat-mode-card,
.uat-data-section,
.uat-feedback {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid #d7eaf3;
  border-radius: 18px;
  background: #fff;
}

.uat-mode-card h3,
.uat-mode-card p,
.uat-data-section h3,
.uat-feedback h3,
.uat-feedback p {
  margin: 0;
}

.uat-mode-card p,
.uat-mode-card small,
.uat-feedback p {
  color: #4a6a7a;
  line-height: 1.5;
}

.uat-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 23px;
  color: #34586a;
}

.uat-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.uat-data-grid article {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid #dcecf4;
  border-radius: 14px;
  background: #f5fbfe;
}

.uat-data-grid span {
  color: var(--brand-action);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.uat-data-grid small {
  color: #4b6b7b;
  line-height: 1.45;
}

#uatFeedbackSummary {
  min-height: 190px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.recipe-builder {
  background: #eef8fc;
  border: 1px solid #d9ebf3;
}

.toast {
  background: var(--brand-deep);
  box-shadow: 0 10px 28px rgba(8, 74, 112, .24);
}

@media (max-width: 820px) {
  .login-layout {
    grid-template-columns: 1fr;
    max-width: 650px;
  }

  .login-brand-panel {
    padding: 28px;
  }

  .login-logo {
    width: min(240px, 78%);
    margin-bottom: 24px;
  }

  .login-brand-panel h2 {
    max-width: 560px;
    font-size: clamp(32px, 8vw, 46px);
  }

  .brand-benefits {
    grid-template-columns: repeat(3, 1fr);
  }

  .brand-benefits span {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .app-header {
    min-height: 66px;
    padding: 10px 14px;
  }

  .brand-lockup {
    gap: 9px;
  }

  .header-logo {
    width: 108px;
    max-width: none;
  }

  .header-title {
    padding-left: 9px;
  }

  .header-title .eyebrow {
    display: none;
  }

  .header-title h1 {
    font-size: 16px;
  }

  .demo-chip {
    padding: 6px 8px;
  }

  .demo-chip-detail {
    display: none;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  main {
    padding: 18px 16px 38px;
  }

  .login-brand-panel,
  .login-card,
  .home-hero {
    border-radius: 22px;
  }

  .login-brand-panel,
  .login-card {
    padding: 24px 20px;
  }

  .login-logo {
    width: min(205px, 76%);
    margin-bottom: 20px;
  }

  .login-brand-panel h2 {
    margin-top: 14px;
    font-size: clamp(30px, 10vw, 40px);
  }

  .brand-benefits {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 24px;
  }

  .brand-benefits span {
    align-items: center;
    flex-direction: row;
  }

  .role-preview-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-height: 74px;
    padding: 12px;
  }

  .role-icon {
    width: 42px;
    height: 42px;
  }

  .home-hero {
    padding: 22px 18px;
  }

  .home-hero .welcome-row {
    gap: 16px;
  }

  .home-hero h2 {
    font-size: 31px;
  }

  .action-grid,
  .setup-grid,
  .read-only-links {
    grid-template-columns: 1fr;
  }

  .action-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    min-height: 92px;
    padding: 15px;
  }

  .action-icon {
    width: 46px;
    height: 46px;
  }

  .quick-form {
    padding: 18px 16px;
    border-radius: 19px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .screen-title .help-button {
    margin-left: 54px;
  }

  .dialog-form,
  .guidance-content,
  .uat-content {
    padding: 19px 17px;
  }

  .uat-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .uat-mode-grid,
  .uat-feedback-grid,
  .uat-data-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .header-logo {
    width: 96px;
  }

  .header-title {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .demo-chip {
    font-size: 11px;
  }

  .login-brand-panel h2 {
    font-size: 30px;
  }

  .role-preview-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .role-icon {
    width: 40px;
    height: 40px;
  }

  .role-copy strong {
    font-size: 15px;
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .product-card {
    padding: 13px;
  }

  .checklist-row {
    grid-template-columns: 34px 1fr;
  }

  .status-label {
    grid-column: 2;
  }
}

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