:root {
  --font-ui: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-label: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bg: #f3f7fb;
  --bg-strong: #e8eef8;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-muted: #f8fafc;
  --panel-gradient-start: rgba(255, 255, 255, 0.96);
  --panel-gradient-end: rgba(248, 251, 255, 0.9);
  --card-gradient-start: rgba(255, 255, 255, 0.96);
  --card-gradient-end: rgba(248, 250, 252, 0.92);
  --card-gradient-soft-end: rgba(248, 250, 252, 0.88);
  --soft-surface: rgba(248, 250, 252, 0.9);
  --ghost-bg: rgba(255, 255, 255, 0.66);
  --chip-bg: rgba(248, 250, 252, 0.84);
  --input-bg: rgba(248, 250, 252, 0.92);
  --input-focus-bg: #ffffff;
  --table-wrap-bg: rgba(248, 250, 252, 0.72);
  --table-head-bg: #f8fafc;
  --table-row-bg: rgba(255, 255, 255, 0.94);
  --table-row-hover-bg: #f8fbff;
  --inline-panel-bg: rgba(248, 250, 252, 0.62);
  --detail-row-bg: rgba(255, 255, 255, 0.64);
  --search-result-bg: rgba(148, 163, 184, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --muted-strong: #334155;
  --line: #d9e2ef;
  --line-strong: #c5d2e3;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.12);
  --info: #0369a1;
  --info-soft: rgba(14, 165, 233, 0.14);
  --success: #0f766e;
  --success-soft: rgba(15, 118, 110, 0.12);
  --warning: #b45309;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #b91c1c;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --muted-soft: rgba(100, 116, 139, 0.14);
  --shadow-sm: 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.1);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

body[data-theme="dark"] {
  --bg: #08111f;
  --bg-strong: #0f1c30;
  --surface: rgba(13, 23, 42, 0.92);
  --surface-solid: #111c30;
  --surface-muted: #16233b;
  --panel-gradient-start: rgba(18, 28, 48, 0.96);
  --panel-gradient-end: rgba(12, 20, 36, 0.92);
  --card-gradient-start: rgba(24, 36, 60, 0.96);
  --card-gradient-end: rgba(16, 27, 46, 0.92);
  --card-gradient-soft-end: rgba(13, 23, 42, 0.88);
  --soft-surface: rgba(18, 31, 54, 0.9);
  --ghost-bg: rgba(18, 31, 54, 0.88);
  --chip-bg: rgba(18, 31, 54, 0.92);
  --input-bg: rgba(16, 27, 46, 0.96);
  --input-focus-bg: rgba(19, 33, 59, 1);
  --table-wrap-bg: rgba(11, 21, 37, 0.84);
  --table-head-bg: #0f1c30;
  --table-row-bg: rgba(17, 28, 48, 0.9);
  --table-row-hover-bg: rgba(23, 44, 78, 0.92);
  --inline-panel-bg: rgba(15, 25, 43, 0.88);
  --detail-row-bg: rgba(13, 22, 38, 0.76);
  --search-result-bg: rgba(37, 99, 235, 0.16);
  --text: #e5eefc;
  --muted: #90a1bf;
  --muted-strong: #d4e0f5;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.24);
  --brand-soft: rgba(59, 130, 246, 0.18);
  --info-soft: rgba(14, 165, 233, 0.2);
  --success-soft: rgba(20, 184, 166, 0.18);
  --warning-soft: rgba(245, 158, 11, 0.2);
  --danger-soft: rgba(239, 68, 68, 0.2);
  --muted-soft: rgba(148, 163, 184, 0.18);
  --shadow-sm: 0 12px 32px rgba(2, 6, 23, 0.34);
  --shadow-lg: 0 24px 60px rgba(2, 6, 23, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(14, 165, 233, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fb 46%, #edf3fa 100%);
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(14, 165, 233, 0.18), transparent 24%),
    linear-gradient(180deg, #07111f 0%, #0a1628 46%, #091220 100%);
  color-scheme: dark;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 72%);
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.auth-screen,
.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 28px 0;
}

.auth-screen__panel,
.hero,
.workspace,
.catalog-grid {
  display: grid;
  gap: 24px;
}

.auth-screen__panel {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 430px);
}

.page-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: clamp(16px, 2.2vw, 28px);
  background: #ffffff;
}

body[data-theme="dark"] .page-shell {
  background: #07111f;
}

.app-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: clamp(16px, 1.8vw, 24px);
  align-items: start;
}

.app-main {
  display: grid;
  grid-column: 2;
  gap: 20px;
}

.auth-copy,
.auth-card,
.sidebar,
.topbar,
.hero,
.panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, var(--panel-gradient-start), var(--panel-gradient-end)),
    var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: rise-in 0.45s ease both;
}

.auth-copy,
.auth-card,
.sidebar,
.topbar,
.hero,
.panel {
  padding: 28px;
}

.auth-copy::after,
.auth-card::after,
.sidebar::after,
.topbar::after,
.hero::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 42%);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-lockup--compact {
  margin-bottom: 0;
}

.brand-lockup__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), #06b6d4);
  color: #fff;
  font-family: var(--font-label);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.32);
}

