/* Admin PC Portal — sidebar, tables, drawer, global toolbar */
@media (min-width: 960px) {
  body.admin-pc-portal #admin-portal-sidebar {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 248px;
    z-index: 200;
    background: linear-gradient(180deg, #0d47a1 0%, #1565c0 48%, #1976d2 100%);
    color: #fff;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    font-family: inherit;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
  }

  body.admin-pc-portal-sidebar-collapsed #admin-portal-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    pointer-events: none;
  }

  #admin-sidebar-reopen {
    display: none;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 210;
    border: none;
    border-radius: 0 10px 10px 0;
    background: #1565c0;
    color: #fff;
    padding: 14px 10px 14px 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 2px 0 14px rgba(0, 0, 0, 0.18);
    font-family: inherit;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
  }

  body.admin-pc-portal.admin-pc-portal-sidebar-collapsed #admin-sidebar-reopen {
    display: flex;
  }

  body.admin-pc-portal-sidebar-collapsed .app {
    margin-left: 0 !important;
  }

  body.admin-pc-portal-sidebar-collapsed #admin-global-toolbar {
    left: 0 !important;
  }

  body.admin-pc-portal-sidebar-collapsed.admin-show-filters #ah-emp-filter-wrap,
  body.admin-pc-portal-sidebar-collapsed.admin-show-filters #s-admin-products .ah-prod-panel,
  body.admin-pc-portal-sidebar-collapsed.admin-show-filters #s-admin-branches .ah-form-card {
    left: 0 !important;
  }

  body.admin-pc-portal .app {
    margin-left: 248px;
    flex: 1 1 auto !important;
    max-width: none !important;
    width: auto !important;
    box-shadow: none;
  }

  /* แอดมินใช้ sidebar แล้ว — ซ่อนแผงขวา + mobile chrome ถาวร */
  body.admin-pc-portal {
    display: block !important;
  }

  body.admin-pc-portal #pc-panel,
  body.admin-pc-portal #pc-panel-desktop-reopen,
  body.admin-pc-portal #pc-panel-backdrop,
  body.admin-pc-portal #pc-panel-collapse-desktop,
  body.admin-pc-portal #mobile-app-header,
  body.admin-pc-portal #mobile-app-tabbar,
  body.admin-pc-portal #mobile-pending-fab,
  body.admin-pc-portal #mob-pwa-install {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
  }

  body.admin-hide-pc-panel #pc-panel,
  body.admin-hide-pc-panel #pc-panel-desktop-reopen,
  body.admin-hide-pc-panel #pc-panel-backdrop,
  body.admin-hide-pc-panel #pc-panel-collapse-desktop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
  }

  body.admin-hide-pc-panel .app {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none;
  }

  body.admin-pc-portal .screen.ah-wrap > .ah-hdr .ah-back {
    display: none;
  }

  body.admin-pc-portal #admin-global-toolbar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.admin-pc-portal.admin-pc-global-toolbar .screen.ah-wrap.active {
    padding-top: 0;
  }

  body.admin-pc-portal:has(#s-admin-home.active) .screen.ah-wrap.active {
    padding-top: 0;
  }

  body.admin-pc-portal.admin-show-filters #ah-emp-filter-wrap .admin-hide-on-pc-toolbar,
  body.admin-pc-portal.admin-show-filters #s-admin-products .admin-hide-on-pc-toolbar,
  body.admin-pc-portal.admin-show-filters #s-admin-branches .admin-hide-on-pc-toolbar {
    display: block !important;
  }

  body.admin-pc-portal.admin-show-filters #ah-emp-filter-wrap,
  body.admin-pc-portal.admin-show-filters #s-admin-products .ah-prod-panel,
  body.admin-pc-portal.admin-show-filters #s-admin-branches .ah-form-card {
    position: fixed;
    top: 0;
    left: 248px;
    right: 0;
    z-index: 140;
    max-height: 50vh;
    overflow: auto;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  }

  body.admin-pc-portal.admin-table-density-compact .admin-data-table th,
  body.admin-pc-portal.admin-table-density-compact .admin-data-table td {
    padding: 5px 8px;
    font-size: 11px;
  }

  body.admin-pc-portal:not(.admin-table-density-compact) .admin-data-table th,
  body.admin-pc-portal:not(.admin-table-density-compact) .admin-data-table td {
    padding: 10px 14px;
    font-size: 13px;
  }

  body.admin-pc-portal .admin-table-enhanced {
    max-height: calc(100vh - 220px);
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
  }

  body.admin-pc-portal .admin-table-enhanced .admin-data-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
  }

  body.admin-pc-portal .admin-table-enhanced .admin-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f1f5f9;
    box-shadow: 0 1px 0 #e2e8f0;
  }

  body.admin-pc-portal .admin-table-enhanced .admin-data-table .admin-sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
  }

  body.admin-pc-portal .admin-table-enhanced .admin-data-table thead .admin-sticky-col {
    z-index: 4;
    background: #f1f5f9;
  }

  body.admin-pc-portal .admin-table-enhanced .admin-data-table tbody tr:hover td {
    background: #eff6ff;
  }

  body.admin-pc-portal .admin-table-enhanced .admin-data-table tbody tr:hover .admin-sticky-col {
    background: #eff6ff;
  }

  /* Side drawer (replaces center modal on PC) */
  body.admin-pc-drawer-open {
    overflow: hidden;
  }

  body.admin-pc-drawer-open .ah-modal.admin-pc-drawer {
    display: flex !important;
    justify-content: flex-end;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.28);
    pointer-events: auto;
    padding: 0;
  }

  body.admin-pc-drawer-open .ah-modal.admin-pc-drawer .ah-modal-box {
    pointer-events: auto;
    width: min(520px, 42vw);
    max-width: 520px;
    min-width: 380px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    animation: adminDrawerSlide 0.22s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.admin-pc-drawer-open .ah-modal.admin-pc-drawer .ah-modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: none !important;
  }

  body.admin-pc-drawer-open .app {
    pointer-events: auto;
  }
}

