:root {
  --bg: #061120;
  --bg2: #08182f;
  --card: linear-gradient(180deg, rgba(9,24,48,.95), rgba(4,13,28,.98));
  --text: #e7eefc;
  --muted: #9fb4d9;
  --line: rgba(135, 170, 235, 0.16);
  --input: #08172d;
  --accent: #274776;
  --accent-2: #4f7dbf;
  --success-bg: rgba(19, 127, 58, .18);
  --success: #59e08f;
  --danger-bg: rgba(155, 37, 37, .16);
  --danger: #ff7f7f;
  --shadow: 0 18px 45px rgba(0,0,0,.35);
}
body.light {
  --bg: #eef4ff;
  --bg2: #f6f9ff;
  --card: linear-gradient(180deg, rgba(255,255,255,.96), rgba(243,248,255,.98));
  --text: #13233d;
  --muted: #5f7393;
  --line: rgba(56, 88, 136, 0.16);
  --input: #ffffff;
  --accent: #294d88;
  --accent-2: #3d6ec0;
  --shadow: 0 18px 40px rgba(22,38,70,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top left, rgba(61,110,192,.15), transparent 28%), linear-gradient(180deg, var(--bg2), var(--bg));
  color: var(--text);
  min-height: 100vh;
  font-size: 13px;
}
.container { width: min(1840px, calc(100% - 12px)); margin: 10px auto 24px; }
.topbar, .card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.topbar { padding: 11px 14px; display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; position: sticky; top: 6px; z-index: 10; backdrop-filter: blur(12px); }
.brand h1 { margin: 0; font-size: 22px; line-height: 1.1; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { padding: 12px; margin-top: 10px; }
.compact-card { padding-bottom: 10px; }
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card .card-head, .records-head { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; flex-wrap:wrap; margin-bottom: 8px; }
.card .hint { color: var(--muted); font-size: 12px; }
.grid-2 { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.grid-1 { display:grid; grid-template-columns: 1fr; gap:10px; }
label { display:block; margin-bottom:5px; color: var(--text); font-size: 12px; }
input[type="text"], input[type="password"], input[type="search"], textarea, select, input[type="file"] {
  width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--input); color: var(--text); padding: 9px 10px; font-size: 13px; outline: none;
}
textarea { min-height: 78px; resize: vertical; }
.actions { display:flex; gap:8px; flex-wrap: wrap; align-items:center; margin-top: 10px; }
button, .btn { appearance:none; border:1px solid rgba(111,150,220,.2); cursor:pointer; text-decoration:none; background: linear-gradient(180deg, rgba(55,87,142,.95), rgba(36,62,108,.95)); color:white; padding: 9px 13px; border-radius: 12px; font-weight: 700; font-size: 13px; }
.btn.secondary, button.secondary { background: transparent; color: var(--text); }
.btn.small, button.small { padding: 7px 10px; font-size: 12px; border-radius: 10px; }
.btn.micro, button.micro { padding: 4px 6px; font-size: 10px; border-radius: 8px; line-height: 1; }
.muted { color: var(--muted); }
.flash { padding: 10px 12px; border-radius: 12px; margin-top: 10px; }
.flash.success { background: rgba(35,150,85,.15); color: #8ff0b0; border:1px solid rgba(35,150,85,.2); }
.flash.error { background: rgba(170,40,40,.14); color: #ffabab; border:1px solid rgba(170,40,40,.2); }
.toast { position: fixed; right: 14px; bottom: 14px; z-index: 99; padding: 9px 12px; border-radius: 12px; background: rgba(20, 35, 60, .96); color: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.searchbar { display:grid; grid-template-columns: 1fr 110px 160px 76px; gap: 8px; }
.stats { display:flex; gap:8px; flex-wrap:wrap; }
.stat { padding: 7px 10px; border:1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); min-width: 72px; }
pre.codebox { margin:0 0 8px; padding:10px; border-radius:14px; background:#071325; border:1px solid var(--line); color:#c7d7f5; overflow:auto; white-space: pre-wrap; font-size: 12px; }
.login-shell { min-height:100vh; display:grid; place-items:center; padding: 24px; }
.login-card { width:min(560px,100%); }
.footer-note { color: var(--muted); text-align:center; margin-top:14px; font-size:14px; }
summary { cursor: pointer; display:flex; align-items:center; gap:10px; }
.entry-form { margin-top: 12px; }
.import-line { display:grid; grid-template-columns: 1fr auto; gap: 8px; align-items:center; margin-top: 8px; }
.records-card { padding: 10px; }
.indexbar { position: sticky; top: 66px; z-index: 8; display:grid; grid-template-columns: 1fr 150px 92px 58px 105px 80px; gap: 6px; align-items:center; background: rgba(5, 16, 34, .95); border: 1px solid var(--line); border-radius: 14px; padding: 7px; margin-bottom: 8px; backdrop-filter: blur(12px); }
body.light .indexbar { background: rgba(245,248,255,.95); }
.selected-count { color: var(--muted); font-weight: 700; align-self:center; }
.table-wrap { border-radius: 16px; border:1px solid var(--line); width:100%; overflow-x: auto; overflow-y: auto; max-height: 72vh; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 0; }
th, td { padding: 4px 4px; border-bottom: 1px solid var(--line); text-align:left; vertical-align: middle; line-height: 1.12; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th { position: sticky; top: 0; background: rgba(10,23,44,.98); z-index: 2; font-size: 10px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
body.light th { background: rgba(240,246,255,.98); }
tr:hover td { background: rgba(255,255,255,.025); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; }
.c-sel { width: 26px; } .c-id { width: 34px; } .c-serial { width: 6%; } .c-phone { width: 6%; } .c-imei { width: 8%; } .c-track { width: 7.5%; } .c-name { width: 8%; } .c-title { width: 7%; } .c-address { width: 9%; } .c-notes { width: 12%; } .c-ams { width: 54px; } .c-status { width: 9%; } .c-created { width: 70px; } .c-updated { width: 70px; } .c-actions { width: 68px; }
.select-cell, th:first-child { text-align:center; padding-left: 2px; padding-right: 2px; }
input[type="checkbox"] { transform: scale(.85); accent-color: var(--accent-2); }
.badge { display:inline-flex; align-items:center; justify-content:center; gap:4px; border-radius:999px; padding:3px 5px; font-weight:800; font-size: 10px; border: 1px solid transparent; white-space: nowrap; min-width: 45px; }
.badge.yes { color: var(--success); background: var(--success-bg); border-color: rgba(89,224,143,.25); }
.badge.no { color: var(--danger); background: var(--danger-bg); border-color: rgba(255,127,127,.2); }
.dot { width: 6px; height: 6px; border-radius:50%; display:inline-block; flex: 0 0 auto; }
.dot.green { background: var(--success); box-shadow:0 0 10px rgba(89,224,143,.5); }
.dot.red { background: var(--danger); box-shadow:0 0 10px rgba(255,127,127,.45); }
.status-select { width:100%; border-radius: 999px; padding: 3px 16px 3px 7px; height: 23px; font-size: 10px; font-weight: 800; border: 1px solid rgba(255,255,255,.12); color:#f7fbff; background-color: rgba(44,77,130,.75); }
.status-shipped { background-color: rgba(35, 121, 207, .72); }
.status-provisioning { background-color: rgba(88, 83, 190, .72); }
.status-issues-with-activation { background-color: rgba(176, 55, 55, .72); }
.status-verifying-address, .status-verifying-with-rd, .status-verifying-with-cm { background-color: rgba(190, 130, 35, .75); }
.status-address-verified, .status-qualified, .status-dropped-off-at-clinic { background-color: rgba(35, 145, 82, .75); }
.status-shipping-delayed { background-color: rgba(180, 95, 35, .75); }
.status-picked-up-at-chq { background-color: rgba(68, 120, 170, .75); }
.status-terminated, .status-cycled-out-of-role, .status-non-eligible { background-color: rgba(120, 45, 55, .78); }
.notes-cell { padding: 2px 3px; }
.inline-notes { height: 24px; min-height: 24px; resize: horizontal; max-width: 100%; border-radius: 8px; padding: 4px 6px; font-size: 11px; line-height: 1.1; overflow: hidden; white-space: nowrap; background: rgba(255,255,255,.035); }
.inline-notes:focus { height: 78px; min-width: 260px; max-width: 420px; position: relative; z-index: 5; white-space: normal; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.date-cell { color: var(--muted); }
.row-actions { display:flex; gap:3px; align-items:center; white-space:nowrap; }
.row-actions form { margin:0; }
@media (max-width: 1200px) {
  body { font-size: 12px; }
  .container { width: calc(100% - 6px); }
  th, td { font-size: 10px; padding: 3px 3px; }
  .mono { font-size: 9px; }
  .brand p { display:none; }
  .c-title { width: 6%; } .c-address { width: 8%; } .c-notes { width: 10%; } .c-status { width: 8%; }
  .indexbar { grid-template-columns: 1fr 128px 80px 52px 92px 70px; top: 58px; }
}
@media (max-width: 900px) {
  .grid-2, .searchbar, .indexbar, .import-line { grid-template-columns: 1fr; }
  .table-wrap { overflow-x:auto; }
  table { min-width: 1100px; }
}


/* === TRUE INLINE EDITING: added without removing existing UI logic === */
.editable-cell {
  cursor: text;
  border-radius: 6px;
  transition: background .15s ease, box-shadow .15s ease;
}
.editable-cell:hover {
  background: rgba(255,255,255,.045);
}
.editable-cell:focus {
  outline: 1px solid rgba(111,168,255,.85);
  background: rgba(79,140,255,.14);
  box-shadow: inset 0 0 0 1px rgba(111,168,255,.35), 0 0 12px rgba(79,140,255,.20);
  white-space: nowrap;
  overflow: hidden;
}
.locked-cell { opacity: .82; }
.row-saved td { background: rgba(89,224,143,.045); }
.inline-notes { cursor: text; }
.inline-notes:focus { outline: 1px solid rgba(111,168,255,.85); }


/* === Master control center update: regions, bulk delete, keyboard selection === */
.searchbar { grid-template-columns: 1fr 110px 160px 150px 76px; }
.ops-indexbar {
  grid-template-columns: minmax(160px,1fr) 132px 132px 82px 58px 96px 96px 74px 82px 78px 68px;
  gap: 5px;
}
.region-line {
  display:grid;
  grid-template-columns: 1fr auto;
  gap:8px;
  align-items:center;
  margin-top:8px;
}
.c-region { width: 7%; }
.region-input {
  width:100%;
  border-radius: 999px;
  padding: 3px 7px;
  height: 23px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  background: rgba(44,77,130,.30);
}
.region-input:focus {
  outline: 1px solid rgba(111,168,255,.85);
  background: rgba(79,140,255,.14);
}
button.danger, .btn.danger {
  background: linear-gradient(180deg, rgba(140,45,55,.95), rgba(100,30,40,.95));
  border-color: rgba(255,127,127,.28);
}
.active-row td {
  background: rgba(79,140,255,.075) !important;
  box-shadow: inset 0 1px 0 rgba(79,140,255,.12), inset 0 -1px 0 rgba(79,140,255,.12);
}
.row-selected td {
  background: rgba(89,224,143,.045);
}
.status-pending-approval,
.status-awaiting-leadership-approval,
.status-awaiting-budget-approval,
.status-awaiting-device-availability,
.status-awaiting-user-response,
.status-awaiting-manager-response,
.status-awaiting-shipping-confirmation,
.status-awaiting-activation,
.status-awaiting-sim,
.status-awaiting-intune-enrollment,
.status-awaiting-apple-enrollment,
.status-testing-device,
.status-ready-to-ship,
.status-in-transit,
.status-out-for-delivery,
.status-hold,
.status-needs-review {
  background-color: rgba(190, 130, 35, .75);
}
.status-delivered,
.status-received,
.status-activated,
.status-completed,
.status-in-use,
.status-reassigned {
  background-color: rgba(35, 145, 82, .75);
}
.status-rejected,
.status-returned-to-corporate,
.status-lost-in-transit,
.status-damaged-in-transit,
.status-cancelled,
.status-rejected-by-user,
.status-rejected-by-leadership,
.status-device-failure,
.status-activation-failed,
.status-duplicate-request,
.status-escalated,
.status-archived {
  background-color: rgba(140, 45, 65, .78);
}
@media (max-width: 1400px) {
  .ops-indexbar { grid-template-columns: 1fr 126px 126px 76px 54px 86px 86px 68px 78px 72px 64px; }
  th, td { font-size: 10px; padding: 3px 3px; }
  .status-select, .region-input { font-size: 9px; height: 22px; }
}
@media (max-width: 900px) {
  .ops-indexbar, .region-line { grid-template-columns: 1fr; }
}


/* === Region View Filter: active runtime, not shell === */
.region-filter-shell {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(8,18,36,.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.region-filter-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.region-filter-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.region-filter-search {
  width: 100%;
  height: 25px;
  margin-bottom: 6px;
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 10px;
}
.region-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 86px;
  overflow: auto;
  padding-right: 2px;
}
.region-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(111,168,255,.20);
  background: rgba(37,68,119,.34);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.region-chip input { width: 12px; height: 12px; margin: 0; }
.region-chip em {
  font-style: normal;
  opacity: .72;
  font-size: 9px;
  padding-left: 2px;
}
.region-chip:has(input:not(:checked)) {
  opacity: .48;
  background: rgba(255,255,255,.04);
}
@media (max-width: 900px) {
  .region-filter-head { grid-template-columns: 1fr; }
  .region-filter-actions { justify-content: flex-start; }
}


/* === Clean integrated region dropdown, sorting, resize, shift-scroll === */
.compact-region-filter { margin: 0 0 8px; padding: 7px; }
.compact-region-head { grid-template-columns: auto 1fr auto; margin-bottom: 0; }
.region-filter-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 7px 12px;
  background: linear-gradient(180deg, rgba(55,87,142,.95), rgba(36,62,108,.95));
  border:1px solid rgba(111,150,220,.28); color:#fff; font-weight:900;
}
.region-filter-toggle strong { color:#bcd5ff; }
.region-filter-toggle .chev { opacity:.85; }
.region-filter-hint { align-self:center; }
.region-filter-menu {
  margin-top: 8px; padding: 8px; border-radius: 12px;
  background: rgba(3,14,31,.96);
  border: 1px solid rgba(111,168,255,.16);
  box-shadow: 0 16px 35px rgba(0,0,0,.26);
}
.region-filter-menu[hidden] { display: none !important; }
.region-filter-grid { max-height: 210px; }
.sortable-column { cursor:pointer; user-select:none; position:relative; }
.sortable-column:hover { color:#dbe9ff; }
.sorted-column { color:#fff !important; }
.sort-cue { color:#86b8ff; font-size:9px; padding-left:2px; }
.column-resizer {
  position:absolute; right:-2px; top:0; width:7px; height:100%;
  cursor:col-resize; z-index:5;
}
.column-resizer:hover { background: rgba(111,168,255,.26); }
.resizing-columns, .resizing-columns * { cursor: col-resize !important; user-select:none !important; }
.table-wrap { scroll-behavior: auto; }
.notes-cell textarea.inline-notes { resize: both; }
.inline-notes:focus { height: 110px; min-width: 360px; max-width: 640px; }
@media (max-width: 900px) {
  .compact-region-head { grid-template-columns: 1fr; }
}




/* === FINAL NOTES CLICK-TO-TYPE NO AUTO EXPAND FIX === */
/* Click should only place cursor in notes box. Rows stay compact unless user manually changes layout elsewhere. */

td.notes-cell,
td[data-field="notes"],
td[data-col="notes"],
.rpt-notes-cell,
.notes-cell {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    vertical-align: middle !important;
}

td.notes-cell textarea,
td[data-field="notes"] textarea,
td[data-col="notes"] textarea,
textarea[name="notes"],
.rpt-notes-cell textarea,
.notes-cell textarea {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;

    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;

    overflow-y: hidden !important;
    overflow-x: auto !important;

    white-space: nowrap !important;
    word-break: normal !important;

    resize: horizontal !important;

    line-height: normal !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;

    transition: none !important;
}

/* Remove old expanded/focus behavior from previous passes */
td.notes-cell textarea:focus,
td[data-field="notes"] textarea:focus,
td[data-col="notes"] textarea:focus,
textarea[name="notes"]:focus,
.rpt-notes-cell textarea:focus,
.notes-cell textarea:focus {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
}

/* Disable previous class-based popout expansion */
.rpt-notes-cell.rpt-notes-expanded,
.notes-cell.rpt-notes-expanded {
    max-width: none !important;
    min-width: 0 !important;
    position: static !important;
    z-index: auto !important;
    box-shadow: none !important;
    white-space: normal !important;
}

/* Keep table rows tight */
tbody tr,
tbody tr td {
    height: auto !important;
}



/* ===== NOTES COLUMN PUSH LAYOUT FIX ===== */

table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100% !important;
}

.notes-cell,
.notes-column,
td.notes-cell {
    min-width: 760px !important;
    width: 760px !important;
    max-width: 760px !important;
}

.notes-cell textarea,
.notes-cell input,
.notes-input,
.notes-textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

/* Push all columns AFTER notes further right */
.ams-cell,
.status-cell,
.created-cell,
.updated-cell,
.actions-cell {
    padding-left: 18px !important;
    position: relative !important;
}



/* ===== FINAL NOTES + STATUS WIDTH TUNING ===== */

/* Cut notes width roughly in half */
.notes-cell,
.notes-column,
td.notes-cell {
    min-width: 380px !important;
    width: 380px !important;
    max-width: 380px !important;
}

/* Give status dropdown breathing room */
.status-cell,
td.status-cell {
    min-width: 220px !important;
    width: 220px !important;
    overflow: visible !important;
}

/* Prevent dropdown arrow clipping */
.status-cell select,
.status-dropdown,
.status-pill,
.status-select {
    min-width: 200px !important;
    padding-right: 34px !important;
    overflow: visible !important;
}

/* Push later columns slightly */
.created-cell,
.updated-cell,
.actions-cell {
    padding-left: 14px !important;
}


/* ===== RP YOUTUBE WALLPAPER SYSTEM ===== */

/* Full-screen video canvas */
#rpYoutubeWallpaperFrame {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border: 0 !important;
  z-index: -9999 !important;
  pointer-events: none !important;
  opacity: 1 !important;
  background: #000 !important;
}

/* Make page able to show the video without repainting the table system */
html.rp-video-active,
body.rp-video-active {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

/* Toolbar */
.rp-video-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
  padding: 10px 12px !important;
  margin: 0 0 10px 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 99999 !important;
  background: rgba(0,0,0,.14) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 12px !important;
}

.rp-video-toolbar button,
.rp-video-toolbar select,
.rp-video-toolbar input {
  height: 36px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: rgba(0,0,0,.30) !important;
  color: #fff !important;
  padding: 0 12px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.rp-video-toolbar input {
  min-width: 320px !important;
  flex: 1 1 320px !important;
}

.rp-video-toolbar select {
  min-width: 220px !important;
}

/* Clear mode: no panel fill, video first */
body.rp-clear-video .topbar,
body.rp-clear-video .card,
body.rp-clear-video .records-card,
body.rp-clear-video .indexbar,
body.rp-clear-video .table-wrap,
body.rp-clear-video .toolbar,
body.rp-clear-video table,
body.rp-clear-video thead,
body.rp-clear-video tbody,
body.rp-clear-video tr,
body.rp-clear-video th,
body.rp-clear-video td {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Glass mode: transparent glass but still lets the video show */
body.rp-glass-video .topbar,
body.rp-glass-video .card,
body.rp-glass-video .records-card,
body.rp-glass-video .indexbar,
body.rp-glass-video .table-wrap {
  background: rgba(0,0,0,.16) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-color: rgba(255,255,255,.14) !important;
}

/* Keep text readable over video */
body.rp-clear-video,
body.rp-glass-video {
  color: #fff !important;
}

body.rp-clear-video th,
body.rp-clear-video td,
body.rp-glass-video th,
body.rp-glass-video td {
  text-shadow: 0 1px 3px rgba(0,0,0,.9) !important;
}

/* Hide video safely */
body.rp-video-hidden #rpYoutubeWallpaperFrame {
  display: none !important;
}

/* ===== END RP YOUTUBE WALLPAPER SYSTEM ===== */


/* ===== RP STATIC VIDEO TOOLBAR FIX ===== */

/* toolbar should NEVER scroll over content */
#rpYoutubeToolbar{
position:fixed!important;
top:10px!important;
left:10px!important;
right:10px!important;
z-index:999999!important;
}

/* create permanent top spacing so toolbar never overlaps */
body.rp-video-toolbar-spacing{
padding-top:72px!important;
}

/* true responsive video scaling */
#rpYoutubeWallpaperFrame{
position:fixed!important;
top:0!important;
left:0!important;
width:100vw!important;
height:100vh!important;
min-width:100vw!important;
min-height:100vh!important;
object-fit:cover!important;
transform:scale(1.08)!important;
transform-origin:center center!important;
}

/* maintain cover behavior during resize */
html,
body{
overflow-x:hidden!important;
}

/* prevent page elements from covering toolbar */
.topbar,
.card,
.records-card,
.table-wrap{
position:relative!important;
z-index:2!important;
}

/* toolbar stays above everything */
#rpYoutubeToolbar{
backdrop-filter:blur(10px)!important;
-webkit-backdrop-filter:blur(10px)!important;
}

/* ===== END RP STATIC VIDEO TOOLBAR FIX ===== */


/* ===== DASHBOARD-ANCHORED VIDEO TOOLBAR ===== */

/* toolbar behaves like dashboard/top data area */
#rpYoutubeToolbar{
position:relative!important;
top:auto!important;
left:auto!important;
right:auto!important;
width:100%!important;
margin:0 0 12px 0!important;
z-index:50!important;
}

/* remove fake body spacing from fixed mode */
body.rp-video-toolbar-spacing{
padding-top:0!important;
}

/* anchor toolbar inside dashboard area */
.dashboard,
.records-card,
.card,
.table-wrap{
overflow:visible!important;
}

/* toolbar scrolls naturally WITH the page */
#rpYoutubeToolbar{
display:flex!important;
align-items:center!important;
flex-wrap:wrap!important;
}

/* ===== END DASHBOARD-ANCHORED VIDEO TOOLBAR ===== */


/* ===== SAFE PRINTER COLUMN ONLY ===== */
.c-printer { width: 58px; }
.printer-cell {
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
  overflow: hidden;
  white-space: nowrap;
}
.printer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  margin: 0 auto;
}
.printer-btn:hover {
  background: rgba(79,125,191,.20);
}

/* Brother QL-800 2.4in x 1.1in print label */
@media print {
  @page { size: 2.4in 1.1in; margin: 0; }
}
.rp-label {
  width: 2.4in;
  height: 1.1in;
  box-sizing: border-box;
  border: 1px solid #000;
  padding: 0.055in;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rp-label-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.055in;
  font-size: 6pt;
  line-height: 1.08;
  white-space: nowrap;
}
.rp-label-right { text-align: right; overflow: hidden; }
.rp-label-left { overflow: hidden; }
.rp-label-divider {
  border-top: 1px solid #000;
  margin: 0.025in 0;
}
.rp-label-name {
  font-weight: 900;
  font-size: 7.5pt;
  line-height: 1.05;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-label-address {
  font-size: 6.3pt;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-label-bars {
  margin-top: auto;
  height: 0.30in;
  display: flex;
  align-items: stretch;
  gap: 1px;
  overflow: hidden;
  width: 100%;
}
.rp-label-bars span {
  display: block;
  background: #000;
  height: 100%;
  flex: 0 0 auto;
}


/* ===== TABLE HORIZONTAL SCROLL FIX ===== */

.records-card,
.table-wrap,
#recordsTable{
position:relative!important;
isolation:isolate!important;
}

/* keep table separated from upper controls */
.table-wrap{
margin-top:14px!important;
padding-top:8px!important;
border-top:1px solid rgba(255,255,255,.12)!important;
overflow-x:auto!important;
overflow-y:hidden!important;
max-width:100%!important;
}

/* stop header/control bleed */
.dashboard,
.topbar,
.toolbar,
.records-toolbar,
.region-filter-shell{
position:relative!important;
z-index:5!important;
}

/* table layer lower than controls */
#recordsTable{
z-index:1!important;
min-width:1800px!important;
}

/* preserve clean scrolling */
.table-wrap::-webkit-scrollbar{
height:12px!important;
}

.table-wrap::-webkit-scrollbar-thumb{
background:rgba(255,255,255,.18)!important;
border-radius:999px!important;
}

/* notes containment */
.notes-cell{
overflow:hidden!important;
}

/* prevent text overlap */
th,
td{
overflow:hidden!important;
text-overflow:ellipsis!important;
white-space:nowrap!important;
}

/* ===== END TABLE HORIZONTAL SCROLL FIX ===== */


/* ===== CINEMATIC CLEAR GLASS UI ===== */

:root{
--panel-bg:transparent!important;
--card-bg:transparent!important;
--input-bg:transparent!important;
}

/* remove blue fills globally */
.card,
.panel,
.section,
.dashboard,
.records-card,
.toolbar,
.topbar,
.table-wrap,
.bulk-panel,
.manage-panel,
.region-shell,
.region-filter-shell,
fieldset,
legend{
background:transparent!important;
background-color:transparent!important;
}

/* floating glass only */
.card,
.panel,
.section,
.dashboard,
.records-card,
.toolbar,
.topbar,
.table-wrap{
backdrop-filter:blur(5px)!important;
-webkit-backdrop-filter:blur(5px)!important;
border:1px solid rgba(255,255,255,.10)!important;
box-shadow:none!important;
}

/* inputs */
input,
textarea,
select{
background:transparent!important;
background-color:transparent!important;
border:1px solid rgba(255,255,255,.12)!important;
backdrop-filter:blur(4px)!important;
-webkit-backdrop-filter:blur(4px)!important;
box-shadow:none!important;
}

/* rows fully transparent */
table,
tbody,
tr,
td{
background:transparent!important;
background-color:transparent!important;
}

/* keep headers readable */
thead th{
background:rgba(0,0,0,.16)!important;
backdrop-filter:blur(6px)!important;
-webkit-backdrop-filter:blur(6px)!important;
}

/* hover only */
tbody tr:hover{
background:rgba(255,255,255,.04)!important;
}

/* remove dark overlays */
.overlay,
.overlay-dark,
.dim-layer,
.video-overlay{
background:transparent!important;
opacity:1!important;
}

/* buttons */
button,
.btn{
background:rgba(255,255,255,.05)!important;
border:1px solid rgba(255,255,255,.14)!important;
backdrop-filter:blur(5px)!important;
-webkit-backdrop-filter:blur(5px)!important;
box-shadow:none!important;
}

/* preserve video visibility */
body::before,
body::after{
display:none!important;
}

/* notes */
.notes-cell,
.notes-input{
background:transparent!important;
}

/* sections spacing */
.dashboard,
.records-card,
.section{
margin-bottom:12px!important;
}

/* ===== END CINEMATIC CLEAR GLASS UI ===== */



/* ===== RP LOCK CONTROL TOGGLE ===== */
#rpYoutubeToolbar{
transition:opacity .25s ease,max-height .25s ease,transform .25s ease!important;
}

body.rp-toolbar-hidden #rpYoutubeToolbar{
opacity:0!important;
pointer-events:none!important;
max-height:0!important;
overflow:hidden!important;
transform:translateY(-12px)!important;
margin:0!important;
padding:0!important;
border:0!important;
}

#rpToolbarToggle{
position:fixed!important;
top:16px!important;
right:16px!important;
width:48px!important;
height:48px!important;
border-radius:50%!important;
border:1px solid rgba(255,255,255,.22)!important;
background:rgba(255,255,255,.10)!important;
backdrop-filter:blur(14px)!important;
-webkit-backdrop-filter:blur(14px)!important;
display:flex!important;
align-items:center!important;
justify-content:center!important;
z-index:9999999!important;
color:#fff!important;
font-size:18px!important;
box-shadow:0 4px 18px rgba(0,0,0,.35)!important;
}

/* ===== ASSET TAG CENTERING FIX ===== */
@media print{
.asset-tag,
.asset-tag *,
.print-label,
.print-label *{
box-sizing:border-box!important;
}

.asset-tag,
.print-label{
display:flex!important;
flex-direction:column!important;
align-items:center!important;
justify-content:center!important;
text-align:center!important;
padding:18px!important;
overflow:hidden!important;
}

.asset-tag table,
.print-label table{
margin:0 auto!important;
width:100%!important;
}

.asset-tag td,
.asset-tag th,
.print-label td,
.print-label th{
text-align:center!important;
vertical-align:middle!important;
padding:6px 10px!important;
word-break:break-word!important;
}

svg,
canvas,
img{
max-width:100%!important;
}
}
/* ===== END FIXES ===== */


/* ===== RESTORE BASELINE ROW VERTICAL SCROLL FIX =====
   Scope: records/table viewport only.
   Purpose: allow scrolling down to view all rows without touching print logic.
*/
html,
body{
  min-height:100vh !important;
  height:auto !important;
  overflow-y:auto !important;
}

body{
  overflow-x:hidden;
}

.table-wrap,
.records-table-wrap,
.records-container,
.records-wrapper,
.table-container,
.results-wrap,
.data-wrap,
.main-table-wrap{
  overflow-y:auto !important;
  overflow-x:auto !important;
  max-height:78vh !important;
  -webkit-overflow-scrolling:touch;
}

.table-wrap table,
.records-table-wrap table,
.records-container table,
.table-container table{
  width:max-content;
  min-width:100%;
}

/* If a parent card was locking the table, allow the table wrapper to scroll instead. */
.dashboard,
.panel,
.card,
.content,
.main-content,
.app-main,
.records-card{
  min-height:0 !important;
}

/* Keep print output isolated from scrolling changes. */
@media print{
  html,
  body{
    overflow:hidden !important;
    height:auto !important;
  }

  .table-wrap,
  .records-table-wrap,
  .records-container,
  .records-wrapper,
  .table-container{
    max-height:none !important;
    overflow:visible !important;
  }
}
/* ===== END RESTORE BASELINE ROW VERTICAL SCROLL FIX ===== */
