/* V0.21 tester programme: terms / notice dialogs and the admin panel. Uses the existing style.css tokens. */
.v21-dialog{border:0;border-radius:var(--radius);padding:0;width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-shadow:0 18px 60px #1e344033;color:var(--ink)}
.v21-dialog::backdrop{background:#16263080}
.v21-dialog-form{display:flex;flex-direction:column;gap:14px;padding:22px;max-height:calc(100dvh - 32px);overflow:auto}
.v21-dialog-body{display:flex;flex-direction:column;gap:12px}
.v21-dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.v21-dialog-actions button{min-height:42px;padding:0 18px;border-radius:10px}
.v21-lead{font-size:14px;line-height:1.7}
.v21-terms{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px;font-size:13px;line-height:1.7}
.v21-agree input[type=checkbox]{padding:0;border:0;box-shadow:none;width:18px;height:18px}
.v21-agree{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--teal-soft);font-weight:600;color:var(--ink)}

.v21-admin{display:flex;flex-direction:column;gap:16px}
.v21-admin>.section-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap}
.v21-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.v21-stats .card{padding:14px 16px}
.v21-stats p{color:var(--muted);font-size:12px}
.v21-stats strong{display:block;font-size:24px;font-variant-numeric:tabular-nums;letter-spacing:-.4px}

.v21-trend .section-heading{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.v21-days{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(14,minmax(0,1fr));gap:6px;align-items:end;height:130px}
.v21-days li{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;min-width:0}
.v21-day-bar{display:block;width:100%;max-width:26px;height:var(--h);min-height:2px;border-radius:4px 4px 0 0;background:var(--teal)}
.v21-day-n{font-size:11px;font-variant-numeric:tabular-nums;color:var(--ink)}
.v21-day-d{font-size:10px;color:var(--muted);white-space:nowrap}

.v21-reg-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0 4px}
.v21-reg button[type=submit]{margin-top:12px;min-height:40px;padding:0 18px;border-radius:10px}

.v21-apply{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}
.v21-apply li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:12px}
.v21-apply li>div:first-child{display:flex;flex-direction:column;min-width:0}
.v21-apply span,.v21-table td span{color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.v21-apply small,.v21-table td small{display:block;color:var(--muted);font-size:11px}
.v21-row-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.v21-row-actions button{min-height:34px;padding:0 12px;border-radius:9px;font-size:13px;white-space:nowrap}

.v21-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}
.v21-toolbar input[type=search]{max-width:260px}
.v21-filters{display:flex;gap:6px;flex-wrap:wrap}
.v21-filters button{padding:6px 12px;border-radius:999px;border:1px solid var(--line);font-size:12px;display:inline-flex;gap:6px;align-items:center}
.v21-filters button span{color:var(--muted);font-variant-numeric:tabular-nums}
.v21-filters button.active{background:var(--teal);border-color:var(--teal);color:#fff}
.v21-filters button.active span{color:#ffffffcc}

.v21-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:12px}
.v21-table{width:100%;border-collapse:collapse;font-size:13px;min-width:880px}
.v21-table th{text-align:left;font-size:11px;font-weight:600;color:var(--muted);padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap;background:#fafbfc}
.v21-table td{padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:top;font-variant-numeric:tabular-nums}
.v21-table tbody tr:last-child td{border-bottom:0}
.v21-table td:first-child{min-width:200px}
.v21-table td:first-child strong{display:block}

.v21-pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.v21-ok{background:#e4f3ec;color:#1d6b48}
.v21-warn{background:#fdf1dc;color:#8a5a00}
.v21-off{background:#eef1f4;color:#5b6b76}

.v21-system summary{display:flex;flex-direction:column;gap:2px;cursor:pointer}
.v21-system-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}
.v21-system-grid small{display:block;color:var(--muted)}
.v21-audit{list-style:none;margin:10px 0 0;padding:0;max-height:260px;overflow:auto;font-size:12px}
.v21-audit li{display:flex;gap:10px;padding:4px 0;border-bottom:1px dashed var(--line)}
.v21-audit span{color:var(--muted);white-space:nowrap}

.v21-sort{display:inline-flex;align-items:center;gap:4px;font:inherit;font-size:11px;font-weight:600;color:var(--muted);padding:0;white-space:nowrap}
.v21-sort span{font-size:10px;opacity:.55}
.v21-sort.active{color:var(--ink)}
.v21-sort.active span{opacity:1}
.v21-sort:focus-visible{outline:2px solid #78bbd4;outline-offset:2px;border-radius:4px}
.v21-table td .v21-pill+.v21-pill{margin-top:4px}
.v21-table td .v21-pill{display:block;width:max-content}
.v21-danger{color:#a33a3a}
.v21-dialog button.danger{background:#b5473f;color:#fff}
.v21-modes{border:1px solid var(--line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:8px;margin:0}
.v21-modes legend{font-size:12px;color:#506773;padding:0 4px}
.v21-days-input{flex-direction:row;align-items:center;gap:8px;margin-left:24px}
.v21-days-input input{width:90px}

@media (max-width:760px){
  .v21-stats,.v21-reg-grid,.v21-system-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .v21-days{gap:3px;height:110px}
  .v21-day-d{font-size:9px}
  .v21-days li:nth-child(odd) .v21-day-d{visibility:hidden}
  .v21-apply li{flex-direction:column;align-items:stretch}
  .v21-row-actions{justify-content:flex-start}
  .v21-toolbar input[type=search]{max-width:none}
}