@keyframes adminDrawerSlide {
  from { transform: translateX(100%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

#admin-portal-sidebar {
  display: none;
}

.admin-sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.admin-sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.admin-sidebar-collapse-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.admin-sidebar-reopen-lbl {
  font-size: 10px;
  opacity: 0.92;
}

.admin-sidebar-reopen-ic {
  font-size: 16px;
  line-height: 1;
}

.admin-sidebar-brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-sidebar-brand p {
  margin: 4px 0 0;
  font-size: 11px;
  opacity: 0.75;
}

.admin-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 16px;
}

.admin-acc {
  margin-bottom: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.2);
}

.admin-acc[data-acc="home"] {
  background: linear-gradient(145deg, rgba(191, 219, 254, 0.44) 0%, rgba(147, 197, 253, 0.22) 100%);
  border-color: rgba(191, 219, 254, 0.55);
  box-shadow: inset 3px 0 0 #93c5fd;
}

.admin-acc[data-acc="reports"] {
  background: linear-gradient(145deg, rgba(167, 243, 208, 0.42) 0%, rgba(110, 231, 183, 0.2) 100%);
  border-color: rgba(167, 243, 208, 0.52);
  box-shadow: inset 3px 0 0 #6ee7b7;
}

.admin-acc[data-acc="hold"] {
  background: linear-gradient(145deg, rgba(254, 215, 170, 0.46) 0%, rgba(253, 186, 116, 0.24) 100%);
  border-color: rgba(254, 215, 170, 0.58);
  box-shadow: inset 3px 0 0 #fdba74;
}

.admin-acc[data-acc="settings"] {
  background: linear-gradient(145deg, rgba(233, 213, 255, 0.44) 0%, rgba(216, 180, 254, 0.22) 100%);
  border-color: rgba(233, 213, 255, 0.55);
  box-shadow: inset 3px 0 0 #d8b4fe;
}

.admin-acc-hdr {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.admin-acc-hdr i {
  width: 18px;
  opacity: 0.9;
}

.admin-acc-hdr .admin-acc-chevron {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.admin-acc.open .admin-acc-chevron {
  transform: rotate(180deg);
}

.admin-acc-body {
  display: none;
  padding: 4px 6px 8px;
}

.admin-acc.open .admin-acc-body {
  display: block;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-nav-item.active {
  background: rgba(255, 255, 255, 0.28);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.admin-acc[data-acc="home"] .admin-nav-item.active {
  background: rgba(191, 219, 254, 0.45);
  color: #eff6ff;
}

.admin-acc[data-acc="reports"] .admin-nav-item.active {
  background: rgba(167, 243, 208, 0.4);
  color: #ecfdf5;
}

.admin-acc[data-acc="hold"] .admin-nav-item.active {
  background: rgba(254, 215, 170, 0.42);
  color: #fff7ed;
}

.admin-acc[data-acc="settings"] .admin-nav-item.active {
  background: rgba(233, 213, 255, 0.42);
  color: #faf5ff;
}

.admin-sidebar-foot {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  opacity: 0.65;
  text-align: center;
}

#admin-global-toolbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 6;
  flex-shrink: 0;
}

/* ไม่แสดงชื่อ/Employee ID แอดมินในแถบหัว — ใช้ sidebar แทน */
body.admin-pc-portal #ah-user-label,
body.admin-pc-portal #db-user-bar,
body.admin-pc-portal #db-hdr-emp-id {
  display: none !important;
}

/* หน้าแรกแอดมินล้วน — ซ่อนแถบหัวที่มีชื่อผู้ใช้ (ใช้ sidebar + ops dashboard) */
@media (min-width: 960px) {
  body.admin-pc-pure-admin #s-admin-home > .ah-hdr {
    display: none !important;
  }
}

.admin-global-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 12px;
  min-height: 40px;
}

