:root {
  --bg: #eff4fb;
  --bg-strong: #d8e6f4;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: #f8fbff;
  --text: #142033;
  --muted: #63758d;
  --line: #d6e0eb;
  --primary: #e85d16;
  --primary-dark: #bb4610;
  --primary-soft: #fff1e8;
  --success: #157347;
  --success-soft: #e8f7ee;
  --warning: #9a6700;
  --warning-soft: #fff4d1;
  --danger: #b42318;
  --danger-soft: #feeceb;
  --shadow: 0 22px 52px rgba(16, 24, 40, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(232, 93, 22, 0.12), transparent 28%),
    radial-gradient(circle at right 20%, rgba(22, 101, 216, 0.1), transparent 26%),
    linear-gradient(180deg, var(--bg), #f6f9fd);
  font-family: Aptos, "Trebuchet MS", "Segoe UI", sans-serif;
}

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

a {
  color: inherit;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #edf2f8;
  font-size: 0.92em;
}

.landing-shell,
.page-shell,
.setup-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.setup-shell {
  max-width: 980px;
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.panel {
  border: 1px solid rgba(214, 224, 235, 0.96);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.setup-panel,
.auth-panel {
  width: min(760px, 100%);
  padding: 28px;
}

.card-pad {
  padding: 22px;
}

.section-copy {
  margin-bottom: 22px;
}

.section-lead,
.topbar-copy,
.section-title p,
.portal-card p:not(.eyebrow),
.helper-card p {
  color: var(--muted);
  line-height: 1.58;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.top-hero {
  margin-bottom: 22px;
}

.portal-grid,
.page-grid,
.stat-grid {
  display: grid;
  gap: 18px;
}

.portal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-grid {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  margin-bottom: 20px;
  align-items: start;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.portal-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.stat-card {
  min-height: 118px;
  padding: 18px 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
}

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

.nav-actions,
.action-row,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.two-col,
.three-col {
  display: grid;
  gap: 14px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  color: #2a3d57;
  font-size: 0.84rem;
  font-weight: 800;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
}

.checkbox-row span {
  color: #2a3d57;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(232, 93, 22, 0.72);
  box-shadow: 0 0 0 4px rgba(232, 93, 22, 0.14);
}

input[readonly],
textarea[readonly] {
  background: var(--panel-soft);
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  padding: 0 16px;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button {
  border: 1px solid var(--primary);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #ff7a3d);
  box-shadow: 0 14px 24px rgba(232, 93, 22, 0.22);
}

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

.primary-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.secondary-button {
  border: 1px solid var(--line);
  color: #253449;
  background: rgba(255, 255, 255, 0.98);
}

.secondary-button:hover {
  border-color: #b8c8d9;
  background: #f8fbff;
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.flash {
  margin-bottom: 18px;
  border: 1px solid;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 700;
}

.flash-success {
  border-color: #b7e4c7;
  color: #195c37;
  background: var(--success-soft);
}

.flash-error {
  border-color: #f1b7b3;
  color: #8d241a;
  background: var(--danger-soft);
}

.section-title {
  margin-bottom: 8px;
}

.section-title-inline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.helper-card,
.empty-card {
  border: 1px solid rgba(232, 93, 22, 0.2);
  border-radius: 16px;
  background: var(--primary-soft);
  padding: 16px;
}

.helper-card-soft {
  margin-top: 14px;
  border-color: #d7e2ee;
  background: #f7fbff;
}

.helper-card strong,
.empty-card {
  display: block;
  font-weight: 800;
}

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

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

.compact-table table {
  min-width: 620px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid #e4edf6;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  color: #4d627d;
  background: #f7fbff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  color: #223246;
}

.table-empty {
  padding: 24px 14px;
  color: var(--muted);
  text-align: center;
}

.reason-cell {
  min-width: 220px;
  color: #45586f;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 88px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-approved {
  color: var(--success);
  background: var(--success-soft);
}

.status-rejected {
  color: var(--danger);
  background: var(--danger-soft);
}

.inline-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.inline-filter select {
  min-width: 140px;
}

.mini-form {
  min-width: 190px;
}

.request-stack {
  display: grid;
  gap: 14px;
}

.request-card {
  border: 1px solid #e1e9f2;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}

.request-card p {
  margin-bottom: 14px;
  color: #44586e;
  line-height: 1.55;
}

.request-card-top,
.request-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.request-card-top {
  margin-bottom: 12px;
}

.request-card-top div,
.request-card-footer {
  color: var(--muted);
  font-size: 0.9rem;
}

.request-card-top strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.request-card-top span,
.request-card-footer span {
  line-height: 1.45;
}

@media (max-width: 980px) {
  .portal-grid,
  .page-grid,
  .stat-grid,
  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-title-inline {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .landing-shell,
  .page-shell,
  .setup-shell {
    width: min(100% - 20px, 1200px);
    padding: 18px 0 28px;
  }

  .setup-panel,
  .auth-panel,
  .card-pad,
  .portal-card {
    padding: 20px;
  }

  .nav-actions,
  .action-row,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .request-card-top,
  .request-card-footer {
    flex-direction: column;
  }

  th,
  td {
    padding: 12px;
  }
}
