:root{
  --bg:#f5f6f8;
  --card:#ffffff;
  --text:#1f2430;
  --muted:#6b7280;
  --primary:#2f5bea;
  --border:#e5e7eb;
  --shadow:0 10px 30px rgba(0,0,0,.08);
  --radius:16px;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Segoe UI, system-ui, -apple-system, Arial;
  background:var(--bg);
  color:var(--text);
}
.app{max-width:1100px;margin:28px auto;padding:0 18px}
header{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:18px}
h1{font-size:22px;margin:0}
.muted{color:var(--muted);font-size:13px}
.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:14px}
.toolbar input{
  flex:1;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
table{width:100%;border-collapse:collapse}
th,td{padding:12px 14px;border-bottom:1px solid var(--border);font-size:13px}
th{font-size:12px;color:var(--muted);text-align:left;background:#fafafa}
tr:hover td{background:#fcfcff}
.right{text-align:right}

.btn{
  border:1px solid transparent;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:600;
}
.btn.small{padding:8px 10px;border-radius:10px;font-size:12px}
.btn.primary{background:var(--primary);color:#fff}
.btn.ghost{background:#f3f4f6;color:#111827}
.btn.disabled{background:#e5e7eb;color:#6b7280;cursor:not-allowed}

.backdrop{
  position:fixed;inset:0;
  background:rgba(0,0,0,.35);
  display:flex;align-items:center;justify-content:center;
  padding:18px;
}
.hidden{display:none}
.modal{
  width:min(760px, 96vw);
  background:#fff;
  border-radius:18px;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
  overflow:hidden;
}
th.sortable {
  cursor: pointer;
}
th.sortable:hover {
  color: #2f5bea;
}
.modalHeader{
  display:flex;justify-content:space-between;align-items:flex-start;
  padding:16px 18px;border-bottom:1px solid var(--border);
}
.title{font-size:16px;font-weight:800}
.iconBtn{border:none;background:transparent;font-size:18px;cursor:pointer;color:var(--muted)}
.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  padding:16px 18px;
}
.field{display:flex;flex-direction:column;gap:6px}
.field.full{grid-column:1/-1}
label{font-size:12px;color:var(--muted);font-weight:700}
textarea,input{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font-family:inherit;
  font-size:13px;
}
.chips{display:flex;flex-wrap:wrap;gap:10px}
.chips label,.radios label{font-size:13px;color:var(--text);font-weight:600}
.modalFooter{
  display:flex;align-items:center;gap:12px;
  padding:14px 18px;border-top:1px solid var(--border);
}
.spacer{flex:1}
.spinner{
  width:18px;height:18px;border-radius:50%;
  border:2px solid #d1d5db;border-top-color:var(--primary);
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
