/* ==========================================================================
   tables.css — IITMS 데이터 표 통합 (.device-table + .data-table + 반응형)
   --------------------------------------------------------------------------
   device.css + table_common.css + app-ui.css(.data-table) 를 병합. 클래스명은
   전부 유지(JS 결합: device_list_inline.js/device_inspection_inline.js 가
   .device-table/.device-table-scroll-wrapper/.device-row 를 직접 참조).
   포인트색 배경 + 흰 글자 헤더(사용자 확정), 정렬은 표별 기존 값 유지.
   tokens.css 이후 로드.
   ========================================================================== */

:root {
    --table-font-size: clamp(13px, 0.7vw + 4px, 15px);
    --table-line-height: 1.32;
}

/* ==========================================================================
   1. .device-table — 장비/무선/IP 등 목록 표 (가운데 정렬 유지)
   ========================================================================== */
.device-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.device-table th {
    background-color: var(--ui-th-bg);
    color: var(--ui-th-text);
    padding: 8px 10px;
    text-align: center;
    font-weight: 700;
    font-size: var(--table-font-size);
    line-height: var(--table-line-height);
    letter-spacing: .01em;
    vertical-align: middle;
    border: none;
    white-space: nowrap;
}
.device-table td {
    padding: 7px 10px;
    text-align: center;
    border-bottom: 1px solid var(--ui-divider);
    vertical-align: middle;
    font-size: var(--table-font-size);
    color: var(--ui-slate-700);
    line-height: var(--table-line-height);
    font-variant-numeric: tabular-nums;
    white-space: normal;
    word-break: keep-all;
}
.device-table tbody tr:hover { background-color: var(--ui-row-hover); }
.device-table tbody tr:nth-child(even) { background: var(--ui-zebra); }

/* 컬럼 너비(class 기반) */
.col-school { width: 80px; } .col-cno { width: 100px; } .col-uid { width: 100px; }
.col-manage { width: 90px; } .col-type { width: 80px; } .col-pos { width: 60px; }
.col-name { width: 80px; } .col-mfg { width: 90px; } .col-model { width: 120px; }
.col-date { width: 90px; } .col-ip { width: 100px; } .col-room { width: 80px; }
/* 배부여부(0013) — 폭을 안 주면 이 열만 width:100% 잉여 공간을 전부 흡수해 과대해진다 */
.col-distribution { width: 90px; }
.col-purpose { width: 70px; } .col-set { width: 80px; } .col-note { width: 100px; }
.col-unused { width: 50px; } .col-action { width: 90px; } .col-inspect { width: 60px; }
.device-table th.col-unused, .device-table tbody td.col-unused { text-align: center; font-weight: 600; }

@media (min-width: 1024px) {
    .device-list-container .device-table { min-width: 1780px; width: 100%; }
}
.device-table-scroll-wrapper, .table-scroll {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--ui-radius-md);
    scrollbar-gutter: stable;
}
.table-scroll { box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.04); }

.device-type, .ip-address { white-space: nowrap; }
@media (max-width: 1400px) {
    .device-table tbody td.col-model, .device-table tbody td.col-manage {
        max-height: calc(2 * var(--table-line-height) * 1em); overflow: hidden; vertical-align: middle;
    }
    .device-list-page .device-table:not(.summary-pivot-table) tbody td.col-model,
    .device-list-page .device-table:not(.summary-pivot-table) tbody td.col-manage,
    .device-inspection-page .device-table tbody td.col-model,
    .device-inspection-page .device-table tbody td.col-manage {
        max-height: none; overflow: visible; vertical-align: middle;
    }
}
@media (max-width: 1220px) {
    .device-type, .ip-address, .device-table td:nth-child(11) { white-space: normal; }
}
@media (min-width: 993px) and (max-width: 1400px) {
    .device-list-page .device-table:not(.summary-pivot-table), .device-inspection-page .device-table { overflow: visible !important; }
    .device-list-page .device-table:not(.summary-pivot-table) .device-type, .device-inspection-page .device-table .device-type {
        display: block; min-width: 0; white-space: normal !important; overflow: visible !important; text-overflow: unset !important;
    }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-model, .device-list-page .device-table:not(.summary-pivot-table) td.col-model,
    .device-inspection-page .device-table th.col-model, .device-inspection-page .device-table td.col-model {
        word-break: break-word; overflow-wrap: anywhere;
    }
}

