/* Matches docs/design_plans/brenda_input_form/admin-panel.html (Phase 1 subset) */
:root {
  --primary: #1f4e88;
  --primary-700: #153a63;
  --primary-050: #eef4fb;
  --primary-100: #dbe7f6;
  --accent-border: #c9dcf2;
  --green: #0f7d54;
  --green-050: #e7f6ef;
  --red: #d1442b;
  --red-050: #fbecea;
  --amber: #b7791f;
  --amber-050: #fbf3e3;
  --blue: #2563eb;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --line: #e6eaf0;
  --line-2: #eef1f6;
  --ink: #1a2432;
  --ink-2: #3b4757;
  --muted: #6b7585;
  --faint: #98a2b3;
  --radius: 12px;
  --radius-sm: 8px;
  --ctl-h: 38px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
  --shadow-up: 0 -2px 10px rgba(16, 24, 40, 0.06);
  --ring: 0 0 0 3px rgba(31, 78, 136, 0.15);
}
* {
  box-sizing: border-box;
}
html {
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.topbar {
  background: var(--primary);
  color: #fff;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.brand-name {
  font-weight: 700;
  font-size: 15.5px;
}
.brand-sub {
  font-size: 11.5px;
  opacity: 0.8;
  margin-top: 1px;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.proto-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.5);
  border-radius: 999px;
  padding: 4px 10px;
}
.admin-chip {
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.admin-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5be59a;
}

.role-banner {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 8px 24px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--primary-050);
  color: var(--primary-700);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 3px 10px;
}

