:root {
  color-scheme: light;
  --bg: #f7f6f4;
  --surface: rgb(255 255 255 / 84%);
  --surface-solid: #ffffff;
  --surface-subtle: #f5f1ef;
  --surface-tint: #fff8f3;
  --line: rgb(37 43 55 / 10%);
  --line-strong: rgb(37 43 55 / 18%);
  --text: #191b22;
  --muted: #626978;
  --blue: #3157d5;
  --rose: #e25563;
  --teal: #0f8b82;
  --green: #23784a;
  --amber: #9b6300;
  --red: #b42318;
  --radius: 8px;
  --shadow-soft: 0 1px 2px rgb(25 27 34 / 6%), 0 12px 34px rgb(25 27 34 / 9%);
  --shadow-lift: 0 16px 46px rgb(49 87 213 / 16%), 0 4px 16px rgb(226 85 99 / 10%);
  --focus: 0 0 0 3px rgb(49 87 213 / 18%);
  font-family:
    "Aptos",
    "Segoe UI Variable",
    "Segoe UI",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgb(255 255 255 / 0), rgb(255 232 223 / 66%) 28%, rgb(235 244 255 / 74%) 52%, rgb(239 255 249 / 64%) 78%, rgb(255 255 255 / 0)),
    repeating-linear-gradient(90deg, rgb(25 27 34 / 3%) 0 1px, transparent 1px 76px),
    repeating-linear-gradient(0deg, rgb(25 27 34 / 2%) 0 1px, transparent 1px 76px),
    var(--bg);
  background-size: 240% 240%, auto, auto, auto;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  animation: ambientPan 18s ease-in-out infinite alternate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgb(49 87 213 / 10%), transparent 28%),
    linear-gradient(320deg, rgb(226 85 99 / 10%), transparent 34%),
    linear-gradient(0deg, rgb(255 255 255 / 72%), rgb(255 255 255 / 22%));
  mix-blend-mode: multiply;
  animation: veilShift 14s ease-in-out infinite alternate;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 16px 0;
  background: linear-gradient(180deg, rgb(247 246 244 / 94%), rgb(247 246 244 / 72%) 72%, rgb(247 246 244 / 0));
  backdrop-filter: blur(18px) saturate(1.25);
  animation: headerDrop 520ms cubic-bezier(.2, .8, .2, 1) both;
}

.app-bar {
  min-height: 58px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 14px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 84%), rgb(255 255 255 / 66%)),
    linear-gradient(90deg, rgb(255 240 235 / 78%), rgb(239 247 255 / 72%));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.brand {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 188px;
  padding: 2px 8px 2px 2px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(145deg, #1f2a44, #3157d5 54%, #e25563),
    #3157d5;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: var(--radius);
  font-weight: 800;
  box-shadow: 0 8px 22px rgb(49 87 213 / 24%);
  transform: translateZ(0);
  animation: markPulse 4.8s ease-in-out infinite;
}

.brand strong,
.brand span {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-size: 15px;
  font-weight: 760;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 98px;
}

.nav-list {
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.nav-list::-webkit-scrollbar {
  height: 6px;
}

.nav-list::-webkit-scrollbar-thumb {
  background: rgb(49 87 213 / 22%);
  border-radius: 999px;
}

.nav-button {
  position: relative;
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 12px;
  background: transparent;
  color: #343946;
  font-weight: 680;
  text-align: center;
  white-space: nowrap;
  scroll-snap-align: center;
  transform: translateY(0);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-button::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--blue), var(--teal));
  opacity: 0;
  transform: scaleX(.2);
  transform-origin: center;
  transition: transform 220ms ease, opacity 220ms ease;
}

.nav-button:hover,
.nav-button:focus-visible {
  outline: none;
  color: var(--blue);
  border-color: rgb(49 87 213 / 16%);
  background: rgb(255 255 255 / 64%);
  box-shadow: 0 7px 18px rgb(49 87 213 / 10%);
  transform: translateY(-1px);
}

.nav-button:focus-visible {
  box-shadow: var(--focus), 0 7px 18px rgb(49 87 213 / 10%);
}