/* 교실/담당자/그룹 서브 헤더 행 */
.device-table tr.classroom-header { background: var(--ui-info) !important; border: none; }
.device-table tr.classroom-header td { padding: 7px 14px; font-weight: 700; color: var(--ui-surface) !important; text-align: left; font-size: 0.95rem; }
.device-table tr.classroom-header i { margin-right: 10px; color: var(--ui-surface); }
.device-table tr.operator-header { background: var(--ui-slate-100) !important; }
.device-table tr.operator-header td { padding: 5px 16px; font-weight: 600; color: var(--ui-slate-500) !important; text-align: left; font-size: 0.88rem; border-bottom: 1px solid var(--ui-slate-200); }
.device-table tr.operator-header i { margin-right: 8px; color: var(--ui-slate-400); }
.device-table tr.group-header { background-color: var(--ui-row-hover) !important; border-top: 1px solid var(--ui-border); }
.device-table tr.group-header td { padding: 5px 8px; font-weight: 600; color: var(--ui-primary); text-align: left; }
.device-table tr.group-header strong { font-size: 13px; font-weight: 700; color: var(--ui-info); }
.device-table tr.group-item { border-left: 3px solid transparent; }
.device-table tr.set-group-item { border-left: 3px solid var(--ui-info); }
.device-table tr.operator-group-item { border-left: 3px solid #ffa502; }
.table-striped th, .table-striped td { vertical-align: middle; font-size: 0.9rem; }

/* ==========================================================================
   2. 목록 행 hover/expand, 타일 뷰, 상세 패널(table_common.css 계승)
   ========================================================================== */
.device-row { cursor: pointer; transition: background 0.2s; }
.device-row:hover { background-color: var(--ui-row-hover) !important; }
.device-row.active { background-color: var(--ui-zebra) !important; }
.device-row--tile-pack { cursor: default; }
.device-row--tile-pack:hover { background-color: inherit !important; }
.device-row--tile-pack > td { padding: 10px 12px; vertical-align: top; }
.device-tile-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.device-tile-row.device-tile-row--one-col { grid-template-columns: minmax(0, 1fr); }
.device-tile { border: 1px solid var(--ui-slate-200); border-radius: 10px; padding: 10px 10px 10px 12px; background: var(--ui-surface); cursor: pointer; transition: background 0.15s, box-shadow 0.15s; min-width: 0; }
.device-tile:hover { background: var(--ui-slate-50); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
.device-tile.active { background: var(--ui-zebra) !important; box-shadow: inset 0 0 0 1px #93c5fd; }
.device-tile.device-row-bulk-selected { box-shadow: inset 0 0 0 2px var(--ui-info); }
.device-tile__bulk { margin-bottom: 8px; }
.device-tile__inspect { margin-bottom: 8px; }
.device-tile__grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 0.8rem; line-height: 1.35; }
@media (min-width: 993px) {
    .device-list-page .device-tile .device-tile__grid, .device-inspection-page .device-tile .device-tile__grid { grid-template-columns: minmax(0, 1fr); }
    .device-list-page .device-tile .device-tile__cell.col-unused, .device-inspection-page .device-tile .device-tile__cell.col-unused { grid-column: auto; }
}
.device-tile__cell { min-width: 0; word-break: break-word; }
.device-tile__cell.col-unused { grid-column: 1 / -1; margin-top: 4px; }
.device-tile.row-scan-success { background: var(--ui-slate-100) !important; border-color: #6ee7b7; }
@media (max-width: 1100px) {
    .device-tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .device-tile-row.device-tile-row--one-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) { .device-tile-row { grid-template-columns: 1fr; } }

.detail-row { display: none; background-color: var(--ui-slate-50); border-bottom: 2px solid var(--ui-slate-200); }
.detail-row.active { display: table-row; }
.detail-content { padding: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.detail-item { display: flex; flex-direction: column; border-bottom: 1px solid var(--ui-slate-100); padding-bottom: 8px; }
.detail-label { font-size: 0.7rem; color: var(--ui-slate-400); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.detail-value { font-size: 0.9rem; font-weight: 600; color: var(--ui-slate-700); word-break: break-all; }
.detail-row .detail-panel-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.82rem; font-weight: 700; color: var(--ui-slate-600); }
.detail-item--note .detail-value { white-space: pre-wrap; font-weight: 500; }
.detail-row .detail-panel-heading .fa-chevron-down { transition: transform 0.2s ease; }
.detail-row.active .detail-panel-heading .fa-chevron-down { transform: rotate(-180deg); }

@media (max-width: 630px) {
    .detail-grid { grid-template-columns: 1fr; }
    .device-list-page .detail-grid, .device-inspection-page .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
    .device-list-page .detail-item--note, .device-inspection-page .detail-item--note { grid-column: 1 / -1; }
}

/* ==========================================================================
   3. 모바일 접힌 행(992px 이하) — 열 숨김·sticky·그리드 재배치
   ========================================================================== */
@media (max-width: 992px) {
    .col-school, .col-cno, .col-manage, .col-type, .col-pos, .col-mfg, .col-date, .col-ip, .col-distribution, .col-purpose, .col-set, .col-note, .col-action { display: none !important; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .device-table { min-width: unset !important; width: 100%; table-layout: auto; }
    .device-table th, .device-table td { font-size: 12px; padding: 6px 6px; line-height: 1.32; }
    .col-inspect { position: sticky; left: 0; z-index: 20; width: 75px !important; min-width: 75px !important; background-color: var(--ui-surface) !important; }
    th.col-inspect { background-color: var(--ui-th-bg) !important; color: var(--ui-th-text) !important; }
    .device-list-page .device-table:not(.summary-pivot-table) tbody td.col-uid,
    .device-list-page .device-table:not(.summary-pivot-table) thead th.col-uid {
        position: sticky; left: 0; z-index: 19; background-color: var(--ui-surface) !important; box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
    }
    .device-list-page .device-table:not(.summary-pivot-table) thead th.col-uid {
        background-color: var(--ui-th-bg) !important; color: var(--ui-th-text) !important; box-shadow: 2px 0 4px rgba(0, 0, 0, 0.12);
    }
    .device-list-page .device-table:not(.summary-pivot-table) tbody tr.detail-row td { position: static; left: auto; }
}
@media (max-width: 992px) {
    .device-list-page .device-table:not(.summary-pivot-table) th, .device-list-page .device-table:not(.summary-pivot-table) td,
    .device-inspection-page .device-table th, .device-inspection-page .device-table td {
        font-size: clamp(10px, 2.6vw, 12px) !important; padding: 4px 3px !important; line-height: 1.3 !important;
    }
    .device-list-page .device-table:not(.summary-pivot-table) .detail-content, .device-inspection-page .device-table .detail-content { padding: 12px 10px; }
    .device-list-page .device-table:not(.summary-pivot-table) .detail-grid, .device-inspection-page .device-table .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px 8px; }
    .device-list-page .device-table:not(.summary-pivot-table) .detail-item--note, .device-inspection-page .device-table .detail-item--note { grid-column: 1 / -1; }
    .device-list-page .device-table:not(.summary-pivot-table) .detail-label, .device-inspection-page .device-table .detail-label { font-size: 0.62rem; margin-bottom: 2px; }
    .device-list-page .device-table:not(.summary-pivot-table) .detail-value, .device-inspection-page .device-table .detail-value { font-size: 0.78rem; }
    .device-list-page .device-table:not(.summary-pivot-table) tbody td.col-uid, .device-list-page .device-table:not(.summary-pivot-table) thead th.col-uid { position: static !important; left: auto !important; box-shadow: none !important; }
    .device-inspection-page .device-table .col-inspect { position: static !important; left: auto !important; width: auto !important; min-width: 0 !important; }
    .device-list-page .device-table:not(.summary-pivot-table) tbody tr.device-row > td, .device-inspection-page .device-table tbody tr.device-row > td {
        max-height: none !important; overflow: visible !important; padding-top: 6px !important; padding-bottom: 6px !important;
    }
    .device-list-page .device-table:not(.summary-pivot-table) thead tr, .device-list-page .device-table:not(.summary-pivot-table) tbody tr.device-row {
        display: grid !important; box-sizing: border-box; width: 100% !important; min-width: 0; align-items: start; justify-items: stretch;
    }
    .device-list-page .device-table:not(.summary-pivot-table) tbody tr.device-row { column-gap: 4px; row-gap: 4px; }
    .device-list-page .device-table:not(.summary-pivot-table) thead tr { column-gap: 0; row-gap: 0; background: var(--ui-th-bg); }
    .device-list-page .device-table:not(.summary-pivot-table) thead tr,
    .device-list-page .device-table:not(.summary-pivot-table) tbody tr.device-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: auto auto;
        grid-template-areas: "l_md l_r  l_m  l_ip" ".    l_n  l_mg l_t";
    }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-room, .device-list-page .device-table:not(.summary-pivot-table) td.col-room { grid-area: l_r; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-manage, .device-list-page .device-table:not(.summary-pivot-table) td.col-manage { grid-area: l_m; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-mfg, .device-list-page .device-table:not(.summary-pivot-table) td.col-mfg { grid-area: l_mg; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-model, .device-list-page .device-table:not(.summary-pivot-table) td.col-model { grid-area: l_t; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-type, .device-list-page .device-table:not(.summary-pivot-table) td.col-type { grid-area: l_md; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-name, .device-list-page .device-table:not(.summary-pivot-table) td.col-name { grid-area: l_n; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-ip, .device-list-page .device-table:not(.summary-pivot-table) td.col-ip { grid-area: l_ip; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr,
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row {
        grid-template-columns: 2.25rem repeat(4, minmax(0, 1fr));
        grid-template-areas: "bblk btyp broom bman bip" ".    bname bmfg  bmd .";
    }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead th.bulk-col,
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.bulk-col { display: block !important; grid-area: bblk; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr th.col-room, .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.col-room { grid-area: broom; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr th.col-manage, .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.col-manage { grid-area: bman; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr th.col-mfg, .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.col-mfg { grid-area: bmfg; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr th.col-model, .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.col-model { grid-area: bmd; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr th.col-type, .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.col-type { grid-area: btyp; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr th.col-name, .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.col-name { grid-area: bname; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) thead tr th.col-ip, .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.device-row > td.col-ip { grid-area: bip; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.accordion-header {
        display: grid !important; grid-template-columns: 2.25rem minmax(0, 1fr); width: 100% !important; min-width: 0; box-sizing: border-box;
    }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.accordion-header > td.bulk-col { grid-column: 1; display: flex !important; align-items: center; justify-content: center; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.accordion-header > td:not(.bulk-col) { grid-column: 2; min-width: 0; max-width: 100% !important; }
    .device-list-page.selection-mode-on .device-table:not(.summary-pivot-table) tbody tr.purpose-header.accordion-header > td:only-of-type { grid-column: 1 / -1; }
    .device-list-page .device-table:not(.summary-pivot-table) tbody tr.accordion-header.collapsed td { border-bottom: none !important; }
    .device-list-page .device-table:not(.summary-pivot-table) tbody tr.accordion-header.collapsed { border-bottom: none; box-shadow: none; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-uid, .device-list-page .device-table:not(.summary-pivot-table) td.col-uid,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-cno, .device-list-page .device-table:not(.summary-pivot-table) td.col-cno,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-pos, .device-list-page .device-table:not(.summary-pivot-table) td.col-pos,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-date, .device-list-page .device-table:not(.summary-pivot-table) td.col-date,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-purpose, .device-list-page .device-table:not(.summary-pivot-table) td.col-purpose,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-set, .device-list-page .device-table:not(.summary-pivot-table) td.col-set,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-note, .device-list-page .device-table:not(.summary-pivot-table) td.col-note,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-unused, .device-list-page .device-table:not(.summary-pivot-table) td.col-unused,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-inspect, .device-list-page .device-table:not(.summary-pivot-table) td.col-inspect,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-school, .device-list-page .device-table:not(.summary-pivot-table) td.col-school { display: none !important; }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-room, .device-list-page .device-table:not(.summary-pivot-table) td.col-room,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-manage, .device-list-page .device-table:not(.summary-pivot-table) td.col-manage,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-mfg, .device-list-page .device-table:not(.summary-pivot-table) td.col-mfg,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-type, .device-list-page .device-table:not(.summary-pivot-table) td.col-type,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-model, .device-list-page .device-table:not(.summary-pivot-table) td.col-model,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-name, .device-list-page .device-table:not(.summary-pivot-table) td.col-name,
    .device-list-page .device-table:not(.summary-pivot-table) th.col-ip, .device-list-page .device-table:not(.summary-pivot-table) td.col-ip {
        display: block !important; min-width: 0; box-sizing: border-box; white-space: normal !important; overflow-wrap: anywhere;
        word-wrap: break-word; word-break: keep-all; line-height: 1.45 !important;
    }
    .device-list-page .device-table:not(.summary-pivot-table) th.col-model, .device-list-page .device-table:not(.summary-pivot-table) td.col-model { word-break: break-word !important; overflow-wrap: anywhere; }

    .device-inspection-page .device-table thead tr, .device-inspection-page .device-table tbody tr.device-row {
        display: grid !important; box-sizing: border-box; width: 100% !important; min-width: 0; align-items: start; justify-items: stretch;
        grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto auto;
        grid-template-areas: "di_typ di_room di_man di_insp" "di_mfg di_mod di_name di_ip";
    }
    .device-inspection-page .device-table tbody tr.device-row { column-gap: 4px; row-gap: 4px; }
    .device-inspection-page .device-table thead tr { column-gap: 0; row-gap: 0; background: var(--ui-th-bg); }
    .device-inspection-page .device-table th.col-type, .device-inspection-page .device-table td.col-type { grid-area: di_typ; min-width: 0; }
    .device-inspection-page .device-table th.col-room, .device-inspection-page .device-table td.col-room { grid-area: di_room; min-width: 0; }
    .device-inspection-page .device-table th.col-manage, .device-inspection-page .device-table td.col-manage { grid-area: di_man; min-width: 0; }
    .device-inspection-page .device-table th.col-inspect, .device-inspection-page .device-table td.col-inspect { grid-area: di_insp; min-width: 0; }
    .device-inspection-page .device-table th.col-mfg, .device-inspection-page .device-table td.col-mfg { grid-area: di_mfg; min-width: 0; }
    .device-inspection-page .device-table th.col-model, .device-inspection-page .device-table td.col-model { grid-area: di_mod; min-width: 0; }
    .device-inspection-page .device-table th.col-name, .device-inspection-page .device-table td.col-name { grid-area: di_name; min-width: 0; }
    .device-inspection-page .device-table th.col-ip, .device-inspection-page .device-table td.col-ip { grid-area: di_ip; min-width: 0; }
    .device-inspection-page .device-table th.col-uid, .device-inspection-page .device-table td.col-uid,
    .device-inspection-page .device-table th.col-cno, .device-inspection-page .device-table td.col-cno,
    .device-inspection-page .device-table th.col-pos, .device-inspection-page .device-table td.col-pos,
    .device-inspection-page .device-table th.col-date, .device-inspection-page .device-table td.col-date,
    .device-inspection-page .device-table th.col-purpose, .device-inspection-page .device-table td.col-purpose,
    .device-inspection-page .device-table th.col-set, .device-inspection-page .device-table td.col-set,
    .device-inspection-page .device-table th.col-unused, .device-inspection-page .device-table td.col-unused { display: none !important; }
    .device-inspection-page .device-table th.col-inspect, .device-inspection-page .device-table td.col-inspect,
    .device-inspection-page .device-table th.col-room, .device-inspection-page .device-table td.col-room,
    .device-inspection-page .device-table th.col-manage, .device-inspection-page .device-table td.col-manage,
    .device-inspection-page .device-table th.col-mfg, .device-inspection-page .device-table td.col-mfg,
    .device-inspection-page .device-table th.col-type, .device-inspection-page .device-table td.col-type,
    .device-inspection-page .device-table th.col-model, .device-inspection-page .device-table td.col-model,
    .device-inspection-page .device-table th.col-name, .device-inspection-page .device-table td.col-name,
    .device-inspection-page .device-table th.col-ip, .device-inspection-page .device-table td.col-ip {
        display: block !important; min-width: 0; box-sizing: border-box; white-space: normal !important; overflow-wrap: anywhere;
        word-wrap: break-word; word-break: keep-all; line-height: 1.45 !important;
    }
    .device-inspection-page .device-table th.col-model, .device-inspection-page .device-table td.col-model { word-break: break-word !important; overflow-wrap: anywhere; }
    .device-list-page .device-table:not(.summary-pivot-table) .device-type, .device-inspection-page .device-table .device-type {
        display: block; min-width: 0; white-space: normal !important; overflow: visible !important; text-overflow: unset !important;
    }
    .device-list-page .device-table:not(.summary-pivot-table) thead th, .device-inspection-page .device-table thead th { border: 1px solid rgba(255, 255, 255, 0.22) !important; }
    .device-list-page .device-table:not(.summary-pivot-table), .device-inspection-page .device-table { overflow: visible !important; width: 100% !important; table-layout: auto; }
    .device-list-page .device-table:not(.summary-pivot-table) thead, .device-inspection-page .device-table thead { width: 100%; }
    .device-list-page .device-table:not(.summary-pivot-table) thead th, .device-list-page .device-table:not(.summary-pivot-table) tbody tr.device-row > td { text-align: center !important; }
    .device-inspection-page .device-table thead th, .device-inspection-page .device-table tbody tr.device-row > td { text-align: center !important; }
    .device-list-page .device-table:not(.summary-pivot-table) thead tr th, .device-list-page .device-table:not(.summary-pivot-table) tbody tr.device-row > td,
    .device-inspection-page .device-table thead tr th, .device-inspection-page .device-table tbody tr.device-row > td { width: auto !important; max-width: 100% !important; }
    .device-inspection-page .device-table thead th.col-inspect, .device-inspection-page .device-table thead th.col-room, .device-inspection-page .device-table thead th.col-manage,
    .device-inspection-page .device-table thead th.col-mfg, .device-inspection-page .device-table thead th.col-type, .device-inspection-page .device-table thead th.col-model,
    .device-inspection-page .device-table thead th.col-name, .device-inspection-page .device-table thead th.col-ip,
    .device-inspection-page .device-table tbody tr.device-row > td.col-inspect, .device-inspection-page .device-table tbody tr.device-row > td.col-room,
    .device-inspection-page .device-table tbody tr.device-row > td.col-manage, .device-inspection-page .device-table tbody tr.device-row > td.col-mfg,
    .device-inspection-page .device-table tbody tr.device-row > td.col-type, .device-inspection-page .device-table tbody tr.device-row > td.col-model,
    .device-inspection-page .device-table tbody tr.device-row > td.col-name, .device-inspection-page .device-table tbody tr.device-row > td.col-ip { padding: 6px 5px !important; }
}

/* 유형 강조 시 용도별 배경 — 색은 「PC 용도 관리」에서 지정한다(고정 5분류 아님) */
.device-list-page .device-table.device-table--purpose-hl tbody tr.device-row.device-row-bulk-selected,
.device-inspection-page .device-table.device-table--purpose-hl tbody tr.device-row.device-row-bulk-selected { box-shadow: inset 0 0 0 2px var(--ui-info); }
/* 용도별 배경색 규칙은 「PC 용도 관리」 지정색으로 device_list.php / device_inspection.php 가
   런타임 생성한다(DevicePurposeTableHighlight::styleBlock). 여기에 색을 하드코딩하지 말 것. */
.device-list-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]), .device-inspection-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]),
.device-list-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]) > td, .device-inspection-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]) > td,
.device-list-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]) + tr.detail-row, .device-inspection-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]) + tr.detail-row,
.device-list-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]) + tr.detail-row > td, .device-inspection-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]) + tr.detail-row > td { background-color: #ffffff !important; }
.device-list-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]):hover, .device-inspection-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]):hover,
.device-list-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]):hover > td, .device-inspection-page .device-table.device-table--purpose-hl tbody tr.device-row:not([data-purpose-hl]):hover > td { background-color: var(--ui-slate-50) !important; }

