* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  background: #EDF0EE;
  color: #1A2420;
  font-size: 14px;
}

.hidden { display: none !important; }
.full { width: 100%; }
.muted { color: #6E7B75; font-size: 13px; }
code { background: #DFE5E1; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  background: #1A2420;
  color: #DFE5E1;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 22px;
  border-bottom: 1px solid #2A3631;
}

.logo-dot {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #0A6847;
  box-shadow: inset 0 0 0 2px #0A6847, inset 0 0 0 4px #FFFFFF;
}

.logo-name { font-size: 17px; font-weight: 700; color: #FFFFFF; }
.logo-sub { font-size: 11px; color: #9AA59F; }

.nav { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; flex: 1; }

.nav-item {
  background: transparent;
  border: none;
  color: #C9D2CD;
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-item:hover { background: #2A3631; color: #FFFFFF; }
.nav-item.active { background: #0A6847; color: #FFFFFF; font-weight: 600; }

.sidebar-footer { padding-top: 16px; border-top: 1px solid #2A3631; }

.main { flex: 1; padding: 22px 28px; overflow-x: auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h1 { font-size: 22px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.map-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid #C9D2CD;
  border-radius: 10px;
  padding: 3px 6px;
}

.map-switch-lbl {
  font-size: 12px;
  color: #6E7B75;
  font-weight: 600;
  padding: 0 6px;
}

.seg-btn {
  height: 28px;
  padding: 0 11px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #3D4A44;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn:hover { background: #EDF0EE; }
.seg-btn.active { background: #0A6847; color: #FFFFFF; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.stat-val { font-family: "DIN Alternate", "Roboto Condensed", "Helvetica Neue", sans-serif; font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 700; color: #1A2420; margin-top: 6px; }
.stat-val.green { color: #08573B; }
.stat-lbl { font-size: 13px; color: #6E7B75; }

.sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.sys-item {
  background: #F5F7F6;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-ok { background: #E4F1EA; color: #08573B; }
.badge-warn { background: #FFF6D6; color: #7A5A00; }
.badge-bad { background: #FBEAE7; color: #A8321F; }
.badge-slate { background: #DFE5E1; color: #3D4A44; }

.config-list { display: flex; flex-direction: column; gap: 12px; }

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  background: #F5F7F6;
  border-radius: 10px;
  border: 1px solid #DFE5E1;
}

.config-meta { flex: 1; }
.config-label { font-weight: 600; font-size: 14px; }
.config-key { font-size: 12px; color: #6E7B75; margin-top: 2px; }
.config-input { width: 240px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

input, select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #C9D2CD;
  border-radius: 8px;
  font-size: 13px;
  background: #FFFFFF;
}

.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-primary { background: #0A6847; color: #FFFFFF; }
.btn-primary:hover { background: #08573B; }
.btn-warn { background: #F5B800; color: #1A2420; }
.btn-danger { background: #D2412F; color: #FFFFFF; }
.btn:focus-visible, .nav-item:focus-visible, .seg-btn:focus-visible { outline: 2px solid #F5B800; outline-offset: 2px; }
input:focus, select:focus { outline: none; border-color: #0A6847; box-shadow: 0 0 0 3px rgba(10, 104, 71, 0.15); }
.btn-ghost { background: #DFE5E1; color: #2A3631; }
.sidebar .btn-ghost { background: #2A3631; color: #C9D2CD; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid #DFE5E1; vertical-align: middle; }
th { background: #F5F7F6; color: #3D4A44; font-weight: 600; white-space: nowrap; }

.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: #3D4A44; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.login-box, .modal-box {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 26px;
  width: 420px;
  max-width: 92vw;
}

.modal-box { width: 540px; }

.brand-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.login-box input { width: 100%; margin: 16px 0 14px; height: 42px; }
.err-text { color: #DC2626; font-size: 13px; margin-top: 10px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 20px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #3D4A44; font-weight: 600; }
.form-grid .span-2 { grid-column: span 2; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed;
  top: 20px;
  right: 24px;
  background: #1A2420;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 300;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
