:root { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; }
body { margin:0; background:#f6f7fb; color:#111; }
.container { max-width:1100px; margin:0 auto; padding:18px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
h1 { margin:8px 0 16px; }
h2 { margin:0 0 12px; }
h3 { margin:12px 0 8px; }
.card { background:#fff; border-radius:16px; padding:16px; box-shadow:0 6px 18px rgba(0,0,0,.06); margin-bottom:14px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns:1fr; } }

label { display:block; font-size:12px; color:#444; margin:10px 0 6px; }
input, select { width:100%; padding:10px; border:1px solid #d9dde8; border-radius:10px; outline:none; }
input:focus, select:focus { border-color:#7b8cff; box-shadow:0 0 0 3px rgba(123,140,255,.15); }

.row { display:flex; gap:10px; align-items:end; flex-wrap:wrap; }
.row > * { flex:1; min-width:180px; }

.btn { padding:10px 12px; border-radius:10px; border:1px solid #d9dde8; background:#fff; cursor:pointer; }
.btn:hover { background:#f2f4ff; }
.btn.primary { background:#3b5bff; border-color:#3b5bff; color:#fff; }
.btn.primary:hover { filter:brightness(.95); }
.btn.success { background:#16a34a; border-color:#16a34a; color:#fff; }
.btn.danger { background:#dc2626; border-color:#dc2626; color:#fff; }
.btn.ghost { background:transparent; }
.hidden { display:none !important; }

.muted { color:#666; }
.small { font-size:12px; }
.center { text-align:center; }

.tabs { display:flex; gap:8px; margin:10px 0 12px; }
.tab { padding:8px 10px; border-radius:10px; border:1px solid #d9dde8; background:#fff; cursor:pointer; }
.tab.active { background:#111; color:#fff; border-color:#111; }

.msg { margin-top:10px; padding:10px; border-radius:10px; background:#f1f5ff; border:1px solid #d8e1ff; }
.msg.error { background:#fff1f1; border-color:#ffd2d2; }

.pill { display:inline-block; padding:6px 10px; border-radius:999px; background:#111; color:#fff; font-size:12px; }

.list { margin-top:10px; display:flex; flex-direction:column; gap:10px; }
.item { border:1px solid #eef0f6; border-radius:12px; padding:10px; background:#fafbff; }
.item b { display:block; margin-bottom:4px; }

.kpis { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
@media (max-width: 900px) { .kpis { grid-template-columns:1fr; } }
.kpi { border:1px solid #eef0f6; border-radius:12px; padding:10px; background:#fafbff; }
.kpiLabel { font-size:12px; color:#555; }
.kpiValue { font-size:22px; font-weight:700; margin-top:4px; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.hidden { display: none; }

.modal-box {
  background: #fff;
  padding: 20px;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
}

.modal-box h3 { margin-top: 0; }

.modal-actions {
  margin-top: 15px;
  text-align: right;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}
.modalCard {
  width: min(920px, 98vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
}
.modalHeader {
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
.hidden { display: none !important; }
.ruleEditor { min-height: 170px; width: 100%; padding: 10px; border:1px solid #d9dde8; border-radius:10px; font: inherit; resize: vertical; }
.ruleEditor:focus { border-color:#7b8cff; box-shadow:0 0 0 3px rgba(123,140,255,.15); outline:none; }
