/* Pichforest Webadmin - TaiVPS Compatibility & Responsive Polish */
html, body { max-width: 100%; overflow-x: hidden; background-color: var(--bs-body-bg, #f5f6f8); }
.page-content { min-height: calc(100vh - 70px); }
img, video, canvas, iframe { max-width: 100%; }
pre { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.page-title-box h4 { font-size: 18px; font-weight: 600; }

/* Avatar centering across all sizes */
.avatar-sm { height: 2.5rem; width: 2.5rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.avatar-xs { height: 1.75rem; width: 1.75rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.avatar-md { height: 3.5rem; width: 3.5rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.avatar-lg { height: 4.5rem; width: 4.5rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.avatar-title {
  align-items: center; display: flex; font-weight: 500;
  height: 100%; justify-content: center; width: 100%;
}
/* Fallback bridge for any dynamic DB HTML or JS fragments */
.avtar { display: inline-flex; align-items: center; justify-content: center; border-radius: .5rem; width: 2.5rem; height: 2.5rem; flex-shrink: 0; }
.avtar-xs { width: 1.75rem; height: 1.75rem; font-size: .875rem; }
.avtar-s { width: 2.5rem; height: 2.5rem; font-size: 1.125rem; }
.avtar-lg, .avtar-xl { width: 3.5rem; height: 3.5rem; font-size: 1.5rem; }
.bg-light-primary { background-color: rgba(31,88,199,.12) !important; color: #1f58c7 !important; }
.bg-light-success { background-color: rgba(40,183,101,.12) !important; color: #28b765 !important; }
.bg-light-warning { background-color: rgba(244,194,56,.15) !important; color: #a07000 !important; }
.bg-light-danger  { background-color: rgba(237,85,85,.12) !important; color: #ed5555 !important; }
.bg-light-info    { background-color: rgba(82,198,234,.14) !important; color: #0e86ad !important; }
.bg-light-secondary { background-color: rgba(164,169,180,.15) !important; color: #495057 !important; }
.btn-light-primary { background-color: rgba(31,88,199,.12); color: #1f58c7; border-color: transparent; }
.btn-light-primary:hover { background-color: #1f58c7; color: #fff; }
.btn-light-secondary { background-color: rgba(164,169,180,.18); color: #495057; border-color: transparent; }
.btn-light-secondary:hover { background-color: #495057; color: #fff; }
.btn-light-danger { background-color: rgba(237,85,85,.12); color: #ed5555; border-color: transparent; }
.btn-light-danger:hover { background-color: #ed5555; color: #fff; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-soft-primary { background-color: rgba(31,88,199,.12); color: #1f58c7; border: 0; }
.btn-soft-primary:hover { background-color: #1f58c7; color: #fff; }
.btn-soft-success { background-color: rgba(40,183,101,.12); color: #28b765; border: 0; }
.btn-soft-danger { background-color: rgba(237,85,85,.12); color: #ed5555; border: 0; }
.f-10 { font-size: 10px !important; } .f-12 { font-size: 12px !important; }
.f-14 { font-size: 14px !important; } .f-16 { font-size: 16px !important; }
.f-18 { font-size: 18px !important; } .f-20 { font-size: 20px !important; }
.f-24 { font-size: 24px !important; } .f-30 { font-size: 30px !important; }
.plan-card .card-body { padding-top: 2.2rem !important; }
.active-badge { top: 0 !important; right: 0 !important; z-index: 2; }
.f-w-500 { font-weight: 500 !important; } .f-w-600, .f-w-700 { font-weight: 600 !important; }
.wid-35 { width: 35px; height: 35px; } .wid-45 { width: 45px; height: 45px; }
.card { border-radius: .75rem; box-shadow: 0 2px 6px rgba(18,32,51,.04); border: 1px solid #eff0f2; margin-bottom: 24px; }
.card-header { background-color: transparent; border-bottom: 1px solid #eff0f2; padding: 1rem 1.25rem; }
.table thead th { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: #495057; }
#sidebar-menu ul li a i.bx, #sidebar-menu ul li a i.mdi { font-size: 18px; min-width: 1.75rem; vertical-align: middle; }
#sidebar-menu ul li a .badge { float: right; margin-top: 2px; }
.header-profile-user { object-fit: cover; }
.authentication-bg .bg-overlay { opacity: .88; }

/* Single-line auth buttons & topbar spacing */
.header-auth-btns .btn { white-space: nowrap; flex-shrink: 0; }
.navbar-header > .d-flex:first-child { min-width: 0; flex: 1; }
.navbar-header .page-title-box { min-width: 0; flex: 1; overflow: hidden; }
.navbar-header .page-title-box h4 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-header > .d-flex:last-child { flex-shrink: 0; }

/* Desktop: only sidebar shows logo; Mobile/Tablet (<992px): only topbar shows ONE single logo */
@media (min-width: 992px) {
  .vertical-menu .navbar-brand-box { padding: 0 1.25rem; height: 70px; display: flex; align-items: center; }
}
@media (max-width: 991.98px) {
  .main-content { margin-left: 0 !important; }
  .footer { left: 0 !important; text-align: center; }
  .navbar-header { padding: 0 12px; gap: 6px; }
  /* CRITICAL: Hide sidebar brand box so opening mobile menu NEVER shows a 2nd logo */
  .vertical-menu .navbar-brand-box,
  .vertical-menu .vertical-menu-btn { display: none !important; }
  /* Keep topbar logo crisp & visible on ALL mobile/tablet screens (even 360-380px) without getting squished on 768px */
  #page-topbar .navbar-brand-box,
  .ishorizontal-topbar .navbar-brand-box {
    display: inline-flex !important;
    align-items: center;
    flex-shrink: 0;
    padding: 0 6px 0 0 !important;
    width: auto !important;
    position: relative !important;
  }
  #page-topbar .logo span.logo-lg,
  .ishorizontal-topbar .logo span.logo-lg { display: none !important; }
  #page-topbar .logo span.logo-sm,
  .ishorizontal-topbar .logo span.logo-sm { display: inline-flex !important; align-items: center; }
  #page-topbar .logo img,
  .ishorizontal-topbar .logo img { max-height: 28px; width: auto; max-width: 110px; object-fit: contain; }
}
@media (max-width: 575.98px) {
  .page-content { padding: calc(70px + 12px) 6px 60px; }
  .card-body { padding: 1rem; }
  .page-title-box { flex-wrap: wrap; gap: .5rem; }
  .nav-tabs, .nav-pills { flex-wrap: wrap; gap: .25rem; }
  .dataTables_wrapper .dataTables_filter input { width: 130px !important; }
  .modal-dialog { margin: .5rem; }
  .header-auth-btns { gap: 4px !important; }
  .header-auth-btns .btn { font-size: 12px; padding: .3rem .55rem; }
  .header-item.noti-icon { padding: 0 6px !important; }
}
