:root {
  --blue-900: #0b2f5b;
  --blue-800: #104579;
  --blue-700: #145ca8;
  --blue-100: #e8f1fb;
  --blue-50: #f4f8fd;
  --green-700: #187448;
  --green-100: #e7f5ed;
  --amber-700: #8a5708;
  --amber-100: #fff4d9;
  --red-700: #ad2e2e;
  --red-100: #fdeaea;
  --gray-950: #17202e;
  --gray-700: #4b5b6e;
  --gray-600: #667487;
  --gray-500: #7b8797;
  --gray-300: #cbd4df;
  --gray-200: #dce3eb;
  --gray-100: #edf1f5;
  --gray-50: #f6f8fa;
  --white: #ffffff;
  --border: #d7e0e9;
  --focus: rgba(20, 92, 168, 0.18);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--gray-50);
}

body {
  background: var(--gray-50);
  color: var(--gray-950);
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.topbar {
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 32px;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px max(20px, calc((100vw - 1240px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-brand {
  align-items: center;
  color: var(--blue-900);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
  text-decoration: none;
}

.topbar-brand img {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  height: 42px;
  object-fit: contain;
  padding: 2px;
  width: 42px;
}

.topbar-brand span {
  display: grid;
  line-height: 1.15;
}

.topbar-brand strong {
  font-size: 15px;
  font-weight: 700;
}

.topbar-brand small {
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 4px;
}

.topbar nav a,
.link-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--gray-700);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  min-height: 38px;
  padding: 8px 12px;
  text-decoration: none;
}

.topbar nav a:hover,
.link-button:hover {
  background: var(--gray-50);
  color: var(--blue-800);
}

.topbar nav a[aria-current="page"] {
  background: var(--blue-100);
  color: var(--blue-800);
}

.page-shell {
  margin: 0 auto;
  max-width: 1240px;
  padding: 32px 20px 64px;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading-row {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.page-heading h1 {
  color: var(--blue-900);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 4px;
}

.page-heading p,
.login-panel > p {
  color: var(--gray-600);
  font-size: 15px;
  margin: 0;
}

.availability-label {
  align-items: center;
  color: var(--gray-700);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
}

.availability-label::before {
  background: var(--gray-500);
  border-radius: 50%;
  content: "";
  height: 8px;
  width: 8px;
}

.availability-online::before {
  background: var(--green-700);
}

.availability-offline::before {
  background: var(--red-700);
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.search-panel {
  padding: 24px;
}

.search-panel-head,
.form-heading,
.section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.search-panel-head,
.form-heading {
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
  padding-bottom: 16px;
}

.search-panel-head h2,
.form-heading h2,
.section-head h2,
.results-toolbar h2 {
  color: var(--blue-900);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.3;
  margin: 0 0 3px;
}

.search-panel-head p,
.form-heading p,
.section-head p,
.results-toolbar p {
  color: var(--gray-600);
  font-size: 13px;
  margin: 0;
}

.search-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(210px, 1.2fr) minmax(170px, 0.75fr) minmax(210px, 1fr) minmax(170px, 0.8fr);
}

label {
  color: var(--gray-700);
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
}

label small {
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

input,
select {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  color: var(--gray-950);
  height: 42px;
  min-width: 0;
  padding: 9px 11px;
  width: 100%;
}

input::placeholder {
  color: var(--gray-500);
}

input:hover,
select:hover {
  border-color: #aebac8;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px var(--focus);
  outline: 0;
}

.actions-row,
.form-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.search-grid .actions-row {
  border-top: 1px solid var(--gray-100);
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 16px;
}

.primary-button,
.secondary-button,
.danger-button,
.table-button,
.icon-button {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  justify-content: center;
  line-height: 1;
  height: 42px;
  min-height: 42px;
  padding: 10px 15px;
  white-space: nowrap;
}

.primary-button {
  background: var(--blue-700);
  border: 1px solid var(--blue-700);
  color: var(--white);
}

.primary-button:hover {
  background: var(--blue-800);
  border-color: var(--blue-800);
}

.secondary-button {
  background: var(--white);
  border: 1px solid var(--blue-700);
  color: var(--blue-700);
}

.secondary-button:hover {
  background: var(--blue-50);
}

.danger-button {
  background: var(--white);
  border: 1px solid var(--red-700);
  color: var(--red-700);
}

.danger-solid {
  background: var(--red-700);
  color: var(--white);
}

.danger-button:hover {
  background: var(--red-100);
}

.danger-solid:hover {
  background: #8f2424;
}

button:disabled {
  background: var(--gray-200) !important;
  border-color: var(--gray-200) !important;
  color: var(--gray-500) !important;
  cursor: not-allowed;
  opacity: 1;
}

button[aria-busy="true"] {
  cursor: wait;
}

.button-spinner,
.spinner {
  animation: spin 0.75s linear infinite;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  height: 16px;
  margin-right: 8px;
  width: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.notice {
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  font-size: 13px;
  gap: 3px;
  margin-top: 16px;
  padding: 12px 14px;
}

.notice strong {
  font-weight: 650;
}

.notice-warning {
  background: var(--amber-100);
  border-color: #ebcf91;
  color: var(--amber-700);
}

.notice-error {
  background: var(--red-100);
  border-color: #efbcbc;
  color: var(--red-700);
}

.notice-success {
  background: var(--green-100);
  border-color: #afd8c1;
  color: var(--green-700);
}

.notice-info {
  background: var(--blue-50);
  border-color: #bed3e9;
  color: var(--blue-800);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  background: #fffafa;
  border-color: var(--red-700);
}

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(173, 46, 46, 0.14);
}

label .field-error {
  color: var(--red-700);
  font-size: 12px;
  font-weight: 600;
  margin-top: -1px;
}

.results-toolbar {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 28px 0 12px;
}

.result-metrics {
  align-items: center;
  color: var(--gray-600);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0;
}

.result-metrics span {
  border-left: 1px solid var(--gray-300);
  padding: 0 12px;
}

.result-metrics span:first-child {
  border-left: 0;
}

.result-metrics strong {
  color: var(--blue-900);
  font-size: 15px;
}

.progress-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 18px;
}

.progress-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-header strong {
  color: var(--blue-900);
  font-size: 14px;
}

.progress-header p {
  color: var(--gray-600);
  font-size: 12px;
  margin: 2px 0 0;
}

.progress-count {
  color: var(--blue-800);
  font-size: 13px;
  font-weight: 700;
}

.progress-bar {
  background: var(--gray-100);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.progress-bar div {
  background: var(--blue-700);
  height: 100%;
  transition: width 0.2s ease;
  width: 0%;
}

.branch-progress-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  margin-top: 14px;
}

.branch-progress-item {
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
}

.branch-progress-name {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-progress-status {
  border-radius: 4px;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 6px;
  white-space: nowrap;
}

.status-pending { background: var(--gray-100); color: var(--gray-600); }
.status-searching { background: var(--blue-100); color: var(--blue-800); }
.status-done { background: var(--green-100); color: var(--green-700); }
.status-failed { background: var(--red-100); color: var(--red-700); }

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 1000px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
}

th {
  background: var(--blue-50);
  color: var(--blue-900);
  font-size: 12px;
  font-weight: 700;
  padding: 12px 16px;
  position: sticky;
  text-transform: none;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}

td {
  color: var(--gray-950);
  font-size: 13px;
  padding: 14px 16px;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--blue-50);
}

td > strong,
#branchesTable td > strong {
  color: var(--gray-950);
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 2px;
}

td small,
#branchesTable td small {
  color: var(--gray-600);
  display: block;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}

#resultsTable th:nth-child(1) { width: 146px; }
#resultsTable th:nth-child(2) { min-width: 230px; }
#resultsTable th:nth-child(3) { min-width: 280px; }
#resultsTable th:nth-child(4) { width: 146px; }
#resultsTable th:nth-child(5) { width: 120px; }
#resultsTable th:nth-child(6) { width: 120px; }
#resultsTable th:nth-child(7) { width: 116px; }

#branchesTable {
  min-width: 1250px;
}

#branchesTable th:nth-child(1) { width: 72px; }
#branchesTable th:nth-child(2) { width: 150px; }
#branchesTable th:nth-child(3) { width: 180px; }
#branchesTable th:nth-child(4) { width: 190px; }
#branchesTable th:nth-child(5) { width: 160px; }
#branchesTable th:nth-child(6) { width: 210px; }
#branchesTable th:nth-child(7) { width: 280px; }

.client-cell {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.client-cell strong {
  color: var(--gray-950);
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.client-cell small {
  color: var(--gray-600);
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.mini-avatar {
  align-items: center;
  background: var(--blue-100);
  border-radius: 50%;
  color: var(--blue-800);
  display: flex;
  flex: 0 0 36px;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.address-cell {
  color: var(--gray-700);
  line-height: 1.45;
  max-width: 380px;
  white-space: normal;
}

.technical-value,
.code-pill {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.code-pill {
  background: var(--blue-100);
  border-radius: 4px;
  color: var(--blue-900);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  max-width: 140px;
  overflow: hidden;
  padding: 4px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  border-radius: 4px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.badge-blue { background: var(--blue-100); color: var(--blue-800); }
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-red { background: var(--red-100); color: var(--red-700); }
.badge-muted,
.badge-neutral { background: var(--gray-100); color: var(--gray-700); }

.status-stack,
.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-button {
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  font-size: 12px;
  height: 32px;
  min-height: 32px;
  padding: 7px 9px;
}

.table-button:hover {
  background: var(--gray-50);
  border-color: var(--blue-700);
  color: var(--blue-800);
}

.table-button-primary {
  border-color: var(--blue-700);
  color: var(--blue-700);
}

.table-button-danger {
  border-color: #e4b1b1;
  color: var(--red-700);
}

.table-button-danger:hover {
  background: var(--red-100);
  border-color: var(--red-700);
  color: var(--red-700);
}

.table-loading,
.table-error {
  align-items: center;
  color: var(--gray-600);
  display: flex;
  justify-content: center;
  min-height: 120px;
}

.table-error {
  color: var(--red-700);
}

.empty-state {
  align-items: center;
  color: var(--gray-600);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
  padding: 40px 20px;
  text-align: center;
}

.empty-state-mark {
  align-items: center;
  background: var(--blue-100);
  border-radius: 50%;
  color: var(--blue-800);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 48px;
  justify-content: center;
  margin-bottom: 14px;
  width: 48px;
}

.empty-state strong {
  color: var(--blue-900);
  font-size: 16px;
  font-weight: 650;
}

.empty-state span {
  font-size: 13px;
  margin-top: 4px;
  max-width: 460px;
}

.summary-strip {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--gray-600);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0;
  margin-bottom: 20px;
  padding: 12px 16px;
}

.summary-strip span {
  border-left: 1px solid var(--gray-300);
  padding: 0 14px;
}

.summary-strip span:first-child {
  border-left: 0;
  padding-left: 0;
}

.summary-strip strong {
  color: var(--blue-900);
  font-size: 15px;
}

.summary-success strong { color: var(--green-700); }
.summary-danger strong { color: var(--red-700); }

.branch-editor {
  margin-bottom: 20px;
  padding: 24px;
}

.branch-editor form {
  margin: 0 auto;
  max-width: 860px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.form-two-col {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.form-two-col-port {
  grid-template-columns: minmax(0, 1fr) 150px;
}

.check-row {
  align-items: flex-start;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.check-row input {
  flex: 0 0 auto;
  height: 17px;
  margin: 2px 0 0;
  width: 17px;
}

.check-row span {
  display: grid;
  gap: 1px;
}

.check-row strong {
  color: var(--gray-950);
  font-size: 13px;
}

.form-actions {
  border-top: 1px solid var(--gray-200);
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 16px;
}

.branch-list-panel .section-head {
  border-bottom: 1px solid var(--gray-200);
  padding: 18px 20px;
}

.table-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.table-tools input,
.table-tools select {
  height: 42px;
  width: auto;
}

.table-tools input {
  min-width: 210px;
}

.details-dialog,
.confirm-dialog {
  background: var(--white);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(18, 35, 54, 0.2);
  color: var(--gray-950);
  max-height: calc(100vh - 48px);
  max-width: 780px;
  overflow: auto;
  padding: 0;
  width: calc(100% - 32px);
}

.confirm-dialog {
  max-width: 520px;
}

.details-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(15, 29, 45, 0.54);
}

.dialog-head {
  align-items: center;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
}

.dialog-head h2 {
  color: var(--blue-900);
  font-size: 19px;
  line-height: 1.3;
  margin: 1px 0 0;
}

.dialog-eyebrow {
  color: var(--gray-600);
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.icon-button {
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  font-size: 22px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.icon-button:hover {
  background: var(--gray-50);
  color: var(--blue-900);
}

.details-body {
  padding: 22px;
}

.profile-row {
  align-items: center;
  background: var(--blue-50);
  border: 1px solid #d3e3f3;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px;
}

.avatar {
  align-items: center;
  background: var(--blue-100);
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--blue-800);
  display: flex;
  flex: 0 0 68px;
  font-size: 24px;
  font-weight: 700;
  height: 68px;
  justify-content: center;
  overflow: hidden;
  width: 68px;
}

.avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.profile-summary h3 {
  color: var(--blue-900);
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}

.profile-summary p {
  color: var(--gray-600);
  font-size: 12px;
  margin: 2px 0 7px;
}

.detail-sections {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.detail-section {
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
}

.detail-section-wide {
  grid-column: 1 / -1;
}

.detail-section h4 {
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}

.detail-grid {
  display: grid;
  gap: 10px 16px;
  grid-template-columns: 1fr 1fr;
}

.detail-item span {
  color: var(--gray-600);
  display: block;
  font-size: 11px;
  margin-bottom: 2px;
}

.detail-item strong {
  color: var(--gray-950);
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dialog-loading {
  align-items: center;
  color: var(--gray-600);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 240px;
  text-align: center;
}

.dialog-loading .spinner {
  color: var(--blue-700);
  height: 24px;
  margin: 0 0 12px;
  width: 24px;
}

.dialog-loading strong {
  color: var(--blue-900);
  font-size: 14px;
}

.dialog-loading small {
  font-size: 12px;
  margin-top: 3px;
}

.confirm-dialog-body {
  color: var(--gray-700);
  padding: 20px;
}

.confirm-dialog-body p {
  margin: 0 0 20px;
}

.login-body {
  align-items: center;
  background: var(--gray-50);
  display: flex;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 420px);
}

.login-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
}

.login-logo-wrap {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  height: 80px;
  justify-content: center;
  margin-bottom: 18px;
  overflow: hidden;
  width: 80px;
}

.login-logo-wrap img {
  height: 74px;
  object-fit: contain;
  width: 74px;
}

.brand-mark {
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.login-panel h1 {
  color: var(--blue-900);
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 6px;
}

.login-panel .stack-form {
  margin-top: 24px;
}

.login-panel .primary-button {
  margin-top: 4px;
  width: 100%;
}

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .table-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    position: static;
  }

  .topbar nav {
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
  }

  .topbar nav a,
  .link-button {
    flex: 0 0 auto;
  }

  .page-shell {
    padding: 24px 14px 48px;
  }

  .page-heading-row,
  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .page-heading-row .primary-button {
    width: 100%;
  }

  .search-panel,
  .branch-editor {
    padding: 18px;
  }

  .search-grid,
  .form-two-col,
  .form-two-col-port,
  .detail-sections,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .search-grid .actions-row,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-grid .actions-row button,
  .form-actions button {
    width: 100%;
  }

  .result-metrics {
    align-items: flex-start;
    display: grid;
    gap: 4px;
  }

  .result-metrics span {
    border-left: 0;
    padding: 0;
  }

  .summary-strip {
    align-items: flex-start;
    display: grid;
    gap: 5px;
  }

  .summary-strip span,
  .summary-strip span:first-child {
    border-left: 0;
    padding: 0;
  }

  .table-tools {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .table-tools input,
  .table-tools select,
  .table-tools button {
    width: 100%;
  }

  table,
  #branchesTable {
    min-width: 0;
  }

  #resultsTable thead,
  #branchesTable thead {
    display: none;
  }

  #resultsTable,
  #resultsTable tbody,
  #resultsTable tr,
  #resultsTable td,
  #branchesTable,
  #branchesTable tbody,
  #branchesTable tr,
  #branchesTable td {
    display: block;
    width: 100%;
  }

  #resultsTable tr,
  #branchesTable tr {
    border-bottom: 8px solid var(--gray-50);
    padding: 10px 0;
  }

  #resultsTable tr:last-child,
  #branchesTable tr:last-child {
    border-bottom: 0;
  }

  #resultsTable td,
  #branchesTable td {
    border: 0;
    padding: 7px 14px;
  }

  #resultsTable td::before,
  #branchesTable td::before {
    color: var(--gray-600);
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 3px;
  }

  .address-cell {
    max-width: none;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .table-button,
  .result-action {
    width: 100%;
  }

  .detail-section-wide {
    grid-column: auto;
  }

  .details-body {
    padding: 16px;
  }

  .profile-row {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .topbar-brand span {
    max-width: 180px;
  }

  .row-actions {
    grid-template-columns: 1fr;
  }

  .login-body {
    align-items: flex-start;
    padding: 16px;
  }

  .login-panel {
    padding: 24px;
  }
}

/* Administration */

#adminPageNotice {
  margin-bottom: 20px;
}

#adminsTable {
  min-width: 1080px;
}

#adminsTable th:nth-child(1) { min-width: 190px; }
#adminsTable th:nth-child(2) { min-width: 130px; }
#adminsTable th:nth-child(3) { min-width: 150px; }
#adminsTable th:nth-child(4) { width: 100px; }
#adminsTable th:nth-child(5),
#adminsTable th:nth-child(6) { min-width: 165px; }
#adminsTable th:nth-child(7) { width: 110px; }

#adminsTable td:first-child .badge {
  margin-top: 4px;
}

.security-panel {
  margin-top: 20px;
  padding: 24px;
}

.security-fields {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audit-panel {
  margin-top: 20px;
}

.pagination-bar {
  align-items: center;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 20px;
}

.pagination-bar p {
  color: var(--gray-600);
  font-size: 13px;
  margin: 0;
}

.pagination-controls {
  align-items: center;
  display: flex;
  gap: 10px;
}

.pagination-controls .secondary-button {
  height: 36px;
  min-height: 36px;
  padding: 8px 12px;
}

.pagination-controls span {
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 600;
  min-width: 88px;
  text-align: center;
}

#auditTable {
  min-width: 1180px;
}

#auditTable th:nth-child(1) { min-width: 180px; }
#auditTable th:nth-child(2) { min-width: 130px; }
#auditTable th:nth-child(3) { min-width: 145px; }
#auditTable th:nth-child(4) { min-width: 270px; }
#auditTable th:nth-child(5) { min-width: 220px; }
#auditTable th:nth-child(6) { min-width: 130px; }

@media (max-width: 720px) {
  .security-panel {
    padding: 18px;
  }

  .security-fields {
    grid-template-columns: 1fr;
  }

  #adminsTable,
  #auditTable {
    min-width: 0;
  }

  #adminsTable thead,
  #auditTable thead {
    display: none;
  }

  #adminsTable,
  #adminsTable tbody,
  #adminsTable tr,
  #adminsTable td,
  #auditTable,
  #auditTable tbody,
  #auditTable tr,
  #auditTable td {
    display: block;
    width: 100%;
  }

  #adminsTable tr,
  #auditTable tr {
    border-bottom: 8px solid var(--gray-50);
    padding: 10px 0;
  }

  #adminsTable tr:last-child,
  #auditTable tr:last-child {
    border-bottom: 0;
  }

  #adminsTable td,
  #auditTable td {
    border: 0;
    padding: 7px 14px;
  }

  #adminsTable td::before,
  #auditTable td::before {
    color: var(--gray-600);
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 3px;
  }

  .admin-list-panel .row-actions {
    grid-template-columns: 1fr;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .pagination-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
}
