* { box-sizing: border-box; }
body {
  margin: 0;
  color: #1f2937;
  background: #f4f6f8;
  font-family: Arial, Helvetica, sans-serif;
}
a { color: inherit; text-decoration: none; }
.sidebar {
  background: #102033;
  color: #fff;
  height: 100vh;
  left: 0;
  padding: 22px 16px;
  position: fixed;
  top: 0;
  width: 240px;
}
.brand { font-size: 22px; font-weight: 800; }
.tenant { color: #a7b4c4; font-size: 13px; margin: 6px 0 24px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a {
  border-radius: 6px;
  color: #d7e0eb;
  display: block;
  font-weight: 700;
  padding: 10px 12px;
}
.sidebar a:hover { background: #1e3652; color: #fff; }
.main { margin-left: 240px; padding: 24px; }
.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}
h1 { font-size: 28px; margin: 0; }
.topbar p { color: #64748b; margin: 4px 0 0; }
.panel {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 18px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; }
label { color: #475569; font-size: 12px; font-weight: 800; text-transform: uppercase; }
input, select, textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  padding: 10px 11px;
  width: 100%;
}
textarea { min-height: 82px; resize: vertical; }
.button, button {
  background: #176b54;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  padding: 10px 14px;
}
.button.ghost { background: #e2e8f0; color: #102033; }
.button.danger { background: #b42318; }
.actions { align-items: end; display: flex; gap: 8px; }
.inline-form { align-items: center; display: flex; gap: 8px; }
.inline-form input { min-width: 180px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 100%; }
th, td { border-bottom: 1px solid #e2e8f0; padding: 10px; text-align: left; white-space: nowrap; }
th { background: #f8fafc; color: #475569; font-size: 12px; text-transform: uppercase; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { background: #fff; border: 1px solid #dbe3ec; border-radius: 8px; padding: 16px; }
.metric span { color: #64748b; display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metric strong { display: block; font-size: 26px; margin-top: 8px; }
.login-page { align-items: center; display: flex; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: #fff; border: 1px solid #dbe3ec; border-radius: 8px; max-width: 420px; padding: 24px; width: 100%; }
.error { background: #fee2e2; border-radius: 6px; color: #991b1b; margin-bottom: 12px; padding: 10px; }
.success { background: #dcfce7; border-color: #86efac; color: #166534; }
.help-text { color: #64748b; font-size: 13px; }
.check-field { align-content: center; }
.check-field label { align-items: center; display: flex; gap: 8px; }
.check-field input, .check-option input { width: auto; }
.subcategory-field { margin-top: 18px; }
.check-list {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}
.check-option { align-items: center; border-radius: 5px; display: flex; gap: 8px; padding: 8px; text-transform: none; }
.check-option:hover { background: #f1f5f9; }
.check-option span { display: grid; gap: 2px; }
.check-option small { color: #64748b; font-weight: 400; }
.check-option em { color: #b45309; font-size: 10px; margin-left: auto; }
.wrap-cell { max-width: 420px; white-space: normal; }
.token-panel {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.12);
}
.location-edit-form input { min-width: 120px; }
.filter-grid { grid-template-columns: repeat(6, minmax(130px, 1fr)); }
.report-section-title { margin: 0 0 14px; }
.muted { color: #64748b; }
@media (max-width: 900px) {
  .sidebar { height: auto; position: static; width: auto; }
  .main { margin-left: 0; }
  .grid, .cards, .check-list { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .inline-form.location-edit-form { align-items: stretch; flex-direction: column; }
}