.brand-lockup__title {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.brand-lockup__text,
.sidebar__caption,
.sidebar__text,
.auth-card__text,
.hero__text,
.panel__subtext,
.quick-catalog__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.brand-lockup__text {
  margin-top: 4px;
  font-size: 13px;
}

.auth-copy--minimal {
  display: grid;
  align-content: center;
  gap: 24px;
  min-height: 100%;
}

.auth-copy__headline {
  display: grid;
  gap: 6px;
  max-width: 9ch;
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.auth-copy__headline-accent {
  color: var(--brand-dark);
}

.auth-copy h1,
.hero h1,
.panel h2,
.topbar__title {
  margin: 0;
  line-height: 1.08;
}

.auth-copy h1,
.hero h1 {
  max-width: 13ch;
  font-size: clamp(34px, 5vw, 58px);
}

.hero__eyebrow,
.panel__eyebrow,
.topbar__eyebrow {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-copy > .hero__text {
  margin-top: 18px;
  max-width: 62ch;
}

.auth-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.metric-card,
.stat-card,
.highlight-card,
.sidebar__card,
.quick-catalog-form {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  box-shadow: var(--shadow-sm);
}

.metric-card {
  padding: 16px 18px;
}

.metric-card__label,
.stat-card__label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card__value {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.auth-highlights {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.highlight-card {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
}

.highlight-card strong {
  font-size: 16px;
}

.highlight-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 42px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
}

.auth-card {
  display: grid;
  align-content: center;
  gap: 18px;
}

.auth-card__header {
  display: grid;
  gap: 8px;
}

.auth-card h2 {
  font-size: 32px;
}

.auth-card__button {
  width: 100%;
}

.auth-card__footer {
  display: grid;
  gap: 14px;
}

.auth-card__hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.support-pills,
.hero__chips,
.sidebar__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.support-pill,
.hero-chip,
.sidebar__pill,
.hero__badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.support-pill,
.sidebar__pill {
  background: var(--soft-surface);
  color: var(--muted-strong);
}

.hero__badge {
  width: fit-content;
  margin-bottom: 18px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 28px;
  min-height: 600px;
  padding: 28px;
  border-color: #0b1730;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(29, 44, 72, 0.96), rgba(6, 15, 31, 0.98)),
    #081326;
  color: #e5eefc;
  box-shadow: none;
}

.sidebar::after,
.topbar::after,
.dashboard-panel::after {
  display: none;
}

.tabs {
  display: grid;
  gap: 18px;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 14px;
  background: transparent;
  color: #dbe7f7;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.tab-button:hover {
  background: rgba(30, 64, 115, 0.38);
  transform: translateY(-1px);
}

.tab-button__icon {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(143, 162, 190, 0.42);
  color: #dbe7f7;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.tab-button.is-active {
  background: linear-gradient(135deg, rgba(14, 91, 171, 0.7), rgba(10, 38, 75, 0.9));
  color: #2f8cff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.tab-button.is-active .tab-button__icon {
  background: linear-gradient(135deg, #2f8cff, #06b6d4);
  box-shadow: 0 0 0 6px rgba(47, 140, 255, 0.12);
  color: #fff;
}

.sidebar__brand {
  display: grid;
  gap: 18px;
}

.sidebar .brand-lockup__title {
  color: #eef5ff;
}

.sidebar .brand-lockup__text,
.sidebar__caption {
  color: #8fa2be;
}

.sidebar__card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.sidebar__card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: center;
  gap: 24px;
  min-height: 160px;
  padding: 30px 28px 30px 78px;
  border: 1px solid #1f3558;
  border-radius: 44px;
  background:
    radial-gradient(circle at 14% 18%, rgba(47, 140, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #1f2f4c 0%, #101c31 54%, #081326 100%);
  box-shadow: none;
  color: #e7eefb;
}

.topbar__title {
  color: #f8fbff;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.topbar__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(138px, auto);
  gap: 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  justify-content: flex-start;
}

.theme-toggle__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-soft) 76%, transparent);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.theme-toggle__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.theme-toggle__copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.theme-toggle__label {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted-strong);
}

.theme-toggle__state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.session-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  min-height: 66px;
  border-radius: 0;
  border: 1px solid #22324e;
  background: #0b1730;
  color: #e5eefc;
}

.session-chip__meta {
  display: grid;
  gap: 4px;
}

.session-chip__meta strong {
  font-size: 15px;
  color: #f8fbff;
}

.session-chip__label,
.session-chip__role {
  color: #8fa2be;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-search {
  position: relative;
  grid-column: 1 / -1;
  min-width: 0;
}

.search--compact {
  min-height: 62px;
  border-color: #22324e;
  border-radius: 0;
  background: #0b1730;
  color: #e5eefc;
}

.search--compact input {
  color: #e5eefc;
}

.topbar__eyebrow {
  color: #2f8cff;
  font-size: 11px;
  font-weight: 800;
}

.topbar .ghost-button {
  min-height: 48px;
  border-color: #22324e;
  background: #0b1730;
  color: #f8fbff;
}

.topbar .theme-toggle {
  min-height: 66px;
  border-radius: 0;
}

.topbar .theme-toggle__label {
  color: #f8fbff;
}

.topbar .theme-toggle__state {
  color: #8fa2be;
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: var(--shadow-lg);
}

body[data-theme="dark"] .search-results {
  background: linear-gradient(180deg, rgba(17, 28, 48, 0.98), rgba(13, 23, 42, 0.96));
}

.search-results__group {
  display: grid;
  gap: 8px;
}

.confirm-dialog {
  width: min(420px, calc(100% - 24px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
}

.confirm-dialog__panel {
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, var(--panel-gradient-start), var(--panel-gradient-end)),
    var(--surface);
  box-shadow: var(--shadow-lg);
}

.confirm-dialog__content {
  display: grid;
  gap: 10px;
}

.confirm-dialog__title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.confirm-dialog__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.search-results__title {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-result {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--search-result-bg);
  color: var(--text);
  text-align: left;
}

.hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.9fr);
  align-items: stretch;
}

.hero__content {
  display: grid;
  align-content: start;
}

.hero__text {
  margin-top: 16px;
  max-width: 64ch;
}

.hero__chips {
  margin-top: 22px;
}

.hero-operations {
  display: grid;
  gap: 16px;
  margin-top: 26px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-soft-end));
  box-shadow: var(--shadow-sm);
}

