:root {
  --bg: #edf7f7;
  --bg-accent: radial-gradient(circle at top left, rgba(64, 164, 169, 0.22), transparent 28%), linear-gradient(180deg, #f5fbfb 0%, #eaf6f6 100%);
  --card: rgba(255, 255, 255, 0.95);
  --text: #18202a;
  --muted: #667085;
  --primary: #40a4a9;
  --primary-deep: #18202a;
  --accent: #9bd34f;
  --border: #d7e5e5;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 18px 40px rgba(24, 32, 42, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: var(--bg-accent); color: var(--text); }
.hidden { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card, .card { background: var(--card); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.7); border-radius: 22px; box-shadow: var(--shadow); }
.auth-card { width: 100%; max-width: 460px; padding: 36px; text-align: center; position: relative; overflow: hidden; }
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}
.auth-card h1 { margin-bottom: 8px; font-size: 2.1rem; }
.auth-logo {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 28px;
  margin: 8px auto 16px;
  display: block;
  box-shadow: 0 14px 30px rgba(24, 32, 42, 0.18);
}
.auth-eyebrow { color: var(--primary); margin-bottom: 10px; }
.auth-subtitle { max-width: 320px; margin: 0 auto 8px; }
.auth-footer-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(24,32,42,0.08);
  color: var(--muted);
  font-size: 0.92rem;
}
.stack { display: grid; gap: 12px; }
input, select, textarea, button { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(64,164,169,0.65); box-shadow: 0 0 0 4px rgba(64,164,169,0.12); }
textarea { min-height: 88px; resize: vertical; }
button { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%); color: white; border: none; font-weight: 600; cursor: pointer; box-shadow: 0 10px 22px rgba(64,164,169,0.22); transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease; }
button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(64,164,169,0.24); }
button.secondary, .secondary { background: rgba(255,255,255,0.9); color: var(--text); border: 1px solid var(--border); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; box-shadow: none; }
.small-action { width: auto; padding: 8px 12px; border-radius: 10px; font-size: 0.86rem; }
.error-text { color: var(--danger); min-height: 20px; }
#dashboardView { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #18202a 0%, #10161f 100%); color: white; padding: 28px 22px; display: flex; flex-direction: column; gap: 20px; border-right: 1px solid rgba(255,255,255,0.05); position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar h2 { margin: 0; }
.sidebar-title { font-size: 1.35rem; line-height: 1.1; white-space: nowrap; }
.sidebar p { color: #cbd5e1; }
.brand-block { display: grid; gap: 8px; }
.sidebar-logo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 700; color: #77d5d8; }
.nav-btn { background: transparent; color: white; text-align: left; border: 1px solid rgba(255,255,255,0.08); transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease; }
.nav-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(119,213,216,0.3); transform: translateX(2px); }
.nav-btn.active { background: rgba(64,164,169,0.22); border-color: rgba(155,211,79,0.45); }
.main { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.topbar h1 { margin: 4px 0 6px; font-size: 2rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-chip { padding: 10px 14px; border-radius: 999px; background: rgba(155,211,79,0.18); color: #46611c; font-weight: 700; font-size: 0.85rem; border: 1px solid rgba(155,211,79,0.34); }
.muted { color: var(--muted); }
.metrics-grid, .grid-two { display: grid; gap: 18px; }
.metrics-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.grid-two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 18px; }
.quick-grid { margin-top: 8px; }
.metric-card { padding: 20px; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,255,0.95)); position: relative; }
.metric-card::after {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}
.metric-card h4, .metric-card p { margin: 0; }
.metric-card h4 { color: var(--muted); font-weight: 600; }
.metric-card p { margin-top: 10px; font-size: 1.9rem; font-weight: 800; }
.card { padding: 20px; overflow: hidden; }
.card h3 { margin-top: 0; margin-bottom: 14px; color: #18202a; }
.chart-shell {
  position: relative;
  height: 240px;
  min-height: 240px;
  max-height: 240px;
  overflow: hidden;
}
.card canvas {
  display: block;
  width: 100% !important;
  height: 240px !important;
  max-height: 240px !important;
}
.tab { display: none; }
.tab.active { display: block; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,0.45); border-radius: 14px; overflow: hidden; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.95rem; }
th { background: rgba(64,164,169,0.08); color: #334155; font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.green { background: #dcfce7; color: #166534; }
.badge.yellow { background: #fef3c7; color: #92400e; }
.list { display: grid; gap: 12px; }
.list-item { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: rgba(255,255,255,0.7); }
.pulse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pulse-item { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: rgba(255,255,255,0.72); }
.pulse-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.pulse-value { font-size: 1.2rem; font-weight: 800; }
.compact-form { margin-bottom: 16px; }
.inline-two, .inline-three, .inline-actions, .inline-filters { display: grid; gap: 12px; }
.inline-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-filters { grid-template-columns: 2fr 1fr 1fr; margin-bottom: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 0.94rem; color: var(--muted); }
.checkbox-row input { width: auto; }
.top-gap { margin-top: 16px; }
@media (max-width: 900px) {
  #dashboardView { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 3; height: auto; }
  .sidebar-title { white-space: normal; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .pulse-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px; }
  .inline-two, .inline-three, .inline-actions, .inline-filters { grid-template-columns: 1fr; }
}
