.setup-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.setup-actions .sa-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 6px 6px 2px;
}

.setup-card .table-wrap {
  border-radius: calc(var(--radius) - 4px);
}

.list-total-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 4px 6px;
}

.list-total-row .chip:empty {
  display: none;
}

.data-table td .row-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: nowrap;
}

.icon-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn-sm:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

html[data-theme="dark"] .icon-btn-sm:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--brand-200);
}

.icon-btn-sm.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-bg);
}

.icon-btn-sm .icon {
  width: 16px;
  height: 16px;
}

.icon-btn-sm[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.setup-table tr.is-deleted td {
  opacity: 0.55;
}

.setup-table tr.is-deleted .t-main {
  text-decoration: line-through;
}

.pill-deleted {
  background: var(--danger-bg);
  color: var(--danger);
}

.pill-current {
  background: var(--gold-soft-bg);
  color: var(--gold-600);
  border: 1px solid rgba(200, 150, 62, 0.4);
}

html[data-theme="dark"] .pill-current {
  color: var(--gold-300);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 2px;
  font-size: var(--fs-small);
  color: var(--muted);
}

.pager .pg-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pager .pg-size {
  min-width: 120px;
}

.pager .pg-size .select-btn {
  min-height: 38px;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.bijoy-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.18s ease;
  margin: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(3, 26, 20, 0.25);
  transition: transform 0.18s ease;
}

.switch:checked {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.switch:checked::after {
  transform: translateX(20px);
}

html[dir="rtl"] .switch:checked::after {
  transform: translateX(-20px);
}

.input-inner-toggle {
  position: relative;
}

.input-inner-toggle .input {
  padding-inline-end: 92px;
}

.inner-toggle {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.switch.switch-sm {
  width: 34px;
  height: 20px;
}

.switch.switch-sm::after {
  width: 14px;
  height: 14px;
}

.switch.switch-sm:checked::after {
  transform: translateX(14px);
}

html[dir="rtl"] .switch.switch-sm:checked::after {
  transform: translateX(-14px);
}

.modal.modal-wide {
  max-width: 1100px;
}

@media (min-width: 1500px) {
  .modal.modal-wide {
    max-width: 1200px;
  }
}

@media (min-width: 1150px) {
  .modal-wide .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.form-grid .field.full {
  grid-column: 1 / -1;
}

.field .select-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.field .select-row .dd {
  flex: 1;
  min-width: 0;
}

.field .select-row .icon-btn-sm {
  width: 44px;
  height: auto;
  min-height: 44px;
}

.field .switch-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 2px;
}

.setup-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 14px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.routine-grid-wrap {
  overflow-x: auto;
  border-radius: calc(var(--radius) - 4px);
}

.routine-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
  min-width: 720px;
}

.routine-grid th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 4px;
  text-align: center;
  white-space: nowrap;
}

.routine-grid td {
  padding: 0;
  vertical-align: top;
}

.routine-grid .rg-period {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding-top: 14px;
  white-space: nowrap;
}

.rg-cell {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 1px dashed var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 7px;
  text-align: start;
  font-size: 12.5px;
  line-height: 1.45;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rg-cell:hover {
  border-color: var(--brand-400);
}

.rg-cell.filled {
  border-style: solid;
  border-color: var(--brand-200);
  background: var(--brand-50);
  color: var(--text);
}

html[data-theme="dark"] .rg-cell.filled {
  background: rgba(29, 132, 104, 0.14);
  border-color: rgba(110, 192, 166, 0.35);
}

.rg-cell .rg-subject {
  display: block;
  font-weight: 700;
  color: var(--brand-800);
}

html[data-theme="dark"] .rg-cell .rg-subject {
  color: var(--brand-200);
}

.rg-cell .rg-teacher {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.rg-cell .rg-time {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-num);
}

.rg-cell .rg-add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--muted);
}

