/* Scoped to Platformadmin; the main sidebar and other modules are unchanged. */
body:has(#platformAdminSection:not(.is-hidden)) { background: var(--surface); }
body:has(#platformAdminSection:not(.is-hidden)) > h1 { display: none; }
#platformAdminSection {
  --accent: var(--blue);
  --accent-dark: var(--blue);
  min-width: 0;
  gap: 16px;
  background: var(--surface);
}
#platformAdminSection [hidden] { display: none !important; }
#platformAdminSection * { min-width: 0; }
#platformAdminSection :is(h2, h3, h4, p) { overflow-wrap: anywhere; }
#platformAdminSection h2 { margin: 0 0 6px; font-size: 1.55rem; }
#platformAdminSection h3 { font-size: 1.1rem; }
#platformAdminSection h4 { margin: 18px 0 10px; font-size: .95rem; }
#platformAdminSection .surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  background: white;
  padding: 20px;
  margin-bottom: 16px;
}
#platformAdminSection .section-heading { margin-bottom: 16px; }
#platformAdminSection .section-copy { max-width: 80ch; font-size: .88rem; line-height: 1.55; }
#platformAdminSection .platform-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
#platformAdminSection .platform-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
#platformAdminSection .platform-tabs button { background: transparent; color: var(--muted); border: 1px solid transparent; }
#platformAdminSection .platform-tabs button[aria-selected="true"] { background: white; color: var(--blue); border-color: var(--line); box-shadow: inset 0 -2px var(--blue); }
#platformAdminSection :is(button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
#platformAdminSection button { width: auto; max-width: 100%; flex: 0 1 auto; min-height: 36px; padding: 7px 12px; white-space: normal; border-radius: 6px; box-shadow: none; background-image: none; }
#platformAdminSection button:hover { box-shadow: none; }
#platformAdminSection .form-actions, #platformAdminSection .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#platformAdminSection :is(input, select, textarea) { max-width: 100%; border-radius: 6px; }
#platformAdminSection .platform-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
#platformAdminSection .platform-metric { display: grid; gap: 12px; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 18px; }
#platformAdminSection .platform-metric span { font-size: .84rem; color: var(--muted); }
#platformAdminSection .platform-metric strong { font-size: 1.8rem; font-weight: 650; }
#platformAdminSection :is(.table-wrap, .table-shell) { overflow: visible; border: 0; }
#platformAdminSection table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: .82rem; }
#platformAdminSection :is(th, td) { padding: 11px 10px; vertical-align: top; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
#platformAdminSection th { background: var(--panel-subtle); color: var(--muted); font-size: .76rem; font-weight: 650; text-align: left; }
#platformAdminSection td { border-bottom: 1px solid var(--line); }
#platformAdminSection tr:last-child td { border-bottom: 0; }
#platformAdminSection .platform-selected-row { background: #f1f6ff; }
#platformAdminSection .platform-selection { color: var(--muted); margin: 20px 0 12px; }
#platformAdminSection .platform-detail:not(:empty) { border-top: 1px solid var(--line); padding-top: 18px; }
#platformAdminSection .platform-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
#platformAdminSection .platform-facts dt { color: var(--muted); font-size: .8rem; margin-bottom: 5px; }
#platformAdminSection .platform-facts dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
#platformAdminSection .platform-facts :is(input, select) { width: 100%; min-height: 34px; font-size: .9rem; }
#platformAdminSection .platform-facts .platform-inline-checkbox { display: inline-flex; gap: 8px; align-items: center; min-height: 34px; }
#platformAdminSection .platform-facts .platform-inline-checkbox input { width: auto; min-height: 0; }
#platformAdminSection .platform-user-profile .section-heading :is(input[type="text"], input[type="email"]) {
  width: min(100%, 360px);
  min-height: 36px;
}
#platformAdminSection .platform-timeline { padding-left: 20px; font-size: .88rem; line-height: 1.7; }
#platformAdminSection .platform-timeline li { margin-bottom: 8px; overflow-wrap: anywhere; }
#platformAdminSection .platform-internal-case { border-top: 1px solid var(--line); }
#platformAdminSection .platform-filters { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
#platformAdminSection .platform-user-management { margin-bottom: 14px; }
#platformAdminSection .platform-users-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
#platformAdminSection #platformUsersTable {
  min-width: 1320px;
  table-layout: fixed;
}
#platformAdminSection #platformUsersTable :is(th, td) {
  vertical-align: middle;
  overflow-wrap: break-word;
}
#platformAdminSection #platformUsersTable th { white-space: nowrap; }
#platformAdminSection #platformUsersTable :is(th, td):nth-child(1) { width: 18%; }
#platformAdminSection #platformUsersTable :is(th, td):nth-child(2) { width: 18%; }
#platformAdminSection #platformUsersTable :is(th, td):nth-child(3) { width: 14%; }
#platformAdminSection #platformUsersTable :is(th, td):nth-child(4) { width: 11%; }
#platformAdminSection #platformUsersTable :is(th, td):nth-child(5) { width: 11%; }
#platformAdminSection #platformUsersTable :is(th, td):nth-child(6) { width: 9%; }
#platformAdminSection #platformUsersTable :is(th, td):nth-child(7) {
  width: 150px;
  white-space: nowrap;
}
#platformAdminSection #platformUsersTable :is(th, td):last-child {
  width: 260px;
  white-space: nowrap;
}
#platformAdminSection #platformUsersTable .row-actions {
  min-width: 240px;
  align-items: center;
  flex-wrap: wrap;
}
#platformAdminSection #platformUsersTable .row-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}
#platformAdminSection .platform-user-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}
#platformAdminSection .platform-user-filters label { margin: 0; font-size: .78rem; }
#platformAdminSection .platform-user-filters :is(input, select) { min-height: 36px; }
#platformAdminSection .platform-user-profile {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}
#platformAdminSection .platform-user-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 16px 0;
}
#platformAdminSection .platform-user-metrics .platform-metric { padding: 12px; gap: 6px; }
#platformAdminSection .platform-user-metrics .platform-metric strong { font-size: 1.35rem; }
#platformAdminSection .platform-note-form { max-width: 720px; margin-top: 14px; }
#platformAdminSection .platform-payment-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
#platformAdminSection .platform-payment-filters > .field-grid:nth-of-type(1) { grid-column: span 2; }
#platformAdminSection .platform-payment-filters > .field-grid:nth-of-type(2) { grid-column: 1 / -1; }
#platformAdminSection .platform-payment-filters > .field-grid:nth-of-type(3) { grid-column: span 2; }
#platformAdminSection .platform-payment-filters > .form-actions { justify-content: end; align-self: end; }
#platformAdminSection .platform-payment-filters > label { max-width: 600px; }
#platformAdminSection .field-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; align-items: start; }
#platformAdminSection td summary { cursor: pointer; color: var(--blue); margin-top: 6px; }
#platform-panel-fees .surface > .section-heading:not(:first-child) { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
@media (min-width: 701px) {
  #platformTenantsTable th:first-child { width: 36%; }
  #platformTenantsTable th:nth-child(n+2):nth-child(-n+5) { width: 7%; }
  #platformTenantsTable th:nth-child(6) { width: 12%; }
  #platformTenantsTable th:last-child { width: 24%; }
}
#platformAdminSection .platform-disclosure { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 8px; background: white; }
#platformAdminSection .platform-disclosure > summary { cursor: pointer; padding: 13px 16px; color: var(--blue); font-size: .9rem; font-weight: 650; }
#platformAdminSection .platform-disclosure > :not(summary) { margin: 0; padding: 16px; border: 0; }
#platformAdminSection .platform-disclosure form { max-width: 900px; }
#platformAdminSection .late-return-admin-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: white; }
#platformAdminSection .late-return-admin-card-header { align-items: start; gap: 12px; }
#platformAdminSection .late-return-admin-status { white-space: normal; border-radius: 6px; background: var(--surface); color: var(--ink); }
#platformAdminSection .late-return-admin-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#platformAdminSection .late-return-admin-decision { grid-column: 1 / -1; }
#platformAdminSection .late-return-admin-section { background: white; border-radius: 6px; }
#platformAdminSection .settings-summary-card { box-shadow: none; background: var(--panel-subtle); border-radius: 6px; }
#platformAdminSection :is(#platformAdminLoadStatus, #platformAdminActionStatus):empty { display: none; }
#platformAdminSection #platformAdminActionStatus:not(:empty) { position: sticky; top: 8px; z-index: 5; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: white; }
@media (max-width: 1150px) {
  #platformAdminSection .platform-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #platformAdminSection .platform-user-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #platformAdminSection .platform-user-filters > label:first-child { grid-column: 1 / -1; }
  #platformAdminSection .platform-user-filters > .form-actions { grid-column: 1 / -1; }
  #platformAdminSection .platform-user-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #platformAdminSection .platform-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #platformAdminSection .surface { padding: 16px; }
  #platformAdminSection :is(th, td) { padding: 9px 6px; }
}
@media (max-width: 700px) {
  #platformAdminSection .platform-header { align-items: start; flex-direction: column; }
  #platformAdminSection .platform-tabs { gap: 4px; }
  #platformAdminSection .platform-tabs button { font-size: .82rem; }
  #platformAdminSection .platform-metric { padding: 12px; }
  #platformAdminSection .platform-metric strong { font-size: 1.5rem; }
  #platformAdminSection :is(.platform-facts, .platform-filters, .late-return-admin-actions, .late-return-admin-facts) { grid-template-columns: minmax(0, 1fr); }
  #platformAdminSection .platform-payment-filters { grid-template-columns: minmax(0, 1fr); }
  #platformAdminSection .platform-user-filters,
  #platformAdminSection .platform-user-metrics { grid-template-columns: minmax(0, 1fr); }
  #platformAdminSection .platform-payment-filters > :is(.field-grid, .form-actions) { grid-column: 1 / -1; }
  #platformAdminSection .platform-payment-filters > .form-actions { justify-content: start; }
  #platformAdminSection table, #platformAdminSection tbody { display: block; }
  #platformAdminSection thead { display: none; }
  #platformAdminSection tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  #platformAdminSection td { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1fr); gap: 12px; border: 0; padding: 5px 0; }
  #platformAdminSection td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
  #platformAdminSection .late-return-admin-card-header { flex-direction: column; }
  #platformAdminSection .row-actions { flex-direction: row; }
  #platformAdminSection .platform-users-table-wrap #platformUsersTable { display: table; }
  #platformAdminSection .platform-users-table-wrap #platformUsersTable tbody { display: table-row-group; }
  #platformAdminSection .platform-users-table-wrap #platformUsersTable thead { display: table-header-group; }
  #platformAdminSection .platform-users-table-wrap #platformUsersTable tr {
    display: table-row;
    border-bottom: 0;
    padding: 0;
  }
  #platformAdminSection .platform-users-table-wrap #platformUsersTable td {
    display: table-cell;
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
  }
  #platformAdminSection .platform-users-table-wrap #platformUsersTable td::before { content: none; }
}
