@import url('/utility-glass.css?v=20260818-specular-v2');
/* ==========================================================================
   NTS MOCKUP SIDEBAR NAVIGATION - ZERO-LAYOUT-SHIFT FLOATING DRAWER
   Loại bỏ 100% hiện tượng co giật trang khi đóng/mở/thoát Sidebar
   ========================================================================== */

:root {
  --sidebar-w-rail: 56px;
  --sidebar-w-expanded: 270px;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-item-hover: #f1f5f9;
  --sidebar-item-active: #eef2ff;
  --sidebar-text-active: #4338ca;
  --sidebar-text: #334155;
  --sidebar-muted: #94a3b8;
  --sidebar-header: #475569;
  --sidebar-shadow-floating: 0 12px 36px -4px rgba(15, 23, 42, 0.22), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
}

/* App Wrapper */
.nts-app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-app, #f8fafc);
  position: relative;
}

/* Sidebar Slot Cố Định Trong Flow: Luôn chiếm 56px bất biến, không bao giờ thay đổi kích thước */
.nts-sidebar {
  width: var(--sidebar-w-rail);
  min-width: var(--sidebar-w-rail);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 120;
}

/* Sidebar Panel Nổi (Bên trong): Tự do co giãn 56px <-> 270px mà không ảnh hưởng một pixel nào đến trang */
.nts-sidebar-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w-rail);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  user-select: none;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease;
  z-index: 120;
  overflow: hidden;
}

/* Khi Mở Rộng: Chỉ có panel nổi rộng ra 270px và đè lên lớp backdrop */
.nts-sidebar.expanded .nts-sidebar-panel {
  width: var(--sidebar-w-expanded);
  box-shadow: var(--sidebar-shadow-floating);
}

/* Sidebar Header / Brand */
.nts-sidebar-head {
  height: 60px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.nts-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0f172a;
  overflow: hidden;
}

.nts-brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4338ca, #6366f1);
  color: white;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(67, 56, 202, 0.25);
}

.nts-brand-text {
  display: none;
  flex-direction: column;
  white-space: nowrap;
}

.nts-sidebar.expanded .nts-brand-text {
  display: flex;
}

.nts-brand-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.nts-brand-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sidebar-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Sidebar Toggle Button */
.nts-sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--sidebar-border);
  background: #f8fafc;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.nts-sidebar-toggle:hover {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,242,255,.86));
  color: #0f172a;
  transform: translateY(-1.5px) scale(1.04);
  box-shadow: inset 0 1.5px 2px #fff, 0 6px 16px rgba(67,56,202,.15);
}
.nts-sidebar-toggle:active { transform: scale(.94); box-shadow: inset 0 2px 4px rgba(0,0,0,.1); }

.nts-sidebar:not(.expanded) .nts-sidebar-toggle {
  margin: 0 auto;
}

/* Sidebar Scrollable Navigation */
.nts-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nts-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.nts-sidebar-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* ==========================================================================
   SECTION ACCORDION & SUB-GROUPS
   ========================================================================== */
.nts-nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nts-nav-section-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--sidebar-header);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nts-sidebar.expanded .nts-nav-section-header {
  display: flex;
}

.nts-nav-section-header:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nts-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nts-section-chevron {
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-muted);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nts-nav-section.is-collapsed .nts-section-chevron {
  transform: rotate(-90deg);
}

/* Section Body Items */
.nts-nav-section-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nts-sidebar.expanded .nts-nav-section.is-collapsed .nts-nav-section-body {
  display: none;
}

.nts-nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 4px 4px;
}

/* Nav Item Link */
.nts-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nts-sidebar:not(.expanded) .nts-nav-item {
  justify-content: center;
  padding: 8px 0;
}

.nts-nav-item:hover {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,242,255,.78));
  color: #0f172a;
  transform: translateY(-1.5px) scale(1.015);
  box-shadow: 0 6px 16px rgba(15,23,42,.07), inset 0 1px 1px #fff;
}
.nts-nav-item:active { transform: scale(.96); box-shadow: inset 0 2px 4px rgba(0,0,0,.1); }

