:root{
  --bg:#f3f1ea;
  --card:#ffffff;
  --text:#1b1b1b;
  --muted:#6b6b6b;
  --border:#e2dfd6;
  --green:#1f6f55;
  --red:#a44848;
  --shadow:0 8px 24px rgba(0,0,0,.06);
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
body{ margin:0; font-family:var(--font); background:var(--bg); color:var(--text); }

.topbar{
  position:sticky; top:0; z-index:10;
  background:var(--bg);
  padding:10px 12px;
  display:flex; align-items:center; gap:10px;
  border-bottom:1px solid var(--border);
}
.topbar-actions{ display:flex; gap:10px; margin-inline:auto; }
.topbar-right{ display:flex; align-items:center; gap:10px; }

.container{ max-width:980px; margin:20px auto 60px; padding:0 14px; }
.page-title{ text-align:center; margin:18px 0 20px; font-size:38px; letter-spacing:.5px; }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
  margin:14px 0;
}
.card-title{ font-size:20px; font-weight:700; margin-bottom:12px; }

.label{ display:block; font-size:14px; color:var(--muted); margin-bottom:6px; }

.input{
  width:100%;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  font-size:16px;
  outline:none;
}
.input:focus{ border-color:#b9cbbf; box-shadow:0 0 0 3px rgba(31,111,85,.12); }

.hint{ margin-top:8px; font-size:13px; color:var(--muted); line-height:1.4; }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }

@media (max-width: 720px){
  .grid-2{ grid-template-columns:1fr; }
  .page-title{ font-size:30px; }
  .topbar{ flex-wrap:wrap; }
  .topbar-right{ width:100%; justify-content:flex-end; }
}

.btn{
  border:0;
  padding:12px 16px;
  border-radius:16px;
  font-size:16px;
  cursor:pointer;
  white-space:nowrap;
}
.btn-success{ background:var(--green); color:#fff; }
.btn-danger{ background:var(--red); color:#fff; }
.btn-light{ background:#fff; border:1px solid var(--border); color:var(--text); }

.row-actions{ display:flex; justify-content:flex-start; gap:10px; margin-top:12px; }

.stat{ border:1px solid var(--border); border-radius:18px; padding:16px; background:#fff; }
.stat-label{ font-size:14px; color:var(--muted); margin-bottom:8px; }
.stat-value{ font-size:34px; font-weight:800; }

/* ComboBox */
.combo{ position:relative; }
.combo-list{
  position:absolute;
  top:calc(100% + 8px);
  right:0; left:0;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 18px 30px rgba(0,0,0,.08);
  max-height:320px;
  overflow:auto;
  padding:8px;
  z-index:20;
}
.combo-item{
  width:100%;
  text-align:right;
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  cursor:pointer;
  margin-bottom:8px;
}
.combo-item:last-child{ margin-bottom:0; }
.combo-item-title{ font-size:16px; font-weight:800; }
.combo-item-sub{ font-size:12px; color:var(--muted); margin-top:4px; }
.combo-item.active{ border-color:#b9cbbf; box-shadow:0 0 0 3px rgba(31,111,85,.12); }
.combo-empty{ padding:12px; color:var(--muted); font-size:14px; }

/* Mode row */
.mode-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
  padding:12px;
  border:1px dashed var(--border);
  border-radius:16px;
  background:#fff;
}
.mode-title{ font-weight:800; margin-inline-end:8px; }
.mode-option{ display:flex; align-items:center; gap:8px; font-size:14px; color:var(--text); }
.mode-option input{ transform: scale(1.1); }

/* Derived pills */
.pill-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}
.pill{
  background:#fff;
  border:1px solid var(--border);
  border-radius:999px;
  padding:10px 14px;
  font-size:14px;
}


/* Toggle */
.toggle{ display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px dashed var(--border); border-radius:16px; background:#fff; cursor:pointer; }
.toggle input{ width:18px; height:18px; }
