:root {
  --dark-red: #4a0d10;
  --deep-red: #5c1114;
  --bright-red: #7a1519;
  --accent-red: #a01f24;
  --gold: #f2b705;
  --gold-hover: #ffce2e;
  --sidebar-bg: #3f0b0e;
  --text-light: #f5f5f5;
  --text-muted: #d9b9ba;
  --card-bg: #ffffff;
  --label-color: #555;
  --value-color: #111;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--dark-red);
  color: var(--text-light);
}

.sprite {
  display: none;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 12px;
  height: 12px;
}

.icon-lg {
  width: 30px;
  height: 30px;
  stroke-width: 1.4;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  background: var(--bright-red);
  height: 56px;
  border-bottom: 3px solid var(--accent-red);
}

.topbar-brand {
  width: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 100%;
  background: var(--accent-red);
}

.brand-name {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}

.hamburger {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.topbar-title {
  flex: 1;
  padding-left: 24px;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--gold);
  font-weight: bold;
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  height: 100%;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  height: 100%;
  background: none;
  border: none;
  font-family: inherit;
  color: var(--gold);
  font-weight: bold;
  font-size: 13px;
}

.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(242, 183, 5, 0.5);
  border-radius: 3px;
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
}

.topbar-logout:hover {
  background: var(--gold);
  color: var(--deep-red);
  border-color: var(--gold);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* Body layout */
.body {
  flex: 1;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  padding: 18px 0;
  flex-shrink: 0;
}

.menu-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 18px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
}

.menu-item .icon {
  color: var(--gold);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.menu-item.active {
  background: var(--gold);
  color: #3f0b0e;
  font-weight: bold;
}

.menu-item.active .icon {
  color: #3f0b0e;
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
  background: var(--dark-red);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 40px;
  border-bottom: 4px solid var(--accent-red);
  min-width: 0;
}

.profile-photos {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.profile-photo {
  position: relative;
  width: 110px;
  height: 130px;
  min-width: 110px;
  max-width: 110px;
  max-height: 130px;
  background: #fff;
  border: 1px solid #ccc;
  flex: 0 0 110px;
  overflow: hidden;
  box-sizing: border-box;
}

.profile-photo[hidden] {
  display: none !important;
}

.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 3px 4px;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.6px;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  background: rgba(63, 11, 14, 0.78);
  pointer-events: none;
}

/* Real photo must always fill the frame, never use intrinsic image size */
.profile-photo-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 110px !important;
  height: 130px !important;
  max-width: 110px !important;
  max-height: 130px !important;
  object-fit: cover;
  object-position: center top;
  display: block;
  cursor: default;
  z-index: 1;
}

.profile-photo-img[hidden] {
  display: none !important;
  visibility: hidden !important;
}

.profile-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.photo-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: #b8b8b8;
  font-size: 28px;
  z-index: 0;
}

.photo-placeholder[hidden] {
  display: none !important;
}

/* Application page status panels */
.app-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  padding: 40px 24px;
  color: var(--text-muted);
  text-align: center;
}

.app-status[hidden] {
  display: none !important;
}

.app-status .empty-title {
  color: var(--gold);
}

.app-status .empty-text {
  color: var(--text-muted);
  max-width: 360px;
}

.app-status-error .empty-title {
  color: #ffb4b4;
}

.app-status .search-spinner {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: var(--gold);
}