.hero-operations__intro {
  display: grid;
  gap: 8px;
}

.hero-operations__intro h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.hero-operations__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scenario-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 186px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.scenario-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: var(--scenario-gradient, linear-gradient(90deg, #2563eb, #60a5fa));
}

.scenario-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--scenario-soft, rgba(37, 99, 235, 0.14)), transparent 72%);
  pointer-events: none;
}

.scenario-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--scenario-color, var(--brand)) 34%, var(--line));
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
}

.scenario-card:disabled,
.scenario-card.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.scenario-card--success {
  --scenario-color: #16a34a;
  --scenario-soft: rgba(22, 163, 74, 0.18);
  --scenario-gradient: linear-gradient(90deg, #16a34a, #4ade80);
}

.scenario-card--brand {
  --scenario-color: #2563eb;
  --scenario-soft: rgba(37, 99, 235, 0.18);
  --scenario-gradient: linear-gradient(90deg, #2563eb, #60a5fa);
}

.scenario-card--info {
  --scenario-color: #0284c7;
  --scenario-soft: rgba(2, 132, 199, 0.18);
  --scenario-gradient: linear-gradient(90deg, #0284c7, #38bdf8);
}

.scenario-card--warning {
  --scenario-color: #d97706;
  --scenario-soft: rgba(217, 119, 6, 0.18);
  --scenario-gradient: linear-gradient(90deg, #d97706, #fbbf24);
}

.scenario-card--muted {
  --scenario-color: #475569;
  --scenario-soft: rgba(71, 85, 105, 0.18);
  --scenario-gradient: linear-gradient(90deg, #475569, #94a3b8);
}

.scenario-card--danger {
  --scenario-color: #dc2626;
  --scenario-soft: rgba(220, 38, 38, 0.18);
  --scenario-gradient: linear-gradient(90deg, #dc2626, #fb7185);
}

.scenario-card__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 44px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--scenario-soft, rgba(37, 99, 235, 0.16)) 92%, transparent);
  color: var(--scenario-color, var(--brand-dark));
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.scenario-card__title {
  font-size: 18px;
  line-height: 1.2;
}

.scenario-card__text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.scenario-card__metric {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  width: fit-content;
  max-width: 100%;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--scenario-soft, rgba(37, 99, 235, 0.16)) 88%, transparent);
  color: var(--scenario-color, var(--brand-dark));
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.hero-insight-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hero-chip {
  background: var(--ghost-bg);
  border: 1px solid var(--line);
  color: var(--muted-strong);
}

.hero-focus-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.hero-focus-card::before {
  content: "";
  position: absolute;
  inset: auto auto -48px -48px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 72%);
  pointer-events: none;
}

.hero-focus-card--featured {
  grid-column: 1 / -1;
  gap: 16px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-soft-end));
}

.hero-focus-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hero-focus-card__eyebrow {
  margin: 0;
  color: var(--brand-dark);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-focus-card__title {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 1.12;
}

.hero-focus-card__title--compact {
  font-size: 18px;
}

.hero-focus-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-line, rgba(37, 99, 235, 0.18));
  background: var(--accent-soft, color-mix(in srgb, var(--brand-soft) 72%, transparent));
  color: var(--accent-color, var(--brand-dark));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hero-focus-card__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-focus-card__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-focus-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
}

.hero-focus-stat__label {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-focus-stat__value {
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1;
}

.hero-focus-stat__hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hero-rank-list {
  display: grid;
  gap: 12px;
}

.hero-rank-list__empty {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  color: var(--muted);
  line-height: 1.6;
}

.hero-rank-item {
  --rank-gradient: linear-gradient(90deg, #2563eb, #60a5fa);
  --rank-soft: rgba(37, 99, 235, 0.14);
  --rank-solid: #2563eb;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--ghost-bg);
  box-shadow: inset 3px 0 0 var(--rank-soft);
}

.hero-rank-item__header,
.hero-rank-item__footer {
  display: grid;
  align-items: center;
  gap: 12px;
}

.hero-rank-item__header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.hero-rank-item__footer {
  grid-template-columns: minmax(0, 1fr) auto;
}

.hero-rank-item__index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rank-soft) 92%, transparent);
  color: var(--rank-solid);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
}

.hero-rank-item__label {
  min-width: 0;
  font-weight: 700;
  line-height: 1.45;
}

.hero-rank-item__value {
  font-size: 18px;
  line-height: 1;
}

.hero-rank-item__track {
  height: 8px;
  border-radius: 999px;
  background: var(--muted-soft);
  overflow: hidden;
}

.hero-rank-item__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--rank-gradient);
}

.hero-rank-item__meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero__stats {
  display: block;
}

.hero-visual {
  display: grid;
  gap: 18px;
  height: 100%;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 34%),
    linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-soft-end));
  box-shadow: var(--shadow-sm);
}

body[data-theme="dark"] .hero-visual {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.24), transparent 36%),
    linear-gradient(180deg, rgba(18, 31, 54, 0.96), rgba(12, 22, 39, 0.92));
}

.hero-visual__header {
  display: grid;
  gap: 10px;
}

.hero-visual__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-visual__pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ghost-bg);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-visual__pill--accent {
  border-color: var(--accent-line, rgba(37, 99, 235, 0.2));
  background: var(--accent-soft, color-mix(in srgb, var(--brand-soft) 76%, transparent));
  color: var(--accent-color, var(--brand-dark));
}

.hero-visual__eyebrow {
  margin: 0;
  color: var(--brand-dark);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-visual__header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
}

.hero-visual__text,
.hero-chart__meta,
.hero-metric-card__hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-visual__body {
  display: grid;
  gap: 16px;
}

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

.hero-kpi-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.hero-kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.26), rgba(148, 163, 184, 0));
}

