/* ── Base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f6f7f9;
  color: #1a1a1a;
  line-height: 1.5;
}
.muted { color: #6b7280; font-size: 0.9rem; }
.error { color: #b00020; min-height: 1.2em; margin: 0.5rem 0 0; font-size: 0.9rem; }
.success { color: #047857; min-height: 1.2em; margin: 0.5rem 0 0; font-size: 0.9rem; }
#toggle-mode { color: #2563eb; text-decoration: none; }
#toggle-mode:hover { text-decoration: underline; }

/* ── Auth (login) ─────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  background: #fff;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 380px;
}
.auth-card h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.auth-card form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.auth-card label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 500; }
.auth-card input {
  padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}
.auth-card input:focus { outline: 2px solid #3b82f6; outline-offset: -1px; border-color: transparent; }
.auth-card button {
  padding: 0.7rem;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}
.auth-card button:hover { background: #1f2937; }
.auth-card button:disabled { background: #9ca3af; cursor: not-allowed; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.brand { font-weight: 600; }
.user-info { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; color: #4b5563; }
.link-btn {
  background: none;
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.link-btn:hover { background: #f3f4f6; }

/* ── Container & sections ─────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.container h1 { margin: 0 0 0.25rem; }
.container h2 { margin: 2rem 0 1rem; font-size: 1.1rem; }

/* ── KPIs ─────────────────────────────────────────────────── */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.kpi {
  background: #fff;
  padding: 1.1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}
.kpi-label { font-size: 0.8rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 1.5rem; font-weight: 600; margin-top: 0.35rem; }

/* ── Dashboard tiles (menu page) ──────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.dash-tile {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.dash-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #c7d2fe;
}
.dash-title { font-weight: 600; font-size: 1.05rem; }
.dash-desc { color: #6b7280; font-size: 0.9rem; flex: 1; }
.dash-cta { color: #2563eb; font-size: 0.9rem; font-weight: 500; margin-top: 0.5rem; }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid #f3f4f6; }
th { background: #f9fafb; font-weight: 600; color: #374151; }
tr:last-child td { border-bottom: none; }