.rg-cell .rg-add .icon {
  width: 18px;
  height: 18px;
}

.routine-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2px 12px;
}

.print-head {
  display: none;
}

.wiz-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.wiz-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  background: var(--surface-2);
}

.wiz-step .wiz-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-num);
}

.wiz-step.active {
  color: var(--brand-800);
  border-color: var(--brand-400);
  background: var(--brand-50);
}

.wiz-step.active .wiz-no {
  background: var(--brand-600);
  color: #ffffff;
}

.wiz-step.done {
  color: var(--brand-700);
}

.wiz-step.done .wiz-no {
  background: var(--brand-100);
  color: var(--brand-700);
}

html[data-theme="dark"] .wiz-step.active {
  color: var(--brand-200);
  background: rgba(29, 132, 104, 0.14);
}

.wiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.wiz-nav-left,
.wiz-nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-bottom: 6px;
}

.lang-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.lang-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand-600);
  cursor: pointer;
}

.lang-check input[type="checkbox"]:disabled {
  cursor: default;
}

.field.lang-hidden {
  display: none;
}

.lang-check-note {
  font-size: var(--fs-cap);
  color: var(--muted);
  margin: 0 0 10px;
}

.profile-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
}

.profile-photo {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex: none;
}

.profile-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-50);
}

.photo-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-preview.contain .photo-preview-img {
  object-fit: contain;
  background: #ffffff;
}

.photo-preview.wide {
  width: 140px;
}

.inst-sec-title {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-800);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.inst-sec-title:first-child {
  margin-top: 2px;
}

.inst-auth-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  background: var(--surface);
}

.inst-auth-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: var(--fs-small);
  color: var(--brand-700);
}

.inst-phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.inst-phone-row .input {
  flex: 1;
}

.photo-preview-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-700);
}

.photo-preview-fallback svg {
  width: 30px;
  height: 30px;
}

.photo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.staff-name-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.staff-name-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.staff-thumb {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--brand-50);
  overflow: hidden;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.staff-thumb-fallback {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-700);
}

.profile-meta {
  flex: 1 1 220px;
  min-width: 0;
}

.profile-meta h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.5;
}

.profile-meta p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 18px;
}

.kv-grid .kv {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.kv-grid .kv-k {
  font-size: var(--fs-cap);
  font-weight: 700;
  color: var(--muted);
}

.kv-grid .kv-v {
  font-size: var(--fs-small);
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (min-width: 1024px) {
  .accordion-profile {
    columns: 2;
    column-gap: 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .accordion-profile .acc-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }

  .accordion-profile .acc-item + .acc-item {
    border-top: 1px solid var(--border);
  }

  .accordion-profile .acc-head {
    pointer-events: none;
  }

  .accordion-profile .acc-head .icon-chev {
    display: none;
  }

  .accordion-profile .acc-body {
    display: block;
  }
}

.doc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.doc-row:last-child {
  border-bottom: none;
}

.doc-row .doc-name {
  flex: 1 1 160px;
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-small);
}

.doc-row .doc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reg-group-title {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--brand-800);
  margin: 12px 0 4px;
  line-height: 1.5;
}

html[data-theme="dark"] .reg-group-title {
  color: var(--brand-200);
}

.date-range-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.date-range-row .f-field {
  min-width: 160px;
  flex: 1 1 160px;
}

