:root {
  --cream: #FBF6F0;
  --paper: #FFFDF9;
  --brown: #4F352A;
  --brown-dark: #4A2E20;
  --terracotta: #C45A2A;
  --terracotta-dark: #A94B23;
  --gold: #C9A35B;
  --rose: #F4E6DE;
  --line: #E5D6C9;
  --muted: #8F7E74;
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--brown);
  background: var(--cream);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--cream); }
body { min-height: 100dvh; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100dvh; }
.view { min-height: 100dvh; padding: 34px 20px 32px; }
.hidden { display: none !important; }

.login-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.login-logo {
  display: block;
  width: min(220px, 58vw);
  height: auto;
  margin: 0 auto 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--terracotta);
  font-size: 12px;
  letter-spacing: .18em;
  font-weight: 800;
}

h1, h2 { font-family: Georgia, "Times New Roman", serif; color: var(--brown-dark); }
h1 { margin: 0; font-size: clamp(42px, 9vw, 58px); line-height: 1.02; font-weight: 500; }
.intro {
  margin: 18px auto 30px;
  line-height: 1.6;
  color: #6f5a50;
  text-align: center;
}

.card, .summary-card, .modal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 16px 45px rgba(79,53,42,.08);
}

.form-card {
  width: 100%;
  border-radius: 22px;
  padding: 24px;
  text-align: left;
}

label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 750;
  color: var(--brown);
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #D1BFAF;
  border-radius: 10px;
  padding: 12px 14px;
  background: #F8EFEB;
  color: var(--brown-dark);
  outline: none;
  margin-bottom: 18px;
}

input:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196,90,42,.10);
}

.btn-primary {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--terracotta);
  color: #FFF5EC;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.error { min-height: 20px; margin: -4px 0 14px; color: #9f2f24; font-size: 13px; line-height: 1.45; }

.dashboard-view { max-width: 820px; margin: 0 auto; padding-top: max(28px, env(safe-area-inset-top)); }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.topbar h1 { font-size: 36px; }
.btn-ghost { border: 1px solid var(--line); background: var(--paper); color: var(--brown); border-radius: 999px; padding: 10px 16px; cursor: pointer; }
.summary-card { border-radius: 24px; padding: 26px; margin-bottom: 20px; }
.summary-kicker { margin: 0 0 8px; color: var(--terracotta); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.summary-card h2 { font-size: 30px; margin: 0 0 12px; font-weight: 500; }
.summary-card p:last-child { margin-bottom: 0; line-height: 1.6; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.dash-card { min-height: 150px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); padding: 20px; text-align: left; color: var(--brown-dark); opacity: 1; }
.dash-card:disabled { color: var(--brown-dark); }
.dash-icon { display: block; font-size: 25px; color: var(--gold); margin-bottom: 22px; }
.dash-card strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; }
.dash-card small { display: block; margin-top: 7px; color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(55,35,27,.72);
  backdrop-filter: blur(8px);
}
.modal-card { width: min(100%, 510px); border-radius: 24px; padding: 28px; text-align: left; }
.modal-alert { margin: 0 0 9px; font-size: 12px; font-weight: 900; letter-spacing: .18em; color: var(--terracotta); }
.modal-card h2 { margin: 0 0 14px; font-size: 31px; line-height: 1.05; font-weight: 500; }
.modal-copy { margin: 0 0 24px; line-height: 1.55; color: #6f5a50; }
.credential-form input:last-of-type { margin-bottom: 16px; }

@media (max-width: 520px) {
  .view { padding-left: 18px; padding-right: 18px; }
  .login-logo { width: min(185px, 56vw); margin-bottom: 24px; }
  .login-view h1 { font-size: clamp(39px, 12vw, 52px); }
  .intro { margin-top: 14px; margin-bottom: 26px; }
  .form-card, .modal-card { padding: 22px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dash-card { min-height: 138px; padding: 17px; }
  .dash-card strong { font-size: 20px; }
  .modal-card h2 { font-size: 27px; }
}

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