.action-btn-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.photo-badge {
  position: absolute;
  bottom: -6px;
  left: 8px;
  color: var(--gold);
  background: var(--dark-red);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.profile-name {
  font-size: 26px;
  color: var(--gold);
  letter-spacing: 1px;
}

.content-inner {
  display: flex;
  gap: 24px;
  padding: 24px 40px 60px;
  align-items: flex-start;
}

/* Card */
.card {
  flex: 1;
  background: var(--card-bg);
  color: var(--value-color);
  padding: 28px 60px;
  border-radius: 2px;
}

.row {
  display: flex;
  padding: 3px 0;
  font-size: 13px;
}

.label {
  width: 200px;
  text-align: right;
  padding-right: 16px;
  color: var(--label-color);
  flex-shrink: 0;
}

.value {
  margin: 0;
  font-weight: bold;
  color: var(--value-color);
}

.section-title {
  text-align: center;
  font-size: 13px;
  font-weight: normal;
  color: #666;
  letter-spacing: 1px;
  margin: 22px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}

/* Actions */
.actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 200px;
  flex-shrink: 0;
}

.action-btn {
  background: var(--deep-red);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: bold;
  font-size: 14px;
  line-height: 1.5;
  padding: 20px 10px;
  cursor: pointer;
  border-radius: 2px;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.action-btn:hover {
  background: var(--gold);
  color: var(--deep-red);
}

.action-sub {
  font-weight: normal;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 820px) {
  .body {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .content-inner {
    flex-direction: column;
    padding: 20px;
  }
  .card {
    padding: 20px;
  }
  .actions {
    width: 100%;
    flex-direction: row;
  }
  .action-btn {
    flex: 1;
  }
  .label {
    width: 140px;
  }
}

/* ==========================================================================
   Login / auth screens
   ========================================================================== */

.auth-body {
  background: radial-gradient(
      circle at 50% 0%,
      var(--bright-red) 0%,
      var(--dark-red) 55%,
      #2c070a 100%
    )
    fixed;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.auth-header {
  background: var(--sidebar-bg);
  border-bottom: 3px solid var(--gold);
  padding: 22px 30px;
  text-align: center;
}

.auth-brand {
  display: block;
  font-size: 26px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 0.5px;
}

.auth-subtitle {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold);
  font-weight: bold;
}

.auth-body-inner {
  padding: 28px 30px 30px;
  color: var(--value-color);
}

.auth-title {
  font-size: 17px;
  color: var(--value-color);
}

.auth-hint {
  margin-top: 5px;
  font-size: 12px;
  color: var(--label-color);
}

.auth-form {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: block;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: var(--label-color);
  margin-bottom: 6px;
}

.field-control {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #d5d5d5;
  border-radius: 3px;
  background: #fafafa;
  padding: 0 11px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field-control:focus-within {
  border-color: var(--accent-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(160, 31, 36, 0.13);
}

.field-icon {
  color: #a0a0a0;
}

.field-control:focus-within .field-icon {
  color: var(--accent-red);
}

.field-control input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--value-color);
  padding: 11px 0;
  min-width: 0;
}

.field-control input::placeholder {
  color: #b0b0b0;
}

.toggle-visibility {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #a0a0a0;
  display: flex;
}

.toggle-visibility:hover,
.toggle-visibility.active {
  color: var(--accent-red);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--label-color);
  cursor: pointer;
}

.remember input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-red);
  cursor: pointer;
}

.link {
  color: var(--accent-red);
  text-decoration: none;
  font-weight: bold;
}

.link:hover {
  text-decoration: underline;
}

.auth-btn {
  margin-top: 4px;
  background: var(--deep-red);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 13px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-btn:hover {
  background: var(--gold);
  color: var(--deep-red);
}

.auth-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #ececec;
  text-align: center;
  font-size: 12px;
  color: var(--label-color);
}

.auth-support {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Server-side error from the login handler */
.auth-error {
  margin-top: 16px;
  font-size: 12px;
  font-weight: bold;
  color: #b3261e;
  background: #fdecea;
  border-left: 3px solid #b3261e;
  padding: 10px 12px;
  border-radius: 2px;
}

/* Captcha */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.captcha-img {
  border: 1px solid #d5d5d5;
  border-radius: 3px;
  display: block;
  background: var(--sidebar-bg);
}

.captcha-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #d5d5d5;
  border-radius: 3px;
  background: #fafafa;
  color: var(--accent-red);
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
}