.date-range-row .f-field label {
  display: block;
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.seg-toggle {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: var(--surface);
  padding: 3px;
  box-shadow: var(--shadow-soft);
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  padding: 6px 15px;
  cursor: pointer;
  line-height: 1.5;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg-btn.active {
  background: var(--brand-700);
  color: #ffffff;
  box-shadow: 0 4px 12px -4px rgba(11, 79, 62, 0.45);
}

.req-sort {
  min-width: 150px;
}

.merit-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.merit-controls .f-field {
  min-width: 160px;
  flex: 1 1 160px;
}

.merit-controls .f-field label {
  display: block;
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.merit-hint {
  margin: 8px 0 0;
  font-size: var(--fs-cap);
  color: var(--muted);
  line-height: 1.5;
}

.review-title {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--brand-800);
  margin: 0 0 10px;
  line-height: 1.5;
}

html[data-theme="dark"] .review-title {
  color: var(--brand-200);
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.batch-route {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--brand-800);
  line-height: 1.6;
}

html[data-theme="dark"] .batch-route {
  color: var(--brand-200);
}

.batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 6px;
  font-size: var(--fs-cap);
  color: var(--muted);
  line-height: 1.5;
}

.prom-status-filter {
  min-width: 150px;
}

.prom-status-filter label {
  display: block;
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.prom-result-select {
  min-width: 130px;
}

.prom-roll-input {
  width: 90px;
}

.check-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  line-height: 1.5;
}

.check-row:last-child {
  border-bottom: none;
}

.check-row .check-name {
  font-weight: 600;
}

.check-row .check-sub {
  color: var(--muted);
  font-size: var(--fs-cap);
  margin-inline-start: auto;
}

.code-group {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.code-group h5 {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--brand-800);
  margin: 0 0 10px;
  line-height: 1.5;
}

html[data-theme="dark"] .code-group h5 {
  color: var(--brand-200);
}

.code-preview {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--surface-muted, var(--surface));
}

.slip-card {
  max-width: 640px;
  margin: 0 auto;
  border: 2px solid var(--brand-700);
  border-radius: var(--radius);
  background: #ffffff;
  color: #1a1a1a;
  padding: 18px;
}

.slip-head {
  text-align: center;
  border-bottom: 1px solid #dddddd;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.slip-inst {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #0b4f3e;
  line-height: 1.5;
}

.slip-sub {
  font-size: 13px;
  color: #444444;
  line-height: 1.5;
}

.slip-title {
  font-size: 16px;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.5;
}

.slip-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.slip-info {
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
}

.slip-info .kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dotted #dddddd;
  padding-bottom: 4px;
}

.slip-info .kv-k {
  color: #555555;
  font-size: var(--fs-cap);
  font-weight: 600;
}

.slip-info .kv-v {
  font-weight: 600;
  text-align: end;
}

.slip-qr {
  flex: 0 0 auto;
  text-align: center;
}

.slip-qr-text {
  font-size: var(--fs-cap);
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.slip-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #dddddd;
  margin-top: 12px;
  padding-top: 8px;
  font-size: var(--fs-cap);
  color: #555555;
}

.qr-svg {
  display: block;
  margin-inline: auto;
}

