:root {
  color-scheme: dark;
  --bg: #05060a;
  --card: rgba(255, 255, 255, 0.04);
  --card-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.16);
  --primary: #7f5dff;
  --primary-strong: #a678ff;
  --accent: #27f0ff;
  --text: #f6f7fb;
  --muted: rgba(246, 247, 251, 0.6);
  --danger: #ff6b6b;
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(119, 82, 255, 0.25), transparent 45%),
    radial-gradient(circle at 20% 20%, rgba(39, 240, 255, 0.2), transparent 35%),
    var(--bg);
  color: var(--text);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 25px 50px rgba(5, 6, 10, 0.55);
}

.card header {
  margin-bottom: 1.5rem;
}

.hero-card {
  display: grid;
  gap: 1.25rem;
}

.hero-card h1 {
  margin: 0 0 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.65rem;
  text-transform: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-left: 0.75rem;
}

.pill.online {
  color: #0ad48b;
  border-color: rgba(10, 212, 139, 0.4);
}

.pill.offline {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.4);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.hero-metrics .metric {
  font-size: 1.8rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

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

.card.wide {
  grid-column: 1 / -1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

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

.global-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.global-stats strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 0.35rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(127, 93, 255, 0.6);
  outline-offset: 1px;
}

select option {
  color: #05060a;
  background: #f6f7fb;
}

select option[disabled] {
  color: rgba(5, 6, 10, 0.5);
}

.primary-btn,
.ghost-btn {
  border: none;
  border-radius: 999px;
  font: inherit;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #020205;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(127, 93, 255, 0.35);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border: 1px solid transparent;
}

.ghost-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.ghost-btn.danger {
  color: var(--danger);
}

.quick-pills {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.quick-pills span {
  color: var(--muted);
  font-size: 0.85rem;
}

.quick-pills div {
  display: flex;
  gap: 0.5rem;
}

.quick-pills button {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}

.timer-display {
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.customer-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customer-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
  align-items: center;
}

.customer-ident {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.customer-ident .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.customer-ident .name {
  margin: 0;
  font-weight: 600;
}

.customer-ident .subline {
  color: var(--muted);
}

.customer-metrics {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.progress-track {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-track .progress {
  height: 100%;
  width: 0;
  background: linear-gradient(120deg, var(--primary), var(--accent));
}

.legend {
  display: flex;
  gap: 1rem;
  color: var(--muted);
}

.averages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.averages strong {
  font-size: 1.3rem;
  margin-top: 0.35rem;
  display: block;
}

.table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  overflow-x: auto;
}

.header-with-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.card-tools {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.card-tools select {
  min-width: 160px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

thead {
  background: rgba(255, 255, 255, 0.04);
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
}

tbody tr + tr {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
  .app-shell {
    padding: 2rem 1rem 3rem;
  }

  .timer-actions {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

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