:root {
  --bg: #081018;
  --bg-deep: #060c12;
  --panel: rgba(12, 19, 27, 0.9);
  --panel-strong: rgba(15, 24, 34, 0.94);
  --panel-soft: rgba(20, 32, 45, 0.86);
  --panel-menu: rgba(11, 18, 27, 0.82);
  --panel-menu-strong: rgba(14, 23, 34, 0.88);
  --panel-muted: rgba(255, 255, 255, 0.03);
  --line: rgba(156, 188, 214, 0.14);
  --line-strong: rgba(156, 188, 214, 0.28);
  --text: #eef4fb;
  --text-soft: #adc0d4;
  --text-dim: #708398;
  --accent: #7bd0ff;
  --accent-soft: rgba(123, 208, 255, 0.16);
  --accent-mint: #9cf0bb;
  --accent-warm: #ffc47d;
  --success: #9cf0bb;
  --warning: #ffd27c;
  --danger: #ff9d9d;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: #081018;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI Variable Display", "Trebuchet MS", "Verdana", sans-serif;
  --viewport-glow:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 196, 125, 0.1), transparent 30%);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  overflow-x: hidden;
  background-color: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 64px,
      rgba(255, 255, 255, 0.015) 64px,
      rgba(255, 255, 255, 0.015) 65px
    );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--viewport-glow);
}

body,
input,
select,
textarea,
button {
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  padding-left: max(14px, env(safe-area-inset-left, 0px));
}

.app {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

body.web-login-active .app-shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.web-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 8%, rgba(123, 208, 255, 0.18), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(255, 196, 125, 0.13), transparent 30%),
    rgba(5, 10, 15, 0.72);
  backdrop-filter: blur(14px);
}

.web-login-card {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(15, 24, 34, 0.96), rgba(8, 16, 24, 0.96));
  box-shadow: var(--shadow);
}

.web-login-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.web-login-title {
  margin: 0 0 4px;
  font-size: 30px;
  line-height: 1;
}

.web-login-error {
  padding: 11px 13px;
  border: 1px solid rgba(255, 157, 157, 0.32);
  border-radius: 14px;
  color: var(--danger);
  background: rgba(74, 24, 24, 0.54);
}

.screen {
  display: block;
}

body.reports-screen-active {
  --viewport-glow:
    radial-gradient(circle at 12% 2%, rgba(123, 208, 255, 0.14), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(255, 196, 125, 0.09), transparent 24%),
    radial-gradient(circle at 78% 92%, rgba(156, 240, 187, 0.08), transparent 26%),
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 196, 125, 0.1), transparent 30%);
}

body.inventory-screen-active,
body.payments-screen-active {
  --viewport-glow:
    radial-gradient(circle at 12% 2%, rgba(123, 208, 255, 0.16), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(255, 196, 125, 0.1), transparent 24%),
    radial-gradient(circle at 78% 92%, rgba(156, 240, 187, 0.08), transparent 26%),
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.16), transparent 34%),
    radial-gradient(circle at bottom left, rgba(156, 240, 187, 0.09), transparent 30%);
}

.screen-shell {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hidden,
.owner-only.hidden,
.hidden-role {
  display: none !important;
}

.stack {
  display: grid;
}

.gap8 {
  gap: 8px;
}

.gap10 {
  gap: 10px;
}

.gap12 {
  gap: 12px;
}

.gap14 {
  gap: 14px;
}

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

.two-col,
.mobile-one {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.wrap {
  flex-wrap: wrap;
}

.alert,
.card,
.home-card,
.list-item,
.inventory-item,
.slot-card,
.order-card,
.chat-item,
.result-box,
.status-panel,
.job-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-strong) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.alert {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-color: rgba(255, 157, 157, 0.32);
  background: linear-gradient(180deg, rgba(74, 24, 24, 0.88), rgba(43, 16, 16, 0.92));
  color: var(--text);
}

.card {
  padding: 18px;
}

.card.screen-shell,
section.screen-shell {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
  position: relative;
  isolation: isolate;
}

.card.screen-shell::before,
section.screen-shell::before {
  content: "";
  position: absolute;
  inset: -10px -6px -12px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 2%, rgba(123, 208, 255, 0.14), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(255, 196, 125, 0.09), transparent 24%),
    radial-gradient(circle at 78% 92%, rgba(156, 240, 187, 0.08), transparent 26%);
  opacity: 0.95;
}