@media (max-width: 560px) {
  .slip-body {
    flex-direction: column;
    align-items: center;
  }

  .slip-info {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .setup-table {
    font-size: 13px;
  }

  .setup-table th,
  .setup-table td {
    padding: 6px 8px;
  }

  .setup-actions .btn {
    flex: 1 1 auto;
  }

  .seg-toggle {
    min-width: 0;
    -webkit-overflow-scrolling: touch;
  }

  .seg-btn {
    font-size: 14px;
    padding: 5px 12px;
  }

  .seg-toggle::-webkit-scrollbar {
    display: none;
  }

  .pager {
    justify-content: center;
    text-align: center;
  }

  .pager .pg-group {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-width: none;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    padding: 16px 16px 20px;
  }

  .modal.modal-wide {
    max-width: none;
  }

  .modal .input,
  .modal .select-btn {
    min-height: 46px;
    font-size: 16px;
  }

  .modal .field {
    margin-bottom: 10px;
  }

  .modal-actions,
  .wiz-nav {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding-top: 10px;
    margin-top: 8px;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100dvh - 20px);
    padding: 12px 18px 14px;
  }

  .modal-head {
    margin-bottom: 8px;
  }

  .modal-head h3 {
    font-size: 17px;
  }

  .modal .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2px 16px;
  }

  .modal .field {
    margin-bottom: 8px;
  }

  .modal .field label {
    margin-bottom: 3px;
    font-size: 12.5px;
  }

  .modal .input,
  .modal .select-btn {
    padding: 7px 11px;
    min-height: 38px;
  }

  .modal-actions,
  .wiz-nav {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding-top: 8px;
    margin-top: 6px;
  }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .drawer-backdrop,
  .filterbar,
  .setup-actions,
  .pager,
  .toast-wrap,
  .modal-backdrop,
  .install-popup,
  .kbd-tip,
  .row-actions,
  .routine-hint,
  .profile-actions,
  .wiz-nav,
  .doc-actions,
  .date-range-row,
  .reg-back-row,
  .seg-toggle,
  .merit-controls,
  .merit-hint,
  .review-card,
  .prom-result-select,
  .prom-roll-input,
  .prom-status-filter {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  .app-shell {
    display: block;
  }

  .main-col {
    margin: 0 !important;
    padding: 0 !important;
  }

  .content {
    padding: 0 !important;
  }

  .setup-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .print-head {
    display: block;
    text-align: center;
    margin-bottom: 14px;
  }

  .print-head .ph-inst {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: #0b4f3e;
  }

  .print-head .ph-sub {
    font-size: 13px;
    color: #444444;
  }

  .print-head .ph-title {
    font-size: 16px;
    font-weight: 700;
    margin-top: 6px;
  }

  .data-table th,
  .data-table td {
    border: 1px solid #cccccc;
  }

  .data-table .col-p2,
  .data-table .col-p3 {
    display: table-cell !important;
  }

  .data-table .t-sub-mobile {
    display: none !important;
  }

  .routine-grid {
    border-spacing: 0;
  }

  .routine-grid th,
  .routine-grid td {
    border: 1px solid #cccccc;
    padding: 4px;
  }

  .rg-cell {
    border: none;
    background: transparent;
    min-height: 0;
  }

  .rg-cell .rg-add {
    display: none;
  }
}

.att-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.att-toolbar .f-field {
  min-width: 170px;
}

.att-toolbar .f-field label {
  display: block;
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.att-toolbar .att-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-inline-start: auto;
}

.att-save-bottom {
  display: none;
}

@media (max-width: 820px) {
  .att-save-bottom {
    display: flex;
    margin-top: 12px;
  }

  .att-save-bottom .btn {
    flex: 1;
    min-height: 48px;
  }
}

.att-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.att-summary:not(:empty) {
  margin-bottom: 14px;
}

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}

.att-chip b {
  font-family: var(--font-num);
  font-size: var(--fs-body);
  color: var(--text);
}

.att-chip.chip-present b {
  color: var(--brand-700);
}

.att-chip.chip-absent b {
  color: var(--danger);
}

.att-chip.chip-late b {
  color: var(--gold-600);
}

html[data-theme="dark"] .att-chip.chip-present b {
  color: var(--brand-300);
}

html[data-theme="dark"] .att-chip.chip-late b {
  color: var(--gold-300);
}

.att-status-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
  flex: none;
}

.att-st-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  padding: 6px 11px;
  cursor: pointer;
  line-height: 1.5;
  white-space: nowrap;
}

.att-st-btn + .att-st-btn {
  border-inline-start: 1px solid var(--border);
}

.att-st-btn:hover {
  background: var(--surface-2);
}

.att-st-btn.active-present {
  background: var(--brand-600);
  color: #ffffff;
}

.att-st-btn.active-absent {
  background: var(--danger);
  color: #ffffff;
}

.att-st-btn.active-late {
  background: var(--gold-500);
  color: #ffffff;
}

.att-st-btn.active-leave {
  background: var(--muted);
  color: #ffffff;
}

.att-st-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.att-qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
}

.att-qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.att-qr-row .input {
  flex: 1 1 200px;
}