.hero-kpi-card--active::after {
  background: linear-gradient(90deg, #10b981, rgba(16, 185, 129, 0));
}

.hero-kpi-card--risk::after {
  background: linear-gradient(90deg, #dc2626, rgba(220, 38, 38, 0));
}

.hero-kpi-card--warning::after {
  background: linear-gradient(90deg, #d97706, rgba(217, 119, 6, 0));
}

.hero-kpi-card--info::after {
  background: linear-gradient(90deg, #0284c7, rgba(2, 132, 199, 0));
}

.hero-kpi-card__label {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-kpi-card__value {
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1;
}

.hero-kpi-card--active .hero-kpi-card__value {
  color: #16a34a;
}

.hero-kpi-card--risk .hero-kpi-card__value {
  color: #dc2626;
}

.hero-kpi-card--warning .hero-kpi-card__value {
  color: #d97706;
}

.hero-kpi-card--info .hero-kpi-card__value {
  color: #0284c7;
}

.hero-kpi-card__hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hero-empty-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hero-chart {
  --chart-fill: conic-gradient(from -90deg, rgba(148, 163, 184, 0.22) 0deg 360deg);
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  overflow: hidden;
}

.hero-chart::before,
.hero-chart::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.hero-chart::before {
  width: clamp(190px, 30vw, 224px);
  height: clamp(190px, 30vw, 224px);
  background: var(--chart-fill);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hero-chart::after {
  width: clamp(126px, 20vw, 154px);
  height: clamp(126px, 20vw, 154px);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--panel-gradient-start), var(--panel-gradient-end)),
    var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.hero-chart.is-empty::before {
  filter: saturate(0.7);
  opacity: 0.82;
}

.hero-visual.is-empty .hero-chart {
  min-height: 210px;
}

.hero-visual.is-empty .hero-chart::before {
  width: 170px;
  height: 170px;
}

.hero-visual.is-empty .hero-chart::after {
  width: 114px;
  height: 114px;
}

.hero-chart__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  max-width: 180px;
  text-align: center;
}

.hero-chart__caption,
.hero-metric-card__label {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-chart__value {
  font-size: clamp(40px, 5vw, 54px);
  line-height: 0.95;
}

.hero-legend {
  display: grid;
  gap: 10px;
}

.hero-legend__item {
  --legend-color: var(--brand);
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--ghost-bg);
}

.hero-legend__head,
.hero-legend__foot {
  display: grid;
  align-items: center;
  gap: 10px;
}

.hero-legend__head {
  grid-template-columns: auto 1fr auto;
}

.hero-legend__foot {
  grid-template-columns: minmax(0, 1fr) auto;
}

.hero-legend__swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--legend-color);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--legend-color) 18%, transparent);
}

.hero-legend__label,
.hero-legend__percent,
.hero-legend__empty {
  color: var(--muted-strong);
  font-size: 13px;
}

.hero-legend__total {
  font-size: 15px;
}

.hero-legend__track,
.hero-metric-card__meter {
  height: 8px;
  border-radius: 999px;
  background: var(--muted-soft);
  overflow: hidden;
}

.hero-legend__bar,
.hero-metric-card__meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
}

.hero-legend__bar {
  background: var(--legend-color);
}

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

.hero-metric-card {
  --metric-gradient: linear-gradient(90deg, #2563eb, #60a5fa);
  display: grid;
  gap: 10px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  box-shadow: var(--shadow-sm);
}

.hero-metric-card:last-child {
  grid-column: 1 / -1;
}

.hero-metric-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.hero-metric-card__label {
  line-height: 1.45;
}

.hero-metric-card__value {
  font-size: clamp(28px, 4vw, 34px);
  line-height: 0.95;
  text-align: right;
}

.hero-metric-card--brand .hero-metric-card__value {
  color: #2563eb;
}

.hero-metric-card--success .hero-metric-card__value {
  color: #16a34a;
}

.hero-metric-card--danger .hero-metric-card__value {
  color: #dc2626;
}

.hero-metric-card--brand {
  --metric-gradient: linear-gradient(90deg, #2563eb, #60a5fa);
}

.hero-metric-card--success {
  --metric-gradient: linear-gradient(90deg, #16a34a, #4ade80);
}

.hero-metric-card--danger {
  --metric-gradient: linear-gradient(90deg, #dc2626, #fb7185);
}

.hero-metric-card__meter span {
  background: var(--metric-gradient);
}

.hero-metric-card__hint {
  min-height: 0;
}

.status-banner {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-dark);
  font-weight: 700;
}

.status-banner--error {
  border-color: rgba(239, 68, 68, 0.16);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.auth-feedback,
.app-tab {
  margin-top: 0;
}

.workspace {
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  align-items: start;
}

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

.catalog-workspace,
.inventory-workspace {
  display: grid;
  gap: 20px;
}

.catalog-switcher-panel,
.inventory-switcher-panel {
  overflow: visible;
}

.catalog-segment,
.inventory-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: min(520px, 100%);
}

.catalog-segment__button,
.inventory-segment__button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--ghost-bg);
  color: var(--muted-strong);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.catalog-segment__button:hover,
.inventory-segment__button:hover {
  transform: translateY(-1px);
}

.catalog-segment__button.is-active,
.inventory-segment__button.is-active {
  border-color: rgba(37, 99, 235, 0.24);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.08));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.catalog-segment__icon,
.inventory-segment__icon {
  display: grid;
  place-items: center;
  width: 14px;
  height: 44px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  color: var(--muted-strong);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.catalog-segment__button.is-active .catalog-segment__icon,
.inventory-segment__button.is-active .inventory-segment__icon {
  background: linear-gradient(135deg, var(--brand), #0ea5e9);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1);
  color: #fff;
}

.catalog-segment__button strong,
.catalog-segment__button small,
.inventory-segment__button strong,
.inventory-segment__button small {
  display: block;
}

.catalog-segment__button strong,
.inventory-segment__button strong {
  font-size: 15px;
  line-height: 1.2;
}

.catalog-segment__button small,
.inventory-segment__button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.catalog-panel,
.inventory-panel {
  animation: rise-in 0.28s ease both;
}

.inventory-workspace .panel--form {
  position: relative;
  top: auto;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

#tabDashboard > .hero {
  display: none !important;
}

.panel {
  display: grid;
  gap: 20px;
}

.panel--form {
  position: sticky;
  top: 20px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel__header--spread {
  align-items: center;
}

.panel__header h2 {
  font-size: 28px;
}

.panel__subtext {
  margin-top: 10px;
}

.inventory-form,
.quick-catalog,
.quick-catalog-form {
  display: grid;
  gap: 14px;
}

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

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

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

.inventory-form--wizard {
  grid-template-columns: 1fr;
  gap: 18px;
}

.wizard-header,
.wizard-status,
.wizard-progress,
.wizard-panel,
.wizard-panel__intro,
.wizard-review {
  display: grid;
  gap: 14px;
}

.wizard-header {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-soft-end));
  box-shadow: var(--shadow-sm);
}

.wizard-status {
  grid-template-columns: minmax(0, 1fr);
}

.wizard-status__step {
  color: var(--brand-dark);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wizard-status__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.wizard-status__text {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.wizard-progress {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wizard-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--ghost-bg);
  color: var(--muted-strong);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.wizard-step:hover {
  transform: translateY(-1px);
}

.wizard-step__index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted-strong);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
}

.wizard-step__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wizard-step__title {
  font-size: 15px;
  line-height: 1.2;
}

.wizard-step__text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wizard-step.is-active {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.08));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.wizard-step.is-active .wizard-step__index {
  background: linear-gradient(135deg, var(--brand), #0ea5e9);
  color: #fff;
}

.wizard-step.is-complete {
  border-color: rgba(22, 163, 74, 0.18);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.14), rgba(74, 222, 128, 0.06));
}