.nav-button.is-active {
  color: #111827;
  border-color: rgb(49 87 213 / 20%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(255 255 255 / 72%)),
    linear-gradient(120deg, rgb(255 225 218 / 78%), rgb(230 240 255 / 78%));
  box-shadow: 0 10px 28px rgb(49 87 213 / 14%);
}

.nav-button.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-menu {
  position: relative;
  flex: 0 0 auto;
}

.settings-nav-button::before {
  content: "";
}

.settings-nav-button {
  padding-right: 24px;
}

.settings-nav-button::after {
  right: 24px;
}

.settings-nav-button::before {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: translateY(-35%);
  opacity: .72;
}

.settings-nav-menu {
  position: fixed;
  z-index: 40;
  display: none;
  min-width: 248px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 7px;
  border: 1px solid rgb(49 87 213 / 16%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 18px 48px rgb(31 38 54 / 18%);
  backdrop-filter: blur(14px);
}

.settings-nav-menu.is-open {
  display: grid;
  gap: 4px;
  animation: menuDrop 160ms ease both;
}

.settings-nav-menu button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  padding: 7px 9px;
  text-align: left;
  font-weight: 720;
  cursor: pointer;
}

.settings-nav-menu button:hover,
.settings-nav-menu button:focus-visible,
.settings-nav-menu button.is-active {
  outline: none;
  border-color: rgb(49 87 213 / 18%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(255 255 255 / 72%)),
    linear-gradient(120deg, rgb(255 225 218 / 74%), rgb(230 240 255 / 78%));
  color: var(--blue);
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  max-width: 1480px;
  margin: 10px auto 0;
  padding: 12px 4px 16px;
}

.topbar-eyebrow {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 800;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-signal {
  display: flex;
  gap: 6px;
  align-items: end;
  height: 36px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 54%);
}

.topbar-signal span {
  width: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rose), var(--blue));
  animation: signalDance 1.8s ease-in-out infinite;
}

.topbar-signal span:nth-child(1) {
  height: 14px;
}

.topbar-signal span:nth-child(2) {
  height: 24px;
  animation-delay: 160ms;
}

.topbar-signal span:nth-child(3) {
  height: 18px;
  animation-delay: 320ms;
}

.env-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 72%);
  color: var(--muted);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 5px 16px rgb(25 27 34 / 5%);
}

.env-pill {
  color: var(--teal);
  border-color: rgb(15 139 130 / 18%);
  background: linear-gradient(180deg, rgb(246 255 252 / 88%), rgb(255 255 255 / 72%));
}

.status-critical {
  background: #fff0ed;
  border-color: #f5c0b8;
  color: var(--red);
}

.status-watch {
  background: #fff7e6;
  border-color: #edd094;
  color: var(--amber);
}

.status-ok {
  background: #edf8f1;
  border-color: #b9dac5;
  color: var(--green);
}

.view-root {
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 18px 32px;
  animation: pageRise 420ms cubic-bezier(.2, .8, .2, 1) both;
}

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

.metric {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 86%), rgb(255 255 255 / 68%)),
    linear-gradient(120deg, rgb(255 232 224 / 46%), rgb(235 245 255 / 48%));
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: var(--radius);
  padding: 13px;
  box-shadow: var(--shadow-soft);
  animation: cardEnter 540ms cubic-bezier(.2, .8, .2, 1) both;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 32%, rgb(255 255 255 / 48%) 46%, transparent 60% 100%);
  transform: translateX(-120%);
  animation: sheen 5.5s ease-in-out infinite;
}

.metric:hover {
  border-color: rgb(49 87 213 / 18%);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.metric span {
  position: relative;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  position: relative;
  display: block;
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.1;
}

.toolbar,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.toolbar {
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  font-size: 15px;
}

.view-inventory .panel > .section-header {
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid rgb(219 227 239 / 86%);
  background: linear-gradient(90deg, rgb(238 244 255 / 88%), rgb(255 255 255 / 62%));
}

.view-inventory .panel > .section-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--pink));
}

.view-inventory .panel > .section-header h2 {
  font-size: 16px;
  font-weight: 850;
}

.collapsed-feature {
  color: var(--muted);
  background: rgb(248 250 252 / 58%);
}