.att-qr-title {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--brand-800);
  margin: 0 0 8px;
  line-height: 1.5;
}

html[data-theme="dark"] .att-qr-title {
  color: var(--brand-200);
}

.att-qr-hint {
  margin: 7px 0 0;
  font-size: var(--fs-cap);
  color: var(--muted);
  line-height: 1.5;
}

.att-time-input {
  width: 118px;
  min-height: 36px;
  padding: 5px 9px;
}

.att-grid-wrap {
  overflow-x: auto;
  border-radius: calc(var(--radius) - 4px);
}

.att-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 12.5px;
}

.att-grid th,
.att-grid td {
  border: 1px solid var(--border);
  padding: 4px 3px;
  text-align: center;
  white-space: nowrap;
  font-family: var(--font-num);
}

.att-grid thead th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--muted);
  font-size: 11.5px;
}

.att-grid td.att-name-cell,
.att-grid th.att-name-cell {
  text-align: start;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text);
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  min-width: 150px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-grid thead th.att-name-cell {
  background: var(--surface-2);
  z-index: 1;
}

.att-grid td.att-total-cell {
  font-weight: 700;
  background: var(--surface-2);
}

.att-grid td.att-holiday,
.att-grid th.att-holiday {
  background: var(--gold-soft-bg);
}

.att-mark-present {
  color: var(--brand-700);
  font-weight: 700;
}

.att-mark-absent {
  color: var(--danger);
  font-weight: 700;
}

.att-mark-late {
  color: var(--gold-600);
  font-weight: 700;
}

.att-mark-leave {
  color: var(--muted);
  font-weight: 700;
}

html[data-theme="dark"] .att-mark-present {
  color: var(--brand-300);
}

html[data-theme="dark"] .att-mark-late {
  color: var(--gold-300);
}

.att-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: var(--fs-cap);
  color: var(--muted);
  line-height: 1.5;
}

.att-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2px 14px;
}

.att-self-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.att-self-status {
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.5;
}

.att-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 820px) {
  .att-status-group {
    flex-wrap: nowrap;
  }

  .att-st-btn {
    padding: 7px 8px;
    font-size: 12px;
  }

  .att-grid {
    min-width: 640px;
  }

  .att-grid td.att-name-cell,
  .att-grid th.att-name-cell {
    min-width: 120px;
    max-width: 150px;
  }
}

@media print {
  .pr-att-grid {
    font-size: 9.5px;
  }

  .pr-att-grid .pr-att-holiday {
    background: #eeeeee;
  }

  .pr-att-grid th,
  .pr-att-grid td {
    padding: 2px 1px;
    text-align: center;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .pr-att-grid td.pr-att-name,
  .pr-att-grid th.pr-att-name {
    text-align: start;
  }

  .pr-att-grid td.pr-att-total {
    font-weight: 700;
  }

  .att-toolbar,
  .att-summary,
  .att-qr-card,
  .att-save-bottom,
  .att-legend,
  .att-self-row,
  .att-status-group {
    display: none !important;
  }
}

.status-pill.info {
  background: var(--warning-bg);
  color: var(--warning);
}

.prog-mini {
  width: 56px;
  min-width: 0;
  padding: 6px 6px;
  text-align: center;
}

.prog-lesson {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.prog-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 10px;
  font-size: var(--fs-small);
  color: var(--text);
}

.prog-para-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 12px 0 10px;
}

.prog-para-btn {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-num);
  font-size: var(--fs-body);
  font-weight: 700;
  cursor: pointer;
}

.prog-para-btn:hover:not([disabled]) {
  border-color: var(--brand-400);
}

.prog-para-btn.ongoing {
  background: var(--gold-soft-bg);
  border-color: var(--gold-400);
  color: var(--gold-600);
}

.prog-para-btn.done {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #ffffff;
}

