//  @layer:   CORE
//  @upgrade: CAREFUL — styles framework admin-app
//  @deps:    (none)
//
/* layout.css — cdsMKLK shared layout styles */
* { font-family: 'Be Vietnam Pro', sans-serif; }

/* ══ Sidebar ══════════════════════════════════════════════════════════════ */
#sidebar {
  transition: transform 0.25s cubic-bezier(.4,0,.2,1),
              width 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* Desktop: sidebar mở = 248px, đóng = ẩn hoàn toàn (width=0) */
#sidebar.open   { width: 248px; transform: translateX(0); }
#sidebar.closed { width: 0; transform: translateX(-100%); }

/* Mobile: sidebar luôn overlay (width cố định 248px, dùng transform) */
@media (max-width: 1023px) {
  #sidebar       { width: 248px !important; position: fixed; z-index: 40; }
  #sidebar.open  { transform: translateX(0); }
  #sidebar.closed{ transform: translateX(-100%); }
}

/* ══ Label & chevron ẩn khi đóng ══════════════════════════════════════════ */
.menu-label, .menu-chevron {
  transition: opacity 0.15s ease;
  white-space: nowrap; overflow: hidden;
}
#sidebar.closed .menu-label   { opacity: 0; }
#sidebar.open   .menu-label   { opacity: 1; }
#sidebar.closed .menu-chevron { opacity: 0; }
#sidebar.open   .menu-chevron { opacity: 1; }

/* ══ Submenu accordion ═════════════════════════════════════════════════════ */
.submenu { overflow: hidden; transition: max-height 0.2s ease; max-height: 0; }
.submenu.expanded { max-height: 500px; }

/* ══ Active states ═════════════════════════════════════════════════════════ */
.menu-item-active { background: rgba(99,102,241,0.1); color: #4f46e5 !important; }
.menu-item-active i { color: #4f46e5 !important; }
.submenu-active { color: #4f46e5 !important; font-weight: 600; }

/* ══ Backdrop overlay (mobile) ═════════════════════════════════════════════ */
#sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 39;
  transition: opacity 0.25s;
}
@media (max-width: 1023px) {
  #sidebar-backdrop { display: block; }
}

/* ══ Main content transition ═══════════════════════════════════════════════ */
#main-content {
  transition: margin-left 0.25s cubic-bezier(.4,0,.2,1);
}
/* Desktop: đẩy content theo sidebar */
@media (min-width: 1024px) {
  #main-content.sidebar-open   { margin-left: 248px; }
  #main-content.sidebar-closed { margin-left: 0; }
}
/* Mobile: content luôn full width */
@media (max-width: 1023px) {
  #main-content { margin-left: 0 !important; }
}

/* ══ Scrollbar ═════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* ══ Pagination bar ════════════════════════════════════════════════════════ */
.pg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
  border-radius: 0 0 12px 12px;
  gap: 8px;
  /* KHÔNG dùng flex-wrap để tránh xuống dòng */
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}

.pg-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}

.pg-size-select {
  padding: 3px 6px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.pg-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  transition: all 0.1s;
  white-space: nowrap;
}
.pg-btn:hover:not(:disabled):not(.pg-btn-active):not(.pg-btn-dots) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.pg-btn:disabled, .pg-btn.pg-btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pg-btn.pg-btn-active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  cursor: default;
}
.pg-btn.pg-btn-dots {
  border-color: transparent;
  background: transparent;
  color: #94a3b8;
  cursor: default;
  min-width: 20px;
}

/* Mobile: ẩn pageInfo, thu gọn */
@media (max-width: 640px) {
  .pg-info span:first-child { display: none; }
  .pg-btn-nav { display: none; }
}

/* ══ Footer ════════════════════════════════════════════════════════════════ */
#page-footer {
  transition: margin-left 0.25s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 1024px) {
  #main-content.sidebar-open   ~ #page-footer { margin-left: 248px; }
  #main-content.sidebar-closed ~ #page-footer { margin-left: 0; }
}
@media (max-width: 1023px) {
  #page-footer { margin-left: 0 !important; }
}

/* ══ Notify bar (inline alert) ══════════════════════════════════════════════ */
.notify-bar {
  margin: 12px 24px 0;
  border-radius: 10px;
  border-left-width: 4px;
  border-left-style: solid;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.notify-bar-close {
  margin-left: auto;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.15s;
  background: none;
  border: none;
  padding: 0 2px;
  line-height: 1;
}
.notify-bar-close:hover { opacity: 0.9; }