#inventoryScreen .screen-shell::before,
#paymentsScreen .screen-shell::before,
#reportsScreen .screen-shell::before {
  display: none;
}

.card.screen-shell > *,
section.screen-shell > * {
  position: relative;
  z-index: 1;
}

.soft-card,
.inner-card,
.result-box,
.status-panel,
.slot-card,
.order-card,
.chat-item,
.inventory-item,
.job-card,
.list-item {
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.07) 0%, transparent 38%),
    radial-gradient(circle at bottom right, rgba(255, 196, 125, 0.045) 0%, transparent 28%),
    linear-gradient(180deg, rgba(11, 18, 27, 0.9) 0%, rgba(14, 23, 34, 0.92) 100%);
}

.section-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

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

.section-header h2,
.section-heading h2,
h3,
.detail-title,
.title,
.list-title,
.order-title {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.section-header h2,
.section-heading h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 820;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.15;
}

.detail-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 820;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.detail-title.compact-detail {
  font-size: 22px;
}

.eyebrow,
.card-kicker,
.step-label,
.meta-pill__label,
.detail-metric span,
.price-pill span {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-dim);
}

.eyebrow {
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 700;
}

.home-layout {
  display: grid;
  gap: 16px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  border-color: var(--line-strong);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: -35% auto auto -10%;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 208, 255, 0.22) 0%, transparent 68%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: end;
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.hero-text {
  max-width: 54ch;
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}

.hero-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.meta-pills,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.meta-pill strong,
.chip.active {
  color: var(--text);
}

.meta-pill--accent,
.meta-pill.is-active,
.chip.active,
.segment-btn.active,
.tab.active {
  border-color: var(--line-strong);
  background: rgba(123, 208, 255, 0.11);
  color: var(--text);
}

.stats-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  min-height: 116px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.stat-card__label {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.35;
}

.stat-card__value {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  font-weight: 820;
  letter-spacing: -0.05em;
}

.stat-card__hint {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

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

.home-card {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-card::before {
  content: "";
  position: absolute;
  inset: -12% auto auto -8%;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.9;
  pointer-events: none;
}

.home-card--payments::before {
  background: radial-gradient(circle, rgba(123, 208, 255, 0.22) 0%, transparent 70%);
}

.home-card--inventory::before {
  background: radial-gradient(circle, rgba(156, 240, 187, 0.18) 0%, transparent 70%);
}

.home-card--accounts::before {
  background: radial-gradient(circle, rgba(255, 196, 125, 0.16) 0%, transparent 70%);
}

.home-card--archive::before {
  background: radial-gradient(circle, rgba(255, 157, 157, 0.16) 0%, transparent 70%);
}

.home-card--reports::before {
  background: radial-gradient(circle, rgba(123, 208, 255, 0.16) 0%, transparent 70%);
}

.home-card--staff::before {
  background: radial-gradient(circle, rgba(156, 240, 187, 0.14) 0%, transparent 70%);
}

.home-card:hover,
.home-card:active {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(17, 28, 40, 0.96), rgba(11, 18, 26, 0.98));
}

.home-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.home-card__identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 18px;
  flex: 0 0 auto;
}

.card-kicker {
  padding-top: 0;
  flex: 0 0 auto;
}

.home-card .title {
  font-size: 15px;
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.03em;
  min-width: 0;
}

.home-card .desc {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

body.home-screen-active {
  overflow: hidden;
  overscroll-behavior: none;
}

body.home-screen-active .app-shell {
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

body.home-screen-active .app,
body.home-screen-active #homeScreen,
body.home-screen-active #homeScreen > .screen-shell,
body.home-screen-active #homeActions {
  height: 100%;
}

body.home-screen-active #homeActions {
  align-content: stretch;
  grid-auto-rows: 1fr;
}

body.home-screen-active .home-card {
  min-height: 0;
  height: 100%;
}