.wizard-step.is-complete .wizard-step__index {
  background: linear-gradient(135deg, #16a34a, #4ade80);
  color: #fff;
}

.wizard-step:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.wizard-panels {
  display: grid;
}

.wizard-panel {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-end));
  box-shadow: var(--shadow-sm);
}

.wizard-panel__intro h3,
.wizard-review__header h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.wizard-panel__grid,
.wizard-review__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wizard-review {
  margin-top: 6px;
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
}

.wizard-review__header {
  display: grid;
  gap: 6px;
}

.wizard-review__card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.wizard-review__label {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wizard-review__value {
  font-size: 15px;
  line-height: 1.55;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.field,
.checkbox-field {
  display: grid;
  gap: 8px;
}

.field--full,
.checkbox-field,
.form-actions {
  grid-column: 1 / -1;
}

.field span,
.checkbox-field span {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted-strong);
}

.field input,
.field textarea,
.field select,
.toolbar-select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.field input::placeholder {
  color: #94a3b8;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.toolbar-select:focus,
.search input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.42);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.field textarea::placeholder {
  color: #94a3b8;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--soft-surface);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.access-note {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 700;
}

.quick-catalog {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.quick-catalog__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.quick-catalog h3,
.quick-catalog-form h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.quick-catalog__actions,
.quick-catalog-form__grid {
  display: grid;
  gap: 10px;
}

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

.quick-catalog-form {
  padding: 18px;
}

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

.catalog-toolbar {
  margin-top: -6px;
}

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

.dashboard-card,
.mini-panel {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-soft-end));
  box-shadow: var(--shadow-sm);
}

.dashboard-card {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 13px 16px;
  border-radius: 10px;
}

.dashboard-card--success {
  border-color: rgba(22, 163, 74, 0.18);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.14), rgba(74, 222, 128, 0.06));
}

.dashboard-card--brand {
  border-color: rgba(37, 99, 235, 0.18);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(96, 165, 250, 0.06));
}

.dashboard-card--info {
  border-color: rgba(2, 132, 199, 0.18);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.14), rgba(56, 189, 248, 0.06));
}

.dashboard-card--warning {
  border-color: rgba(217, 119, 6, 0.18);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.14), rgba(251, 191, 36, 0.06));
}

.dashboard-card--danger {
  border-color: rgba(220, 38, 38, 0.18);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.14), rgba(251, 113, 133, 0.06));
}

.dashboard-card--primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(14, 165, 233, 0.08));
  border-color: rgba(37, 99, 235, 0.16);
}