.prog-para-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.prog-legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-inline-end: 4px;
  vertical-align: -1px;
}

.prog-legend-dot.ongoing {
  background: var(--gold-soft-bg);
  border-color: var(--gold-400);
}

.prog-legend-dot.done {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.prog-rev-block {
  margin-bottom: 14px;
}

.prog-rev-block strong {
  display: block;
  margin-bottom: 6px;
}

.prog-rev-day {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.prog-rev-day > span {
  min-width: 76px;
  font-weight: 700;
  font-size: var(--fs-small);
  padding-top: 4px;
}

.prog-rev-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.prog-audio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.prog-audio-row span {
  font-size: var(--fs-small);
  color: var(--muted);
}

.dash-prog-list {
  display: flex;
  flex-direction: column;
}

.dash-prog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-small);
}

.dash-prog-row:last-child {
  border-bottom: 0;
}

.dash-prog-row b {
  font-family: var(--font-num);
}

@media (max-width: 820px) {
  .prog-para-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .prog-mini {
    width: 50px;
  }
}

.exam-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.exam-picker-row .f-field {
  flex: 1 1 200px;
  min-width: 160px;
}

.exam-picker-row .f-field label,
.exam-grade-controls .f-field label,
.exam-seat-filter label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  line-height: 1.5;
}

.exam-subcard {
  margin-top: 12px;
}

.exam-subcard-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.exam-subcard-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.exam-subcard-body {
  padding: 12px 14px;
}

.exam-subcard-body .setup-actions,
.exam-subcard-body .setup-card {
  margin: 0;
}

.exam-note {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.6;
  margin: 10px 0;
}

.exam-opt-block {
  margin-top: 14px;
}

.exam-opt-block:first-child {
  margin-top: 0;
}

.exam-opt-block h5 {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
}

.exam-opt-btn {
  flex: 0 0 auto;
}

.exam-opt-btn .btn {
  min-height: 42px;
}

.exam-grade-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 4px;
}

.exam-grade-controls .f-field {
  flex: 0 1 auto;
}

.exam-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.exam-seat-filter {
  min-width: 180px;
}

.exam-admit-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.exam-ac-preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exam-ac {
  container-type: inline-size;
  position: relative;
  width: 100%;
  border: 2px solid #7b1e3a;
  outline: 1px solid #7b1e3a;
  outline-offset: 3px;
  border-radius: 8px;
  background: #fffdf5;
  color: #1a1a1a;
  padding: 3.5cqw 4cqw 3cqw;
  box-sizing: border-box;
  font-family: var(--font-body);
  overflow: hidden;
}

.exam-ac-head {
  display: flex;
  align-items: center;
  gap: 3cqw;
  border-bottom: 2px solid #7b1e3a;
  padding-bottom: 1.6cqw;
}

.exam-ac-emblem {
  width: 11cqw;
  height: 11cqw;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #7b1e3a;
  border-radius: 50%;
  color: #7b1e3a;
  background: #fdf3e3;
  overflow: hidden;
}

.exam-ac-emblem svg,
.exam-ac-emblem img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.exam-ac-inst {
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}

.exam-ac-inst-name {
  font-family: var(--font-display);
  font-size: 4.6cqw;
  font-weight: 800;
  line-height: 1.35;
  color: #7b1e3a;
}

.exam-ac-branch {
  font-size: 2.6cqw;
  font-weight: 700;
  line-height: 1.4;
  color: #444444;
}

.exam-ac-addr {
  font-size: 2.3cqw;
  line-height: 1.45;
  color: #555555;
}

.exam-ac-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 1cqw 3cqw;
  align-items: center;
  justify-content: space-between;
  background: #7b1e3a;
  color: #ffffff;
  border-radius: 4px;
  padding: 1cqw 2.5cqw;
  margin-top: 1.8cqw;
}

.exam-ac-doc {
  font-family: var(--font-display);
  font-size: 3.4cqw;
  font-weight: 800;
  line-height: 1.4;
}