.captcha-refresh:hover {
  background: #f0f0f0;
  border-color: var(--accent-red);
}

.captcha-input input {
  letter-spacing: 2px;
  text-transform: uppercase;
}

.captcha-input input::placeholder {
  letter-spacing: normal;
  text-transform: none;
}

.field-note {
  margin-top: 6px;
  font-size: 11px;
  color: #8a8a8a;
}

@media (max-width: 420px) {
  .auth-body-inner {
    padding: 22px 20px 24px;
  }
  .auth-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ==========================================================================
   Search page
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-xl {
  width: 42px;
  height: 42px;
  stroke-width: 1.3;
}

.page-header {
  padding: 22px 40px;
  border-bottom: 4px solid var(--accent-red);
}

.page-title {
  font-size: 24px;
  color: var(--gold);
  letter-spacing: 1px;
}

.page-subtitle {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.page-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 40px 60px;
  max-width: 1000px;
}

.page-inner-wide {
  max-width: none;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Search panel */
.search-card {
  padding: 24px 28px;
  max-width: 720px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  border: 1px solid #d5d5d5;
  border-radius: 3px;
  overflow: hidden;
  align-self: flex-start;
}

.segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-face {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: bold;
  color: var(--label-color);
  background: #fafafa;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.segment + .segment .segment-face {
  border-left: 1px solid #d5d5d5;
}

.segment-face:hover {
  background: #f0f0f0;
}

.segment input:checked + .segment-face {
  background: var(--deep-red);
  color: var(--gold);
}

.segment input:focus-visible + .segment-face {
  outline: 2px solid var(--accent-red);
  outline-offset: -2px;
}

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

.form-error {
  font-size: 12px;
  font-weight: bold;
  color: #b3261e;
  background: #fdecea;
  border-left: 3px solid #b3261e;
  padding: 9px 12px;
  border-radius: 2px;
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.8px;
  padding: 12px 26px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-gold {
  background: var(--deep-red);
  border: 2px solid var(--gold);
  color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold);
  color: var(--deep-red);
}

.btn-ghost {
  background: none;
  border: 2px solid #d5d5d5;
  color: var(--label-color);
}

.btn-ghost:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Results */
.results-card {
  padding: 20px 28px 22px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
}

.results-title {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--label-color);
}

.results-count {
  font-size: 12px;
  color: var(--label-color);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.data-table {
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--value-color);
  table-layout: fixed;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--label-color);
  padding: 10px 8px;
  border-bottom: 1px solid #e2e2e2;
  white-space: nowrap;
}

.data-table td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  /* Allow long text to wrap instead of blowing out table width */
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.data-table tbody tr:hover {
  background: #fcf7f2;
}

/* Cap address so main grid stays within the card */
.data-table td.cell-address {
  max-width: 160px;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.data-table td.cell-email {
  max-width: 140px;
}

.data-table td.cell-sub,
.data-table td.cell-phone,
.data-table td.cell-date,
.data-table td.mono {
  white-space: nowrap;
  max-width: 110px;
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
}

.cell-action {
  text-align: left;
  white-space: nowrap;
}

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.pill-ok {
  background: #e6f4ea;
  color: #1e7b34;
}

.pill-warn {
  background: #fff4e0;
  color: #96601a;
}

.pill-info {
  background: #eaf1fb;
  color: #24528f;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--label-color);
}

.empty-state .icon {
  color: #cfcfcf;
}

.empty-title {
  margin-top: 10px;
  font-size: 14px;
  font-weight: bold;
  color: var(--value-color);
}

.empty-text {
  margin-top: 4px;
  font-size: 12px;
}

.results-note {
  margin-top: 14px;
  font-size: 11px;
  color: #8a8a8a;
  font-style: italic;
}

/* Loading indicator */
.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 20px;
  font-size: 13px;
  color: var(--label-color);
}

