:root {
  color-scheme: light;
  --ink: #121411;
  --muted: #66706a;
  --soft: #f3f1e8;
  --surface: rgba(255, 255, 255, 0.86);
  --line: rgba(28, 31, 35, 0.11);
  --line-strong: rgba(28, 31, 35, 0.18);
  --accent: #087f6f;
  --accent-ink: #063f38;
  --danger: #c2412d;
  --warning: #b77912;
  --ok: #24784d;
  --shadow: 0 18px 60px rgba(32, 35, 30, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(8, 127, 111, 0.13), transparent 34%),
    linear-gradient(280deg, rgba(183, 121, 18, 0.1), transparent 38%),
    var(--soft);
  color: var(--ink);
  font-family: "Geist", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1540px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar,
.control-strip,
.workspace,
.inventory-header,
.table-title,
.panel-heading {
  display: flex;
  align-items: center;
}

.topbar {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(8, 127, 111, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand-block {
  flex: 1;
  min-width: 0;
}

.header-meta {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 8px;
  margin-bottom: 10px;
}

.project-kicker,
.project-lead {
  justify-self: center;
  margin: 0;
  color: var(--accent);
  text-align: center;
  text-transform: uppercase;
}

.project-kicker {
  font-size: clamp(0.9rem, 1.8vw, 1.25rem);
  font-weight: 900;
}

.project-lead {
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-weight: 900;
  letter-spacing: 0;
}

.beta-label {
  justify-self: center;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid rgba(29, 140, 122, 0.22);
  border-radius: 999px;
  background: rgba(29, 140, 122, 0.1);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 400;
  line-height: 0.88;
}

.req-meta-compact {
  display: none;
}

h2 {
  font-size: 1.08rem;
}

h3 {
  font-size: 0.96rem;
}

.topbar-actions,
.legend,
.quick-adjust,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(245, 243, 239, 0.82);
  backdrop-filter: blur(22px);
}

.auth-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.locked-panel input[readonly] {
  border-color: rgba(21, 22, 23, 0.08);
  background: rgba(21, 22, 23, 0.04);
  color: var(--ink);
  cursor: default;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(29, 140, 122, 0.12);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.primary-button,
.ghost-button,
.icon-button,
.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  padding: 0 15px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(21, 22, 23, 0.16);
}

.ghost-button,
.segment,
select,
.search-field,
.table-search,
.new-item-form,
.inventory-area {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  font-weight: 700;
}

.icon-button {
  width: 38px;
  height: 38px;
  color: var(--muted);
  background: rgba(21, 22, 23, 0.06);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.segment:hover {
  transform: translateY(-1px);
}

svg {
  width: 17px;
  height: 17px;
  flex: none;
  stroke-width: 2.1;
}

.control-strip {
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  margin-bottom: 14px;
  background: rgba(245, 243, 239, 0.78);
  backdrop-filter: blur(24px);
}

.view-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
}

.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  text-decoration: none;
}

.view-tab.active {
  background: var(--ink);
  color: #fff;
}

.search-field {
  flex: 1 1 360px;
  min-height: 44px;
  gap: 8px;
  padding: 0 13px;
  border-radius: var(--radius);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.segmented {
  min-height: 44px;
  padding: 4px;
  border-radius: var(--radius);
}

.segment {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 750;
}

.segment.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 7px 18px rgba(21, 22, 23, 0.08);
}

select,
input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  outline-color: rgba(29, 140, 122, 0.4);
}

.workspace {
  align-items: flex-start;
  gap: 14px;
}

.side-panel {
  position: sticky;
  top: 78px;
  width: 300px;
  flex: 0 0 300px;
}

.new-item-form,
.inventory-area {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.new-item-form {
  padding: 16px;
}

.new-item-form {
  display: grid;
  gap: 12px;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.full {
  width: 100%;
}

.inventory-area {
  flex: 1;
  min-width: 0;
  padding: 16px;
}

.requisition-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(320px, 1.18fr);
  gap: 14px;
  margin-bottom: 14px;
}

.req-panel,
.requisition-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.req-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.requisition-board {
  padding: 16px;
}

.req-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
}

.req-actions,
.req-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.req-actions select {
  width: auto;
  min-width: 190px;
}

.req-summary {
  margin-bottom: 12px;
}

.req-group + .req-group {
  margin-top: 18px;
}

.inventory-header {
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 14px;
}

.legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
}

.dot.ok {
  background: var(--ok);
}

.dot.warning {
  background: var(--warning);
}

.dot.danger {
  background: var(--danger);
}

