:root {
  color-scheme: light;
  --background: #eef3f8;
  --card: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #d9e2ec;
  --primary: #1264a3;
  --primary-dark: #0d4978;
  --danger: #b42318;
  --success-bg: #ecfdf3;
  --success-text: #027a48;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(18, 100, 163, 0.16), transparent 28rem),
    var(--background);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 0.75rem;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1.1rem;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--ink);
  padding: 0.75rem 0.85rem;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 0.4rem;
}

.app-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

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

.eyebrow {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 680px;
}

.card,
.metric-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 226, 236, 0.8);
  border-radius: 1.2rem;
  box-shadow: 0 20px 60px rgba(16, 24, 40, 0.08);
}

.card {
  padding: 1.25rem;
}

.login-card {
  max-width: 430px;
}

.login-card p,
.section-heading p {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.secondary-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--primary);
}

.secondary-button:hover {
  background: #f8fafc;
}

.danger-button {
  background: #fff;
  border: 1px solid #fecdca;
  color: var(--danger);
}

.danger-button:hover {
  background: #fff5f5;
}

.small-button {
  border-radius: 999px;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
}

.metrics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metric-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.metric-card strong {
  font-size: 2rem;
  letter-spacing: -0.04em;
}

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

.compact-field {
  min-width: 220px;
}

.queue-controls {
  align-items: end;
  display: flex;
  gap: 0.75rem;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.9rem;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill {
  background: var(--success-bg);
  border-radius: 999px;
  color: var(--success-text);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
}

.error-message {
  color: var(--danger);
  font-weight: 700;
  min-height: 1.5rem;
}

.empty-state {
  color: var(--muted);
  padding: 1rem 0 0;
}

.hidden {
  display: none !important;
}

#pipRoot[hidden] {
  display: none;
}

.pip-widget {
  background: var(--background);
  box-sizing: border-box;
  display: grid;
  gap: 0.75rem;
  height: 100vh;
  padding: 0.9rem;
  width: 100vw;
}

.pip-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.pip-title {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pip-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.pip-count strong {
  color: var(--ink);
}

.pip-next {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem;
}

.pip-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pip-next strong {
  font-size: 1.3rem;
  line-height: 1.2;
}

.pip-wait {
  color: var(--muted);
  font-size: 0.82rem;
}

.pip-upcoming {
  display: grid;
  font-size: 0.85rem;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  overflow-y: auto;
  padding: 0;
}

.pip-upcoming li {
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  padding-bottom: 0.35rem;
}

@media (max-width: 760px) {
  .hero,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .queue-controls {
    align-items: stretch;
    flex-direction: column;
  }
}