.admin-global-search-wrap:focus-within {
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
  background: #fff;
}

.admin-global-search-wrap i {
  color: #94a3b8;
  font-size: 14px;
}

#admin-global-search {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.admin-global-search-wrap kbd {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.admin-toolbar-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.admin-toolbar-btn:hover {
  border-color: #90caf9;
  color: #1565c0;
}

.admin-toolbar-btn.active {
  background: #e3f2fd;
  border-color: #1565c0;
  color: #0d47a1;
}

.admin-filter-popover {
  position: relative;
}

.admin-filter-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 280px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 50;
}

.admin-filter-popover.open .admin-filter-panel {
  display: block;
}

.admin-drawer-form .ah-inp:focus,
.admin-drawer-form select:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

/* ไอดีแอดมิน (role=admin ไม่ใช่ admin-employee) — ซ่อนไทล์เมนูหน้าแรก ใช้ sidebar แทน */
@media (min-width: 960px) {
  body.admin-pc-portal:has(#s-admin-home.active) #admin-portal-sidebar {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-banner,
  body.admin-pc-pure-admin #s-admin-home .ah-card-grid,
  body.admin-pc-pure-admin #s-admin-home .ah-tile-profile,
  body.admin-pc-pure-admin #s-admin-home .ah-tile-payroll,
  body.admin-pc-pure-admin #s-admin-home .ah-tile-audit {
    display: none !important;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-dashboard {
    display: block !important;
    margin: 0 16px 20px;
    padding: 0 0 8px;
    max-width: 100%;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-head {
    margin-bottom: 14px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #0d47a1;
    letter-spacing: -0.02em;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-head-rule {
    margin-top: 8px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #1565c0, #64b5f6 55%, transparent);
  }

  /* Two-column layout: 70% primary / 30% sidebar */
  body.admin-pc-pure-admin #s-admin-home .ah-ops-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
    gap: 14px;
    align-items: start;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-col-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-col-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-card--staff {
    border-top: 3px solid #1565c0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-card--route {
    border-top: 3px solid #16a34a;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-card--urgent {
    border-top: 3px solid #dc2626;
    background: linear-gradient(180deg, #fff 0%, #fffbfb 100%);
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-top {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-card--staff .ah-ops-kpi-icon {
    color: #1565c0;
    background: #e3f2fd;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-card--route .ah-ops-kpi-icon {
    color: #16a34a;
    background: #dcfce7;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-card--urgent .ah-ops-kpi-icon {
    color: #dc2626;
    background: #fee2e2;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    line-height: 1.3;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-top: 2px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-pct {
    font-size: 28px;
    color: #1565c0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-urgent {
    color: #dc2626;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-route-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-donut-wrap {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-progress-wrap {
    margin: 2px 0 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #42a5f5, #1565c0);
    transition: width 0.5s ease;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-sub {
    margin: 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.35;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-panel,
  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    padding: 12px 14px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-col-main .ah-ops-tasks {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-panel-hdr {
    margin-bottom: 10px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-status .ah-ops-panel-hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-card-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-card-hdr .ah-ops-chart-title {
    margin: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-panel-hdr .ah-admin-approval-sub {
    margin-top: 4px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-approval-panel {
    min-height: 0;
    padding: 12px 12px 10px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-approval-panel .ah-ops-panel-title {
    font-size: 13px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-panel-title,
  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.35;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-col-main .ah-ops-table-wrap {
    overflow: auto;
    flex: 1;
    min-height: 260px;
    max-height: calc(100vh - 300px);
    border: 1px solid #f1f5f9;
    border-radius: 8px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-table th {
    text-align: left;
    padding: 8px 10px;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-table tr:hover td {
    background: #f8fafc;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 16px 16px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-col {
    border: 1px solid #e8edf2;
    border-radius: 10px;
    background: #fafbfc;
    min-height: 120px;
    max-height: 280px;
    display: flex;
    flex-direction: column;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-col--ok {
    border-top: 3px solid #2e7d32;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-col--pending {
    border-top: 3px solid #f57c00;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-col--leave {
    border-top: 3px solid #5c6bc0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-col-title {
    margin: 0;
    padding: 10px 12px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    border-bottom: 1px solid #e8edf2;
    flex-shrink: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-item {
    padding: 6px 12px;
    font-size: 12px;
    color: #1e293b;
    line-height: 1.4;
    border-bottom: 1px solid #f1f5f9;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-item--warn {
    color: #b45309;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-ci-zone {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-ci-time {
    float: right;
    font-size: 11px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-ci-late {
    float: right;
    margin-left: 6px;
    font-size: 10px;
    color: #c62828;
    font-weight: 600;
  }

  @media (max-width: 900px) {
    body.admin-pc-pure-admin #s-admin-home .ah-ops-checkin-grid {
      grid-template-columns: 1fr;
    }
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-status-pending {
    background: #fef3c7;
    color: #b45309;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-status-urgent {
    background: #fee2e2;
    color: #b91c1c;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-empty {
    text-align: center;
    color: #94a3b8;
    padding: 20px !important;
    font-size: 12px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-row-actions {
    display: inline-flex;
    gap: 4px;
    white-space: nowrap;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-row-actions .ah-admin-btn-approve,
  body.admin-pc-pure-admin #s-admin-home .ah-ops-row-actions .ah-admin-btn-reject {
    min-width: 28px;
    padding: 4px 8px;
    font-size: 11px;
  }

  /* Compact vertical approval list (right column) */
  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 2px;
    grid-template-columns: unset;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e8eef5;
    background: #fafcff;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-card-main {
    min-width: 0;
    flex: 1;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-emp {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-detail {
    font-size: 11px;
    color: #64748b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-card-hdr,
  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-meta {
    display: none;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-reason {
    display: none;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-actions {
    flex-direction: row;
    gap: 4px;
    flex-shrink: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact .ah-admin-pending-actions button {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 6px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-charts {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-card {
    padding: 10px 12px 8px;
    min-height: 0;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-canvas-wrap--bar {
    position: relative;
    height: 150px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-canvas-wrap--line {
    position: relative;
    height: 130px;
  }

  body.admin-pc-pure-admin #s-admin-home .ah-ops-chart-canvas-wrap canvas {
    max-height: 100%;
  }

  @media (max-width: 1200px) {
    body.admin-pc-pure-admin #s-admin-home .ah-ops-layout {
      grid-template-columns: 1fr;
    }
    body.admin-pc-pure-admin #s-admin-home .ah-ops-kpi-row {
      grid-template-columns: 1fr;
    }
    body.admin-pc-pure-admin #s-admin-home .ah-ops-col-main .ah-ops-table-wrap {
      max-height: 360px;
    }
    body.admin-pc-pure-admin #s-admin-home .ah-admin-pending-list-compact {
      max-height: 320px;
    }
  }

  body.admin-pc-pure-admin #s-admin-home #ah-daily-report-section {
    display: none !important;
  }

  body.admin-pc-portal .db-report-screen {
    display: none;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f5f8ff;
  }

  body.admin-pc-portal .db-report-screen.active {
    display: flex !important;
  }

  body.admin-pc-portal .db-report-screen .db-report-mount {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.admin-pc-portal .cp-hold-screen {
    display: none;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f0f4fa;
  }

  body.admin-pc-portal .cp-hold-screen.active {
    display: flex !important;
  }

  body.admin-pc-portal #page-dashboard.admin-db-embedded {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    z-index: 1 !important;
    overflow-y: auto;
    background: #f0f4fa;
  }

  body.admin-pc-portal #page-dashboard.admin-db-embedded .db-tabs {
    display: none !important;
  }

  body.admin-pc-portal #page-dashboard.admin-db-embedded .db-back {
    display: none !important;
  }

  body.admin-pc-portal #page-dashboard.admin-db-embedded .db-hdr {
    position: sticky;
    top: 0;
    z-index: 5;
  }
}
