/* CleanMat embedded management CSS */
#housingManagementRoot button, #housingManagementRoot input, #housingManagementRoot select{font:inherit}
#housingManagementRoot button{cursor:pointer}
#housingManagementRoot a{text-decoration:none;color:inherit}
#housingManagementRoot .side-label{font-size:10px;letter-spacing:1.7px;color:#7892b2;padding:0 14px 13px;font-weight:800}
#housingManagementRoot .refresh-btn{background:#edf4ff;border:1px solid #d8e7fa;color:#2059a3;border-radius:9px;padding:9px 14px;font-weight:700}
#housingManagementRoot .refresh-btn:hover{background:#dfeeff}
#housingManagementRoot .page-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}
#housingManagementRoot .eyebrow{color:#3975c3;letter-spacing:1.4px;font-weight:800;font-size:11px;margin-bottom:10px}
#housingManagementRoot h1{font-size:31px;letter-spacing:-1.1px;margin:0 0 8px;color:#142743}
#housingManagementRoot h1 span{font-size:19px;color:#7285a0;font-weight:500}
#housingManagementRoot p{margin:0}
#housingManagementRoot .page-intro p{color:#687b92}
#housingManagementRoot .view-map{border:1px solid #d6e2f0;background:white;color:#245c9f;padding:11px 16px;border-radius:10px;font-weight:700;white-space:nowrap}
#housingManagementRoot .stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:22px}
#housingManagementRoot .stat{background:white;border:1px solid #e3eaf3;border-radius:15px;padding:20px;box-shadow:0 5px 20px #213c6110;position:relative;min-height:155px}
#housingManagementRoot .stat-icon{position:absolute;right:18px;top:18px;background:#ecf4ff;color:#2466c1;border-radius:11px;width:38px;height:38px;display:grid;place-items:center;font-size:22px}
#housingManagementRoot .stat-label{color:#5f728b;font-weight:700;display:block}
#housingManagementRoot .stat-label small{font-weight:400}
#housingManagementRoot .stat strong{display:block;font-size:36px;letter-spacing:-1px;color:#183456;margin-top:10px}
#housingManagementRoot .stat-foot{color:#94a4b7;font-size:11px;text-transform:uppercase;letter-spacing:1px}
#housingManagementRoot .notice{display:flex;gap:13px;background:#edf5ff;border:1px solid #d9e9ff;border-radius:12px;padding:16px 18px;color:#355c8a;margin-bottom:16px}
#housingManagementRoot .notice>span{font-size:21px}
#housingManagementRoot .notice p{font-size:12px;margin-top:3px;color:#5d7798}
#housingManagementRoot #status{color:#53738f;font-size:12px;margin:10px 0 20px;min-height:18px}
#housingManagementRoot .panel{background:#fff;border:1px solid #e2eaf3;border-radius:16px;box-shadow:0 6px 26px #213c610c;padding:0;margin:20px 0;overflow:hidden;scroll-margin-top:22px}
#housingManagementRoot .panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:22px 24px 18px;border-bottom:1px solid #e9eef5}
#housingManagementRoot .panel-heading h2{font-size:18px;color:#1c3453;margin:0;letter-spacing:-.3px}
#housingManagementRoot .panel-count{font-size:12px;color:#3268a9;background:#edf5ff;border:1px solid #d9e8fb;border-radius:999px;padding:5px 12px;font-weight:700}
#housingManagementRoot .panel-body{padding:22px 24px}
#housingManagementRoot .form-title{font-size:12px;color:#6e829c;font-weight:800;letter-spacing:.6px;margin-bottom:14px;text-transform:uppercase}
#housingManagementRoot form{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:14px;align-items:end}
#housingManagementRoot label{display:grid;gap:7px;font-weight:700;font-size:12px;color:#4b5e76}
#housingManagementRoot input, #housingManagementRoot select{min-height:42px;padding:10px 12px;border:1px solid #d4deeb;border-radius:9px;color:#203650;background:#fff;width:100%;outline:none}
#housingManagementRoot input:focus, #housingManagementRoot select:focus{border-color:#3983dc;box-shadow:0 0 0 3px #3983dc1c}
#housingManagementRoot form button, #housingManagementRoot .panel button{min-height:40px;border:0;border-radius:9px;padding:10px 15px;background:#2467bd;color:white;font-weight:700}
#housingManagementRoot .panel button:hover{filter:brightness(.96)}
#housingManagementRoot .panel button.secondary{background:#edf3fb;color:#285a96}
#housingManagementRoot .table-wrap{overflow-x:auto;margin-top:22px;border:1px solid #e5ebf3;border-radius:11px}
#housingManagementRoot table{width:100%;border-collapse:collapse;min-width:540px}
#housingManagementRoot thead{background:#f6f8fc}
#housingManagementRoot th{text-align:left;color:#647992;font-size:11px;letter-spacing:.5px;text-transform:uppercase;font-weight:800;padding:13px 16px}
#housingManagementRoot td{padding:13px 16px;border-top:1px solid #edf1f6;vertical-align:middle;color:#52657e}
#housingManagementRoot td:first-child{color:#1d3555;font-weight:700}
#housingManagementRoot tbody tr:hover{background:#f9fbfe}
#housingManagementRoot tr.muted{opacity:.66}
#housingManagementRoot td .secondary{font-size:12px;min-height:32px;padding:7px 11px}
#housingManagementRoot .empty{padding:30px;text-align:center;color:#8a9bb0;font-size:13px}
#housingManagementRoot .edit-box{background:#f7faff;border:1px solid #dce9f8;border-radius:12px;padding:18px;margin-bottom:20px}
#housingManagementRoot .edit-box h2{font-size:16px;margin:0 0 15px}
#housingManagementRoot footer{text-align:center;color:#98a7ba;font-size:12px;padding-top:25px}
@media (max-width:1100px){#housingManagementRoot .stats{gap:10px}
#housingManagementRoot .stat{padding:16px}}
@media (max-width:820px){#housingManagementRoot .nav-open .sidebar{transform:translateX(0)}
#housingManagementRoot .nav-open .nav-shade{display:block;position:fixed;inset:0;background:#10233b80;z-index:15}
#housingManagementRoot .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
#housingManagementRoot .page-intro{align-items:flex-start;flex-direction:column}
#housingManagementRoot .page-intro h1{font-size:27px}}
@media (max-width:540px){#housingManagementRoot .refresh-btn span{display:none}
#housingManagementRoot .stat{min-height:126px}
#housingManagementRoot .stat strong{font-size:30px}
#housingManagementRoot .stat-icon{width:32px;height:32px;font-size:18px}
#housingManagementRoot .panel-heading{padding:18px}
#housingManagementRoot .panel-body{padding:18px}
#housingManagementRoot form{grid-template-columns:1fr}
#housingManagementRoot .page-intro h1 span{display:block;font-size:17px}
#housingManagementRoot .notice{padding:12px}}
#housingManagementRoot .hierarchy-note{display:flex;flex-wrap:wrap;gap:8px 18px;align-items:center;padding:15px 18px;margin:0 0 20px;border:1px solid #dce5f0;border-radius:14px;background:#f5f8fc;color:#243c5a;font-size:13px}
#housingManagementRoot .hierarchy-note strong{white-space:nowrap}
#housingManagementRoot .hierarchy-note span{line-height:1.6}
#housingManagementRoot [hidden]{display:none!important}
#housingManagementRoot .content-view{background:#fff;border:1px solid #e2eaf3;border-radius:18px;padding:26px;box-shadow:0 6px 26px #213c610c;min-height:250px}
#housingManagementRoot .section-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:24px;flex-wrap:wrap}
#housingManagementRoot .section-head h2{margin:0 0 5px;color:#183456;font-size:22px}
#housingManagementRoot .section-head p{color:#71839b;font-size:13px}
#housingManagementRoot .content-view button{border:0;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}
#housingManagementRoot .content-view button.primary-action{background:#2467bd;color:white}
#housingManagementRoot .content-view button.secondary{background:#edf3fb;color:#285a96}
#housingManagementRoot .overview-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
#housingManagementRoot .overview-tile{background:#f7faff;border:1px solid #dfe8f4!important;min-height:180px;text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:9px;position:relative}
#housingManagementRoot .overview-tile:hover, #housingManagementRoot .room-card:hover{border-color:#8ab7ef!important;background:#f0f7ff}
#housingManagementRoot .overview-tile strong{font-size:18px;color:#19385b}
#housingManagementRoot .overview-tile small{font-size:12px;color:#6b7f98}
#housingManagementRoot .tile-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#e5f0ff;color:#2467bd;font-size:24px}
#housingManagementRoot .tile-arrow{position:absolute;right:15px;bottom:12px;color:#3474c0;font-size:22px}
#housingManagementRoot .room-grid, #housingManagementRoot .bedroom-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(245px,1fr));gap:15px}
#housingManagementRoot .room-card{display:flex;flex-direction:column;gap:18px;align-items:stretch;text-align:left;background:#fff;border:1px solid #dfe7f2!important;padding:20px!important;min-height:155px;box-shadow:0 3px 12px #1735560b}
#housingManagementRoot .room-top, #housingManagementRoot .room-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px}
#housingManagementRoot .room-top strong{font-size:22px;color:#17365b}
#housingManagementRoot .room-building{color:#647d98}
#housingManagementRoot .room-bottom{font-size:12px;color:#58728d;border-top:1px solid #e8edf5;padding-top:13px}
#housingManagementRoot .room-bottom span{color:#2467bd;font-weight:800}
#housingManagementRoot .status-chip{font-size:11px;border-radius:20px;background:#eaf5ff;padding:5px 9px;color:#2a649c}
#housingManagementRoot .back-link{background:transparent;color:#2867aa;padding:0 0 17px!important}
#housingManagementRoot .detail-meta{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:22px}
#housingManagementRoot .detail-meta span{background:#f0f5fb;border-radius:8px;padding:9px 13px;color:#526b85}
#housingManagementRoot .bedroom-card{border:1px solid #e0e8f2;border-radius:13px;padding:20px;display:flex;flex-direction:column;justify-content:space-between;gap:22px}
#housingManagementRoot .bedroom-card h3{font-size:18px;margin:8px 0 3px}
#housingManagementRoot .bedroom-card p{color:#6b7f98}
#housingManagementRoot .bed-icon{font-size:23px}
#housingManagementRoot .bedroom-actions{display:flex;gap:8px}
#housingManagementRoot .is-muted{opacity:.6}
#housingManagementRoot .editor-overlay{position:fixed;inset:0;background:#0a1d35a6;z-index:50;display:flex;align-items:center;justify-content:center;padding:18px}
#housingManagementRoot .editor-dialog{background:white;border-radius:17px;max-width:690px;width:100%;max-height:90vh;overflow-y:auto;padding:25px;box-shadow:0 24px 90px #081b3755}
#housingManagementRoot .editor-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}
#housingManagementRoot .editor-head h2{font-size:20px;margin:0}
#housingManagementRoot .editor-head .close-editor{font-size:26px;background:transparent;color:#627b94;border:0;cursor:pointer}
#housingManagementRoot .editor-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
#housingManagementRoot .editor-buttons{grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;margin-top:10px}
#housingManagementRoot .editor-buttons button{border:0;border-radius:9px;padding:11px 20px;background:#2467bd;color:white;font-weight:700}
#housingManagementRoot .editor-buttons button.secondary{background:#edf3fb;color:#285a96}
#housingManagementRoot .content-view .table-wrap{margin-top:0}
@media (max-width:920px){#housingManagementRoot .overview-actions{grid-template-columns:1fr 1fr}}
@media (max-width:540px){#housingManagementRoot .content-view{padding:17px}
#housingManagementRoot .overview-actions{grid-template-columns:1fr}
#housingManagementRoot .overview-tile{min-height:135px}
#housingManagementRoot .editor-form{grid-template-columns:1fr}
#housingManagementRoot .section-head h2{font-size:19px}
#housingManagementRoot .room-grid, #housingManagementRoot .bedroom-grid{grid-template-columns:1fr}}

/* Active housing submenu */
#housingSubmenu [data-housing-view].housing-submenu-selected {
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: inset 3px 0 0 #2563eb;
}

/* housing-overview-only-v1 */

/* Chỉ hiện nội dung tổng quan khi thuộc tính hidden không có */
#housingManagementRoot .stats[hidden],
#housingManagementRoot .hierarchy-note[hidden],
#housingManagementRoot .notice[hidden] {
  display: none !important;
}

/* Phần giới thiệu chỉ dành cho Tổng quan */
#housingManagementRoot:has(.stats[hidden]) .page-intro {
  display: none !important;
}

/* Không hiện các thẻ thống kê trong trang danh sách */
#housingManagementRoot:has(.stats[hidden]) .stats,
#housingManagementRoot:has(.stats[hidden]) .hierarchy-note,
#housingManagementRoot:has(.stats[hidden]) .notice {
  display: none !important;
}


/* CM_ROOMS_BY_BUILDING_V1 */
#housingManagementRoot .cm-room-building-groups{display:flex;flex-direction:column;gap:22px;margin-top:18px}
#housingManagementRoot .cm-room-building-section{background:#fff;border:1px solid #dce7f4;border-radius:17px;padding:20px;box-shadow:0 6px 22px rgba(23,53,86,.045)}
#housingManagementRoot .cm-room-building-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid #e9eef6}
#housingManagementRoot .cm-room-building-title{display:flex;align-items:center;gap:11px;min-width:0}
#housingManagementRoot .cm-room-building-title h3{font-size:19px;line-height:1.3;margin:0;color:#193657;overflow-wrap:anywhere}
#housingManagementRoot .cm-room-building-symbol{display:grid;place-items:center;width:37px;height:37px;flex-shrink:0;background:#eaf2ff;color:#2567bb;border-radius:10px;font-size:21px}
#housingManagementRoot .cm-room-building-count{flex-shrink:0;color:#55718f;background:#edf4fc;border-radius:999px;padding:6px 12px;font-size:12px;font-weight:700}
#housingManagementRoot .cm-room-building-section .room-grid{grid-template-columns:repeat(auto-fill,minmax(225px,1fr));gap:14px}
#housingManagementRoot .cm-room-building-section .room-card{min-height:145px}
@media(max-width:650px){#housingManagementRoot .cm-room-building-section{padding:14px}#housingManagementRoot .cm-room-building-section .room-grid{grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:10px}#housingManagementRoot .cm-room-building-title h3{font-size:16px}}

/* Public trainee detail: no private data is fetched */
.cm-public-profile-trigger{cursor:pointer;border:0;padding:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;flex-shrink:0}.cm-public-profile-trigger:focus-visible{outline:3px solid #2563eb;outline-offset:3px}.cm-public-profile-overlay{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.6);display:flex;align-items:center;justify-content:center;padding:16px}.cm-public-profile-card{position:relative;background:white;color:#172334;border-radius:16px;padding:24px;width:min(100%,470px);max-height:90vh;overflow:auto;box-shadow:0 22px 80px #0003}.cm-public-profile-close{position:absolute;right:14px;top:10px;border:0;background:#f1f5f9;border-radius:50%;width:34px;height:34px;font-size:24px;cursor:pointer}.cm-public-profile-head{display:flex;gap:16px;align-items:center;margin:8px 20px 20px 0}.cm-public-profile-head h2{font-size:19px;margin:0 0 5px}.cm-public-profile-photo{width:84px;height:84px;flex:none;border-radius:12px;background:#edf2f7;display:grid;place-items:center;overflow:hidden;font-size:36px}.cm-public-profile-photo img{width:100%;height:100%;object-fit:cover}.cm-public-profile-status{font-size:12px;color:#47627e}.cm-public-profile-card dl{margin:0}.cm-public-profile-card dl>div{padding:10px 0;border-bottom:1px solid #e5eaf0}.cm-public-profile-card dt{font-size:12px;color:#66788d;margin-bottom:3px}.cm-public-profile-card dd{margin:0;font-size:14px}.cm-public-profile-locked{margin-top:18px;background:#f3f6fa;border:1px solid #dbe3ec;border-radius:10px;padding:15px}.cm-public-profile-locked p{font-size:13px;line-height:1.5;margin:8px 0 0;color:#536477}

/* CleanMat Housing — mobile trainee profile dialog layout fix (2026-11-15) */
@media (max-width: 600px) {
  .cm-public-profile-overlay {
    box-sizing: border-box;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .cm-public-profile-overlay .cm-public-profile-card {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 420px;
    min-width: 0;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    padding: 18px 16px 20px;
    font-size: 14px;
    line-height: 1.45;
  }
  .cm-public-profile-overlay .cm-public-profile-close {
    z-index: 2;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
  }
  .cm-public-profile-overlay .cm-public-profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    margin: 8px 28px 14px;
    min-width: 0;
  }
  .cm-public-profile-overlay .cm-public-profile-photo {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    max-width: 100%;
    border-radius: 14px;
    overflow: hidden;
  }
  .cm-public-profile-overlay .cm-public-profile-photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
  }
  .cm-public-profile-overlay .cm-public-profile-head > div:last-child {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .cm-public-profile-overlay .cm-public-profile-head h2 {
    margin: 0 0 3px;
    font-size: 17px;
    line-height: 1.3;
  }
  .cm-public-profile-overlay .cm-public-profile-card dl > div {padding: 8px 0;}
  .cm-public-profile-overlay .cm-public-profile-locked {margin-top: 12px; padding: 11px 12px;}
  .cm-public-profile-overlay .cm-public-profile-locked p {font-size: 12px; line-height: 1.45;}
}