.layout {
  display: flex;
  min-height: calc(100vh - 60px - 37px);
}
.side {
  width: 246px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 0;
  flex-shrink: 0;
}
.side-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 24px;
  margin: 2px 0 10px;
}
.side a {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.side a:hover {
  background: #f3f6fb;
}
.side a.active {
  background: var(--primary-050);
  color: var(--primary-700);
}
.side a .nav-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side a svg {
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
  display: block;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side a.active svg {
  color: var(--primary);
}

.main {
  flex: 1;
  padding: 26px 30px;
  max-width: 1160px;
}
.page {
  display: none;
}
.page.active {
  display: block;
  animation: fade 0.18s ease;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 3px;
  color: var(--ink);
}
.sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.card h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 700;
}
.card .desc {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 16px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
label.fld {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
input,
select,
textarea {
  width: 100%;
  height: var(--ctl-h);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea {
  height: auto;
  padding: 9px 12px;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7585' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.checkline {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.checkline label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  height: auto;
  width: auto;
}
.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.rowbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--faint);
}
.stat .n {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}
.stat .l {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.stat.g::before {
  background: var(--green);
}
.stat.g .n {
  color: var(--green);
}
.stat.r::before {
  background: var(--red);
}
.stat.r .n {
  color: var(--red);
}
.stat.b::before {
  background: var(--blue);
}
.stat.b .n {
  color: var(--blue);
}
.stat.a::before {
  background: var(--amber);
}
.stat.a .n {
  color: var(--amber);
}

.tbl-scroll {
  overflow-x: auto;
  border: 1px solid #ccd4df;
  border-radius: 6px;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 12.5px;
}
th {
  background: #eef1f6;
  text-align: left;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4a5568;
  white-space: nowrap;
  border: 1px solid #d5dbe5;
}
td {
  padding: 4px 10px;
  height: 30px;
  border: 1px solid #e2e7ef;
  color: var(--ink-2);
  vertical-align: middle;
  background: #fff;
}
td.ck {
  text-align: center;
}
.muted-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.b-none {
  background: var(--red-050);
  color: #a1341f;
}
.b-draft {
  background: #e7f0fd;
  color: #1e4d8c;
}
.b-sub {
  background: var(--green-050);
  color: #0f6b48;
}

.hist-card {
  padding: 0;
  overflow: hidden;
}
.hist-list {
  display: flex;
  flex-direction: column;
}
.hist-empty {
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.hist-count {
  display: inline-block;
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}
.hist-toolbar-meta {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.hist-entry {
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
  background: #fff;
}
.hist-entry:last-child {
  border-bottom: none;
}
.hist-entry:hover {
  background: #fafbfd;
}
.hist-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 10px;
}
.hist-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hist-action-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.hist-area-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 6px;
  background: #e8eef8;
  color: #1e4d8c;
}
.hist-area-badge.area-recipients {
  background: #f3e8ff;
  color: #6b21a8;
}
.hist-area-badge.area-submission {
  background: #e6f6ef;
  color: #0f6b48;
}
.hist-area-badge.area-round {
  background: #fff4e5;
  color: #9a3412;
}
.hist-area-badge.area-forms {
  background: #fce7f3;
  color: #9d174d;
}
.hist-when {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  line-height: 1.4;
}
.hist-when strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.hist-summary {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
}
.hist-actor {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hist-actor span {
  color: var(--text);
  font-weight: 500;
}
.hist-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.hist-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-2, #f1f5f9);
  border: 1px solid var(--line);
  color: var(--muted);
}
.hist-chip b {
  color: var(--text);
  font-weight: 600;
}
.hist-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 12px 0 8px;
}
.hist-diff-row {
  display: grid;
  grid-template-columns: minmax(100px, 140px) 1fr auto 1fr;
  gap: 8px 12px;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--line-2, #e8ecf2);
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 6px;
}
.hist-diff-row .hist-field-name {
  font-weight: 600;
  color: var(--text);
}
.hist-diff-row .hist-val-old {
  color: #b42318;
  text-decoration: line-through;
  word-break: break-word;
}
.hist-diff-row .hist-val-new {
  color: #027a48;
  font-weight: 600;
  word-break: break-word;
}
.hist-diff-arrow {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.hist-kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 4px;
  border: 1px solid var(--line-2, #e8ecf2);
  border-radius: 8px;
  overflow: hidden;
}
.hist-kv-table th,
.hist-kv-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.hist-kv-table th {
  width: 28%;
  background: #f8fafc;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hist-kv-table tr:last-child td,
.hist-kv-table tr:last-child th {
  border-bottom: none;
}
.hist-kv-table .val-old {
  color: #b42318;
}
.hist-kv-table .val-new {
  color: #027a48;
  font-weight: 600;
}
.hist-changes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 4px;
  border: 1px solid var(--line-2, #e8ecf2);
  border-radius: 8px;
  overflow: hidden;
}
.hist-changes-table th {
  background: #f1f5f9;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.hist-changes-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.35;
}
.hist-changes-table tr:last-child td {
  border-bottom: none;
}
.hist-changes-table .cell-old {
  color: #b42318;
  max-width: 120px;
  word-break: break-word;
}
.hist-changes-table .cell-new {
  color: #027a48;
  font-weight: 600;
  max-width: 120px;
  word-break: break-word;
}
.hist-more-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 8px;
}
.hist-json-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.savebar {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  margin: 22px -30px -26px;
  padding: 14px 30px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  box-shadow: var(--shadow-up);
}
.btn {
  height: var(--ctl-h);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  text-decoration: none;
}
.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn.ghost:hover {
  border-color: var(--faint);
  background: #fafbfc;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
}
.btn.primary:hover {
  background: var(--primary-700);
}
.btn.green {
  background: var(--green);
  color: #fff;
}
.btn.green:hover {
  background: #0c6a46;
}
.f-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  height: var(--ctl-h);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  font-family: inherit;
}
.f-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.toast.toast-fixed {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: 0.25s;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 80;
}
.toast.toast-fixed.show {
  opacity: 1;
}
.toast.toast-fixed.error {
  background: #7f1d1d;
}

pre.out {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 11px;
  margin-top: 10px;
}
.fd-preview-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
}
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
select.inline {
  width: auto;
  min-width: 180px;
}

/* Matrix preview (grid.js) */
.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.grid th {
  background: #eef1f6;
  text-align: left;
  padding: 6px 8px;
  font-size: 10px;
  text-transform: uppercase;
  border: 1px solid #d5dbe5;
}
.grid td {
  border: 1px solid #e2e8f0;
  padding: 0;
  vertical-align: middle;
  height: auto;
}
.grid td.locked {
  background: #f1f5f9;
  padding: 6px 8px;
  font-weight: 600;
}
.grid td.input select,
.grid td.input input {
  width: 100%;
  border: none;
  padding: 6px 8px;
  background: #fffbeb;
  height: 30px;
}
.grid td.req-empty {
  box-shadow: inset 0 0 0 2px var(--red);
  background: var(--red-050);
}
.grid td.req-empty.locked {
  color: var(--red);
  font-weight: 700;
}
.grid td.req-empty select,
.grid td.req-empty input {
  background: var(--red-050);
}
.grid td.auto {
  background: #f0fdf4;
  padding: 6px 8px;
  color: var(--green);
}

.validation-list {
  margin: 12px 0 0;
  padding: 12px 16px 12px 28px;
  background: var(--red-050);
  border: 1px solid #f5c6c0;
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
}
.validation-list li {
  margin: 4px 0;
}
.workbook-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.workbook-hint {
  color: var(--muted);
  font-size: 12px;
  flex: 1 1 200px;
}

/* BU submission page (signed link) */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.context-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}
.ctx {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.ctx-email {
  flex: 1 1 280px;
}
.ctx .lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}
.ctx .val {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tab {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}
.tab.active {
  border-color: var(--primary);
  background: var(--primary-050);
  color: var(--primary-700);
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
button.primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  height: var(--ctl-h);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.toast.ok {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--green-050);
  color: var(--green);
}
.toast.error:not(.toast-fixed) {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--red-050);
  color: var(--red);
  white-space: pre-wrap;
}

