:root {
  color-scheme: light;
  --bg: #f1f6f5;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5c6b73;
  --accent: #0b6e4f;
  --accent-soft: #dff1e9;
  --border: #d5dde0;
  --danger: #d43f3a;
  --shadow: 0 16px 30px rgba(11, 110, 79, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 20%, #ffffff 0%, #f1f6f5 50%, #e8f1ee 100%);
  min-height: 100vh;
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 360px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 24px;
  font-size: 24px;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.logo-wrap img {
  max-width: 160px;
  height: auto;
}

label {
  display: block;
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 10px 12px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}

button {
  width: 100%;
  padding: 10px 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(11, 110, 79, 0.25);
}

button.ghost {
  width: auto;
  padding: 8px 16px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.alert {
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #ffe4e4;
  color: var(--danger);
  border: 1px solid #f2b8b5;
}

.notice {
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #e6f6ee;
  color: var(--accent);
  border: 1px solid #b8e3d0;
}

.auth-links {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
}

.dashboard-page {
  position: relative;
}

.dashboard-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(11, 110, 79, 0.08), transparent 40%),
    linear-gradient(300deg, rgba(218, 165, 32, 0.08), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.dashboard-page .topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
}

.brand img {
  height: 36px;
  width: auto;
}

.container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

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

.pill {
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.plant-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), #f2b544);
}

.card h2 {
  margin-top: 0;
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  font-size: 22px;
  font-weight: 600;
}

.metric-value.danger {
  color: var(--danger);
}

.metric-unit {
  color: var(--muted);
  font-size: 12px;
}

.metric-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.metric-sub.danger {
  color: var(--danger);
  font-weight: 600;
}

.action {
  display: inline-block;
  margin-top: 12px;
  color: #fff;
  background: var(--accent);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(11, 110, 79, 0.2);
}

.panel {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  background: #fde7cf;
  color: #9b4f00;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

@media (max-width: 640px) {
  .login-card {
    width: 100%;
    margin: 0 16px;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