.exam-ac-meta {
  font-size: 2.2cqw;
  line-height: 1.45;
}

.exam-ac-body {
  display: flex;
  gap: 3.5cqw;
  margin-top: 2.2cqw;
}

.exam-ac-photo {
  flex: 0 0 auto;
  width: 17cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2cqw;
}

.exam-ac-photo-box {
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1.5px dashed #7b1e3a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2cqw;
  color: #777777;
  text-align: center;
  overflow: hidden;
  background: #ffffff;
}

.exam-ac-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exam-ac-qr svg {
  width: 13cqw;
  height: 13cqw;
  display: block;
}

.exam-ac-info {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8cqw 3cqw;
  align-content: start;
  min-width: 0;
}

.exam-ac-row {
  display: flex;
  gap: 1.5cqw;
  font-size: 2.5cqw;
  line-height: 1.5;
  border-bottom: 1px dotted #cbb;
  padding: 0.4cqw 0;
}

.exam-ac-row span {
  flex: 0 0 auto;
  color: #666666;
}

.exam-ac-row strong {
  font-weight: 700;
  min-width: 0;
}

.exam-ac-rules {
  margin-top: 2cqw;
  border: 1px solid #d8c9a3;
  border-radius: 4px;
  padding: 1.4cqw 2cqw;
  background: #fdf8ec;
}

.exam-ac-rules-title {
  font-weight: 700;
  font-size: 2.4cqw;
  line-height: 1.5;
  color: #7b1e3a;
  margin-bottom: 0.6cqw;
}

.exam-ac-rule {
  display: flex;
  gap: 1.2cqw;
  font-size: 2.2cqw;
  line-height: 1.55;
}

.exam-ac-sign {
  display: flex;
  justify-content: space-between;
  gap: 4cqw;
  margin-top: 3.5cqw;
}

.exam-ac-sign-box {
  width: 34cqw;
  text-align: center;
  font-size: 2.3cqw;
  line-height: 1.5;
}

.exam-ac-sign-line {
  border-top: 1.5px solid #333333;
  margin-bottom: 0.8cqw;
}

.print-bw-mode .exam-ac {
  border-color: #000000;
  outline-color: #000000;
  background: #ffffff;
}

.print-bw-mode .exam-ac-head {
  border-bottom-color: #000000;
}

.print-bw-mode .exam-ac-emblem {
  border-color: #000000;
  color: #000000;
  background: #ffffff;
}

.print-bw-mode .exam-ac-inst-name {
  color: #000000;
}

.print-bw-mode .exam-ac-banner {
  background: #ffffff;
  color: #000000;
  border: 1.5px solid #000000;
}

.print-bw-mode .exam-ac-photo-box {
  border-color: #000000;
}

.print-bw-mode .exam-ac-rules {
  background: #ffffff;
  border-color: #999999;
}

.print-bw-mode .exam-ac-rules-title {
  color: #000000;
}

.res-grid td {
  vertical-align: middle;
}

.res-marks-input {
  width: 88px;
  min-height: 38px;
  text-align: center;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.res-total-cell {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--brand-800);
  white-space: nowrap;
}

html[data-theme="dark"] .res-total-cell {
  color: var(--brand-300);
}

.res-total-invalid {
  color: var(--danger);
}

.res-layout-field {
  min-width: 180px;
}

.res-layout-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  line-height: 1.5;
}

.res-ms-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 10px 4px;
}

.res-search-wrap {
  flex: 1 1 260px;
  max-width: 420px;
}

