:root {
  --ink: #162333;
  --muted: #657487;
  --line: #dbe3ec;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --brand: #0c6e8f;
  --brand-dark: #084c67;
  --brand-soft: #e5f5f8;
  --accent: #e8a53a;
  --success: #18794e;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(24, 48, 72, 0.1);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef4f7;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eef4f7;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(68, 178, 193, 0.16), transparent 28rem),
    linear-gradient(145deg, #f5fafb 0%, #eef4f7 58%, #e8f0f4 100%);
  color: var(--ink);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.45), transparent 48%);
  content: "";
  pointer-events: none;
}

.shell {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.shell--narrow {
  display: grid;
  align-content: center;
  width: min(100% - 40px, 540px);
  min-height: 100vh;
  padding: 40px 0;
}

.shell--narrow > * {
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 26px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  content: "";
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 16px;
  color: var(--brand-dark);
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 22px;
  color: var(--brand-dark);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.shell--narrow h1 {
  font-size: clamp(2.4rem, 8vw, 4.1rem);
}

.shell--narrow::after {
  position: absolute;
  z-index: -1;
  width: min(80vw, 430px);
  height: min(80vw, 430px);
  border: 1px solid rgba(12, 110, 143, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(12, 110, 143, 0.035), 0 0 0 70px rgba(12, 110, 143, 0.022);
  content: "";
  pointer-events: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 22px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(12, 110, 143, 0.18);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(8, 76, 103, 0.22);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button--secondary {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
  color: var(--brand-dark);
}

.button--secondary:hover {
  border-color: #afc6d3;
  background: var(--brand-soft);
  box-shadow: none;
}

.button--compact {
  min-height: 34px;
  margin-top: 0;
  padding: 0 12px;
  font-size: 0.8rem;
}

.button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(232, 165, 58, 0.55);
  outline-offset: 3px;
}

.shell--narrow form,
.card {
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(219, 227, 236, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.shell--narrow form {
  margin-top: 24px;
}

label {
  display: block;
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
}

.form-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.form-grid--receiving {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label:first-child {
  margin-top: 0;
}

input,
select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #cbd7e1;
  border-radius: var(--radius-sm);
  background: #fbfdfe;
  color: var(--ink);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:hover,
select:hover {
  border-color: #9fb8c7;
}

input:focus,
select:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(12, 110, 143, 0.1);
  outline: 0;
}

.status {
  min-height: 1.65em;
  margin: 18px 0 0;
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 650;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.page-header h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.page-header .button {
  flex: 0 0 auto;
  margin-top: 0;
}

.card + .card {
  margin-top: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

.workspace-intro {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(229, 245, 248, 0.86));
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #b8dfe6;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.workspace-card {
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #fff, #f7fbfc);
  box-shadow: 0 8px 20px rgba(24, 48, 72, 0.06);
}

.workspace-card__code {
  margin-bottom: 12px;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-card h3 {
  margin: 0 0 14px;
  color: var(--brand-dark);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.workspace-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}

.workspace-card .button {
  width: 100%;
  margin-top: 18px;
}

.role-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(229, 245, 248, 0.86));
}

.page-actions,
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-actions {
  margin-top: 18px;
}

.dashboard-actions .button {
  margin-top: 0;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
}

.catalog-grid .card {
  margin-top: 0;
}

.form-grid--catalog {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--catalog .button {
  grid-column: 1 / -1;
  justify-self: start;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto;
  align-items: end;
  gap: 16px;
}

.form-grid--user {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.form-grid > div label {
  margin-top: 0;
}

.form-grid .button {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: var(--surface);
  text-align: left;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid #e8eef3;
  font-size: 0.92rem;
}

th {
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f8fcfd;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, 1120px);
    padding-top: 32px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header .button {
    width: 100%;
  }

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

  .section-heading {
    flex-direction: column;
  }

  .form-grid .button {
    width: 100%;
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
