:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #eef2f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100%;
  padding: 24px;
  place-items: center;
}

.auth-card {
  display: grid;
  gap: 16px;
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid #d9e0ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgb(25 42 70 / 12%);
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.auth-card input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
}

.auth-card input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 13%);
}

.auth-hint,
.form-error {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.form-error {
  min-height: 20px;
  color: #b42318;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  height: 100%;
  padding: 14px;
}

.topbar,
.toolbar,
.grid-wrap {
  background: #fff;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  box-shadow: 0 3px 16px rgb(25 42 70 / 6%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
}

.topbar-status,
.user-block {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.topbar-status {
  flex-direction: column;
}

.user-block {
  align-items: center;
  color: #475467;
  font-size: 12px;
}

.user-block button {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.load-state {
  color: #475467;
  font-size: 13px;
  text-align: right;
}

.load-state.error {
  color: #b42318;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
}

.search-wrap {
  flex: 1 1 360px;
  min-width: 240px;
}

.search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
}

.search-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 13%);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
}

button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #344054;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: #f8fafc;
}

button.primary {
  border-color: #1d4ed8;
  color: #fff;
  background: #2563eb;
}

button.primary:hover {
  background: #1d4ed8;
}

button.danger {
  border-color: #fecdca;
  color: #b42318;
  background: #fff5f4;
}

button.danger:hover {
  background: #fee4e2;
}

button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.55;
}

.row-count {
  min-width: 100px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.grid-wrap {
  min-height: 0;
  overflow: hidden;
}

#ordersGrid {
  width: 100%;
  height: 100%;
}

.grid-link {
  color: #175cd3;
  font-weight: 600;
  text-decoration: none;
}

.grid-link:hover {
  text-decoration: underline;
}

.readonly-action {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  color: #667085;
  background: #f9fafb;
  font-size: 12px;
}

.footer-note {
  color: #667085;
  font-size: 12px;
  text-align: center;
}

.order-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgb(15 23 42 / 28%);
}

.order-dialog::backdrop {
  background: rgb(15 23 42 / 45%);
}

.order-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.order-form header,
.order-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-form h2 {
  margin: 0;
  font-size: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  overflow: auto;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.form-grid label.wide {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #172033;
  background: #fff;
  font: inherit;
}

.form-grid textarea {
  min-height: 86px;
  resize: vertical;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid label.wide {
    grid-column: auto;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1050px) {
  .toolbar {
    flex-wrap: wrap;
  }

  .app-shell {
    overflow: auto;
  }

  .grid-wrap {
    min-height: 620px;
  }
}