.pub-card {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.pub-card-head {
  text-align: center;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.pub-inst {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

html[lang="ar"] .pub-inst {
  font-family: var(--font-ar);
}

.pub-exam {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.5;
}

.pub-student {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  margin-bottom: 10px;
}

.pub-student-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.pub-student-meta {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.pub-subjects th,
.pub-subjects td {
  text-align: center;
}

.pub-summary {
  margin-top: 12px;
}

.pub-card .exam-note {
  margin-top: 12px;
  margin-bottom: 0;
}

.acct-code-big {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  color: var(--text);
  padding: 14px 0 6px;
}
.acct-code-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 4px 0 0;
}
.acct-subsection {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.acct-subsection h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--text);
}

.bp-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}
.bp-overwrite {
  padding-bottom: 8px;
}
.bp-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.6;
}
.bp-drop {
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.bp-drop .icon {
  width: 30px;
  height: 30px;
}
.bp-drop:hover,
.bp-drop.drag {
  border-color: var(--brand-600);
  color: var(--brand-700);
  background: var(--brand-50);
}
html[data-theme="dark"] .bp-drop:hover,
html[data-theme="dark"] .bp-drop.drag {
  background: var(--brand-900);
  color: var(--brand-100);
}
.bp-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.bp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  max-height: 46vh;
  overflow: auto;
  padding: 2px;
}
.bp-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
  padding: 26px 10px;
}
.bp-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
}
.bp-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
}
.bp-fname {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bp-candidates {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.bp-remove {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bp-progress {
  margin: 12px 0 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bp-progress .progress {
  flex: 1;
}
.bp-progress-text {
  font-size: var(--fs-small);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.bp-report {
  margin-top: 12px;
}
.bp-report h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text);
}
.bp-report-summary {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--text);
}
@media (max-width: 640px) {
  .bp-grid {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    max-height: 40vh;
  }
  .bp-thumb {
    height: 100px;
  }
}
.sync-guide-list { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.6; }
.roles-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.roles-toolbar .roles-search { flex: 1 1 220px; max-width: 360px; }
.perm-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; font-weight: 700; color: var(--brand-700); font-size: var(--fs-body); }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.perm-row:last-child { border-bottom: none; }
.perm-row .perm-name { flex: 1; min-width: 0; }
.perm-row .perm-key { color: var(--muted); font-size: var(--fs-small); }
.perm-row .perm-state { display: inline-flex; align-items: center; gap: 6px; }
.perm-row .perm-locked { color: var(--muted); font-size: var(--fs-small); display: inline-flex; align-items: center; gap: 4px; }
.perm-effective { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); flex-shrink: 0; }
.perm-effective.on { background: var(--brand-700); border-color: var(--brand-700); color: #ffffff; }
.seg-mini { padding: 2px; }
.seg-mini .seg-btn { padding: 3px 10px; font-size: var(--fs-small); }
.seg-mini .seg-btn.seg-grant.active { background: #1d7a4f; box-shadow: none; }
.seg-mini .seg-btn.seg-deny.active { background: #b3261e; box-shadow: none; }
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.branch-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px; box-shadow: var(--shadow-soft); }
.branch-card .branch-head { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.branch-card .branch-name { font-weight: 700; font-size: var(--fs-body); }
.branch-card .branch-meta { color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.branch-card .branch-counts { display: flex; gap: 14px; margin: 10px 0; flex-wrap: wrap; }
.branch-card .branch-counts .bc { text-align: center; }
.branch-card .branch-counts .bc b { display: block; font-size: 1.05rem; }
.branch-card .branch-counts .bc span { color: var(--muted); font-size: var(--fs-small); }
.branch-card .branch-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.branch-card.inactive { opacity: 0.65; }
.chip-primary { display: inline-flex; align-items: center; gap: 4px; background: #fdf3d7; color: #8a6d1a; border: 1px solid #e8d48a; border-radius: 999px; padding: 1px 8px; font-size: var(--fs-small); font-weight: 700; }
html[data-theme="dark"] .chip-primary { background: #3a3319; color: #e8d48a; border-color: #6b5d24; }
.roles-pickers { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.roles-pickers .field { flex: 1 1 240px; margin: 0; }
