/* Work area: data first; no permanently reserved detail column. */
.token-alert-card { flex-wrap: wrap; }
.token-alert-card > div { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.token-alert-card > .icon-text { max-width: 100%; white-space: normal; text-align: center; }
@media (max-width: 600px) {
  .token-alert-card > .icon-text { width: 100%; }
}
:root { --shadow: 0 4px 18px rgba(29,39,51,.045); }
.shell { grid-template-columns: 220px minmax(0,1fr); }
.sidebar { padding: 20px 16px; gap: 20px; }
.sidebar .brand { gap: 10px; }
.brand strong { font-size: 15px; }
.sidebar .nav { gap: 4px; }
.nav-btn, .nav-link { padding: 11px 14px; font-size: 14px; border-radius: 9px; }
.nav-group-label { margin-top: 10px; font-size: 10px; letter-spacing: .09em; }
.sidebar-metrics { display: none; }
.sidebar-guide-card { margin-top: auto; padding: 12px; }
.workspace { padding: 24px; min-width: 0; }
.topbar { padding: 0 0 20px; margin-bottom: 22px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; gap: 18px; align-items: flex-start; }
.topbar-eyebrow { display: none; }
.topbar h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.5px; margin: 0 0 10px; }
.topbar p { font-size: 13px; margin: 0; }
.topbar-actions { border: 0; padding: 0; background: transparent; gap: 10px; border-radius: 0; flex-wrap: wrap; justify-content: flex-end; }
.topbar .select-label { width: 228px; padding: 6px 12px; border-radius: 10px; }
.topbar .select-label > span { font-size: 10px; }
.topbar .select-label select { font-size: 13px; min-width: 0; width: 100%; }
.topbar-title-block { min-width: 0; }
.topbar-actions { max-width: 620px; }
.topbar .session-box { padding-left: 10px; gap: 10px; font-size: 12px; }
.topbar #sessionUser { max-width: 130px; }
.topbar .select-label { flex: 0 0 auto; }
.topbar .session-box { flex: 0 0 auto; }
.topbar button.icon-text { font-size: 13px; min-height: 40px; padding: 10px 14px; }
.topbar-meta-stats { gap: 5px; }
.topbar-stat { font-size: 11px; padding: 4px 7px; border-radius: 6px; }
.topbar-integrator-name { font-size: 13px; }
.panel { border-radius: 12px; box-shadow: var(--shadow); }
.panel-header { padding: 18px 20px; gap: 12px; }
.panel-header h2 { font-size: 18px; }
.panel-header p { font-size: 14px; }
.object-layout { display: block; }
.table-panel { overflow-x: auto; }
.objects-table { min-width: 920px; table-layout: auto; }
.objects-table th, .objects-table td { overflow-wrap: normal; word-break: normal; padding: 13px 16px; }
.objects-table th { font-size: 11px; letter-spacing: .025em; white-space: nowrap; }
.objects-table td { font-size: 14px; vertical-align: top; }
.objects-table th:nth-child(1) { width: 22%; }
.objects-table th:nth-child(2) { width: 19%; }
.objects-table th:nth-child(3) { width: 24%; }
.objects-table th:nth-child(4) { width: 9%; }
.objects-table th:nth-child(5) { width: 14%; }
.objects-table th:nth-child(6), .objects-table th:nth-child(7) { width: 60px; }
.objects-table .object-name { font-size: 14px; line-height: 1.4; color: #194fac; }
.objects-table .meta-line { font-size: 12px; line-height: 1.5; }
/* Keep model and firmware details visible in the list as well as the drawer. */
.objects-table .status-pill + br + .meta-line { white-space: nowrap; }
.objects-table .icon-only { width: 34px; height: 34px; font-size: 19px; border-radius: 8px; }
.objects-table .sensor-stack { max-height: 60px; overflow: auto; }
.object-row:hover .object-name { text-decoration: underline; }
.object-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.toolbar { display: flex; flex-wrap: wrap; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 12px; gap: 10px; margin-bottom: 16px; }
.toolbar > * { flex: 1 1 160px; min-width: 130px; }
.toolbar input, .toolbar select, .toolbar .combo-button { min-height: 42px; font-size: 13px; padding: 10px 12px; }
.toolbar > #resetFiltersBtn { flex: 0 0 auto; min-width: 80px; }
.toolbar > #objectSearch { flex-basis: 260px; }
.status-pill { font-size: 12px; padding: 5px 9px; white-space: nowrap; }
.status-processing { color: #965900; background: #fff3d8; }
.table-footer { position: sticky; left: 0; padding: 12px 16px; min-height: 60px; font-size: 13px; }
.detail-panel { display: none; }
.detail-panel.drawer-open { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: min(520px,100vw); max-height: 100dvh; z-index: 80; border-radius: 0; margin: 0; padding: 24px; overflow-y: auto; box-shadow: -12px 0 40px #172b4d24; }
.detail-panel .drawer-close { position: sticky; top: 0; float: right; width: 36px; height: 36px; z-index: 1; margin-left: 12px; border-radius: 8px; background: #eef2f6; }
.drawer-shade { position: fixed; inset: 0; z-index: 79; background: #16223466; }
.object-detail h2 { font-size: 23px; }
.object-detail p { font-size: 14px; }
.object-detail .meta-line { overflow-wrap: anywhere; }
.overview-grid { gap: 12px; }
.overview-card { padding: 18px 20px; min-height: 125px; border-radius: 12px; }
.overview-card strong { font-size: 27px; margin: 10px 0 6px; }
.overview-card > span { font-size: 13px; }
.overview-card small { font-size: 12px; }
.overview-columns { gap: 16px; }
.overview-issue { padding: 16px; }
.overview-issue strong { font-size: 15px; }
.overview-issue small { font-size: 13px; line-height: 1.5; }
.overview-heading { margin-bottom: 16px; }
.overview-heading p { font-size: 14px; }
.overview-actions button { padding: 14px; }
.history-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.history-controls label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.history-controls select, .history-controls input { min-height: 38px; font-size: 13px; padding: 8px 10px; max-width: 210px; }
#historyView table, #auditView table { min-width: 860px; table-layout: auto; }
#historyView th, #historyView td, #auditView th, #auditView td { padding: 14px 18px; overflow-wrap: normal; font-size: 13px; }
#historyView th, #auditView th { font-size: 11px; white-space: nowrap; }
#historyView td:nth-child(5) { white-space: nowrap; }
.history-pager { display: flex; align-items: center; gap: 12px; }
.history-pager span { margin-right: auto; font-size: 13px; color: var(--muted); }
.batch-link { background: transparent; color: var(--blue); font-size: 11px; padding: 4px 0; }
.batch-link:hover { text-decoration: underline; }
.platform-layout { grid-template-columns: minmax(285px, .85fr) minmax(0, 1.6fr); gap: 20px; }
#integratorSearch { margin: 0 20px 12px; width: calc(100% - 40px); font-size: 13px; }
.platform-integrator-select { padding: 14px 16px !important; }
.platform-integrator-card { overflow: hidden; }
.platform-integrator-card input, .platform-integrator-card button { font-size: 13px; }
.platform-integrator-card .inline-fields { display: grid; grid-template-columns: minmax(0,1fr); }
.integrator-selected-settings .integrator-admin-form { grid-template-columns: minmax(0,1fr); }
.menu-toggle { display: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #8eb4ff; outline-offset: 2px; }
@media (max-width: 1400px) {
  .topbar #sessionUser { display: none; }
}
@media (max-width: 1250px) {
  .shell { grid-template-columns: 190px minmax(0,1fr); }
  .sidebar { padding: 18px 12px; }
  .workspace { padding: 20px; }
  .topbar { flex-wrap: wrap; }
  .topbar-title-block { flex: 1 1 260px; }
  .topbar-actions { flex: 0 1 100%; justify-content: flex-start; }
  .overview-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: 250px; height: 100dvh; z-index: 75; box-shadow: 0 0 0 100vmax #16223466; }
  body.nav-open .sidebar { display: flex; }
  .workspace { padding: 16px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 9px 12px; background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
  .topbar { gap: 10px; margin-bottom: 16px; padding-bottom: 16px; }
  .topbar h1 { font-size: 23px; }
  .topbar-actions { gap: 8px; }
  .topbar .select-label { width: 220px; }
  .platform-layout { grid-template-columns: 1fr; }
  .overview-columns { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .workspace { padding: 12px; }
  .topbar { flex-direction: row; flex-wrap: wrap; min-height: 0; }
  .topbar-title-block { flex: 1 1 100%; }
  .topbar-actions { width: 100%; flex-direction: row; flex-wrap: wrap; flex-basis: auto; align-items: center; }
  .topbar .select-label { width: 100%; }
  .topbar .session-box { border: 0; padding: 0; margin-right: auto; }
  .topbar #sessionUser { display: none; }
  .topbar .session-box button { padding: 8px 10px; }
  .topbar-meta-stats { row-gap: 5px; }
  .topbar-integrator-name { display: none; }
  .toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; gap: 8px; }
  .toolbar > * { width: 100%; min-width: 0; max-width: 100%; }
  .toolbar input, .toolbar select, .toolbar .combo, .toolbar .combo-button { min-width: 0; width: 100%; }
  .toolbar #manufacturerFilter, .toolbar #deviceModelFilter { min-width: 0; }
  .toolbar > #objectSearch { grid-column: 1 / -1; }
  .toolbar > #resetFiltersBtn { min-width: 0; padding: 8px; }
  .overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-card { padding: 14px; }
  .overview-card strong { font-size: 22px; }
  .overview-health { font-size: 12px; }
  .overview-heading > div { display: none; }
  .overview-issue { gap: 9px; padding: 12px; }
  .overview-issue-actions { flex-wrap: wrap; }
  .history-controls { padding: 12px; }
  .history-controls label { flex: 1 1 120px; }
  .history-controls select, .history-controls input { width: 100%; max-width: none; }
}
/* Firmware policy is deliberately separate from the one-time bulk action. */
.firmware-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--border, #dce4ed);
}
.firmware-settings-row > div, .firmware-default { min-width: 0; }
.firmware-settings-row p { margin: 6px 0 0; max-width: 760px; }
.firmware-settings-row > button { flex-shrink: 0; }
.firmware-default { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.firmware-default input[type="checkbox"] { width: 20px; height: 20px; margin: 3px 0 0; flex: 0 0 20px; accent-color: #2455d8; }
.firmware-default .meta-line { display: block; margin-top: 6px; }
.firmware-progress { padding: 14px 16px; border-radius: 10px; background: #f1f6fd; overflow-wrap: anywhere; }
.firmware-progress progress { width: 100%; height: 8px; margin-top: 12px; accent-color: #2455d8; }
.firmware-progress details { margin-top: 12px; }
.firmware-progress summary { cursor: pointer; }
.firmware-object-row, .firmware-object-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.firmware-object-row { margin: 12px 0; }
.firmware-object-footer { margin-top: 12px; }
.firmware-object .icon-text { font-size: 14px; padding: 9px 12px; }
@media (max-width: 760px) {
  .firmware-settings-row { align-items: stretch; flex-direction: column; gap: 12px; }
  .firmware-settings-row > button { align-self: flex-start; max-width: 100%; white-space: normal; }
}