.inventory-output-toolbar {
  align-items: end;
}

.panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 86%), rgb(255 255 255 / 70%)),
    linear-gradient(120deg, rgb(255 240 234 / 44%), rgb(240 248 255 / 52%));
  box-shadow: var(--shadow-soft);
  animation: cardEnter 500ms cubic-bezier(.2, .8, .2, 1) both;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rose), var(--blue), var(--teal));
  opacity: .72;
  transform: scaleX(.3);
  transform-origin: left;
  animation: accentSweep 900ms cubic-bezier(.2, .8, .2, 1) both;
}

.panel:hover {
  border-color: rgb(49 87 213 / 18%);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.panel-body {
  padding: 12px;
}

.table-wrap {
  overflow: auto;
  max-height: min(58vh, 560px);
  border-top: 1px solid rgb(25 27 34 / 5%);
  background: rgb(255 255 255 / 40%);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid rgb(25 27 34 / 8%);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: center;
  background: linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(247 248 252 / 94%));
  color: #343946;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.table-sort-button span:first-child {
  overflow-wrap: anywhere;
}

.table-sort-button span[aria-hidden="true"] {
  color: var(--muted);
  font-size: 11px;
}

.table-sort-button:hover,
.table-sort-button:focus-visible,
.table-sort-button.is-active {
  color: var(--blue);
}

.table-sort-button:focus-visible {
  outline: 2px solid rgb(49 87 213 / 36%);
  outline-offset: 3px;
}

tbody tr {
  animation: rowSlide 420ms cubic-bezier(.2, .8, .2, 1) both;
}

tbody tr:nth-child(1) { animation-delay: 20ms; }
tbody tr:nth-child(2) { animation-delay: 45ms; }
tbody tr:nth-child(3) { animation-delay: 70ms; }
tbody tr:nth-child(4) { animation-delay: 95ms; }
tbody tr:nth-child(5) { animation-delay: 120ms; }
tbody tr:nth-child(6) { animation-delay: 145ms; }
tbody tr:nth-child(7) { animation-delay: 170ms; }
tbody tr:nth-child(8) { animation-delay: 195ms; }
tbody tr:nth-child(9) { animation-delay: 220ms; }
tbody tr:nth-child(10) { animation-delay: 245ms; }
tbody tr:nth-child(11) { animation-delay: 270ms; }
tbody tr:nth-child(12) { animation-delay: 295ms; }

tr:hover td {
  background: rgb(49 87 213 / 5%);
}

tr.is-new-submission td {
  background: rgb(34 197 94 / 10%);
  box-shadow: inset 0 1px 0 rgb(34 197 94 / 20%), inset 0 -1px 0 rgb(34 197 94 / 20%);
}

.submission-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(34 197 94 / 30%);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(236 253 245 / 92%), rgb(239 246 255 / 86%));
  color: #14532d;
}

.submission-confirmation strong {
  color: #166534;
}

#nurseQuickRequests:focus {
  outline: none;
}

td.numeric,
th.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.view-inventory .table-wrap {
  max-height: min(70vh, 680px);
  background: rgb(255 255 255 / 56%);
}