.dashboard-card__label {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-card__value {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1;
}

.dashboard-card--primary .dashboard-card__value,
.dashboard-card--brand .dashboard-card__value {
  color: #2563eb;
}

.dashboard-card--success .dashboard-card__value {
  color: #16a34a;
}

.dashboard-card--info .dashboard-card__value {
  color: #0284c7;
}

.dashboard-card--warning .dashboard-card__value {
  color: #d97706;
}

.dashboard-card--danger .dashboard-card__value {
  color: #dc2626;
}

.dashboard-card__hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dashboard-panel {
  min-height: 0;
  padding: 22px;
  border-color: #16304f;
  border-radius: 12px;
  background:
    radial-gradient(circle at top left, rgba(57, 139, 255, 0.16), transparent 32%),
    linear-gradient(180deg, #0c1931 0%, #071225 100%);
  color: #e7eefb;
  box-shadow: none;
}

.dashboard-panel .panel__header h2 {
  color: #e7eefb;
  font-size: 24px;
}

.dashboard-panel .panel__eyebrow {
  color: #2f8cff;
}

.dashboard-panel .panel__subtext {
  color: #8fa2be;
}

.dashboard-panel .dashboard-card {
  border-color: rgba(85, 111, 151, 0.32);
  background: rgba(18, 45, 81, 0.72);
  box-shadow: none;
}

.dashboard-panel .dashboard-card--warning {
  background: rgba(84, 65, 41, 0.58);
}

.dashboard-panel .dashboard-card--danger {
  background: rgba(64, 29, 52, 0.58);
}

.dashboard-panel .dashboard-card--success {
  background: rgba(16, 73, 66, 0.58);
}

.dashboard-panel .dashboard-card--brand,
.dashboard-panel .dashboard-card--primary {
  background: rgba(20, 42, 86, 0.7);
}

.dashboard-panel .dashboard-card__label {
  color: #8fa2be;
  font-size: 10px;
}

.dashboard-panel .dashboard-card__value {
  font-size: 28px;
}

.dashboard-panel .dashboard-card__hint {
  color: #8395af;
  font-size: 10px;
  line-height: 1.35;
}

#tabDashboard .dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

#tabDashboard .dashboard-panel {
  grid-column: 1 / -1;
}

.dashboard-panel__actions {
  justify-content: flex-end;
  min-width: min(340px, 100%);
}

.dashboard-empty-state {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-color: rgba(47, 140, 255, 0.22);
  border-radius: 12px;
  background:
    radial-gradient(circle at 8% 20%, rgba(47, 140, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #0c1931 0%, #071225 100%);
  color: #e7eefb;
  box-shadow: none;
}

.dashboard-empty-state::after {
  display: none;
}

.dashboard-empty-state h2 {
  color: #e7eefb;
  font-size: 24px;
}

.dashboard-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

#tabDashboard.is-empty .dashboard-detail-panel {
  display: none;
}

#tabDashboard .dashboard-detail-panel {
  min-height: 0;
  padding: 22px;
  border-color: #16304f;
  border-radius: 12px;
  background:
    radial-gradient(circle at top right, rgba(47, 140, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #0c1931 0%, #071225 100%);
  color: #e7eefb;
  box-shadow: none;
}

#tabDashboard .dashboard-detail-panel::after {
  display: none;
}

#tabDashboard .dashboard-detail-panel--distribution {
  grid-column: span 8;
}

#tabDashboard .dashboard-detail-panel--departments {
  grid-column: span 4;
}

#tabDashboard .dashboard-detail-panel--operations,
#tabDashboard .dashboard-detail-panel--attention {
  grid-column: span 6;
}

#tabDashboard .dashboard-detail-panel .panel__header h2 {
  color: #e7eefb;
  font-size: 22px;
}

#tabDashboard .dashboard-detail-panel .panel__eyebrow {
  color: #2f8cff;
}

#tabDashboard .dashboard-detail-panel .panel__subtext {
  color: #8fa2be;
  font-size: 13px;
  line-height: 1.5;
}

#tabDashboard .dashboard-detail-panel .mini-panel {
  min-width: 0;
  border-color: rgba(85, 111, 151, 0.28);
  border-radius: 14px;
  background: rgba(9, 24, 45, 0.64);
  box-shadow: none;
}

#tabDashboard .dashboard-detail-panel .mini-panel__header h3 {
  color: #e7eefb;
  font-size: 16px;
}

#tabDashboard .dashboard-detail-panel .breakdown-item {
  border-color: rgba(85, 111, 151, 0.28);
  border-radius: 14px;
  background: rgba(14, 30, 54, 0.72);
  box-shadow: inset 3px 0 0 var(--breakdown-accent);
}

#tabDashboard .dashboard-detail-panel .breakdown-item__label {
  color: #d4e0f5;
}

#tabDashboard .dashboard-detail-panel .breakdown-item__value {
  font-size: 15px;
}

#tabDashboard .dashboard-detail-panel .breakdown-item__track {
  height: 8px;
  background: rgba(148, 163, 184, 0.14);
}

#tabDashboard .dashboard-detail-panel .breakdown-list__empty {
  padding: 18px;
  border: 1px dashed rgba(143, 162, 190, 0.32);
  border-radius: 14px;
  background: rgba(15, 29, 51, 0.52);
  color: #8fa2be;
}

#tabDashboard .dashboard-detail-panel .table-wrap {
  border-color: rgba(85, 111, 151, 0.28);
  border-radius: 14px;
  background: rgba(7, 16, 31, 0.46);
}

#tabDashboard .dashboard-detail-panel .table-wrap--compact table {
  min-width: 100%;
}

#tabDashboard .dashboard-detail-panel thead {
  background: rgba(14, 27, 48, 0.98);
}

#tabDashboard .dashboard-detail-panel th {
  padding: 12px 14px;
  color: #8395af;
  font-size: 10px;
}

#tabDashboard .dashboard-detail-panel td {
  padding: 12px 14px;
  border-bottom-color: rgba(85, 111, 151, 0.2);
  color: #d4e0f5;
  font-size: 13px;
}

#tabDashboard .dashboard-detail-panel tbody tr {
  background: rgba(17, 35, 62, 0.68);
}

#tabDashboard .dashboard-detail-panel tbody tr:hover {
  background: rgba(27, 53, 91, 0.78);
}

#tabDashboard .dashboard-detail-panel--operations .dashboard-split,
#tabDashboard .dashboard-detail-panel--attention .dashboard-split {
  grid-template-columns: 1fr;
}

.dashboard-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-grid,
.metrics-grid {
  display: grid;
  gap: 16px;
}

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

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

.mini-panel {
  padding: 18px;
}

.mini-panel__header {
  margin-bottom: 14px;
}

.mini-panel__header h3 {
  margin: 0;
  font-size: 18px;
}

.breakdown-list {
  display: grid;
  gap: 12px;
}

