
:root {
  color-scheme: light;
  --bg: #eef4f5;
  --panel: #ffffff;
  --text: #172024;
  --muted: #647276;
  --line: #d7e1e3;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --danger-bg: #fee4e2;
  --shadow: 0 18px 45px rgba(23, 32, 36, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(245, 158, 11, 0.08)),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 16px;
}

.topbar form {
  margin: 0;
}

.shell {
  margin: 0 auto;
  max-width: 1080px;
  padding: clamp(20px, 5vw, 56px) clamp(16px, 4vw, 32px);
}

.panel,
.location-row,
.metric {
  background: var(--panel);
  border: 1px solid rgba(215, 225, 227, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(20px, 4vw, 36px);
}

.intro {
  display: grid;
  gap: clamp(24px, 5vw, 48px);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
}

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

h1 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: 0;
  margin: 0;
}

.admin-shell h1,
.auth-shell h1 {
  font-size: 34px;
  line-height: 1.12;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
button {
  border-radius: 8px;
  font: inherit;
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  min-height: 46px;
  padding: 10px 16px;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.danger {
  background: var(--danger-bg);
  border-color: #fda29b;
  color: var(--danger);
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--accent-dark);
  min-height: auto;
  padding: 0;
}

.muted-link {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.time-grid,
.location-form {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.location-form {
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: end;
  margin-top: 24px;
}

.alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  margin: 18px 0 0;
  padding: 12px 14px;
}

.result-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 22px;
}

.metric span,
.metric small {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

.metric.context strong {
  font-size: clamp(24px, 3vw, 34px);
}

.auth-page {
  display: grid;
  place-items: center;
}

.auth-shell {
  max-width: 460px;
  padding: 24px;
  width: 100%;
}

.login-form {
  gap: 18px;
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.locations-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.location-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 16px;
}

.location-row form:first-child {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
}

.delete-form {
  align-self: end;
}

.empty {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 820px) {
  .intro,
  .result-grid,
  .location-form,
  .location-row,
  .location-row form:first-child {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 112px;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .time-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .admin-shell h1,
  .auth-shell h1 {
    font-size: 28px;
  }
}
