:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #657282;
  --line: #d9e0e8;
  --soft: #f4f7f9;
  --paper: #ffffff;
  --brand: #167a7f;
  --brand-dark: #0d555a;
  --accent: #c84d2f;
  --gold: #f3b33d;
  --good: #247a48;
  --warn: #a15c12;
  --danger: #a93838;
  --shadow: 0 18px 40px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #edf2f5;
  color: var(--ink);
}

body {
  line-height: 1.5;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  color: inherit;
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name {
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-pill {
  max-width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #f7fafb;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button,
.ghost-button,
.primary-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 7px;
  padding: 9px 12px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.tab-button {
  background: transparent;
  color: var(--muted);
}

.tab-button.active {
  background: #e2f0f1;
  color: var(--brand-dark);
}

.primary-button {
  background: var(--brand);
  color: white;
  box-shadow: 0 8px 16px rgba(22, 122, 127, 0.2);
}

.ghost-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.danger-button {
  background: #fdebea;
  color: var(--danger);
}

.icon-button {
  min-width: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: white;
}

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

.content {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.band {
  display: grid;
  gap: 22px;
  padding: 22px 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: stretch;
}

.auth-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.auth-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-form {
  margin-top: 4px;
}

.auth-stats {
  margin-top: 24px;
}

.intro-slab,
.summary-slab,
.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(23, 32, 42, 0.03);
}

.intro-slab {
  padding: clamp(22px, 4vw, 36px);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  font-size: clamp(30px, 5vw, 54px);
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 17px;
}

.lead {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.summary-slab {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.machine-preview {
  min-height: 218px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 122, 127, 0.8), rgba(200, 77, 47, 0.74)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='560' viewBox='0 0 900 560'%3E%3Crect width='900' height='560' fill='%23f8fbfc'/%3E%3Cg fill='none' stroke='%2317202a' stroke-width='14' stroke-linejoin='round'%3E%3Crect x='244' y='58' width='320' height='450' rx='30'/%3E%3Cpath d='M580 130h106v278H580z'/%3E%3Cpath d='M296 128h206v260H296z'/%3E%3Cpath d='M318 422h164'/%3E%3Cpath d='M610 184h42M610 236h42M610 288h42'/%3E%3C/g%3E%3Cg fill='%23f3b33d'%3E%3Ccircle cx='335' cy='170' r='24'/%3E%3Ccircle cx='407' cy='170' r='24'/%3E%3Ccircle cx='477' cy='170' r='24'/%3E%3Ccircle cx='335' cy='255' r='24'/%3E%3Ccircle cx='407' cy='255' r='24'/%3E%3Ccircle cx='477' cy='255' r='24'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

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

.admin-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.stat-value {
  font-size: 28px;
  font-weight: 850;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

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

.panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.compact-heading {
  align-items: center;
}

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

.small {
  font-size: 13px;
}

.stack {
  display: grid;
  gap: 12px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #344150;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e1;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(22, 122, 127, 0.18);
  border-color: var(--brand);
}

.help-text {
  color: var(--muted);
  font-size: 12px;
}

.machine-card,
.issue-card,
.question-card,
.plan-card,
.qr-card,
.operator-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.machine-card-header,
.issue-card-header,
.operator-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.operator-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
  align-items: start;
}

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

.operator-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.operator-metrics div {
  border-radius: 7px;
  background: var(--soft);
  padding: 9px;
}

.operator-metrics strong,
.operator-metrics span {
  display: block;
}

.operator-metrics span,
.operator-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.operator-details div {
  min-width: 0;
}

.operator-details dt,
.operator-details dd {
  margin: 0;
}

.operator-details dd {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 4px;
}

.segmented-control button {
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented-control button.active {
  background: #e2f0f1;
  color: var(--brand-dark);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.operator-table-wrap {
  overflow-x: auto;
}

.operator-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.operator-table th,
.operator-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.operator-table th {
  color: #344150;
  font-size: 12px;
  text-transform: uppercase;
}

.compact-button {
  min-height: 32px;
  padding-block: 6px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef3f6;
  color: #3f4d5b;
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  background: #e5f4eb;
  color: var(--good);
}

.badge.orange {
  background: #fff2dd;
  color: var(--warn);
}

.badge.red {
  background: #fdebea;
  color: var(--danger);
}

.badge.blue {
  background: #e2f0f1;
  color: var(--brand-dark);
}

.qr-canvas {
  width: 188px;
  height: 224px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.machine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-list {
  display: grid;
  gap: 10px;
}

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

.meta-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: var(--soft);
}

.meta-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-value {
  font-weight: 750;
}

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

.plan-card.featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(22, 122, 127, 0.14);
}

.price {
  font-size: 24px;
  font-weight: 850;
}

.customer-page {
  min-height: 100vh;
  background: #eef3f6;
}

.customer-wrap {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.customer-header {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.customer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-disc {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-size: 20px;
  font-weight: 850;
}

.machine-banner {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.machine-thumb {
  width: 96px;
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 122, 127, 0.86), rgba(243, 179, 61, 0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Crect width='300' height='300' fill='%23fff'/%3E%3Crect x='84' y='28' width='116' height='222' rx='18' fill='none' stroke='%2317202a' stroke-width='8'/%3E%3Crect x='104' y='58' width='58' height='104' fill='none' stroke='%2317202a' stroke-width='7'/%3E%3Crect x='170' y='62' width='20' height='96' fill='%2317202a'/%3E%3Ccircle cx='118' cy='82' r='12' fill='%23c84d2f'/%3E%3Ccircle cx='148' cy='82' r='12' fill='%23f3b33d'/%3E%3Ccircle cx='118' cy='124' r='12' fill='%23167a7f'/%3E%3Ccircle cx='148' cy='124' r='12' fill='%23c84d2f'/%3E%3Cpath d='M107 190h70' stroke='%2317202a' stroke-width='8'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.report-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.success-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 380px;
  padding: 13px 15px;
  border-radius: 8px;
  background: #17202a;
  color: white;
  box-shadow: var(--shadow);
}

.code-preview {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101820;
  color: #edf7f8;
  padding: 14px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-panel,
  .auth-hero,
  .grid-two,
  .grid-three,
  .pricing-grid,
  .operator-admin-grid,
  .operator-card-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-tabs {
    justify-content: flex-start;
    width: 100%;
  }

  .topbar-account {
    width: 100%;
  }

  .account-pill {
    max-width: none;
    flex: 1;
  }

  .tab-button {
    flex: 1 1 44%;
  }

  .form-grid,
  .issue-meta,
  .machine-banner,
  .operator-metrics,
  .operator-details {
    grid-template-columns: 1fr;
  }

  .machine-thumb {
    width: 100%;
    max-height: 180px;
  }
}

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

  .content,
  .customer-wrap {
    width: min(100% - 20px, 760px);
  }
}