.nts-nav-item.active {
  background: var(--sidebar-item-active);
  color: var(--sidebar-text-active);
  font-weight: 700;
}

.nts-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--sidebar-text-active);
  border-radius: 0 4px 4px 0;
}

.nts-nav-icon.metro-glass-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  flex: 0 0 36px;
  font-size: 0;
}
.nts-sidebar:not(.expanded) .nts-nav-icon.metro-glass-icon { width: 36px; height: 36px; flex-basis: 36px; }
.nts-nav-item:hover .nts-nav-icon.metro-glass-icon { transform: scale(1.08) translateY(-1px) rotate(2deg); }
.nts-nav-item:hover .nts-nav-icon.metro-glass-icon::after { transform: translateX(100%) rotate(25deg); }

.nts-nav-label {
  display: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nts-sidebar.expanded .nts-nav-label {
  display: block;
}

.nts-nav-badge {
  display: none;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.nts-sidebar.expanded .nts-nav-badge {
  display: inline-block;
}

.nts-nav-item.active .nts-nav-badge {
  background: #c7d2fe;
  color: #312e81;
}

/* Floating Tooltip portal cho rail hẹp — nằm ngoài overflow của sidebar/nav */
.nts-sidebar-rail-tooltip {
  position: fixed;
  transform: translateY(-50%) translateX(-4px);
  background: #0f172a;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 11px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 1400;
}

.nts-sidebar-rail-tooltip.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Sidebar Footer (User Info) */
.nts-sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  flex-shrink: 0;
}

.nts-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
}

.nts-sidebar-footer-text {
  display: none;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.nts-sidebar.expanded .nts-sidebar-footer-text {
  display: flex;
}

.nts-user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.nts-user-role {
  font-size: 11px;
  color: var(--sidebar-muted);
}

/* Main Container: Luôn giữ nguyên 100% diện tích không bao giờ bị bóp hẹp */
.nts-main-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Backdrop mờ khi mở rộng menu nổi */
.nts-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(2px);
  z-index: 115;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.nts-sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.nts-mobile-menu-trigger {
  display: none;
  position: fixed;
  left: 12px;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: #4338ca;
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 12px 28px -10px rgba(67, 56, 202, 0.52);
  z-index: 110;
  cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .nts-mobile-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nts-sidebar {
    width: 0 !important;
    min-width: 0 !important;
  }
  .nts-sidebar-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-w-expanded) !important;
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--sidebar-shadow-floating);
  }
  .nts-sidebar.mobile-open .nts-sidebar-panel {
    transform: translateX(0);
  }
  .nts-sidebar.mobile-open .nts-brand-text,
  .nts-sidebar.mobile-open .nts-nav-section-header,
  .nts-sidebar.mobile-open .nts-nav-label,
  .nts-sidebar.mobile-open .nts-nav-badge,
  .nts-sidebar.mobile-open .nts-sidebar-footer-text {
    display: flex !important;
  }
  .nts-sidebar.mobile-open .nts-nav-item {
    justify-content: flex-start !important;
    padding: 8px 10px !important;
  }
}

@media print {
  .nts-sidebar,
  .nts-sidebar-backdrop,
  .nts-mobile-menu-trigger {
    display: none !important;
  }
  .nts-app-wrapper,
  .nts-main-container {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}


.nts-local-view-card{margin-top:8px;display:flex;flex-direction:column;gap:5px;min-width:0}.nts-local-view-card[hidden]{display:none!important}.nts-local-view-label{font-size:9px;font-weight:800;letter-spacing:.06em;color:#64748b}.nts-local-view-segment{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}.nts-local-view-segment button{height:26px;border:1px solid #dbe3ef;background:#f8fafc;color:#475569;border-radius:7px;font:700 9.5px/1 'Plus Jakarta Sans',sans-serif;cursor:pointer}.nts-local-view-segment button.active{background:#4f46e5;color:#fff;border-color:#4f46e5;box-shadow:0 3px 10px -5px rgba(79,70,229,.7)}
