.program-control-page {
  --program-navy: #13233e;
  --program-blue: #246bfd;
  --program-line: #dfe6f0;
  min-width: 0;
  padding-bottom: 92px;
}

.program-page-head,
.program-list-head,
.program-connection-title,
.program-print-bar,
.program-selection-tools,
.program-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.program-page-head { margin-bottom: 18px; }
.program-page-head h2 { margin: 2px 0 6px; color: var(--program-navy); font-size: 26px; }
.program-page-head p { margin: 0; color: #66758d; }
.program-eyebrow { color: var(--program-blue) !important; font-size: 11px; font-weight: 800; letter-spacing: .14em; }

.program-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 0; border-bottom: 1px solid var(--program-line); }
.program-tab { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; min-height: 46px; padding: 0 17px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: #eef2f8; color: #65738b; font-weight: 700; cursor: pointer; }
.program-tab.active { background: #fff; color: var(--program-navy); border-color: var(--program-line); box-shadow: 0 -2px 8px rgba(24, 43, 74, .04); }
.program-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeb8c8; }
.program-status-dot.online { background: #13ad69; box-shadow: 0 0 0 3px rgba(19, 173, 105, .13); }
.program-no-tabs { padding: 13px 2px; color: #7b8798; }

.program-content { min-width: 0; }
.program-connection-card,
.program-list-card,
.program-history-card { margin-top: 14px; border: 1px solid var(--program-line); border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgba(24, 43, 74, .045); }
.program-connection-card { padding: 18px 20px; }
.program-connection-title { justify-content: flex-start; }
.program-connection-title div { display: grid; gap: 3px; }
.program-connection-title small { color: #77849a; }
.program-delete-agent { margin-left: auto; min-height: 34px; padding: 0 12px; border: 1px solid #efc2c2; border-radius: 8px; background: #fff5f5; color: #b73535; font-size: 12px; font-weight: 800; cursor: pointer; }
.program-delete-agent:hover { background: #fdeaea; }
.program-delete-agent:disabled { opacity: .55; cursor: wait; }
.program-status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: #6d7889; background: #edf0f5; font-size: 12px; font-weight: 800; }
.program-status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #9da8b8; }
.program-status-pill.online { color: #087644; background: #e6f7ef; }
.program-status-pill.online i { background: #13ad69; }
.program-setting-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.program-setting-grid label { min-width: 0; padding: 12px 14px; border-radius: 9px; background: #f6f8fb; }
.program-setting-grid span,
.program-setting-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.program-setting-grid span { color: #8190a5; font-size: 11px; font-weight: 700; }
.program-setting-grid strong { margin-top: 5px; color: #24334d; font-size: 13px; }
.program-setting-note { margin: 11px 0 0; color: #7a879a; font-size: 12px; }

.program-list-card { overflow: hidden; }
.program-list-head { padding: 16px 18px; border-bottom: 1px solid #edf1f6; }
.program-list-head h3 { margin: 0 0 4px; color: var(--program-navy); font-size: 16px; }
.program-list-head span { color: #7c899d; font-size: 12px; }
.program-search-area { display: grid; justify-items: end; gap: 5px; }
.program-search-area > small { color: #7c899d; font-size: 11px; }
.program-search-box { display: flex; gap: 7px; }
.program-search-box input { width: min(300px, 42vw); min-height: 38px; padding: 0 12px; border: 1px solid #d8e0eb; border-radius: 7px; }
.program-search-box button:disabled { opacity: .55; cursor: wait; }
.program-selection-tools { justify-content: flex-start; padding: 10px 14px; background: #f8fafc; }
.program-selection-tools span { margin-left: auto; color: #7f8b9d; font-size: 11px; }
.program-table-scroll { width: 100%; overflow: auto; max-height: 540px; }
.program-data-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.program-check-column { width: 48px; min-width: 48px; max-width: 48px; }
.program-data-table th { position: sticky; top: 0; right: auto !important; left: auto !important; z-index: 2; box-sizing: border-box; height: 40px; padding: 0 12px; border-right: 1px solid rgba(255, 255, 255, .16); background: var(--program-navy); color: #fff; text-align: left; white-space: nowrap; }
.program-data-table td { position: static !important; right: auto !important; left: auto !important; box-sizing: border-box; max-width: 240px; height: 38px; padding: 0 12px; border-right: 1px solid #edf1f6; border-bottom: 1px solid #e7ecf3; color: #34435b; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.program-resizable-column { width: 200px; min-width: 200px; max-width: 200px; }
.program-column-resizer { position: absolute; top: 0; right: -5px; z-index: 5; width: 10px; height: 100%; cursor: col-resize; touch-action: none; }
.program-column-resizer::after { content: ""; position: absolute; top: 7px; right: 4px; width: 1px; height: 26px; background: rgba(255, 255, 255, .24); }
.program-column-resizer:hover::after { width: 2px; background: #7fb1ff; }
.program-column-resizing,
.program-column-resizing * { cursor: col-resize !important; user-select: none !important; }
.program-data-table tr:nth-child(even) td { background: #f8fbff; }
.program-data-table tr.selected td { background: #e9f2ff; }
.program-data-table tbody tr:hover td { background: #f0f6ff; }
.program-check-cell { width: 48px; min-width: 48px; text-align: center !important; }
.program-data-table thead .program-check-cell { background: #102039; }
.program-data-table input[type="checkbox"] { appearance: auto; width: 16px !important; min-width: 16px !important; height: 16px !important; min-height: 16px !important; margin: 0; padding: 0 !important; vertical-align: middle; }
.program-serial-cell { width: 200px; min-width: 200px; max-width: 200px; font-weight: 700; color: #17335f !important; }
.program-mobile-serial { width: 100%; padding: 0; border: 0; background: transparent; color: #174a96; text-align: left; font: inherit; font-weight: 800; cursor: pointer; }
.program-no-rows { padding: 28px !important; color: #8490a2 !important; text-align: center; }
.program-pagination { justify-content: center; padding: 12px; border-top: 1px solid #edf1f6; }
.program-pagination button { min-width: 72px; min-height: 34px; border: 1px solid #d9e1ec; border-radius: 7px; background: #fff; color: #3d4c63; cursor: pointer; }
.program-pagination button:disabled { opacity: .45; cursor: default; }

.program-history-card { overflow: hidden; }
.program-history-list { display: grid; }
.program-history-list article { display: grid; grid-template-columns: 76px 70px 1fr; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-top: 1px solid #edf1f6; }
.program-history-list p { margin: 0; padding: 18px; color: #8490a2; }
.program-history-list small { color: #738096; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.program-job-status { width: fit-content; padding: 4px 8px; border-radius: 999px; background: #edf1f6; color: #667388; font-size: 11px; font-weight: 800; }
.program-job-status.completed { color: #087644; background: #e6f7ef; }
.program-job-status.failed { color: #b73535; background: #fdeaea; }
.program-job-status.queued,
.program-job-status.claimed { color: #245fb9; background: #e7f0ff; }

.program-row-detail-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(78vh, 720px); padding: 0; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(16, 32, 57, .28); color: #263750; }
.program-row-detail-dialog::backdrop { background: rgba(8, 20, 39, .55); backdrop-filter: blur(2px); }
.program-row-detail-dialog header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; border-bottom: 1px solid #e8edf4; background: #fff; }
.program-row-detail-dialog header small { color: var(--program-blue); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.program-row-detail-dialog header h3 { margin: 3px 0 0; color: var(--program-navy); font-size: 18px; }
.program-row-detail-dialog header button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef2f7; color: #526079; font-size: 22px; cursor: pointer; }
.program-row-detail-list { max-height: calc(min(78vh, 720px) - 69px); overflow-y: auto; padding: 8px 18px 20px; }
.program-row-detail-list dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; margin: 0; padding: 11px 2px; border-bottom: 1px solid #edf1f6; }
.program-row-detail-list dt { color: #718096; font-size: 12px; font-weight: 800; }
.program-row-detail-list dd { min-width: 0; margin: 0; color: #24334d; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }

.program-print-bar { position: fixed; z-index: 30; right: 24px; bottom: 18px; left: 284px; padding: 13px 16px; border: 1px solid #cfd9e7; border-radius: 13px; background: rgba(255, 255, 255, .96); box-shadow: 0 10px 30px rgba(17, 35, 62, .16); backdrop-filter: blur(10px); }
.sidebar-collapsed .program-print-bar { left: 92px; }
.program-print-bar div { display: grid; gap: 3px; }
.program-print-bar strong { color: var(--program-navy); }
.program-print-bar span { color: #77849a; font-size: 11px; }
.program-print-bar button:disabled { opacity: .5; cursor: not-allowed; }
.program-empty { display: grid; place-items: center; gap: 8px; min-height: 260px; padding: 30px; color: #7b8798; text-align: center; }
.program-empty strong { color: #31415a; font-size: 17px; }
.program-empty.error strong { color: #b73535; }

@media (max-width: 980px) {
  .program-setting-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .program-print-bar { left: 92px; }
}

@media (max-width: 700px) {
  .program-control-page { padding-bottom: 190px; }
  .program-page-head { align-items: flex-start; }
  .program-page-head h2 { font-size: 22px; }
  .program-page-head > div > p:last-child { font-size: 12px; }
  .program-connection-card { padding: 15px; }
  .program-connection-title { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .program-delete-agent { width: 100%; margin-left: 0; }
  .program-setting-grid { grid-template-columns: 1fr; }
  .program-list-head { align-items: stretch; flex-direction: column; }
  .program-search-area { justify-items: stretch; }
  .program-search-box input { width: 100%; }
  .program-selection-tools { flex-wrap: wrap; }
  .program-selection-tools span { width: 100%; margin-left: 0; }
  .program-table-scroll { max-height: none; overflow: visible; }
  .program-mobile-table { width: 100% !important; min-width: 100% !important; table-layout: fixed; }
  .program-mobile-table .program-check-column { width: 44px !important; }
  .program-mobile-table col[data-program-column="HFR_NO"] { width: auto !important; }
  .program-mobile-table .program-check-cell { width: 44px; min-width: 44px; }
  .program-mobile-table .program-serial-head,
  .program-mobile-table .program-serial-cell { width: auto !important; min-width: 0 !important; max-width: none !important; }
  .program-mobile-table td { height: 44px; }
  .program-print-bar { display: flex !important; visibility: visible !important; z-index: 999; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 10px; min-height: 58px; }
  .program-print-bar button { display: inline-flex !important; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 42px; padding: 0 14px; }
  .program-print-bar span { max-width: 56vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .program-history-list article { grid-template-columns: 70px 55px minmax(0, 1fr); padding: 0 12px; }
  .program-row-detail-list dl { grid-template-columns: 72px minmax(0, 1fr); }
}
.program-device-icon{width:22px;height:22px;flex:none;vertical-align:middle}
.program-quick-card{padding:18px;margin:14px 0;background:#fff;border:1px solid #cdddee;border-radius:12px;box-shadow:0 3px 12px #153b5b08}
.program-quick-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.program-quick-heading h3{margin:0 0 5px;font-size:16px;color:#123552}
.program-quick-heading p{margin:0;font-size:12px;color:#65768a}
.program-quick-badge{white-space:nowrap;border-radius:20px;padding:6px 10px;font-size:11px;color:#086b57;background:#e5f6f0}
.program-quick-inputs{display:flex;gap:8px;flex-wrap:wrap}
.program-quick-inputs input{flex:1;min-width:200px;width:auto;padding:11px 12px;border:1px solid #bacde1;border-radius:7px;font-size:16px}
.program-quick-inputs button{min-height:42px}
.program-quick-status{font-size:13px;line-height:1.6;color:#4a637d;overflow-wrap:anywhere}
.program-quick-warning{color:#965608;font-size:12px;background:#fff5e1;padding:10px;border-radius:6px}
.program-quick-preview{padding:15px;background:#f4f8fc;border:1px solid #d6e4f0;border-radius:9px}
.program-quick-summary{display:grid;gap:6px;overflow-wrap:anywhere}
.program-quick-summary strong{font-size:20px;color:#123f72}
.program-quick-summary small{line-height:1.8;color:#496079}
.program-quick-preview details{margin:12px 0;font-size:13px}
.program-quick-preview dl{max-height:260px;overflow:auto}
.program-quick-preview dl>div{display:grid;grid-template-columns:80px 1fr;gap:10px;padding:5px;border-bottom:1px solid #dce6ee}
.program-quick-preview dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.program-quick-preview>.primary-action{min-height:46px;width:100%;position:static}
.program-quick-camera{position:relative;max-width:600px;margin:12px auto;padding:10px;background:#122a40;color:#fff;border-radius:10px}
.program-quick-camera[hidden]{display:none!important}
.program-quick-camera video{width:100%;max-height:360px;object-fit:contain;background:#000}
.program-quick-camera button{min-height:40px}
@media(max-width:700px){.program-quick-card{padding:12px}.program-quick-heading{align-items:flex-start}.program-quick-inputs input{flex-basis:100%;width:100%;min-width:0}.program-quick-inputs button{flex:1}.program-quick-badge{display:none}}
.program-control-page .program-print-bar[hidden] { display: none !important; }
