/* --- World Map Matrix (city menu) --- */
.city-map-matrix td.matrix-center {
  border: 2px solid #facc15 !important;
  background: #3b82f6 !important;
  color: #fff;
  font-weight: bold;
}
.city-map-matrix td.matrix-city {
  background: #64748b !important;
  color: #fff;
}
.city-map-matrix td.matrix-empty {
  background: #3bbf3b !important; /* grass green */
  color: #444;
}
/* Stable status area for units page */
.units-status-area {
  min-height: 70px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#unitsMsg {
  min-height: 38px;
  margin-bottom: 4px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

#unitsQueueBar {
  min-height: 32px;
}
/* Stable status area for buildings page */
.buildings-status-area {
  min-height: 70px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#buildingsMsg {
  min-height: 22px;
  margin-bottom: 4px;
}

#buildQueueBar {
  min-height: 32px;
}
.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px;
}

.kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:10px}
.kpi{
  background:#20252d; /* dark grey */
  border:1px solid #323b48;
  border-radius:10px;
  padding:10px;
}
.kpi-title{font-size:12px;color:var(--muted)}
.kpi-value{font-size:24px;font-weight:700}
.ok{color:#22c55e}.nok{color:#ef4444}.warn{color:#f59e0b}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px}
.dot-green{background:#22c55e}.dot-lime{background:#84cc16}.dot-yellow{background:#eab308}.dot-orange{background:#f97316}.dot-red{background:#ef4444}
.bar{height:10px;background:#1e293b;border-radius:999px;overflow:hidden}
.bar > span{display:block;height:100%;background:#22c55e}
pre{
  background:#11151c;
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px;
  max-height:260px;
  overflow:auto;
}

.auth-wrap{
  max-width: 880px;
  margin: 6vh auto;
  padding: 0 12px;
}

.auth-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}

.auth-card{
  padding:16px;
}

.form-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.form-stack label{
  font-size:13px;
  color:var(--muted);
  margin-bottom:4px;
  display:block;
}

.form-stack input,
.form-stack textarea,
.form-stack select{
  width:100%;
  box-sizing:border-box;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--border);
  background:#11151c;
  color:var(--text);
}

.form-stack button{
  margin-top:6px;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--border);
  background:#262c36;
  color:var(--text);
  cursor:pointer;
}

.form-output{
  margin-top:10px;
}

@media (max-width: 900px){
  .auth-grid{ grid-template-columns: 1fr; }
}

.table { width:100%; border-collapse: collapse; }
.table th, .table td { border:1px solid var(--border); padding:8px; text-align:left; }
.table th { background:#20252d; }

.city-page { display: grid; gap: 14px; }
.city-hero h2 { margin: 0; }
.muted { opacity: 0.75; }

.city-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.city-panel {
  border: 1px solid var(--border, #2f3540);
  background: linear-gradient(180deg, #1a1f27, #141922);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.city-main { grid-column: 1 / -1; }
.city-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.city-title-row h3 { margin: 0; font-size: 1.15rem; }
.city-badge {
  background: #2a3342;
  border: 1px solid #3a465a;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
}
.city-coord { margin: 8px 0 6px; font-weight: 600; }

.city-stat label { display: block; opacity: 0.8; margin-bottom: 8px; font-size: 0.85rem; }
.city-stat strong { font-size: 1.2rem; }

.city-debug pre {
  margin-top: 8px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--border, #2f3540);
  border-radius: 10px;
  padding: 10px;
  background: #0f131a;
}

.dashboard-shell {
  padding: 8px;
}

.dashboard-root {
  display: grid;
  gap: 14px;
}

.dbx-loading {
  background: linear-gradient(145deg, #1b2333, #131a28);
  border: 1px solid #31445f;
  border-radius: 12px;
  padding: 14px;
  color: #c8d8ee;
}

.dbx-hero {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #2e415d;
  background: linear-gradient(135deg, #101927 0%, #1c2130 45%, #20294a 100%);
  min-height: 140px;
}

.dbx-hero-bg {
  position: absolute;
  inset: -20% -10% auto auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle at 30% 30%, #ffc85799 0%, #ffc85700 60%);
  pointer-events: none;
}

.dbx-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.dbx-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.dbx-subtitle {
  margin: 6px 0 0 0;
  color: #b5c2d8;
  font-size: 0.95rem;
}

.dbx-status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dbx-controls {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.dbx-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.dbx-actions button,
.dbx-actions select {
  background: #162237;
  color: #dbe7f7;
  border: 1px solid #324b6c;
  border-radius: 8px;
  padding: 6px 10px;
}

.dbx-actions label {
  font-size: 0.86rem;
  color: #b7c9e2;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.dbx-refresh-meta {
  color: #9bb1cf;
  font-size: 0.82rem;
}

.dbx-pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid #3b4d6b;
  background: #1a2436;
}

.dbx-pill.good { color: #9cf2b2; border-color: #2e6d45; }
.dbx-pill.warn { color: #f9e08b; border-color: #786726; }
.dbx-pill.bad { color: #ffb0b0; border-color: #7a2f2f; }

.dbx-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
}

.dbx-kpi {
  background: linear-gradient(165deg, #1a2233, #161b27);
  border: 1px solid #2e3f5b;
  border-radius: 12px;
  padding: 12px;
}

.dbx-kpi-label {
  font-size: 0.8rem;
  color: #9db1cd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dbx-kpi-value {
  margin-top: 4px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #f4f8ff;
}

.dbx-kpi-note {
  margin-top: 3px;
  font-size: 0.82rem;
  color: #8ea4bf;
}

.dbx-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.dbx-panel h3 {
  margin: 0 0 10px 0;
  font-size: 1.02rem;
}

.dbx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dbx-meter {
  margin-top: 7px;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #111a2a;
  border: 1px solid #2c3c57;
}

.dbx-meter.thin {
  height: 8px;
}

.dbx-meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6ed0ff, #7cf07c);
}

.dbx-meter-caption {
  margin-top: 5px;
  color: #8ea4bf;
  font-size: 0.82rem;
}

.dbx-resource-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.dbx-rowlist {
  display: grid;
  gap: 7px;
}

.dbx-rowlist + .dbx-mini {
  margin-top: 12px;
}

.dbx-mini {
  margin: 9px 0 7px 0;
  font-size: 0.86rem;
  color: #a8bdd8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dbx-two-col {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dbx-empty {
  color: #8ea4bf;
  font-size: 0.9rem;
}

.dbx-project-cards {
  display: grid;
  gap: 8px;
}

.dbx-project {
  border: 1px solid #314661;
  border-radius: 10px;
  padding: 10px;
  background: #151f2f;
}

.dbx-project-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.dbx-project-detail {
  margin-top: 2px;
  color: #95abc7;
  font-size: 0.8rem;
}

.dbx-project-score {
  margin-top: 6px;
  color: #f4f8ff;
  font-weight: 800;
}

.dbx-project.api { border-color: #476394; }
.dbx-project.runtime { border-color: #3b7c5e; }
.dbx-project.economy { border-color: #8d6d2b; }

.dbx-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dbx-stat-grid > div {
  background: #151f2f;
  border: 1px solid #2f4462;
  border-radius: 9px;
  padding: 10px;
}

.dbx-stat-grid span {
  display: block;
  color: #95abc7;
  font-size: 0.8rem;
}

.dbx-stat-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.dbx-endpoints {
  display: grid;
  gap: 6px;
}

.dbx-endpoint {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #2d3f59;
  border-radius: 8px;
  padding: 7px 9px;
  background: #141d2c;
}

.dbx-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
}

.dbx-endpoint.up .dbx-dot { background: #22c55e; }
.dbx-endpoint.down .dbx-dot { background: #ef4444; }

.dbx-endpoint-name {
  font-size: 0.88rem;
  color: #d3def0;
}

.dbx-endpoint-status {
  font-family: Consolas, Menlo, monospace;
  color: #9eb4d2;
  font-size: 0.8rem;
}

.dbx-debug summary {
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .dbx-kpis {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 860px) {
  .dbx-grid {
    grid-template-columns: 1fr;
  }

  .dbx-two-col {
    grid-template-columns: 1fr;
  }

  .dbx-kpis {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

html.sidebar-i18n-pending .sidebar .sidebar-section-title,
html.sidebar-i18n-pending .sidebar .sidebar-link-label {
  visibility: hidden;
}