/* ==========================================================================
   4. .data-table — 레거시 셸(권한/레벨 관리 등) 표
   ========================================================================== */
.data-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    margin: 8px auto;
    table-layout: fixed;   /* 컬럼 폭 균일화 — 한 컬럼이 남는 폭을 독식(치우침)하지 않게. device_usage처럼 */
    font-size: 13.5px;
    line-height: 1.4;
    background: var(--ui-surface);
}
.data-table th, .data-table td {
    border: none;
    border-bottom: 1px solid var(--ui-border);
    padding: 9px 11px;
    text-align: center;    /* 균일 컬럼 안에서 내용 가운데 — 좌측 뭉침/한쪽 여백 방지 */
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
}
.data-table th {
    background: var(--ui-th-bg);
    color: var(--ui-th-text);
    font-weight: 700;
    border-bottom: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.data-table tbody tr:nth-child(even) { background: var(--ui-zebra); }
.data-table tbody tr:hover { background: var(--ui-row-hover); }
.data-table td { color: var(--ui-text); }
.data-table .ui-muted { color: var(--ui-muted); }
/* 테이블 너비 토글: wide 모드면 관리자 표의 페이지별 max-width 캡을 모두 해제 → 전폭.
   헤더 버튼(#inetTableWidthToggle)이 <html data-tablewidth="wide">로 전환 + localStorage 저장. */
/* 표 기본은 전폭(균일 컬럼). 토글 'compact'면 1300 가운데로 좁힘. (폼 페이지는 항상 1200 고정) */
:root[data-tablewidth="compact"] .data-table { max-width: 1300px !important; }

/* 모바일: 표 가로 스크롤 래퍼 */
.ui-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================================================
   5. 무선 AP 목록 표(main.css 계승)
   ========================================================================== */
.wireless-ap-list-page .wireless-ap-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 900px; background: var(--ui-surface); }
.wireless-ap-list-page .wireless-ap-table thead { background: var(--ui-th-bg); border-bottom: 2px solid var(--ui-primary-hover); }
.wireless-ap-list-page .wireless-ap-table th { padding: 7px 8px; font-weight: 700; color: var(--ui-th-text); font-size: 0.85rem; }
.wireless-ap-list-page .wireless-ap-table__row td { padding: 6px 8px; border-bottom: 1px solid var(--ui-slate-100); vertical-align: middle; }
.wireless-ap-list-page .wireless-ap-table__row:hover { background: var(--ui-slate-50); }
.wireless-ap-list-page .wireless-ap-table__cell-strong { font-weight: 600; }
.wireless-ap-list-page .wireless-ap-table__label { color: var(--ui-primary); font-weight: 600; }
.wireless-ap-list-page .wireless-ap-table__mono { font-family: Consolas, monospace; font-size: 0.88rem; }
.wireless-ap-list-page .wireless-ap-table__model { font-weight: 500; }
.wireless-ap-list-page .wireless-ap-table__mfg { font-size: 0.75rem; color: var(--ui-slate-400); }
.wireless-ap-list-page .wireless-ap-table__pill { background: var(--ui-slate-100); padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }
.wireless-ap-list-page .wireless-ap-table__year { font-size: 0.85rem; }
.wireless-ap-list-page .wireless-ap-table__actions { display: flex; gap: 8px; align-items: center; }
.wireless-ap-list-page .wireless-ap-table__action-edit { color: var(--ui-primary); font-size: 1.05rem; min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.wireless-ap-list-page .wireless-ap-table__action-del { color: var(--ui-danger); border: none; background: none; font-size: 1.05rem; cursor: pointer; min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.wireless-ap-list-page .wireless-ap-table__empty { padding: clamp(1.5rem, 5vw, 3rem); text-align: center; color: var(--ui-slate-400); }
.wireless-ap-list-page .wireless-ap-table__empty-icon { font-size: 2.25rem; margin-bottom: 0.75rem; opacity: 0.35; display: inline-block; }
@media (min-width: 1200px) {
    .wireless-ap-list-page .wireless-ap-table { min-width: 1500px; }
}
