:root {
  --brand: #0f4c81;
  --brand-dark: #0a3559;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d8e1eb;
  --success: #107c10;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
}

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

.auth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--brand-dark);
  font-weight: 600;
}

.icon-button {
  width: 46px;
  min-width: 46px;
  padding: 0;
  border-radius: 50%;
  background: #e9f0f8;
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-weight: 700;
  margin: 0 0 6px;
}

h1, h2 {
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.single-column {
  max-width: 900px;
}

.single-column .card {
  width: 100%;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 76, 129, 0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

label span {
  font-size: 14px;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 76, 129, 0.2);
  border-color: var(--brand);
}

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

.actions-row,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  min-height: 46px;
}

button.primary {
  background: var(--brand);
  color: #fff;
}

button.primary:hover {
  background: var(--brand-dark);
}

button.secondary {
  background: #e9f0f8;
  color: var(--brand-dark);
}

.actions-row {
  margin-top: 8px;
}

.actions-row button {
  min-width: 110px;
}

.status-message,
.connection-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--success);
  font-weight: 600;
}

.is-error {
  color: var(--danger) !important;
}

.setup-layout {
  max-width: 760px;
}

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

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #e9f0f8;
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
}

.compact-link {
  white-space: nowrap;
}

.summary-card {
  min-height: 180px;
}

.callout {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #eef6ff;
  border: 1px solid #cfe2f6;
  color: var(--brand-dark);
  line-height: 1.5;
}

.redirect-note {
  margin-top: 10px;
  font-size: 14px;
}

.wrap-actions {
  flex-wrap: wrap;
}

.hint {
  color: var(--muted);
  font-weight: 400;
}

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

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

th,
td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 20px 0;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.signed-in {
  background: #e7f6ec;
  color: var(--success);
}

.badge.signed-out {
  background: #fdecec;
  color: var(--danger);
}

.hidden {
  display: none;
}

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

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

  .hero,
  .section-head,
  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    width: 100%;
    justify-content: stretch;
  }
}