.breakdown-item {
  --breakdown-accent: rgba(37, 99, 235, 0.14);
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--ghost-bg);
  box-shadow: inset 3px 0 0 var(--breakdown-accent);
}

.breakdown-item__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.breakdown-item__label {
  color: var(--muted-strong);
  font-weight: 700;
}

.breakdown-item__value {
  font-size: 14px;
}

.breakdown-item__track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.breakdown-item__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #0ea5e9);
}

.breakdown-list__empty {
  margin: 0;
  color: var(--muted);
}

.operations-shell {
  display: grid;
  gap: 16px;
  width: 100%;
}

.operations-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-gradient-start), var(--card-gradient-soft-end));
  box-shadow: var(--shadow-sm);
}

.operations-group__header {
  display: grid;
  gap: 6px;
}

.operations-group__header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.form-actions,
.toolbar,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar--inline {
  justify-content: flex-start;
}

.toolbar {
  align-items: center;
}

.toolbar > * {
  flex: 0 1 auto;
}

.toolbar .search {
  flex: 1 1 300px;
}

.toolbar-select {
  flex: 0 1 220px;
  appearance: none;
}

.toolbar-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.toolbar--operations .primary-button {
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.toolbar--operations .secondary-button,
.toolbar--support .secondary-button {
  background: color-mix(in srgb, var(--brand-soft) 72%, transparent);
}

.primary-button,
.secondary-button,
.ghost-button,
.row-action {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.row-action:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), #0ea5e9);
  color: #fff;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.24);
}

.secondary-button {
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-dark);
}

.secondary-button--danger,
.row-action--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.ghost-button {
  background: var(--ghost-bg);
  color: var(--muted-strong);
  border: 1px solid var(--line);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.row-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--soft-surface);
}

.search svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: var(--muted);
}

.inline-panel,
.detail-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--inline-panel-bg);
}

.inline-panel__header,
.detail-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.transfer-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    var(--soft-surface);
}

.field {
  position: relative;
}

.field-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
}

.topbar .search--compact {
  min-height: 62px;
  border-color: #22324e;
  border-radius: 0;
  background: #0b1730;
  color: #e5eefc;
}

.topbar .search--compact svg {
  fill: #8fa2be;
}

.topbar .search--compact input {
  color: #e5eefc;
}

.topbar .search--compact input::placeholder {
  color: #8fa2be;
}

body[data-theme="dark"] .topbar {
  background:
    radial-gradient(circle at 14% 18%, rgba(47, 140, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #1f2f4c 0%, #101c31 54%, #081326 100%);
  color: #e5eefc;
}

body[data-theme="dark"] .topbar__title {
  color: #e5eefc;
}

body[data-theme="dark"] .topbar__eyebrow {
  color: #2f8cff;
}

body[data-theme="dark"] .topbar .ghost-button,
body[data-theme="dark"] .session-chip,
body[data-theme="dark"] .topbar .search--compact {
  background: #14213a;
  border-color: #2b4164;
}

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

.table-wrap--compact table {
  min-width: 0;
}

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

thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--table-head-bg);
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  background: var(--table-row-bg);
  transition: background-color 0.14s ease;
}

tbody tr:hover {
  background: var(--table-row-hover-bg);
}

tbody tr.is-clickable {
  cursor: pointer;
}

tbody tr.is-clickable:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: -3px;
}

tbody tr.is-selected {
  background: rgba(37, 99, 235, 0.08);
}

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

.row-actions {
  gap: 8px;
}

.row-action {
  min-height: 36px;
  padding: 0 14px;
  background: var(--soft-surface);
  color: var(--muted-strong);
  font-size: 14px;
}

.stacked-cell {
  display: grid;
  gap: 4px;
}

.stacked-cell__primary {
  font-size: 14px;
  line-height: 1.45;
}

.stacked-cell__secondary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tag {
  background: var(--success-soft);
  color: var(--success);
}

.tag--info {
  background: var(--info-soft);
  color: var(--info);
}

.tag--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag--muted {
  background: var(--muted-soft);
  color: var(--muted-strong);
}

.empty-state {
  display: none;
  padding: 32px 20px 8px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 22px;
}

.empty-state p {
  margin: 0;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.table-footer__summary,
.table-footer__page {
  color: var(--muted);
  font-size: 14px;
}

.table-footer__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-list,
.timeline {
  display: grid;
  gap: 12px;
}

.detail-list__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--detail-row-bg);
}

.detail-list__row--stack,
.detail-list__row--empty,
.detail-list__row--actions {
  display: grid;
  justify-content: stretch;
}

.detail-list__row--actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.detail-list__stack {
  display: grid;
  gap: 4px;
}