.btn,
.tab,
.segment-btn,
.chip {
  appearance: none;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn,
.tab,
.segment-btn,
.chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.btn.primary {
  color: #06111a;
  border-color: transparent;
  background: linear-gradient(135deg, #79d0ff 0%, #aaf1ff 100%);
  box-shadow: 0 16px 34px rgba(123, 208, 255, 0.22);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.03);
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
}

.btn:hover,
.tab:hover,
.segment-btn:hover,
.chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #6cc9fb 0%, #9de9ff 100%);
}

.btn:active,
.tab:active,
.segment-btn:active,
.chip:active {
  transform: translateY(0);
}

.back-btn {
  white-space: nowrap;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.2;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: grid;
}

.input,
.textarea,
.select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.03) 100%);
  color: var(--text);
  outline: none;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  color-scheme: dark;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%23dce8f5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.03) 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: right 16px center, center;
  background-size: 14px 14px, 100% 100%;
}

.select option,
.select optgroup {
  color: var(--text);
  background: #0d1620;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-dim);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(123, 208, 255, 0.08);
}

.input:focus,
.textarea:focus {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.045) 100%);
}

.select:focus {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%23eef4fb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.045) 100%);
}

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

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.reports-date-grid--custom {
  grid-template-columns: 1fr;
}

.reports-date-grid .field {
  min-width: 0;
}

.reports-date-native-wrap {
  display: none !important;
}

.reports-date-native,
.reports-date-field input[type="hidden"] {
  display: none;
}

.reports-range-field {
  min-width: 0;
}

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

.reports-presets .btn {
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  justify-content: center;
  font-weight: 760;
}

.reports-presets .btn.active {
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.12) 0%, transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.045) 100%);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(10, 17, 28, 0.22);
}

.date-trigger {
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.08) 0%, transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.03) 100%);
  color: var(--text);
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.date-trigger--range {
  min-height: 58px;
}

.date-trigger:hover,
.date-trigger:active,
.date-trigger.is-active {
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.12) 0%, transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.045) 100%);
}

.date-trigger__value {
  display: block;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
  color: var(--text);
}

.date-trigger__meta {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-soft);
}

.date-picker {
  margin-top: -2px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.date-picker__head {
  display: grid;
  gap: 10px;
}

.date-picker__caption {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-dim);
}

.date-picker__nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.date-picker__title {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.date-picker__summary {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
}

.date-picker__weekdays,
.date-picker__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.date-picker__weekdays span {
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.date-picker__day {
  appearance: none;
  min-height: 38px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

.date-picker__day-empty {
  min-height: 38px;
  border-radius: 14px;
}

.date-picker__day.is-other {
  opacity: 0.4;
}

.date-picker__day.is-range {
  background: rgba(123, 208, 255, 0.08);
}

.date-picker__day.is-range-start,
.date-picker__day.is-range-end {
  border-color: rgba(123, 208, 255, 0.38);
  background: rgba(123, 208, 255, 0.18);
}

.date-picker__day.is-selected {
  border-color: rgba(123, 208, 255, 0.34);
  background: rgba(123, 208, 255, 0.18);
}

.date-picker__day.is-today {
  box-shadow: inset 0 0 0 1px rgba(255, 196, 125, 0.32);
}

.field > span,
.switch-row,
.muted {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.switch-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(var(--segments-count, 2), minmax(0, 1fr));
  gap: 10px;
}

.segment-btn {
  min-height: 48px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
}

.select-segmented {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.search-row-single {
  grid-template-columns: minmax(0, 1fr);
}

.list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.accounts-panels {
  display: grid;
  gap: 14px;
}

.accounts-issue-card {
  order: 1;
}

.accounts-import-card {
  order: 2;
}

.inventory-layout,
.archive-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  gap: 14px;
}

.inventory-layout .list,
.archive-layout .list,
.payflow-stage-list,
.chat-list {
  max-height: min(58dvh, 720px);
  overflow: auto;
  padding-right: 2px;
}

#inventoryDetails,
#archiveDetail {
  min-height: 100%;
}

#archiveScreen.archive-detail-mode .archive-layout {
  grid-template-columns: 1fr;
}

#archiveScreen.archive-detail-mode #archiveDetail {
  min-height: 0;
}

