:root {
  --green: #44d62c;
  --blue: #00008b;
  --ink: #141414;
  --muted: #6d7280;
  --line: #dfe4ea;
  --soft: #f4f6f8;
  --panel: #ffffff;
  --shadow: 0 18px 45px rgba(20, 20, 20, 0.1);
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f9fb 0%, #eef2f5 100%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  color: #ffffff;
  background: var(--blue);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--green);
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 1.25rem;
}

.brand small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}

.role-tabs {
  display: grid;
  gap: 8px;
}

.role-tab {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  background: transparent;
  text-align: left;
}

.role-tab.active,
.role-tab:hover {
  color: var(--blue);
  background: #ffffff;
}

.install-card {
  margin-top: auto;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 12px;
}

.install-card p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.45;
}

.install-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(68, 214, 44, 0.14);
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar,
.section-head,
.panel-head,
.ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 4rem);
  color: var(--blue);
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
}

h3 {
  font-size: 1.05rem;
}

.primary-action,
.secondary-action {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-action {
  color: var(--blue);
  background: var(--green);
}

.secondary-action {
  color: var(--blue);
  background: #eef1ff;
  border: 1px solid rgba(0, 0, 139, 0.18);
}

.wide {
  width: 100%;
}

.hero-panel {
  min-height: 260px;
  border-radius: 8px;
  padding: clamp(22px, 4vw, 42px);
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(0, 0, 139, 0.92), rgba(0, 0, 139, 0.68)),
    url("assets/queue-visual.svg") center/cover;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
}

.hero-panel .eyebrow,
.hero-copy {
  color: rgba(255, 255, 255, 0.82);
}

.hero-copy {
  max-width: 650px;
  font-size: 1.04rem;
  line-height: 1.65;
}

.live-ticket {
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.ticket-top {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.ticket-top strong {
  color: var(--blue);
  font-size: 2.5rem;
}

.ticket-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding-top: 16px;
}

.ticket-grid span,
.muted {
  color: var(--muted);
}

.view {
  display: none;
  margin-top: 28px;
}

.view.active {
  display: block;
}

.section-head {
  margin-bottom: 18px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.05);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 0.88rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 1.85rem;
}

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

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

.panel {
  padding: 18px;
}

.panel-head {
  margin-bottom: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--blue);
  background: #eef1ff;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.green {
  color: #176d0b;
  background: rgba(68, 214, 44, 0.18);
}

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

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

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  padding: 10px 12px;
}

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

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

.account-list,
.review-list,
.queue-table {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.account-row,
.review-row,
.token-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.account-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.account-row small,
.review-row small,
.token-row small {
  color: var(--muted);
}

.qr-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.qr-art {
  width: 132px;
  aspect-ratio: 1;
  border: 10px solid #ffffff;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--ink) 12px, transparent 12px 24px, var(--ink) 24px 36px, transparent 36px 48px, var(--ink) 48px 60px, transparent 60px),
    linear-gradient(var(--ink) 12px, transparent 12px 24px, var(--ink) 24px 36px, transparent 36px 48px, var(--ink) 48px 60px, transparent 60px);
  background-size: 72px 72px;
  position: relative;
}

.qr-art span {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 7px solid var(--blue);
  background: #ffffff;
}

.qr-art span:nth-child(1) { left: 8px; top: 8px; }
.qr-art span:nth-child(2) { right: 8px; top: 8px; }
.qr-art span:nth-child(3) { left: 8px; bottom: 8px; }
.qr-art span:nth-child(4) {
  right: 14px;
  bottom: 14px;
  width: 20px;
  height: 20px;
  border-color: var(--green);
}

.queue-panel {
  margin-top: 18px;
}

.token-row {
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
}

.token-number {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-size: 1.2rem;
  font-weight: 900;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--blue);
  font-weight: 800;
}

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

.token-result {
  min-height: 426px;
}

.empty-state,
.issued-ticket {
  height: 100%;
  min-height: 390px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
}

.phone-visual {
  width: 140px;
  height: 220px;
  border: 10px solid var(--ink);
  border-radius: 28px;
  background: #ffffff;
  display: grid;
  place-items: center;
  color: var(--blue);
  position: relative;
}

.phone-visual span {
  position: absolute;
  top: 12px;
  width: 45px;
  height: 5px;
  border-radius: 999px;
  background: #d8dde4;
}

.phone-visual strong {
  width: 84px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: linear-gradient(135deg, rgba(68, 214, 44, 0.9), rgba(68, 214, 44, 0.18));
}

.phone-visual small {
  position: absolute;
  bottom: 22px;
  color: var(--muted);
}

.issued-ticket {
  align-content: center;
  padding: 18px;
}

.issued-number {
  color: var(--blue);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
}

.progress-track {
  width: min(100%, 420px);
  height: 12px;
  border-radius: 999px;
  background: #e5e9ee;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 46%;
  background: var(--green);
}

.review-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.review-buttons button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: 180ms ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .role-tab {
    text-align: center;
  }

  .install-card {
    display: none;
  }

  .hero-panel,
  .two-column,
  .front-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .panel-head,
  .ticket-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-tabs,
  .metrics-grid,
  .form-grid,
  .qr-card,
  .token-row,
  .otp-row {
    grid-template-columns: 1fr;
  }

  .role-tab {
    text-align: left;
  }

  .hero-panel {
    min-height: auto;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

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

  .row-actions button {
    flex: 1;
  }
}
