:root {
  --navy: #12345b;
  --blue: #2563a6;
  --blue-dark: #1f4f86;
  --green: #187a4b;
  --red: #c43c45;
  --gray: #657386;
  --ink: #1b2b3f;
  --muted: #637286;
  --surface: #ffffff;
  --background: #f1f5f9;
  --border: #d8e1eb;
  --focus: #84baf4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .3rem; font-size: clamp(1.55rem, 3vw, 2rem); }
h2 { margin-bottom: .55rem; font-size: 1.2rem; }
code { color: #374964; }

label {
  display: block;
  margin: 1rem 0 .4rem;
  font-size: .9rem;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="tel"],
select {
  width: 100%;
  padding: .78rem .85rem;
  border: 1px solid #becada;
  border-radius: .65rem;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem max(1rem, calc((100vw - 1180px) / 2));
  color: #fff;
  background: linear-gradient(125deg, #102e50, #1d568c);
}

.site-header p { margin-bottom: 0; color: #d9e8f6; }
.header-eyebrow { color: #acd0f3 !important; }

.account-box {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: .9rem;
}

.account-box form { margin: 0; }

.dashboard-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.4rem auto 3rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: .9rem;
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(23, 52, 83, .06);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: .8rem;
  margin-bottom: 1rem;
}

.stat-card { min-height: 108px; padding: 1.05rem; }
.label { display: block; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.value { display: block; margin-top: .55rem; font-size: 1.35rem; }
.value-small { font-size: 1rem; line-height: 1.35; }

.section-card { padding: 1.2rem; margin-bottom: 1rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-heading h2 { margin-bottom: 0; }
.page-alert { margin-bottom: 1rem; }
.user-management-grid { align-items: start; }
.user-list { display: grid; gap: .8rem; }
.user-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--border); }
.user-row:first-child { padding-top: 0; border-top: 0; }
.user-row p { margin: .35rem 0 0; }
.user-actions { display: grid; gap: .45rem; min-width: min(100%, 285px); }
.inline-form { display: flex; gap: .45rem; }
.inline-form input { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin-bottom: .3rem; color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small-text { font-size: .82rem; line-height: 1.5; }

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.button-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem .9rem;
  border: 1px solid transparent;
  border-radius: .62rem;
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-size: .88rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { filter: brightness(.94); }
.button:disabled { cursor: wait; opacity: .62; }
.button-primary { background: var(--blue); }
.button-secondary { border-color: #9fb3c9; color: #274867; background: #fff; }
.button-success { background: var(--green); }
.button-danger { background: var(--red); }
.button-neutral { background: var(--gray); }
.button-quiet { border-color: rgba(255,255,255,.45); color: #fff; background: rgba(255,255,255,.08); }
.button-full { width: 100%; margin-top: 1.2rem; }
.button-link { margin-top: .3rem; }

.alert {
  padding: .8rem .9rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  font-size: .9rem;
  line-height: 1.45;
}

.alert-error { border-color: #efbdc1; color: #8d252d; background: #fff0f1; }
.alert-success { border-color: #b8dfc7; color: #176239; background: #edf9f1; }
.alert-info { border-color: #bed5ef; color: #265c91; background: #eff7ff; }
.is-hidden { display: none; }
#page-message { margin-bottom: 1rem; }

.current-weather { display: flex; align-items: center; gap: .8rem; min-height: 70px; margin-bottom: .7rem; }
.current-weather .emoji { font-size: 2.6rem; }
.weather-summary { line-height: 1.55; }

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: .65rem;
  margin-top: .8rem;
}

.forecast-item { padding: .8rem; border: 1px solid var(--border); border-radius: .7rem; text-align: center; background: #fbfdff; }
.forecast-item .emoji { margin: .3rem 0; font-size: 2rem; }
.forecast-item .time { min-height: 2.1rem; font-size: .76rem; font-weight: 750; }
.forecast-item .temperature { font-size: 1.15rem; font-weight: 800; }
.forecast-item .rain { color: #2469a5; font-weight: 750; }

.status-pill { padding: .38rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.status-ready { color: #176239; background: #ddf4e6; }
.status-warning { color: #8a5417; background: #fff0d5; }

.check-row { display: flex; align-items: flex-start; gap: .6rem; color: #33465c; font-weight: 600; line-height: 1.4; }
.check-row input { flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: .15rem; }

.auth-page {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, #eaf2fa, #f6f8fb);
}

.auth-shell { width: min(430px, 100%); }
.auth-card { padding: clamp(1.4rem, 6vw, 2.2rem); border: 1px solid var(--border); border-radius: 1rem; background: #fff; box-shadow: 0 18px 55px rgba(26, 58, 91, .14); }
.auth-card .alert { margin: 1rem 0; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 1rem; border-radius: .75rem; color: #fff; background: var(--navy); font-weight: 850; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .account-box { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .two-column { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .user-row { flex-direction: column; }
  .user-actions { width: 100%; }
}
