:root{
  --sb-bg:#fff;
  --sb-border:#e9edf3;
  --sb-hover:#f3f6fb;
  --sb-active:#e7f3ff;
  --sb-text:#0f172a;
  --sb-muted:#64748b;
  --sb-primary:#0b63c5;
}

/* Layout khuyến nghị nếu bạn dùng page-crm.php */
.ahm-layout{ display:grid; grid-template-columns: 220px 1fr; min-height:100vh; }
.ahm-sidebar{
  background:var(--sb-bg); border-right:1px solid var(--sb-border);
  padding:12px; height:100vh; position:sticky; top:0; overflow:auto;
  scrollbar-width: thin;
}
.ahm-main{ padding:20px; }

/* Menu base */
.ahm-menu, .ahm-menu ul{ list-style:none; margin:0; padding:0; }
.ahm-menu > li + li{ margin-top:6px; }

.ahm-item{
  position:relative; display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:12px;
}
.ahm-link{
  display:flex; align-items:center; gap:10px; flex:1;
  color:var(--sb-text); text-decoration:none; font-weight:600;
}
.ahm-icon{ width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; color:var(--sb-muted); }
.ahm-text{ line-height:1.2 }

/* Hover/active */
.ahm-menu .ahm-menu-item:hover > .ahm-item{ background:var(--sb-hover); }
.ahm-menu .ahm-menu-item.is-active > .ahm-item{
  background:var(--sb-active);
}
.ahm-menu .current-menu-item > .ahm-item .ahm-link,
.ahm-menu .current-menu-ancestor > .ahm-item .ahm-link{
  color:var(--sb-primary);
}
.ahm-menu .current-menu-item > .ahm-item .ahm-icon,
.ahm-menu .current-menu-ancestor > .ahm-item .ahm-icon{ color:var(--sb-primary); }

/* Caret */
.ahm-caret{
  width:18px; height:18px; margin-left:auto; color:#475569;
  position:relative; flex:0 0 auto;
}
.ahm-caret::after{
  content:""; position:absolute; inset:0;
  width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  margin:auto; transform: rotate(-45deg);
}
.ahm-menu-item.open > .ahm-item .ahm-caret::after{ transform: rotate(45deg); }

/* Submenu */
.ahm-submenu{
  margin:6px 0 0 12px; padding:8px;
  border-left:2px solid var(--sb-border);
  background:#fafbff; border-radius:10px;
  display:none;
}
.ahm-menu-item.open > .ahm-submenu{ display:block; }

