* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #1d1d1f;
}
body.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 20px;
}
.card.login { width: 340px; }
.card.login h1 { font-size: 18px; margin: 0 0 16px; }
.card.login label { display: block; font-size: 12px; color: #6e6e73; margin-bottom: 10px; }
.card.login input { display: block; width: 100%; padding: 8px 10px; font-size: 14px; border: 1px solid #d2d2d7; border-radius: 6px; margin-top: 4px; }
.card.login button { width: 100%; padding: 10px; background: #0a84ff; color: #fff; border: 0; border-radius: 6px; font-size: 14px; cursor: pointer; }
.card.login button:hover { background: #006edc; }
.err { color: #d93025; font-size: 12px; margin: 8px 0 0; min-height: 16px; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px;
  background: #1d1d1f; color: #fff;
  padding: 16px; flex-shrink: 0;
}
.sidebar h1 { font-size: 15px; margin: 0 0 16px; opacity: .9; }
.sidebar nav a {
  display: block; padding: 8px 10px; color: #c7c7cc; border-radius: 6px; text-decoration: none; margin-bottom: 4px; cursor: pointer; font-size: 13px;
}
.sidebar nav a.active, .sidebar nav a:hover { background: #2d2d2f; color: #fff; }
.sidebar .footer { position: absolute; bottom: 16px; font-size: 12px; color: #8e8e93; }

.main { flex: 1; padding: 24px; overflow: auto; }
.main h2 { margin: 0 0 16px; font-size: 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { background: #fff; padding: 16px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.kpi .label { font-size: 12px; color: #6e6e73; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; color: #1d1d1f; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f3; font-size: 13px; }
th { background: #f9f9fb; font-weight: 600; color: #6e6e73; font-size: 12px; }
tr:hover td { background: #f9f9fb; }
td.actions { text-align: right; white-space: nowrap; }

.btn { display: inline-block; padding: 6px 12px; font-size: 12px; border-radius: 5px; border: 1px solid #d2d2d7; background: #fff; cursor: pointer; color: #1d1d1f; margin-left: 6px; }
.btn:hover { background: #f5f5f7; }
.btn.primary { background: #0a84ff; color: #fff; border-color: #0a84ff; }
.btn.primary:hover { background: #006edc; }
.btn.danger { background: #fff; color: #d93025; border-color: #f5c6c1; }
.btn.danger:hover { background: #fef0ee; }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 6px 10px; border: 1px solid #d2d2d7; border-radius: 5px; font-size: 13px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag.ok { background: #e8f5e9; color: #1f7a35; }
.tag.off { background: #fdecea; color: #d93025; }
.tag.cur { background: #fff4e5; color: #b86e00; }

.muted { color: #8e8e93; font-size: 12px; }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal { background: #fff; padding: 20px; border-radius: 10px; min-width: 340px; max-width: 520px; }
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal label { display: block; font-size: 12px; color: #6e6e73; margin-bottom: 10px; }
.modal input, .modal textarea { display: block; width: 100%; padding: 8px 10px; font-size: 13px; border: 1px solid #d2d2d7; border-radius: 6px; margin-top: 4px; font-family: inherit; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.section { margin-bottom: 24px; }
.section h3 { font-size: 14px; margin: 0 0 8px; color: #6e6e73; font-weight: 600; }