.inventory-item,
.order-card,
.chat-item,
.slot-card-button,
.list-item {
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border-radius: 20px;
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.inventory-item:hover,
.order-card:hover,
.chat-item:hover,
.slot-card-button:hover,
.list-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.inventory-item.selected,
.order-card.selected,
.chat-item.selected {
  border-color: var(--line-strong);
  background: rgba(123, 208, 255, 0.1);
}

.chat-item.confirm {
  border-color: rgba(255, 210, 124, 0.34);
  background: rgba(255, 210, 124, 0.1);
}

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

.list-title {
  font-size: 18px;
  font-weight: 780;
  line-height: 1.18;
}

.order-title,
.inventory-title {
  font-size: 16px;
  font-weight: 760;
  line-height: 1.28;
}

.list-meta {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.list-meta strong,
.muted strong {
  color: var(--text);
}

.stock-badge {
  min-width: 52px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 820;
  font-size: 14px;
}

.stock-good {
  color: var(--success);
}

.stock-low {
  color: var(--warning);
}

.stock-zero {
  color: var(--danger);
}

.empty {
  padding: 20px 16px;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.025) 100%);
  color: var(--text-dim);
}

.result-box,
.status-panel {
  padding: 16px 18px;
}

.result-card__title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.result-card__body {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.result-card__body strong {
  color: var(--text);
}

.report-card {
  padding: 22px 22px 20px;
  overflow: hidden;
}

.report-card--margin {
  background:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(255, 196, 125, 0.08) 0%, transparent 26%),
    linear-gradient(180deg, rgba(10, 18, 28, 0.96) 0%, rgba(13, 22, 33, 0.94) 100%);
  border-color: rgba(156, 188, 214, 0.22);
}

.report-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--accent);
}

.report-card__hero {
  font-size: clamp(34px, 6vw, 58px);
  line-height: 0.96;
  font-weight: 860;
  letter-spacing: -0.06em;
  color: var(--text);
}

.report-card__range {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

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

.report-metric-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
  display: grid;
  gap: 8px;
}

.report-metric-card span {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.report-metric-card strong {
  color: var(--text);
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1;
  font-weight: 820;
  letter-spacing: -0.04em;
}

.report-metric-card--accent {
  border-color: rgba(123, 208, 255, 0.28);
  background:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, rgba(20, 35, 49, 0.9) 0%, rgba(14, 24, 35, 0.96) 100%);
}

.code-box {
  display: block;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 20, 29, 0.84) 0%, rgba(9, 15, 23, 0.9) 100%);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

.result-card__body .code-box,
.result-card__body .copy-card {
  margin-top: 10px;
}

.copy-card {
  width: 100%;
  appearance: none;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.copy-card:hover,
.copy-card:active {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(10, 17, 26, 0.82);
}

.copy-card__label {
  display: block;
  margin-bottom: 8px;
  font-family: "Segoe UI Variable Display", "Trebuchet MS", "Verdana", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  line-height: 1.2;
  color: var(--accent);
}

.copy-card__body {
  display: block;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-card.is-copied {
  border-color: rgba(156, 240, 187, 0.36);
  background: rgba(18, 38, 27, 0.78);
}

.copy-card.is-copy-failed {
  border-color: rgba(255, 157, 157, 0.34);
  background: rgba(52, 20, 20, 0.78);
}

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

.price-pill {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.03) 100%);
  display: grid;
  gap: 8px;
}

.price-pill strong {
  font-size: 16px;
  line-height: 1.1;
}

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

.slot-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.slot-card .btn {
  width: 100%;
}

.slot-card-button {
  display: grid;
  gap: 10px;
  align-content: start;
}

.slot-card-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

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

.detail-metric {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.03) 100%);
  display: grid;
  gap: 8px;
}

.detail-metric strong {
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-metric--wide {
  grid-column: 1 / -1;
}

.payflow-stage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.payflow-order-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.payflow-order-item__title {
  font-weight: 780;
  line-height: 1.3;
  color: var(--text);
}

.payflow-order-item__meta {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
}

.status-ok {
  border-color: rgba(156, 240, 187, 0.26);
}

.status-title {
  font-size: 22px;
  line-height: 1.08;
  font-weight: 820;
}

.compact-success-panel {
  max-width: 480px;
  margin: 6px auto 0;
  text-align: center;
}

.compact-success-text {
  color: var(--text-soft);
}

.compact-home-btn {
  width: min(100%, 240px);
  margin: 0 auto;
}

#payflowFinalCard.is-sent,
#postpayFinalCard.is-sent,
#ggselFinalCard.is-sent {
  min-height: 0;
}

