/* Scoped to the device route; dialogs and other management pages retain their styles. */
.admin-theme .main.device-main { height:calc(100dvh - 54px); box-sizing:border-box; display:flex; flex-direction:column; overflow:hidden; }
.admin-theme .module-main > .devices-page { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; box-sizing:border-box; overflow:hidden; padding:4px; border:0; background:transparent; box-shadow:none; }
.admin-theme .devices-page .page-title { margin:0; flex-shrink:0; }
.devices-page > p { margin:0; flex-shrink:0; font-size:12px; }
.devices-page .business-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:0; flex-shrink:0; }
.devices-page .business-stats .device-metric { --tone:#2878f0; --wash:#e4efff; position:relative; box-sizing:border-box; min-width:0; height:110px; padding:14px 16px; border-radius:16px; border:1px solid #ffffffd9; background:linear-gradient(130deg,var(--wash),transparent 70%),#ffffffc7; box-shadow:0 6px 20px #325aa00f; backdrop-filter:blur(12px); }
.devices-page .device-metric.violet { --tone:#8b71cf; --wash:#eee8fc; }
.devices-page .device-metric.teal { --tone:#229e99; --wash:#e0f5f0; }
.device-metric-label { display:flex; align-items:center; gap:8px; color:#526887; font-size:13px; }
.device-metric-icon { display:grid; place-items:center; width:26px; height:26px; border-radius:9px; background:var(--wash); color:var(--tone); font-size:17px; }
.device-metric-value { position:relative; z-index:1; margin-top:7px; color:#172b4d; font-size:32px; font-weight:600; line-height:1.15; font-variant-numeric:tabular-nums; }
.device-metric-value span { margin-left:6px; color:#7184a3; font-size:12px; font-weight:400; }
.devices-page .hotel-sparkline { position:absolute; right:16px; bottom:12px; width:42%; height:34px; color:var(--tone); }
.devices-page .hotel-sparkline svg { display:block; width:100%; height:100%; }
.admin-theme .devices-page .entitlement-toolbar { display:flex; margin:0; padding:0; gap:8px; flex-shrink:0; align-items:center; }
.devices-page .entitlement-toolbar > .el-select { width:150px !important; }
.devices-page .entitlement-toolbar > .el-input { width:280px !important; flex:1; min-width:180px; max-width:340px; }
.devices-page .entitlement-toolbar .el-button,.device-actions .el-button { height:36px; margin:0; border-radius:8px; }
.devices-page .entitlement-toolbar .el-input__wrapper,.devices-page .entitlement-toolbar .el-select__wrapper { min-height:36px; border-radius:8px; }
.devices-page .el-button--primary:not(.is-link) { background:linear-gradient(130deg,#438fff,#2878f0); border-color:#3985f4; }
.device-actions { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; flex-shrink:0; }
.device-actions-primary { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.device-table-panel { flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden; border:1px solid #ffffffd9; border-radius:16px; background:#ffffffc7; box-shadow:0 6px 24px #2a5b9e0f; }
.device-list { flex:1; min-height:0; overflow:hidden; }
.device-footer { flex-shrink:0; min-height:48px; box-sizing:border-box; padding:6px 14px; border-top:1px solid #e4edf9; background:#f9fbff; overflow-x:auto; }
.admin-theme .devices-page .device-footer .el-pagination { display:flex; justify-content:flex-end; margin:0; padding:0; min-height:35px; }
.device-footer .el-pagination__total { margin-right:auto; }
.admin-theme .devices-page .device-table { --el-table-header-bg-color:#eaf2fd; --el-table-row-hover-bg-color:#edf5ff; --el-table-border-color:#e7eef8; --el-table-text-color:#405571; font-size:13px; }
.admin-theme .devices-page .device-table th.el-table__cell { height:40px; padding:5px 0; box-sizing:border-box; }
.admin-theme .devices-page .device-table td.el-table__cell { height:44px; padding:5px 0; box-sizing:border-box; }
.devices-page .device-table .cell { line-height:22px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.devices-page .device-table .el-button { margin:0; }
.devices-page .device-table .el-dropdown .el-button { height:28px; }
.devices-page .device-table .el-tag { height:22px; border-radius:6px; }
.channel-rebind .el-dialog__body > .el-alert,
.channel-rebind .el-dialog__body > .el-radio-group { margin-bottom:16px; }
.channel-rebind-file-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; margin-bottom:8px; }
.channel-rebind-file-tools > span { margin-inline-end:auto; overflow-wrap:anywhere; }
.channel-rebind .el-table .channel-rebind-reason > .cell { white-space:normal; overflow-wrap:anywhere; text-overflow:clip; }
.channel-rebind .el-dialog__footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; }
.channel-rebind .el-dialog__footer > * { margin-inline:0; }
.device-renew-error { color:#c45656; font-weight:700; cursor:help; }
.device-profile-section + .device-profile-section { margin-top:16px; }
.device-profile-section h3 { margin:0 0 8px; font-size:16px; color:#263952; }
.device-profile-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 16px; margin:0; padding:12px; border:1px solid #e4ebf4; border-radius:8px; background:#fff; }
.device-profile-fields > div { min-width:0; }
.device-profile-fields dt { color:#5f7087; font-size:13px; }
.device-profile-fields dd { margin:4px 0 0; color:#263952; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.device-import-tools { display:flex; justify-content:flex-end; margin-bottom:8px; }
.device-filter-popover .device-advanced-filters { display:flex; flex-wrap:wrap; gap:12px; max-height:60vh; overflow:auto; padding:4px; }
.device-filter-popover .el-select,.device-filter-popover .el-input { width:calc(50% - 6px) !important; }
.device-filter-popover .el-date-editor { width:100%; flex:none; }
@media(max-width:1000px) { .admin-theme .module-main > .devices-page { gap:8px; } .devices-page .business-stats .device-metric { padding:10px; } .devices-page .entitlement-toolbar > .el-select { width:130px !important; } .device-footer { padding:6px 8px; } }
@media(max-height:650px) { .devices-page .business-stats .device-metric { height:90px; padding:8px 12px; } .admin-theme .module-main > .devices-page { gap:8px; } }

.admin-theme-active .el-dialog.channel-observations {
  box-sizing:border-box; height:calc(100dvh - 48px); max-height:none; max-width:calc(100vw - 24px);
  margin:auto; padding:16px; overflow:hidden; background:#fff;
}
.channel-observations .el-dialog__header { margin:0 0 16px; padding:0 40px 12px 0; }
.channel-observations .el-dialog__headerbtn { top:0; }
.admin-theme-active .channel-observations .el-dialog__body {
  flex:1; display:flex; flex-direction:column; gap:16px;
  min-height:0; max-height:none; padding:0; overflow:hidden;
}
.channel-observations .el-dialog__footer { margin-top:8px; padding:12px 0 0; }
.observation-filters {
  display:grid; grid-template-columns:minmax(120px,1fr) minmax(128px,1.1fr) minmax(100px,.75fr) minmax(264px,1.6fr) auto;
  align-items:end; gap:12px; flex:none;
}
.observation-filters > :not(.observation-filter-actions) { display:grid; gap:4px; min-width:0; }
.observation-filters > * > span { color:#405571; font-size:13px; font-weight:600; }
.observation-date-range,.observation-filter-actions,.observation-footer-actions { display:flex; align-items:center; gap:8px; }
.observation-date-range > input {
  flex:1; min-width:0; width:0; height:32px; box-sizing:border-box; padding:0 8px;
  border:1px solid var(--el-border-color); border-radius:var(--el-border-radius-base);
  background:#fff; color:#263952; font:inherit;
}
.observation-date-range > input:focus-visible { outline:2px solid var(--el-color-primary); outline-offset:-2px; }
.observation-date-range > span { white-space:nowrap; }
.observation-filter-actions .el-button,.observation-footer-actions .el-button { margin:0; }
.observation-results {
  --observation-heading-height:40px; --observation-row-height:40px;
  flex:1; min-height:0; position:relative; overflow:hidden; border:1px solid #e4ebf4; border-radius:8px;
}
.observation-table { width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; color:#263952; }
.observation-table th,.observation-table td { box-sizing:border-box; padding:0 8px; text-align:left; }
.observation-table th {
  height:var(--observation-heading-height); background:#f0f5fc; color:#405571;
  white-space:nowrap; font-weight:600;
}
.observation-table td { height:var(--observation-row-height); border-bottom:1px solid #edf1f6; }
.observation-table tbody tr:hover { background:#f7faff; }
.observation-cell { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:22px; }
.observation-col-mac { width:16%; }
.observation-col-status { width:8.5%; }
.observation-col-channel_code { width:10.5%; }
.observation-col-client_version { width:10%; }
.observation-col-first_seen_at { width:17.5%; }
.observation-mobile-label { display:none; }
.observation-status { display:inline-block; padding:0 8px; border-radius:4px; vertical-align:middle; font-weight:600; }
.observation-status-transferred { background:#e8f5ef; color:#216647; }
.observation-status-pending { background:#eef2f7; color:#455872; }
.observation-status-mismatch { background:#fceced; color:#a03643; }
.observation-empty {
  position:absolute; inset:var(--observation-heading-height) 0 0; display:grid; place-items:center;
  margin:0; color:#5f7087;
}
.observation-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.observation-summary { min-width:0; display:grid; gap:2px; text-align:left; color:#314563; }
.observation-summary > span { color:#5f7087; font-size:12px; }
.observation-summary > span:empty { display:none; }

@media(max-width:900px) {
  .observation-filters { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .observation-date-filter { grid-column:span 2; }
  .observation-results { --observation-heading-height:0px; --observation-row-height:116px; }
  .observation-table,.observation-table tbody { display:block; }
  .observation-table colgroup,.observation-table thead { display:none; }
  .observation-table tr {
    box-sizing:border-box; display:grid; height:var(--observation-row-height);
    grid-template:"mac mac status" 24px "owner current reported" 31px "code version version" 17px "seen seen seen" 17px / repeat(3,minmax(0,1fr));
    gap:2px 8px; align-content:center; padding:0 8px; border-bottom:1px solid #edf1f6;
  }
  .observation-table td { height:auto; width:auto; padding:0; min-width:0; border:0; }
  .observation-table td.observation-col-mac { grid-area:mac; font-weight:600; }
  .observation-table td.observation-col-status { grid-area:status; justify-self:end; }
  .observation-table td.observation-col-owner_name { grid-area:owner; }
  .observation-table td.observation-col-current_owner_name { grid-area:current; }
  .observation-table td.observation-col-reported_name { grid-area:reported; }
  .observation-table td.observation-col-channel_code { grid-area:code; }
  .observation-table td.observation-col-client_version { grid-area:version; }
  .observation-table td.observation-col-first_seen_at { grid-area:seen; }
  .observation-table td:nth-child(n+2):not(.observation-col-status) .observation-mobile-label {
    display:block; color:#5f7087; font-size:11px; line-height:14px; white-space:nowrap;
  }
  .observation-table td .observation-cell { line-height:17px; }
  .observation-table .observation-col-status .observation-cell { line-height:22px; }
  .observation-table td:is(.observation-col-channel_code,.observation-col-client_version,.observation-col-first_seen_at) {
    display:flex; gap:4px; align-items:center; font-size:12px;
  }
  .observation-footer .el-pagination__jump { display:none; }
}
@media(max-width:540px) {
  .admin-theme-active .el-dialog.channel-observations { height:calc(100dvh - 24px); padding:12px; }
  .observation-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .observation-date-filter { order:1; }
  .observation-footer { flex-wrap:wrap; row-gap:8px; }
  .observation-footer > .el-pagination { order:1; justify-content:center; width:100%; }
}
@media(max-height:500px) {
  .admin-theme-active .el-dialog.channel-observations { height:calc(100dvh - 16px); padding:8px 12px; }
  .channel-observations .el-dialog__header { margin-bottom:8px; padding-bottom:8px; }
  .admin-theme-active .channel-observations .el-dialog__body { gap:8px; }
  .channel-observations .el-dialog__footer { padding-top:8px; }
}
@media(max-width:900px) and (max-height:500px) {
  .observation-results { --observation-row-height:92px; }
  .observation-table tr {
    grid-template:"mac mac status" 24px "owner current reported" 31px "code version seen" 17px / repeat(3,minmax(0,1fr));
  }
}