.view-inventory table {
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.view-inventory th,
.view-inventory td {
  padding: 5px 8px;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-history-table table {
  min-width: 1040px;
  table-layout: fixed;
}

.stock-history-table th,
.stock-history-table td {
  border-right: 1px solid rgb(25 27 34 / 8%);
}

.stock-history-table th:last-child,
.stock-history-table td:last-child {
  border-right: 0;
}

.stock-history-table th:nth-child(1),
.stock-history-table td:nth-child(1) {
  width: 14%;
}

.stock-history-table th:nth-child(2),
.stock-history-table td:nth-child(2) {
  width: 10%;
}

.stock-history-table th:nth-child(3),
.stock-history-table td:nth-child(3) {
  width: 10%;
}

.stock-history-table th:nth-child(4),
.stock-history-table td:nth-child(4) {
  width: 10%;
  text-align: center;
}

.stock-history-table th:nth-child(5),
.stock-history-table td:nth-child(5) {
  width: 13%;
}

.stock-history-table th:nth-child(6),
.stock-history-table td:nth-child(6) {
  width: 12%;
}

.stock-history-table th:nth-child(7),
.stock-history-table td:nth-child(7) {
  width: 31%;
}

.movement-quantity {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.movement-positive {
  background: rgb(220 252 231 / 72%);
  color: #166534;
}

.movement-negative {
  background: rgb(254 226 226 / 72%);
  color: #b91c1c;
}

.view-inventory th {
  font-size: 11px;
}

.view-inventory .table-sort-button {
  min-height: 22px;
  gap: 3px;
}

.view-inventory tbody tr {
  animation: none;
}

.view-inventory tr.clickable-row {
  cursor: pointer;
}

.view-inventory tr.clickable-row:focus-visible td {
  outline: 2px solid rgb(49 87 213 / 34%);
  outline-offset: -2px;
}

.view-inventory tr.clickable-row.is-selected td {
  background: rgb(49 87 213 / 10%);
  font-weight: 650;
}

.view-inventory tr.is-summary-row td {
  color: var(--muted);
  background: rgb(248 250 252 / 62%);
}

.view-inventory th:nth-child(1),
.view-inventory td:nth-child(1) {
  width: 8%;
}

.view-inventory th:nth-child(2),
.view-inventory td:nth-child(2) {
  width: 12%;
}

.view-inventory th:nth-child(3),
.view-inventory td:nth-child(3) {
  width: 9%;
}

.view-inventory th:nth-child(4),
.view-inventory td:nth-child(4) {
  width: 14%;
  padding-right: 4px;
}

.view-inventory th:nth-child(5),
.view-inventory td:nth-child(5) {
  width: 16%;
  padding-left: 4px;
  padding-right: 4px;
}

.view-inventory th:nth-child(6),
.view-inventory td:nth-child(6) {
  width: 8%;
  padding-left: 4px;
}

.view-inventory th:nth-child(7),
.view-inventory td:nth-child(7) {
  width: 8%;
}

.view-inventory th:nth-child(8),
.view-inventory td:nth-child(8) {
  width: 5%;
}

.view-inventory th:nth-child(9),
.view-inventory td:nth-child(9) {
  width: 20%;
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 9px;
  align-items: end;
}

.form-section {
  grid-column: 1 / -1;
  align-self: stretch;
  padding: 4px 0 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #191b22;
  font-size: 13px;
  font-weight: 820;
}

.form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgb(226 85 99 / 38%), rgb(49 87 213 / 24%), transparent);
}

.nurse-calculator-section {
  margin-top: 4px;
  padding: 10px;
  border: 1px solid rgb(49 87 213 / 16%);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 66%), rgb(255 255 255 / 42%)),
    linear-gradient(120deg, rgb(255 233 225 / 46%), rgb(235 245 255 / 54%));
}

.nurse-calculator-section p {
  margin: 7px 0 0;
}

.calculator-field {
  min-height: 72px;
  padding: 8px;
  border: 1px solid rgb(49 87 213 / 12%);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 70%), rgb(255 255 255 / 42%)),
    linear-gradient(120deg, rgb(255 240 235 / 34%), rgb(235 245 255 / 38%));
}

.calculator-field:has(input:disabled) {
  background: rgb(239 241 245 / 58%);
}

.wide-field {
  grid-column: span 2;
}

.form-row-start {
  grid-column-start: 1;
}

.compact-form label,
.inline-edit label,
.filter-strip label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 78%);
  color: var(--text);
  padding: 7px 9px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 72%);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
  color: #4f5664;
  background: rgb(239 241 245 / 74%);
  border-color: rgb(37 43 55 / 12%);
  cursor: not-allowed;
}

.single-line-note input {
  min-height: 36px;
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: rgb(49 87 213 / 28%);
  background: rgb(255 255 255 / 92%);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgb(49 87 213 / 54%);
  box-shadow: var(--focus), inset 0 1px 0 rgb(255 255 255 / 90%);
  transform: translateY(-1px);
}

