/* Dutchino - shared components for every area (site, learner app, samin): panels, grids, stat cards,
   compact forms, searchable combobox, tables, badges, pager. Author: SPSDEVNIC.NET */
/* building blocks */
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #a92d25; color: var(--white); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); margin-bottom: var(--s5); }
.panel > h2 { font-size: var(--fs-lg); margin-bottom: var(--s4); }
.grid { display: grid; gap: var(--s4); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* stat cards (real numbers only) */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); }
.stat small { color: var(--muted); font-weight: 600; }
.stat b { display: block; font-size: 1.8rem; color: var(--nl-navy); line-height: 1.3; }
.stat span { font-size: var(--fs-xs); color: var(--muted); }

/* forms: compact */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--s3); }
.field label { font-weight: 600; font-size: var(--fs-sm); color: #344054; }
.field .req { color: var(--danger); }
.field input, .field textarea, .field select, .cb-input {
  font: inherit; font-size: var(--fs-sm); padding: 9px 12px; border: 1px solid #cfd8e8; border-radius: 10px; background: var(--surface); color: var(--text); width: 100%;
}
.field input:focus, .field textarea:focus, .cb-input:focus { outline: none; border-color: var(--nl-blue); box-shadow: 0 0 0 3px rgba(33, 70, 139, .15); }
.field.has-error input, .field.has-error textarea, .field.has-error .cb-input { border-color: var(--danger); }
.field .hint { color: var(--muted); font-size: var(--fs-xs); }
.field .err { color: var(--danger); font-size: var(--fs-xs); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; margin-bottom: var(--s3); font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; accent-color: var(--nl-blue); }
.form-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-end; margin-bottom: var(--s4); }
.filters .field { margin: 0; min-width: 180px; }

/* searchable combobox */
.cb { position: relative; }
.cb-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.cb-list { position: absolute; z-index: 25; inset-inline: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; margin: 0; list-style: none; }
.cb-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: var(--fs-sm); }
.cb-list li[aria-selected="true"], .cb-list li:hover { background: var(--delft-50); color: var(--nl-blue); }
.cb-list li.cb-empty { color: var(--muted); cursor: default; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th, .tbl td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { background: #f8fafd; color: #475467; font-weight: 700; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl a { font-weight: 600; text-decoration: none; }
.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--muted); }
.empty .ic { width: 40px; height: 40px; margin: 0 auto var(--s3); color: var(--delft-200); }
.pager { display: flex; gap: var(--s3); align-items: center; justify-content: center; margin-top: var(--s4); font-size: var(--fs-sm); }
.pager a { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.badge-green { background: var(--success-50); color: var(--success); }
.badge-gray { background: #eef1f5; color: #475467; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: start; }