.coverage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.chip.ok {
  background: var(--green-050);
  color: #0f6b48;
  border-color: #b7e4cc;
}
.chip.bad {
  background: var(--red-050);
  color: #a1341f;
  border-color: #f5c4bc;
}
.open-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f0fdf4;
  border: 1px solid #b7e4cc;
  font-size: 13px;
}
.open-result.warn {
  background: #fffbeb;
  border-color: #fcd34d;
}
.mailtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.mailtabs button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.mailtabs button.active {
  background: var(--primary-050);
  border-color: var(--primary);
  color: var(--primary-700);
}
.email-preview-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.success-card {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--green-050);
  border: 1px solid #b7e4cc;
  margin-top: 14px;
}
.success-card h3 {
  margin: 0 0 6px;
  color: #0f6b48;
}
.row-actions-tight {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Keep later action buttons inside the row. A flex td hides them. */
#tbl-status td {
  height: auto;
}
#tbl-status .status-actions {
  min-width: 168px;
  vertical-align: middle;
}
#tbl-status .status-actions .row-actions-tight {
  align-items: center;
}
#tbl-status .status-actions .f-btn {
  height: 28px;
  padding: 0 10px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.toggle {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #e2e8f0;
  position: relative;
  cursor: pointer;
}
.toggle.on {
  background: var(--green);
  border-color: var(--green);
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: 0.15s;
}
.toggle.on::after {
  left: 18px;
}
.info-strip {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .side {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .grid3,
  .stat-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Reset Data styles */
.btn.danger {
  background: var(--red);
  color: #fff;
  border-color: #b53822;
}
.btn.danger:hover:not(:disabled) {
  background: #b53822;
}
.btn.danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Small selection block: empty when unselected, tick mark when selected */
.select-box {
  width: 20px;
  height: 20px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  vertical-align: middle;
}
.select-box:hover {
  border-color: var(--primary);
  background: #f8fafc;
}
.select-box.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.select-box svg {
  display: none;
}
.select-box.checked svg {
  display: block;
}

/* Contextual Reset Action Panel */
.reset-action-panel {
  background: #f8fafc;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.2s ease;
}
.reset-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.reset-badge-selected {
  font-weight: 700;
  font-size: 13px;
  background: var(--primary-100);
  color: var(--primary-700);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent-border);
}

.reset-counts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.reset-count-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reset-count-card .name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.reset-count-card .num {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.reset-count-card.has-deletions {
  background: #fffafa;
  border-color: #fed7d7;
}
.reset-count-card.has-deletions .num {
  color: var(--red);
}

.b-open {
  background: #e0f2fe;
  color: #0369a1;
}
.b-closed {
  background: #f1f5f9;
  color: #475569;
}
.btn-close {
  background: transparent;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-close:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.reset-success-card {
  border-left: 4px solid var(--green);
  background: #fbfdfb;
}
.reset-success-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6f7ec;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.reset-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  color: #166534;
  font-weight: 600;
}

/* Spinner inline hidden fix */
.spinner-inline {
  display: none;
  font-size: 12.5px;
  color: var(--muted);
  align-items: center;
  gap: 6px;
}
.spinner-inline.active {
  display: inline-flex;
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.row-selected td {
  background: var(--primary-050) !important;
}

[hidden] {
  display: none !important;
}
