:root {
  --bg: #f3efe7;
  --bg-deep: #e4dccf;
  --surface: rgba(255, 252, 245, 0.88);
  --surface-strong: #fffdf8;
  --surface-dark: #1f2a2c;
  --text: #1f252d;
  --muted: #5e6977;
  --line: rgba(57, 71, 86, 0.14);
  --accent: #c55d2d;
  --accent-dark: #8f3d17;
  --accent-soft: rgba(197, 93, 45, 0.12);
  --success: #0f7660;
  --success-soft: rgba(15, 118, 96, 0.12);
  --info: #1f5ea8;
  --info-soft: rgba(31, 94, 168, 0.12);
  --tier-a: #0f7660;
  --tier-b: #9a5d10;
  --tier-c: #7b4859;
  --shadow-lg: 0 24px 60px rgba(43, 33, 20, 0.12);
  --shadow-sm: 0 10px 30px rgba(43, 33, 20, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(197, 93, 45, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(17, 66, 112, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f1e8 0%, #efe7da 52%, #e8dece 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.app-body::before,
.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 85%);
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 36px 20px 48px;
}

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

.topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
}

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

h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.subtle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card,
.card,
.status-card,
.login-card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-sm);
}

.summary-card,
.card,
.status-card {
  border-radius: var(--radius-lg);
}

.summary-card {
  padding: 18px 20px;
}

.summary-label,
.summary-meta,
.status-line {
  display: block;
}

.summary-label {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.summary-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-card {
  min-width: 320px;
  padding: 18px 20px;
}

.status-line + .status-line {
  margin-top: 6px;
}

.status-pill,
.pill,
.tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill {
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.panel {
  margin-bottom: 20px;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.card {
  padding: 22px;
}

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

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

.inline-grid {
  align-items: end;
}

.stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.94rem;
  font-weight: 600;
}

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

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

input:focus,
select:focus {
  border-color: rgba(197, 93, 45, 0.45);
  box-shadow: 0 0 0 4px rgba(197, 93, 45, 0.12);
}

button,
.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #d47a33 100%);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 12px 24px rgba(197, 93, 45, 0.2);
}

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

.button-secondary {
  background: rgba(37, 52, 68, 0.08);
  color: var(--text);
  box-shadow: none;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

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

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(57, 71, 86, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

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

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(57, 71, 86, 0.08);
  text-align: left;
  white-space: nowrap;
}

th {
  background: rgba(245, 239, 231, 0.95);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.55);
}

.domain-cell {
  font-weight: 700;
}

.pill,
.tier {
  padding: 6px 10px;
}

.pill.good {
  background: var(--success-soft);
  color: var(--success);
}

.pill.info {
  background: var(--info-soft);
  color: var(--info);
}

.pill.muted {
  background: rgba(57, 71, 86, 0.08);
  color: #606b77;
}

.tier-A {
  background: rgba(15, 118, 96, 0.12);
  color: var(--tier-a);
}

.tier-B {
  background: rgba(154, 93, 16, 0.12);
  color: var(--tier-b);
}

.tier-C {
  background: rgba(123, 72, 89, 0.12);
  color: var(--tier-c);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 32px 20px;
}

.login-shell {
  min-height: calc(100vh - 84px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.96), rgba(248, 243, 234, 0.92)),
    var(--surface-strong);
  box-shadow: var(--shadow-lg);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.alert {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(143, 61, 23, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(143, 61, 23, 0.12);
}

@media (max-width: 1100px) {
  .summary-grid,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    flex-direction: column;
  }

  .status-card {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 22px 14px 32px;
  }

  .card,
  .summary-card,
  .status-card,
  .login-card {
    padding: 18px;
  }

  .filter-grid,
  .inline-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  button,
  .button {
    width: 100%;
    text-align: center;
  }
}