.button {
  position: relative;
  overflow: hidden;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 7px 11px;
  background: rgb(255 255 255 / 76%);
  color: var(--text);
  font-weight: 760;
  box-shadow: 0 5px 14px rgb(25 27 34 / 6%);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 34%, rgb(255 255 255 / 42%) 48%, transparent 62% 100%);
  transform: translateX(-120%);
  transition: transform 520ms ease;
}

.button:hover,
.button:focus-visible {
  outline: none;
  border-color: rgb(49 87 213 / 34%);
  box-shadow: 0 11px 24px rgb(49 87 213 / 14%);
  transform: translateY(-2px);
}

.button:hover::before,
.button:focus-visible::before {
  transform: translateX(120%);
}

.button:focus-visible {
  box-shadow: var(--focus), 0 11px 24px rgb(49 87 213 / 14%);
}

.button.primary {
  color: #fff;
  border-color: rgb(49 87 213 / 50%);
  background: linear-gradient(135deg, #3157d5, #5f6feb 62%, #e25563);
}

.button.green {
  color: #fff;
  border-color: rgb(35 120 74 / 48%);
  background: linear-gradient(135deg, #23784a, #0f8b82);
}

.button.danger {
  color: var(--red);
  border-color: #efb4aa;
  background: #fff4f2;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.settings-grid table {
  min-width: 100%;
  table-layout: fixed;
}

.settings-grid th:first-child,
.settings-grid td:first-child {
  width: 38%;
}

.settings-grid th:nth-child(2),
.settings-grid td:nth-child(2) {
  width: 42%;
}

.settings-grid th:nth-child(3),
.settings-grid td:nth-child(3) {
  width: 20%;
}

.settings-grid input,
.settings-grid select {
  width: 100%;
}

.settings-save-bar {
  position: sticky;
  top: 86px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 18px;
  padding: 10px 12px;
  border: 1px solid rgb(49 87 213 / 16%);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(255 255 255 / 84%)),
    linear-gradient(120deg, rgb(255 232 224 / 72%), rgb(235 245 255 / 78%));
  box-shadow: 0 12px 32px rgb(31 38 54 / 12%);
  backdrop-filter: blur(14px);
}

.settings-save-bar strong,
.settings-save-bar span {
  display: block;
}

.settings-save-bar strong {
  font-size: 14px;
}

.settings-save-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.settings-save-bar .button {
  flex: 0 0 auto;
}

.settings-stack {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.settings-dropdown-stack {
  grid-template-columns: 1fr;
  padding-top: 8px;
}

.settings-dropdown-stack > .settings-accordion {
  width: 100%;
  min-width: 0;
}

.settings-accordion {
  margin-bottom: 0;
}

.settings-accordion-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.settings-accordion-button:hover,
.settings-accordion-button:focus-visible {
  outline: none;
  background: rgb(49 87 213 / 5%);
}

.settings-accordion-button:focus-visible {
  box-shadow: var(--focus);
}

.settings-accordion-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.settings-accordion-title strong {
  font-size: 15px;
}

.settings-accordion-title span {
  color: var(--muted);
  font-size: 12px;
}

.settings-accordion-state {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 5px 9px;
  border: 1px solid rgb(49 87 213 / 16%);
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  color: var(--blue);
  font-size: 12px;
  font-weight: 780;
  text-align: center;
}

.settings-accordion-content {
  border-top: 1px solid rgb(25 27 34 / 7%);
}

.settings-accordion-content .dropdown-create-form {
  border-top: 0;
}

.settings-accordion-content .table-wrap {
  max-height: min(56vh, 560px);
}

.settings-accordion tr.is-inactive {
  background: rgb(248 250 252 / 72%);
  color: var(--muted);
}

.settings-accordion tr.is-inactive input,
.settings-accordion tr.is-inactive select {
  color: var(--muted);
}

.dropdown-create-form {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) auto;
  padding: 10px 12px;
  border-top: 1px solid rgb(25 27 34 / 6%);
}

.item-master-table table {
  min-width: 1960px;
  table-layout: fixed;
}

.item-master-table th:nth-child(2),
.item-master-table td:nth-child(2) {
  width: 12%;
}

.item-master-table th:nth-child(3),
.item-master-table td:nth-child(3) {
  width: 18%;
}

.item-master-table th:nth-child(10),
.item-master-table td:nth-child(10) {
  width: 5%;
}

.packaging-help {
  align-self: center;
  flex: 1 1 460px;
  min-width: 280px;
  padding: 8px 10px;
  border: 1px solid rgb(49 87 213 / 12%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 62%);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.filter-strip {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgb(25 27 34 / 7%);
}

.filter-strip label {
  min-width: 220px;
}

.number-input {
  max-width: 96px;
  text-align: right;
}

.dropdown-block {
  min-width: 0;
}

.dropdown-block-title {
  margin: 0 0 6px;
  font-weight: 800;
}

.ai-output {
  min-height: 148px;
  padding: 10px;
  white-space: pre-wrap;
  color: #26313d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 72%), rgb(248 250 253 / 78%)),
    repeating-linear-gradient(135deg, rgb(49 87 213 / 3%) 0 1px, transparent 1px 14px);
}

.empty-state {
  display: grid;
  gap: 4px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: #343946;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 12px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 94%), rgb(255 255 255 / 78%)),
    linear-gradient(120deg, rgb(255 232 224 / 70%), rgb(235 245 255 / 70%));
  box-shadow: 0 18px 44px rgb(25 27 34 / 18%);
  backdrop-filter: blur(14px);
}

.toast.is-visible {
  display: block;
  animation: toastIn 260ms cubic-bezier(.2, .8, .2, 1) both;
}

.release-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.release-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 62%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.release-box:hover {
  box-shadow: 0 10px 24px rgb(49 87 213 / 10%);
  transform: translateY(-1px);
}

.release-box strong {
  display: block;
  margin-bottom: 4px;
}

.muted {
  color: var(--muted);
}

@keyframes ambientPan {
  from { background-position: 0% 45%, 0 0, 0 0, 0 0; }
  to { background-position: 100% 55%, 38px 0, 0 38px, 0 0; }
}

.auth-screen {
  min-height: calc(100vh - 96px);
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-panel {
  width: min(100%, 520px);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.auth-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.auth-mark {
  flex: 0 0 auto;
}

.auth-brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.auth-brand p,
.auth-note {
  color: var(--muted);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.auth-provider {
  min-width: 160px;
}

.auth-approval-panel {
  width: min(1120px, calc(100vw - 32px));
}

.auth-approval-panel .table-wrap {
  max-height: min(70vh, 640px);
}

.auth-approval-panel input,
.auth-approval-panel select {
  min-width: 130px;
}

.action-cell {
  white-space: nowrap;
}

@keyframes veilShift {
  from { opacity: .72; transform: translateY(0); }
  to { opacity: .98; transform: translateY(-10px); }
}

@keyframes headerDrop {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rowSlide {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes sheen {
  0%, 62% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes accentSweep {
  from { transform: scaleX(.06); opacity: 0; }
  to { transform: scaleX(1); opacity: .72; }
}

@keyframes markPulse {
  0%, 100% { box-shadow: 0 8px 22px rgb(49 87 213 / 24%); transform: translateY(0); }
  50% { box-shadow: 0 12px 30px rgb(226 85 99 / 22%); transform: translateY(-1px); }
}

@keyframes signalDance {
  0%, 100% { transform: scaleY(.72); opacity: .7; }
  50% { transform: scaleY(1.06); opacity: 1; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.field-hint {
  align-self: end;
  color: #4b6475;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid rgba(68, 94, 115, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(560px, 100%);
  border: 1px solid rgba(83, 113, 134, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
  padding: 18px;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-actions {
  justify-content: flex-end;
  margin: 14px 0 0;
}

@media (max-width: 1180px) {
  .app-bar {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .header-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .app-header {
    padding: 8px 10px 0;
  }

  .app-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand {
    min-width: 0;
  }

  .nav-list {
    width: 100%;
  }

  .metric-grid,
  .grid-2,
  .release-grid,
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 620px) {
  .view-root {
    padding: 8px 10px 24px;
  }

  .nav-button {
    min-height: 36px;
    padding: 8px 10px;
  }

  .metric-grid,
  .grid-2,
  .release-grid,
  .settings-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .filter-strip label {
    min-width: 100%;
  }

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

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