:root {
  --bg: #f4fbf7;
  --bg-accent: #dff4ea;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: rgba(255, 255, 255, 0.98);
  --ink: #14211a;
  --muted: #577266;
  --line: rgba(20, 33, 26, 0.12);
  --brand: #187457;
  --brand-deep: #125b45;
  --brand-soft: #d8efe6;
  --ok: #1f8f5f;
  --warning: #996e13;
  --danger: #bb4c2f;
  --shadow: 0 20px 48px rgba(26, 72, 56, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(35, 147, 111, 0.1), transparent 32%),
    linear-gradient(180deg, #f8fffb 0%, #edf7f2 100%);
  overflow-x: hidden;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
}

.admin-auth-shell,
.checkins-shell {
  min-height: 100vh;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  margin: 0 auto;
  padding: 32px 24px;
}

.auth-panel {
  text-align: center;
}

.auth-panel h1,
.checkins-topbar h1 {
  margin: 12px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 0.95;
}

.auth-copy,
.topbar-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.auth-card,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.auth-card {
  margin-top: 28px;
  padding: 26px 24px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 251, 246, 0.98));
  border: 1px solid rgba(24, 116, 87, 0.14);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 7px;
  background: linear-gradient(90deg, #187457 0%, #3db98d 100%);
}

.login-slot {
  width: 100%;
  min-height: 360px;
  overflow: hidden;
  border-radius: 18px;
}

.login-slot iframe {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 0;
  background: transparent;
}

.auth-status {
  min-height: 1.25rem;
  margin-top: 14px;
  color: var(--brand-deep);
  font-size: 0.9rem;
}

.checkins-app {
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.checkins-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-pill,
.pill,
.panel__meta,
.selection-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(20, 33, 26, 0.06);
  color: var(--ink);
  font-size: 0.95rem;
}

.pill--ok {
  background: rgba(31, 143, 95, 0.12);
  color: var(--ok);
}

.pill--warning {
  background: rgba(153, 110, 19, 0.12);
  color: var(--warning);
}

.pill--muted {
  background: rgba(20, 33, 26, 0.06);
  color: var(--muted);
}

.banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(153, 110, 19, 0.18);
  border-radius: var(--radius-md);
  background: rgba(255, 245, 220, 0.88);
  color: var(--warning);
}

.panel {
  padding: 18px;
}

.panel--controls {
  margin-bottom: 20px;
}

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

.panel__header h2 {
  margin: 8px 0 0;
  font-size: 1.25rem;
}

.panel__footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.controls-grid,
.action-bar {
  display: grid;
  gap: 12px;
}

.controls-grid {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) 180px;
}

.action-bar {
  grid-template-columns: minmax(200px, 1fr) auto auto 240px 120px auto;
  margin-top: 14px;
  align-items: end;
}

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

.field span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field--grow {
  min-width: 0;
}

.field--compact {
  min-width: 0;
}

select,
input,
button {
  font: inherit;
}

select,
input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(20, 33, 26, 0.1);
  background: rgba(252, 255, 253, 0.98);
  color: var(--ink);
}

select:focus,
input:focus {
  outline: none;
  border-color: rgba(24, 116, 87, 0.42);
  box-shadow: 0 0 0 4px rgba(24, 116, 87, 0.12);
}

.primary-button,
.ghost-button {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button {
  background: linear-gradient(180deg, #23936f 0%, #187457 100%);
  color: #fff;
  box-shadow: 0 16px 30px rgba(24, 116, 87, 0.2);
}

.ghost-button {
  background: rgba(20, 33, 26, 0.06);
  color: var(--ink);
}

.ghost-button--block {
  width: 100%;
}

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

.primary-button:disabled,
.ghost-button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.9fr);
  gap: 20px;
}

.dashboard-rail {
  display: grid;
  gap: 20px;
  align-content: start;
}

.table-shell {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 26, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.table-shell table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.table-shell th,
.table-shell td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(20, 33, 26, 0.08);
  vertical-align: top;
}

.table-shell th {
  position: sticky;
  top: 0;
  background: rgba(240, 250, 245, 0.98);
  z-index: 1;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-primary {
  font-weight: 700;
}

.table-secondary {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill--requested {
  background: rgba(153, 110, 19, 0.12);
  color: var(--warning);
}

.status-pill--active {
  background: rgba(31, 143, 95, 0.12);
  color: var(--ok);
}

.status-pill--completed,
.status-pill--muted {
  background: rgba(20, 33, 26, 0.08);
  color: var(--muted);
}

.status-pill--danger {
  background: rgba(187, 76, 47, 0.12);
  color: var(--danger);
}

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

.stack-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(20, 33, 26, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.stack-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stack-card__title {
  margin: 0;
  font-size: 1rem;
}

.stack-card__meta,
.stack-card__participants {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.stack-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.inline-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: rgba(20, 33, 26, 0.06);
  color: var(--ink);
}

.inline-button--primary {
  background: rgba(24, 116, 87, 0.12);
  color: var(--brand-deep);
}

.inline-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.empty-state {
  padding: 28px 18px;
  border-radius: 16px;
  border: 1px dashed rgba(20, 33, 26, 0.14);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

.row-select {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(20, 33, 26, 0.92);
  color: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .controls-grid,
  .action-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .checkins-app {
    padding: 20px 12px 28px;
  }

  .checkins-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .panel {
    padding: 16px;
  }

  .table-shell table {
    min-width: 760px;
  }
}
