/* =====================================================
   RESPONSIVE-ZOOM.CSS — chống tràn viền khi zoom / màn hẹp
   Load SAU styles.css.
   ===================================================== */

/* ---------- 1. KANBAN: hết bị cắt cột ---------- */
/* Cho cột co giãn được (bỏ min-width cứng 272px) */
.kanban-column {
  min-width: 0;
}
.kanban-board {
  grid-auto-columns: minmax(0, 1fr); /* 4 cột chia đều khi đủ rộng */
  overflow-x: auto;                  /* phòng hờ, không bao giờ cắt cụt */
}

/* Viewport < 1360px (zoom ~150% trở lên): chuyển thành lưới 2x2 */
@media (max-width: 1360px) {
  .kanban-board {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Viewport < 720px (zoom rất lớn / điện thoại): 1 cột */
@media (max-width: 720px) {
  .kanban-board {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- 2. Thanh công cụ: ô tìm kiếm co được ---------- */
.search-field {
  min-width: 0;
  flex: 1 1 200px;
  max-width: 290px;
}

/* ---------- 3. Khoảng đệm co giãn mượt (dùng clamp + vw) ---------- */
.page-content {
  padding: clamp(12px, 0vw, 24px);
}
.topbar {
  padding: 0 clamp(14px, 2vw, 24px);
}

/* ---------- 4. Sidebar: thu hẹp rồi chuyển thành ngăn kéo ---------- */
@media (max-width: 1100px) {
  :root {
    --sidebar-w: 220px;
  }
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 900px) {
  .project-title-group {
    width: auto;
    max-width: 100%;
}
.project-header-actions {
    margin-left: 0;}
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(280px, 85vw);
    overflow: hidden; /* chỉ khối điều hướng giữa cuộn (.sidebar-nav-box) */
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  body:has(#sidebar-toggle:checked) .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  }
  body:has(#sidebar-toggle:checked) .sidebar-scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
  }

  .topbar-menu-btn {
    display: inline-flex; /* hiện nút ☰ để mở sidebar */
  }
}

/* ---------- 5. Danh sách (List view): cuộn ngang thay vì bóp méo ---------- */
@media (max-width: 1100px) {
  .task-table-scroll {
    overflow-x: auto;
  }
  .task-table-v2 {
    min-width: 760px;
  }
}

/* ---------- 6. Header dự án: cho xuống dòng khi hẹp ---------- */
@media (max-width: 900px) {
  .project-header-top {
    flex-wrap: wrap;
  }
  .project-title-group {
    min-width: 0;
    flex: 1 1 200px;
    width: auto;
    max-width: 100%;
  }
  .project-header-actions {
    margin-left: 0;
  }
}
/* ---------- Thanh trên cùng trên điện thoại: bộ chọn workspace gọn (chỉ tên), bỏ tên người cạnh ảnh đại diện,
   nút ☰ ở góc trái mở ngăn kéo thanh bên ---------- */
@media (max-width: 900px) {
  .topbar-ws .sidebar-brand-text span { display: none; }
  .topbar-ws { max-width: 200px; }
  .topbar .breadcrumb { flex-shrink: 0; min-width: 110px; max-width: 45%; }
  .account-menu-name { display: none; }
  .account-menu-btn { padding: 0; }
  .topbar .topbar-menu-btn { display: inline-flex; flex: none; order: -1; }
}
/* Điện thoại: bỏ ô tìm việc trên thanh trên cho gọn (tìm trong từng dự án vẫn có) */
@media (max-width: 620px) {
  .topbar .global-search { display: none; }
}
/* Màn rộng: ẩn ☰ (kèm .topbar để thắng display của .icon-btn khai báo sau trong styles.css) */
@media (min-width: 901px) {
  .topbar .topbar-menu-btn { display: none; }
}

/* ---------- Tablet / laptop (641–1366px): chữ gọn, bớt đậm ----------
   Màn này người dùng nhìn gần nên tiêu đề / số liệu không cần to và đậm như màn lớn.
   Tiêu đề trang thống nhất 20px, tiêu đề mục 18px; số liệu lớn co 1 nấc; 800–900 hạ về 700, tên thẻ / hàng 700 hạ về 600. */
@media (min-width: 641px) and (max-width: 1366px) {
  .page-content h1:not(.set-nav-title), .rep-title h1, .rep-head h1, .skp-head-text h1, .simple-page-head h1,
  .pl-page-title h1, .logs-title h1, .project-title-group h1.project-inline-text { font-size: 20px; font-weight: 700; }
  .chat-side-head h2, .st-empty h2 { font-size: 16px; }
  .plan-col h4, .pe-empty h3, .pl-card-title { font-size: 16px; }
  .plan-col h4, .plan-price b, .stat-value, .rep-tile-value, .rep-stile b, .wl-stat-main b,
  .perm-sec-name, .role-title.project-inline-text { font-weight: 700; }
  .rep-tile-value { font-size: 22px; }
  .plan-price b { font-size: 19px; }
  .wl-stat-main b { font-size: 18px; }
  .rep-stile b, .role-title.project-inline-text { font-size: 16px; }
  .ws-name-row b { font-weight: 700; }
  .st-title, .st-group-name, .pl-card-title { font-weight: 600; }
  .st-group-name { font-size: 15px; }
  /* Số liệu lớn ở Báo cáo, Tổng quan dự án, dashboard Nhóm: 26–32px / 800 -> 22–24px / 700 */
  .rep-kpi-value, .team-stat strong, .ov-big { font-size: 24px; font-weight: 700; }
  .tdb-kpi-value, .ovs-tile b, .ov-tiles .report-tile-value, .ovlt-tiles .ov-tile .report-tile-value { font-size: 22px; font-weight: 700; }
}

/* ---------- Avatar trong hàng / thẻ: cỡ gọn ở mọi màn (34px mặc định quá to so với chữ 13–14px của hàng) ---------- */
.st-item .avatar { width: 26px; height: 26px; font-size: 10.5px; }