.table-block {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.table-block + .table-block {
  margin-top: 18px;
}

.table-title {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 9px;
}

.table-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.table-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.stat-chip strong {
  font-size: 0.9rem;
}

.stat-chip.ok {
  color: #0d5637;
  background: rgba(36, 130, 87, 0.12);
}

.stat-chip.warning {
  color: #76500f;
  background: rgba(200, 135, 27, 0.17);
}

.stat-chip.danger {
  color: #7d2318;
  background: rgba(199, 71, 52, 0.16);
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 10px;
  padding: 0 12px;
  border-radius: var(--radius);
}

.table-search input {
  border: 0;
  outline: 0;
  background: transparent;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
  table-layout: fixed;
}

.req-table {
  min-width: 760px;
}

.req-table th:nth-child(1),
.req-table td:nth-child(1) {
  width: 42%;
}

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

.req-table th:nth-child(3),
.req-table td:nth-child(3) {
  width: 12%;
}

.req-table th:nth-child(4),
.req-table td:nth-child(4) {
  width: 14%;
}

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

.req-table th:nth-child(6),
.req-table td:nth-child(6) {
  width: 7%;
  text-align: center;
}

th:nth-child(1),
td:nth-child(1) {
  width: 27%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 9%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 8%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 8%;
}

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

th:nth-child(6),
td:nth-child(6) {
  width: 9%;
}

th:nth-child(7),
td:nth-child(7) {
  width: 13%;
}

th:nth-child(8),
td:nth-child(8) {
  width: 11%;
}

th:nth-child(9),
td:nth-child(9) {
  width: 7%;
  text-align: center;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  font-size: 0.86rem;
}

tbody tr:hover {
  background: #fbfaf7;
}

tbody tr.status-ok {
  background: linear-gradient(90deg, rgba(36, 130, 87, 0.08), transparent 18%);
}

tbody tr.status-minimum {
  background: linear-gradient(90deg, rgba(200, 135, 27, 0.12), transparent 22%);
}

tbody tr.status-critical {
  background: linear-gradient(90deg, rgba(199, 71, 52, 0.15), transparent 26%);
}

tbody tr.status-ok td:first-child {
  border-left: 4px solid var(--ok);
}

tbody tr.status-minimum td:first-child {
  border-left: 4px solid var(--warning);
}

tbody tr.status-critical td:first-child {
  border-left: 4px solid var(--danger);
}

.description-cell {
  font-weight: 700;
  line-height: 1.25;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 92px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.ok {
  color: #0d5637;
  background: rgba(36, 130, 87, 0.16);
  box-shadow: inset 0 0 0 1px rgba(36, 130, 87, 0.18);
}

.pill.warning {
  color: #76500f;
  background: rgba(200, 135, 27, 0.2);
  box-shadow: inset 0 0 0 1px rgba(200, 135, 27, 0.2);
}

.pill.danger {
  color: #7d2318;
  background: rgba(199, 71, 52, 0.22);
  box-shadow: inset 0 0 0 1px rgba(199, 71, 52, 0.24);
}

.qty-input,
.adjust-input {
  width: 64px;
  text-align: right;
}

.available-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 64px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: rgba(21, 22, 23, 0.04);
  color: var(--ink);
  font-weight: 800;
}

.quick-adjust {
  min-width: 126px;
}

.quick-adjust .icon-button {
  width: 34px;
  height: 34px;
}

.delete-button {
  width: 34px;
  height: 34px;
  color: var(--danger);
  background: rgba(199, 71, 52, 0.1);
}

.delete-button:hover {
  background: rgba(199, 71, 52, 0.16);
}

.empty-state {
  height: 96px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.is-hidden {
  display: none;
}

@media (max-width: 1080px) {
  .workspace {
    display: block;
  }

  .side-panel {
    position: static;
    width: auto;
    margin-bottom: 14px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1540px);
    padding-top: 10px;
  }

  .topbar,
  .header-meta,
  .control-strip,
  .inventory-header,
  .req-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    padding: 14px;
  }

  .brand-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 42%);
    column-gap: 10px;
    align-items: start;
  }

  .header-meta {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
    grid-column: 1 / -1;
  }

  .project-kicker {
    font-size: clamp(0.86rem, 3.5vw, 1.08rem);
    line-height: 1.08;
  }

  .project-lead {
    font-size: clamp(0.92rem, 4vw, 1.22rem);
    line-height: 1.14;
  }

  .beta-label {
    justify-self: center;
    font-size: 0.68rem;
  }

  h1 {
    grid-column: 1 / 2;
    align-self: start;
    font-size: clamp(2.55rem, 12vw, 3.45rem);
    line-height: 0.9;
    text-align: left;
  }

  .req-meta-compact {
    display: grid;
    grid-column: 2 / 3;
    justify-self: end;
    width: 100%;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(8, 127, 111, 0.14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    box-shadow: 0 10px 26px rgba(21, 22, 23, 0.08);
  }

  .req-meta-compact span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.7rem;
    line-height: 1.05;
  }

  .req-meta-compact strong {
    color: var(--muted);
    font-size: 0.58rem;
    text-transform: uppercase;
  }

  .topbar-actions,
  .segmented {
    width: 100%;
  }

  .topbar-actions > *,
  .segment {
    flex: 1;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .sync-pill {
    justify-content: center;
    min-width: 100%;
  }

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

  .requisition-shell {
    grid-template-columns: 1fr;
  }

  .locked-panel {
    display: none;
  }

  .view-switch,
  .view-tab,
  .req-actions,
  .req-actions select {
    width: 100%;
  }

  .view-switch {
    position: sticky;
    top: 0;
    z-index: 8;
    margin-bottom: 10px;
    background: rgba(243, 241, 232, 0.9);
  }

  .req-panel,
  .requisition-board,
  .new-item-form,
  .inventory-area {
    padding: 13px;
  }

  .req-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .req-actions select {
    grid-column: 1 / -1;
  }

  .req-actions .ghost-button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    white-space: nowrap;
  }

  .table-title {
    flex-direction: column;
  }

  .table-stats,
  .req-summary {
    justify-content: flex-start;
  }

  table {
    min-width: 780px;
  }

  .req-table {
    min-width: 620px;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: #fff;
  }

  table {
    display: table;
    min-width: 980px;
    table-layout: fixed;
  }

  .req-table {
    min-width: 720px;
  }

  thead {
    display: table-header-group;
  }

  tbody {
    display: table-row-group;
  }

  tr {
    display: table-row;
    width: auto;
  }

  td,
  th {
    display: table-cell;
    width: auto;
    padding: 8px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
  }

  td::before {
    content: none;
  }

  td.description-cell {
    text-align: left;
    white-space: normal;
  }

  .quick-adjust {
    justify-content: flex-end;
  }

  select,
  input {
    min-height: 44px;
    font-size: 16px;
  }

  .control-strip {
    position: static;
  }

  .legend {
    justify-content: flex-start;
  }

}