.detail-list__label,
.detail-list__subvalue {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.detail-list__value {
  color: var(--text);
  font-size: 14px;
}

.timeline__item {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--detail-row-bg);
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.timeline__body {
  color: var(--muted);
  line-height: 1.6;
}

.qr-panel {
  align-content: start;
  justify-items: center;
  text-align: center;
}

.qr-panel__image {
  width: min(220px, 100%);
  aspect-ratio: 1;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.qr-panel__link {
  text-decoration: none;
}

@keyframes rise-in {
  from {
    opacity: 0.96;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-copy,
  .auth-card,
  .sidebar,
  .topbar,
  .hero,
  .panel {
    animation: none;
  }
}

@media (max-width: 1260px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-main {
    grid-column: 1;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding-left: 28px;
  }

  .sidebar,
  .panel--form {
    position: static;
  }

  .tabs {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .tab-button {
    justify-content: center;
  }
}

@media (max-width: 1080px) {
  .auth-screen__panel,
  .hero,
  .workspace,
  .catalog-grid,
  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .auth-copy h1,
  .hero h1 {
    max-width: none;
  }

  #tabDashboard .dashboard-grid {
    grid-template-columns: 1fr;
  }

  #tabDashboard .dashboard-grid > .panel {
    grid-column: 1 / -1;
  }

  .dashboard-empty-state {
    grid-template-columns: 1fr;
  }

  .dashboard-empty-state__actions,
  .dashboard-panel__actions {
    justify-content: flex-start;
  }

  .hero-visual {
    padding: 20px;
  }

  .hero-focus-card__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .detail-grid,
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-segment,
  .inventory-segment {
    min-width: 0;
  }

  .wizard-progress,
  .wizard-panel__grid,
  .wizard-review__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .auth-screen,
  .page-shell {
    width: min(100% - 20px, 100%);
  }

  .page-shell {
    padding-top: 16px;
  }

  .app-layout,
  .app-main,
  .dashboard-grid {
    gap: 16px;
  }

  .auth-copy,
  .auth-card,
  .sidebar,
  .topbar,
  .hero,
  .panel {
    animation: none;
    padding: 20px;
    border-radius: 24px;
  }

  .auth-metrics,
  .dashboard-cards,
  .inventory-form,
  .quick-catalog__actions,
  .quick-catalog-form__grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    padding: 18px;
  }

  .hero-insight-grid {
    grid-template-columns: 1fr;
  }

  .scenario-grid,
  .hero-focus-card__stats,
  .hero-kpi-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 16px;
    padding: 16px;
  }

  .sidebar__brand {
    gap: 10px;
  }

  .sidebar__caption,
  .sidebar .brand-lockup__text {
    display: none;
  }

  .tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 2px 6px;
    margin: 0 -2px -6px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .tabs::-webkit-scrollbar {
    height: 6px;
  }

  .tabs::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
  }

  .tab-button {
    flex: 0 0 auto;
    min-width: 132px;
    min-height: 52px;
    padding: 10px 12px;
    scroll-snap-align: start;
  }

  .tab-button__text {
    white-space: nowrap;
  }

  .topbar,
  .panel__header,
  .panel__header--spread,
  .quick-catalog__header,
  .inline-panel__header,
  .detail-panel__header,
  .table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    gap: 14px;
  }

  .topbar__title,
  .panel__header h2,
  .auth-card h2,
  .confirm-dialog__title {
    font-size: 24px;
  }

  .topbar__actions {
    display: grid;
    gap: 10px;
  }

  .session-chip {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .session-chip .ghost-button,
  #themeToggleButton {
    width: 100%;
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .confirm-dialog {
    width: min(100% - 20px, 100%);
  }

  .confirm-dialog__panel,
  .confirm-dialog__actions {
    grid-template-columns: 1fr;
  }

  .confirm-dialog__actions {
    display: grid;
  }

  .toolbar > *,
  .toolbar .search,
  .toolbar-select,
  .global-search {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
  }

  .toolbar .search {
    grid-column: 1 / -1;
  }

  .toolbar--inline {
    grid-template-columns: 1fr;
  }

  .catalog-segment,
  .inventory-segment {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .metrics-grid,
  .inventory-form--compact {
    grid-template-columns: 1fr;
  }

  .field input,
  .field textarea,
  .field select,
  .toolbar-select,
  .search input {
    font-size: 16px;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .row-action {
    min-height: 48px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(30px, 10vw, 42px);
  }

  .hero__content,
  .dashboard-cards,
  .detail-grid,
  .metrics-grid {
    gap: 14px;
  }

  .hero-focus-card {
    padding: 16px;
  }

  .hero-operations {
    padding: 16px;
  }

  .wizard-header,
  .wizard-panel,
  .wizard-review {
    padding: 16px;
  }

  .wizard-progress,
  .wizard-panel__grid,
  .wizard-review__grid {
    grid-template-columns: 1fr;
  }

  .wizard-step {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hero-focus-card__header {
    flex-direction: column;
  }

  .hero-rank-item__footer {
    grid-template-columns: 1fr;
  }

  .hero-focus-card__badge {
    justify-self: start;
  }

  .hero-chart {
    min-height: 226px;
  }

  .hero-kpi-card {
    min-height: 104px;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  .table-wrap {
    border: 0;
    background: transparent;
  }

  table {
    min-width: 0;
  }

  tbody {
    display: grid;
    gap: 14px;
  }

  tbody tr {
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 16px;
    align-items: start;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .detail-list__row--actions {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .auth-screen,
  .page-shell {
    width: calc(100% - 14px);
  }

  .auth-copy,
  .auth-card,
  .sidebar,
  .topbar,
  .hero,
  .panel {
    padding: 16px;
    border-radius: 20px;
  }

  .app-layout,
  .app-main,
  .dashboard-grid {
    gap: 14px;
  }

  .hero-visual {
    padding: 16px;
    gap: 16px;
  }

  .hero-focus-card__stats {
    grid-template-columns: 1fr;
  }

  .operations-group {
    padding: 14px;
  }

  .catalog-segment__button,
  .inventory-segment__button {
    min-height: 64px;
    padding: 12px;
  }

  .wizard-status__title {
    font-size: 22px;
  }

  .wizard-actions {
    grid-template-columns: 1fr;
  }

  .hero-chart {
    min-height: 208px;
    padding: 16px;
  }

  .hero-chart::before {
    width: 184px;
    height: 184px;
  }

  .hero-chart::after {
    width: 122px;
    height: 122px;
  }

  .hero-metric-card {
    padding: 14px;
  }

  .hero-kpi-grid {
    grid-template-columns: 1fr;
  }

  .topbar__actions,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .tab-button {
    min-width: 120px;
  }

  .session-chip {
    padding: 10px;
  }

  td {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  td::before {
    margin-bottom: 2px;
  }
}