#payflowFinalCard.is-sent .payflow-stage-toolbar,
#payflowFinalCard.is-sent #payflowFinalSummary,
#payflowFinalCard.is-sent #payflowTargetField,
#payflowFinalCard.is-sent #payflowChatWrap,
#postpayFinalCard.is-sent .payflow-stage-toolbar,
#postpayFinalCard.is-sent #postpayFinalSummary,
#postpayFinalCard.is-sent #postpayTargetField,
#postpayFinalCard.is-sent #postpayChatWrap,
#ggselFinalCard.is-sent .payflow-stage-toolbar,
#ggselFinalCard.is-sent #ggselFinalSummary,
#ggselFinalCard.is-sent #ggselChatWrap {
  display: none !important;
}

.job-card {
  padding: 16px;
}

.job-card.tone-pending {
  border-color: rgba(255, 210, 124, 0.28);
}

.job-card.tone-success {
  border-color: rgba(156, 240, 187, 0.24);
}

.job-card.tone-danger {
  border-color: rgba(255, 157, 157, 0.24);
}

.job-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.job-title-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.job-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 18px;
}

.job-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.job-meta,
.job-target,
.job-footer {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.job-target {
  margin-top: 10px;
}

.job-footer {
  margin-top: 8px;
}

.job-actions {
  margin-top: 12px;
}

.job-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.job-status.pending {
  color: var(--warning);
  background: rgba(255, 210, 124, 0.12);
  border-color: rgba(255, 210, 124, 0.24);
}

.job-status.success {
  color: var(--success);
  background: rgba(156, 240, 187, 0.12);
  border-color: rgba(156, 240, 187, 0.22);
}

.job-status.danger {
  color: var(--danger);
  background: rgba(255, 157, 157, 0.12);
  border-color: rgba(255, 157, 157, 0.24);
}

.job-status.muted {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 980px) {
  .hero-grid,
  .inventory-layout,
  .archive-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .price-strip,
  .slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .cards-grid,
  .two-col,
  .three-col,
  .mobile-one,
  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

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

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

  .select-segmented {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .section-header {
    grid-template-columns: auto 1fr;
  }

  .section-header > :last-child:not(h2) {
    display: none;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .inventory-layout .list,
  .archive-layout .list,
  .payflow-stage-list,
  .chat-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    padding-left: max(10px, env(safe-area-inset-left, 0px));
  }

  .card {
    padding: 15px;
  }

  .hero-title {
    font-size: 34px;
  }

  .section-header h2,
  .section-heading h2 {
    font-size: 24px;
  }

  .detail-title,
  .detail-title.compact-detail {
    font-size: 20px;
  }

  .stats-grid,
  .price-strip,
  .slot-grid {
    grid-template-columns: 1fr;
  }

  .home-card {
    min-height: 92px;
    padding: 10px;
  }

  .home-card .title,
  .list-title {
    font-size: 15px;
  }

  .home-card .desc,
  .muted,
  .field > span,
  .list-meta,
  .result-card__body {
    font-size: 12px;
  }

  .report-card {
    padding: 18px;
  }

  .report-card__hero {
    font-size: 36px;
  }

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

  .btn,
  .tab,
  .segment-btn,
  .chip {
    min-height: 42px;
  }

  .reports-date-grid {
    grid-template-columns: 1fr;
  }

  .reports-presets {
    gap: 8px;
  }

  .reports-presets .btn {
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }

  .date-trigger {
    min-height: 48px;
    padding: 11px 12px;
  }

  .date-trigger--range {
    min-height: 52px;
  }

  .date-trigger__value {
    font-size: 14px;
  }

  .date-trigger__meta {
    font-size: 11px;
  }

  .date-picker {
    padding: 14px;
  }

  .date-picker__day {
    min-height: 36px;
  }

  .date-picker__day-empty {
    min-height: 36px;
  }

  .job-card-head,
  .payflow-stage-toolbar,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }
}
