:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --text: #17211b;
  --muted: #66716a;
  --line: #ded8cc;
  --brand: #0f6b53;
  --brand-dark: #084534;
  --gold: #c9912b;
  --danger: #9d2e2e;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(30, 40, 33, 0.12);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(201, 145, 43, 0.2), transparent 34rem),
    linear-gradient(135deg, #f7f3ea 0%, #eef3ee 52%, #f6efe2 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.boot-card,
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 520px);
  display: grid;
  gap: 28px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.login-copy {
  display: grid;
  gap: 14px;
}

.login-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.login-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}

.login-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-badges span {
  padding: 6px 12px;
  border-radius: 999px;
  background: #efede7;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2f3833;
}

.login-divider {
  margin: 4px 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand small,
.muted,
.security-note,
.detail-line span,
.metric-card span,
.message small {
  color: var(--muted);
}

.brand-dot {
  width: 34px;
  height: 34px;
  display: inline-block;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  box-shadow: 0 10px 30px rgba(15, 107, 83, 0.22);
}

.brand.large .brand-dot {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

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

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

.sso-button,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 800;
}

.sso-button {
  justify-content: flex-start;
  border-color: var(--line);
  background: #fff;
}

.sso-button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: white;
}

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

.secondary-button {
  border-color: var(--line);
  background: white;
}

.ghost-button {
  border-color: transparent;
  background: rgba(15, 107, 83, 0.08);
  color: var(--brand-dark);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(222, 216, 204, 0.8);
  background: rgba(244, 241, 234, 0.88);
  backdrop-filter: blur(18px);
}

.app-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.app-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
}

.app-nav .is-active {
  background: var(--text);
  color: white;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.app-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.page-head {
  margin-bottom: 26px;
}

.page-head.split,
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel,
.request-card,
.metric-card,
.payment-card,
.empty-state,
.alert {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 16px 45px rgba(30, 40, 33, 0.08);
}

.panel,
.empty-state,
.alert {
  padding: 24px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  padding: 20px;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
}

.request-list,
.detail-grid {
  display: grid;
  gap: 14px;
}

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

.request-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 20px;
}

.request-card h2,
.request-card p {
  margin-bottom: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.success,
.alert.success {
  background: #e8f5ed;
  color: #12613f;
}

.badge.warning {
  background: #fff3d8;
  color: #80560a;
}

.badge.danger,
.alert.danger {
  background: #fdecec;
  color: var(--danger);
}

.badge.info {
  background: #e8f1f7;
  color: #175779;
}

.badge.neutral {
  background: #efede7;
  color: #4a514c;
}

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

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

.field span {
  font-weight: 800;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  padding: 13px 14px;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-error,
.form-success {
  border-radius: 16px;
  padding: 12px 14px;
}

.form-error {
  background: #fdecec;
  color: var(--danger);
}

.form-success {
  background: #e8f5ed;
  color: #12613f;
}

.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-list span {
  border-radius: 999px;
  background: #efede7;
  padding: 6px 10px;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.quote-amount,
.payment-card strong {
  display: block;
  margin: 8px 0 14px;
  font-size: clamp(2.4rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.07em;
}

.payment-card {
  width: min(720px, 100%);
  padding: 30px;
}

.timeline {
  padding-left: 20px;
}

.timeline li {
  margin-bottom: 12px;
}

.timeline span {
  display: block;
  color: var(--muted);
}

.message-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.message {
  max-width: 760px;
  border-radius: 18px;
  background: #f3f0e8;
  padding: 14px;
}

.message.own {
  margin-left: auto;
  background: #e8f5ed;
}

.message-form {
  display: grid;
  gap: 10px;
}

.message-form textarea {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.center {
  display: grid;
  place-items: center;
  gap: 12px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #d9d2c4;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

  .app-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .account-chip,
  .page-head.split,
  .card-row,
  .request-card {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .wide {
    grid-column: auto;
  }
}
