:root {
  color-scheme: light;
  --bg: #eef7f5;
  --surface: #ffffff;
  --surface-soft: #dff0ed;
  --text: #10201e;
  --muted: #60716e;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --danger: #b42318;
  --border: #c9ddda;
  --shadow: 0 18px 45px rgba(16, 32, 30, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 34rem),
    linear-gradient(135deg, #eef7f5 0%, #f8fbfa 58%, #e0efed 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
.button,
input {
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--primary-strong);
}

button.secondary,
.button.secondary {
  background: var(--surface-soft);
  color: var(--primary-strong);
}

button.secondary:hover,
.button.secondary:hover {
  background: #cce7e3;
}

button.ghost {
  background: transparent;
  color: var(--primary-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.login-panel {
  width: min(420px, 100%);
  margin: 12vh auto 0;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

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

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

label {
  display: block;
  margin: 1.5rem 0 0.45rem;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

form button {
  width: 100%;
  margin-top: 1rem;
}

.form-error {
  min-height: 1.3rem;
  margin: 0.8rem 0 0;
  color: var(--danger);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin-bottom: 0.45rem;
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.actions,
.button-row {
  display: flex;
  gap: 0.65rem;
}

.wrap {
  flex-wrap: wrap;
}

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

.temp-card,
.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 32, 30, 0.08);
}

.temp-card {
  padding: 1.15rem;
}

.temp-card h2 {
  margin-bottom: 0.7rem;
}

.temp-value {
  margin-bottom: 0.4rem;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0;
}

.fresh {
  color: var(--primary-strong);
  font-weight: 800;
}

.stale {
  color: #a16207;
  font-weight: 800;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1rem;
}

.panel {
  padding: 1rem;
}

.chart-panel {
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

canvas {
  display: block;
  width: 100%;
  height: 360px;
}

.side-stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.error-list {
  display: grid;
  gap: 0.65rem;
}

.error-item {
  padding: 0.75rem;
  border-radius: 8px;
  background: #fff6f3;
  color: #7a271a;
}

.empty {
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .topbar,
  .layout-grid {
    display: block;
  }

  .actions {
    margin-top: 1rem;
  }

  .chart-panel {
    margin-bottom: 1rem;
  }

  canvas {
    height: 300px;
  }
}