.ahm-submenu > li + li{ margin-top:2px; }
.ahm-submenu .ahm-item{ padding:8px 10px; border-radius:10px; }
.ahm-submenu .ahm-link{ font-weight:500; color:#334155; }
.ahm-submenu .ahm-icon{ width:18px; height:18px; }

/* Group heading (mục không link dùng làm label) */
.ahm-menu-item.as-heading > .ahm-item{
  opacity:.8; text-transform:uppercase; font-size:12px; letter-spacing:.08em;
  background:transparent; padding:8px 10px;
}
.ahm-menu-item.as-heading > .ahm-item .ahm-link{ pointer-events:none; color:var(--sb-muted); }

/* Thin mode (tablet/đt) */
@media (max-width: 1024px){
  .ahm-layout{ grid-template-columns: 76px 1fr; }
  .ahm-sidebar{ padding:8px; }
  .ahm-text{ display:none; }
  .ahm-caret{ display:none; }
  .ahm-submenu{ display:none !important; }
}

/* Scrollbar đẹp (Chrome/Edge) */
.ahm-sidebar::-webkit-scrollbar{ width:8px; }
.ahm-sidebar::-webkit-scrollbar-thumb{ background:#dce3ee; border-radius:8px; }



















:root{
  --sb-width: 220px;
  --sb-width-collapsed: 76px;
  --sb-active-color: #2563eb; /* yêu cầu */
}

/* ===== Sidebar cố định (fixed) ===== */
.ahm-sidebar{
  position: fixed; left:0; top:0; bottom:0;
  width: var(--sb-width);
  background:#fff; border-right:1px solid #e9edf3;
  padding:12px 12px 16px; box-sizing:border-box;
  overflow:auto; overscroll-behavior: contain;
  z-index: 1000;
}
/* Bù admin bar của WordPress */
.admin-bar .ahm-sidebar{ top:32px; }
@media (max-width: 782px){ .admin-bar .ahm-sidebar{ top:46px; } }

/* Khu nội dung bên phải: đẩy bằng margin-left ngang với sidebar */
.ahm-main{ padding:20px; margin-left: var(--sb-width); }
@media (max-width: 1024px){
  .ahm-main{ padding:16px; }
}

/* ===== Brand (logo + nút thu gọn) ===== */
.ahm-brand{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; padding:6px 6px 10px; margin-bottom:8px;
  border-bottom:1px solid #eef2f7;
}
.ahm-logo img{ display:block; height:26px; width:auto; }

.ahm-collapse{
  width:32px; height:32px; border:none; background:#f1f5f9;
  border-radius:10px; cursor:pointer; position:relative;
}
.ahm-collapse::before, .ahm-collapse::after{
  content:""; position:absolute; width:10px; height:2px; background:#334155; left:50%; transform:translateX(-50%);
}
.ahm-collapse::before{ top:12px; }
.ahm-collapse::after{
  top:18px; width:6px;
}

/* ===== Menu (giữ style cũ), chỉ cập nhật màu active ===== */
.ahm-menu .current-menu-item > .ahm-item .ahm-link,
.ahm-menu .current-menu-ancestor > .ahm-item .ahm-link{
  color: var(--sb-active-color);
}
.ahm-menu .current-menu-item > .ahm-item .ahm-icon,
.ahm-menu .current-menu-ancestor > .ahm-item .ahm-icon{
  color: var(--sb-active-color);
}
.ahm-menu .ahm-menu-item.is-active > .ahm-item{
  background: rgba(37, 99, 235, .08);
}

/* ===== Trạng thái THU GỌN ===== */
body.ahm-collapsed .ahm-sidebar{ width: var(--sb-width-collapsed); }
body.ahm-collapsed .ahm-main{ margin-left: var(--sb-width-collapsed); }

/* Ẩn chữ khi collapsed */
body.ahm-collapsed .ahm-text{ display:none; }
body.ahm-collapsed .ahm-caret{ display:none; }
body.ahm-collapsed .ahm-submenu{ display:none !important; }

/* Responsive: trên tablet/điện thoại mặc định coi như thu gọn */
@media (max-width: 1024px){
  .ahm-sidebar{ width: var(--sb-width-collapsed); }
  .ahm-main{ margin-left: var(--sb-width-collapsed); }
}


















:root{
  --sb-width: 220px;
  --sb-width-collapsed: 76px;
  --sb-active-color: #2563eb;
}

/* ===== Chỉ áp dụng trong trang CRM ===== */
.ahm-crm-page{
  /* nền tổng thể */
  background:#f6f8fb;
}

/* Fixed sidebar + bù admin bar */
.ahm-crm-page .ahm-sidebar{
  position: fixed; left:0; top:0; bottom:0; z-index:1;
  width:var(--sb-width);
  background:#fff; border-right:1px solid #e9edf3;
  padding:12px 12px 16px; box-sizing:border-box;
  overflow:auto; overscroll-behavior:contain;
}
.admin-bar .ahm-crm-page .ahm-sidebar{ top:32px; }
@media (max-width:782px){ .admin-bar .ahm-crm-page .ahm-sidebar{ top:46px; } }

/* Khu nội dung đẩy sang phải, và ĐẶC BIỆT: bỏ bo góc/overflow của Flatsome */
.ahm-crm-page .ahm-main{
  margin-left:var(--sb-width);
  padding:20px;
  position:relative; z-index:1;
}

/* Các wrapper Flatsome thường gây bo góc/overflow – bỏ hết trong trang CRM */
.ahm-crm-page .container,
.ahm-crm-page .row,
.ahm-crm-page .entry-content,
.ahm-crm-page #content,
.ahm-crm-page .page-wrapper,
.ahm-crm-page .page-inner{
  background:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
  overflow:visible !important;
}



/* Brand (logo + collapse) */
.ahm-crm-page .ahm-brand{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; padding:6px 6px 10px; margin-bottom:8px;
  border-bottom:1px solid #eef2f7;
}
.ahm-crm-page .ahm-logo img{ height:26px; width:auto; display:block; }
.ahm-crm-page .ahm-collapse{
  width:32px; height:32px; border:none; background:#f1f5f9;
  border-radius:10px; cursor:pointer; position:relative;
}
.ahm-crm-page .ahm-collapse::before,
.ahm-crm-page .ahm-collapse::after{
  content:""; position:absolute; left:50%; transform:translateX(-50%);
  height:2px; background:#334155;
}
.ahm-crm-page .ahm-collapse::before{ top:12px; width:10px; }
.ahm-crm-page .ahm-collapse::after { top:18px; width:6px; }

/* Menu: màu active theo yêu cầu */
.ahm-crm-page .ahm-menu .current-menu-item > .ahm-item .ahm-link,
.ahm-crm-page .ahm-menu .current-menu-ancestor > .ahm-item .ahm-link{ color:var(--sb-active-color); }
.ahm-crm-page .ahm-menu .current-menu-item > .ahm-item .ahm-icon,
.ahm-crm-page .ahm-menu .current-menu-ancestor > .ahm-item .ahm-icon{ color:var(--sb-active-color); }
.ahm-crm-page .ahm-menu .ahm-menu-item.is-active > .ahm-item{ background:rgba(37,99,235,.08); }

/* Collapsed */
body.ahm-collapsed .ahm-crm-page .ahm-sidebar{ width:var(--sb-width-collapsed); }
body.ahm-collapsed .ahm-crm-page .ahm-main{ margin-left:var(--sb-width-collapsed); }
body.ahm-collapsed .ahm-crm-page .ahm-text,
body.ahm-collapsed .ahm-crm-page .ahm-caret,
body.ahm-collapsed .ahm-crm-page .ahm-submenu{ display:none !important; }

/* Tablet/mobile mặc định coi như thu gọn */
@media (max-width:1024px){
  .ahm-crm-page .ahm-sidebar{ width:var(--sb-width-collapsed); }
  .ahm-crm-page .ahm-main{ margin-left:var(--sb-width-collapsed); }
}




/* Bấm được cả khung */
.ahm-crm-page .ahm-item{ cursor: pointer; }

/* Nếu bạn muốn nhãn group (as-heading) vẫn là toggle -> để pointer; 
   nếu muốn hiển thị như label không click, dùng dòng dưới để đổi lại:
*/
/* .ahm-crm-page .ahm-menu-item.as-heading > .ahm-item{ cursor: default; } */












/* Tooltip đẹp khi sidebar thu gọn */
.ahm-tooltip{
  position: fixed;
  z-index: 2000;
  padding: 8px 10px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(2,6,23,.15);
  font-size: 13px;
  line-height: 1.2;
  transform: translateY(-50%) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.ahm-tooltip::after{
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #ffffff;
  filter: drop-shadow(-1px 0 0 #e6ebf2);
}
.ahm-tooltip.show{
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Không hiện tooltip khi không thu gọn (phòng khi JS lỗi) */
body:not(.ahm-collapsed) .ahm-tooltip{ display:none; }