.search-loading[hidden] {
  display: none;
}

.search-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Photo thumbs only (lightbox styles are applied in JS so CSS can’t hide them) */
.result-photo {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: 3px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  flex-shrink: 0;
}

/* Keep the photo column narrow even when the image file is large */
table.dataTable td:first-child,
table.data-table td:first-child {
  width: 52px;
  max-width: 52px;
  padding: 6px 8px !important;
  vertical-align: middle;
}

table.dataTable td img.result-photo,
table.data-table td img.result-photo {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: cover;
}

.btn-view-details {
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.3px;
  padding: 8px 12px;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  background: var(--deep-red);
  border: 1px solid var(--gold);
  color: var(--gold);
}

.btn-view-details:hover {
  background: var(--gold);
  color: var(--deep-red);
}

/* DataTables — align with eVerifier theme */
.dataTables_wrapper {
  margin-top: 8px;
  font-size: 13px;
  color: var(--value-color);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper .dataTables_scrollBody {
  max-width: 100%;
}

table.dataTable {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  table-layout: fixed;
}

table.dataTable td,
table.dataTable th {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Visible columns: keep names readable, button fits */
table.dataTable td.cell-action,
table.dataTable th:last-child {
  width: 90px;
  white-space: nowrap;
  overflow: visible;
}

table.dataTable .btn-view-details {
  max-width: 100%;
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--label-color);
  margin: 10px 0;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #d5d5d5;
  border-radius: 3px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  background: #fafafa;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(160, 31, 36, 0.13);
  background: #fff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 2px !important;
  border: 1px solid transparent !important;
  padding: 4px 10px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--deep-red) !important;
  border: 1px solid var(--gold) !important;
  color: var(--gold) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #fcf7f2 !important;
  border: 1px solid #e0d5d5 !important;
  color: var(--value-color) !important;
}

table.dataTable thead th {
  border-bottom: 1px solid #e2e2e2 !important;
  color: var(--label-color);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

table.dataTable tbody tr:hover {
  background: #fcf7f2 !important;
}

table.dataTable.no-footer {
  border-bottom: 1px solid #ececec;
}

/* Responsive expand control — own column, left of Photo */
table.dataTable thead th.col-expand,
table.dataTable tbody td.col-expand,
table.dataTable tbody td.dtr-control.col-expand {
  width: 36px !important;
  max-width: 36px !important;
  min-width: 36px !important;
  padding: 8px 4px !important;
  text-align: center;
  vertical-align: middle;
}

table.dataTable.dtr-column.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-column.collapsed > tbody > tr > th.dtr-control:before {
  background-color: var(--deep-red) !important;
  border: 1px solid var(--gold) !important;
  box-shadow: none !important;
  left: 50% !important;
  margin-left: -7px !important;
  top: 50% !important;
  margin-top: -7px !important;
}

table.dataTable.dtr-column.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-column.collapsed > tbody > tr.parent > th.dtr-control:before {
  background-color: var(--gold) !important;
  color: var(--deep-red) !important;
}

table.dataTable > tbody > tr.child ul.dtr-details {
  width: 100%;
}

table.dataTable > tbody > tr.child span.dtr-title {
  font-weight: bold;
  color: var(--label-color);
  min-width: 120px;
}

/* Action button stands alone — no expand arrow beside it */
.cell-action {
  white-space: nowrap;
  width: 90px;
  min-width: 0;
  max-width: 100px;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.cell-action .btn-view-details {
  display: inline-block;
  margin: 0;
}

@media (max-width: 820px) {
  .page-header {
    padding: 18px 20px;
  }
  .page-inner {
    padding: 20px;
  }
  .search-card,
  .results-card {
    padding: 18px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .segmented {
    align-self: stretch;
  }
  .segment {
    flex: 1;
  }
  .segment-face {
    justify-content: center;
  }
  .btn-row {
    flex-direction: column;
  }
}
