/* ============================================================================
   PeopleOne — app.css   โครงหน้าและคอมโพเนนต์
   สีทั้งหมดอ้างจาก token ใน bootstrap-reskin.css SECTION 1 เท่านั้น
   ============================================================================ */

/* ------------------------------------------------------------------ SIDEBAR */
.po-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background:
    radial-gradient(circle at 6% 2%, rgba(242,107,94,.08), transparent 15rem),
    linear-gradient(180deg, #FFFFFF 0%, #FBF9FC 54%, #F8F5FA 100%);
  z-index: 1030; overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid #EDE8F0;
  box-shadow: 14px 0 42px rgba(45,36,64,.07);
}
.po-sidebar::-webkit-scrollbar { width: 5px; }
.po-sidebar::-webkit-scrollbar-thumb { background: #D8D0DE; border-radius: 3px; }

.po-brand {
  display: flex; align-items: center; gap: .75rem; height: var(--topbar-h);
  padding: 0 1.15rem; border-bottom: 1px solid #EEE9F1;
  background: rgba(255,255,255,.86); backdrop-filter: blur(16px);
}
.po-brand-mark {
  width: 38px; height: 38px; border-radius: 13px;
  background: linear-gradient(145deg, #FF8A72, var(--c-accent) 55%, #D95786);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; flex: 0 0 auto;
  box-shadow: 0 9px 22px rgba(242,107,94,.28), inset 0 1px rgba(255,255,255,.35);
  transform: rotate(-4deg);
}
.po-brand-text { min-width: 0; }
.po-brand-name { color: #30253D; font-size: 17px; font-weight: 750; line-height: 1.1; letter-spacing: -.01em; }
.po-brand-sub { color: #8B8194; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.po-nav-tools { padding: 1rem .85rem .75rem; border-bottom: 1px solid #EEE9F1; }
.po-nav-workspaces { display: flex; gap: .55rem; margin-bottom: .75rem; }
.po-nav-workspaces > a { position: relative; min-width: 0; min-height: 68px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: .55rem .25rem; border: 1px solid #EAE4EE; border-radius: 16px; color: #6F6479; background: #FFFFFF; box-shadow: 0 5px 16px rgba(45,36,64,.045); font-size: 11.5px; font-weight: 600; }
.po-nav-workspaces > a i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: #7252A0; background: #F1EBF8; font-size: 15px; }
.po-nav-workspaces > a:hover { color: #3F334B; border-color: #D9CEE4; transform: translateY(-1px); }
.po-nav-workspaces > a.active { color: #C34E43; border-color: #F4B9B1; background: #FFF4F1; box-shadow: 0 7px 18px rgba(242,107,94,.1); }
.po-nav-workspaces > a.active i { color: #fff; background: linear-gradient(145deg, #FF8A72, var(--c-accent)); }
.po-nav-workspaces > a b { position: absolute; right: 7px; top: 5px; min-width: 15px; height: 15px; display: grid; place-items: center; padding: 0 3px; border-radius: 8px; background: var(--c-accent); color: #fff; font-size: 8px; }
.po-nav-search { height: 45px; display: flex; align-items: center; gap: .6rem; padding: 0 .85rem; border: 1px solid #E7E0EB; border-radius: 14px; background: #F6F3F8; color: #84778F; }
.po-nav-search:focus-within { border-color: rgba(112,75,166,.45); background: #fff; box-shadow: 0 0 0 4px rgba(112,75,166,.07); }
.po-nav-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: #392F43; background: transparent; font: inherit; font-size: 13.5px; }
.po-nav-search input::placeholder { color: #A39AA9; }
.po-nav-search button { display: none; border: 0; padding: 0; color: #84778F; background: transparent; font-size: 12px; }
.po-nav-search button.is-visible { display: block; }

.po-nav { padding: .8rem .75rem 2.5rem; }
.po-nav::before { content: 'เมนูทั้งหมด'; display: block; padding: .15rem .55rem .6rem; color: #9B909F; font-size: 11.5px; font-weight: 700; }
.po-nav-head {
  min-height: 46px; display: flex; align-items: center; gap: .65rem; margin: .18rem 0; padding: .35rem .55rem;
  border: 1px solid transparent; border-radius: 13px; color: #62586C; font-size: 13.5px; font-weight: 650;
  letter-spacing: 0; text-transform: none; cursor: pointer; user-select: none;
}
.po-nav-head:hover, .po-nav-head:focus-visible { color: #3D304A; border-color: #E8E1EC; background: #fff; outline: 0; }
.po-nav-head:not(.is-collapsed) { color: #543C72; border-color: #E2D8EB; background: #F5F0F9; }
.po-nav-head-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #7252A0; background: #EEE8F5; font-size: 14px; }
.po-nav-head:not(.is-collapsed) .po-nav-head-icon { color: #fff; background: linear-gradient(145deg, #7958A8, #604287); box-shadow: 0 5px 12px rgba(96,66,135,.2); }
.po-nav-head-chevron { margin-left: auto; color: #A399AA; font-size: 10px; transition: transform .16s ease; }
.po-nav-head.is-collapsed .po-nav-head-chevron { transform: rotate(-90deg); }
.po-nav-item.po-nav-group-hidden, .po-nav-item.po-nav-search-hidden, .po-nav-head.po-nav-search-hidden { display: none; }
.po-nav.is-searching .po-nav-item.po-nav-group-hidden:not(.po-nav-search-hidden) { display: flex; }
.po-nav-item {
  min-height: 47px; display: flex; align-items: center; gap: .72rem; padding: .45rem .58rem;
  color: #62586B; font-size: 14.5px; border: 1px solid transparent; border-radius: 13px;
  margin: 2px 0 2px .45rem; transition: background .16s, color .16s, transform .16s, border-color .16s;
}
.po-nav-item:hover { background: #FFFFFF; border-color: #E9E3EC; color: #3B3045; transform: translateX(2px); box-shadow: 0 4px 12px rgba(45,36,64,.045); }
.po-nav-item i {
  width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center;
  color: #7B6D87; font-size: 15px; text-align: center; flex: 0 0 auto; background: #F0ECF3;
}
.po-nav-item.active {
  background: linear-gradient(100deg, #FFF0EC, #FFF8F6);
  color: #B9473E; border-color: #F3C1BA; font-weight: 700;
  box-shadow: inset 3px 0 0 #F26B5E, 0 6px 16px rgba(242,107,94,.08);
}
.po-nav-item.active i { background: var(--c-accent); color: #fff; box-shadow: 0 5px 12px rgba(242,107,94,.22); }
.po-nav-badge { margin-left: auto; background: var(--c-accent); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.po-nav-badge[hidden] { display: none !important; }

/* ------------------------------------------------------------------- TOPBAR */
.po-topbar {
  position: fixed; top: 0; right: 0; left: var(--sidebar-w); height: var(--topbar-h);
  background: rgba(255,255,255,.9); border-bottom: 1px solid rgba(233,228,237,.85); z-index: 1020;
  display: flex; align-items: center; gap: .75rem; padding: 0 1.45rem;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.po-topbar-company { display: flex; align-items: center; gap: .5rem; }
.po-topbar-search { max-width: 300px; flex: 1; }
.po-topbar-spacer { margin-left: auto; }
.po-quick-search {
  width: min(260px, 24vw); height: 38px; align-items: center; gap: .55rem; margin-left: 1rem;
  padding: 0 .78rem; border-radius: 12px; background: var(--c-line-soft); border: 1px solid transparent;
  color: var(--c-muted); font-size: 12.5px; transition: .16s ease;
}
.po-quick-search:hover { color: var(--c-ink); border-color: var(--c-line); background: #fff; box-shadow: var(--shadow-sm); }
.po-icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--c-line); background: #fff;
  display: grid; place-items: center; color: var(--c-ink-soft); position: relative;
}
.po-icon-btn:hover { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent-dark); }
.po-icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--c-accent); }

.po-user { display: flex; align-items: center; gap: .55rem; padding: .3rem .55rem; border-radius: 12px; }
.po-user:hover { background: var(--c-line-soft); }
.po-avatar {
  width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(145deg, var(--c-accent-soft), #F1EAF9); color: var(--c-accent-dark);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: 0 0 auto;
}
.po-user-name { font-size: 13.5px; font-weight: 600; line-height: 1.15; color: var(--c-ink); }
.po-user-role { font-size: 11.5px; color: var(--c-muted); }

/* ------------------------------------------------------------------ CONTENT */
/* กฎสำคัญ: margin-left + padding-top + box-sizing เท่านั้น
   ห้ามใช้ display:flex บน wrapper และห้ามใส่ width:100% ที่ .po-content */
.po-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  box-sizing: border-box;
  min-height: 100vh;
}
.po-content-inner { width: 100%; max-width: none; margin: 0 auto; padding: 1.55rem 1.7rem 3rem; }

/* --------------------------------------------------------------- PAGE HEAD */
.po-page-head {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.15rem; flex-wrap: wrap;
  padding: 1.05rem 1.2rem; border: 1px solid var(--c-line); border-radius: var(--radius);
  background: linear-gradient(125deg, #fff 20%, #FCF9FD 100%); box-shadow: var(--shadow-sm);
}
.po-page-title { font-size: 22px; font-weight: 700; color: var(--c-ink); margin: 0 0 .15rem; letter-spacing: -.02em; }
.po-page-sub { font-size: 13.5px; color: var(--c-muted); margin: 0; }
.po-page-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* -------------------------------------------------------------------- CARD */
.po-card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.1rem; overflow: hidden; }
.po-card-head {
  display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem;
  background: linear-gradient(90deg, #fff, #FBF9FC); border-bottom: 1px solid var(--c-line-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}
.po-card-title { font-size: 15px; font-weight: 700; margin: 0; color: var(--c-ink); }
.po-card-sub { font-size: 12.5px; color: var(--c-muted); margin: 0; }
.po-card-actions { margin-left: auto; display: flex; gap: .4rem; }
.po-card-body { padding: 1.1rem; }
.po-card-body.flush { padding: 0; }
.po-card-foot { padding: .7rem 1.1rem; border-top: 1px solid var(--c-line-soft); background: #FCFCFD; border-radius: 0 0 var(--radius) var(--radius); }

/* --------------------------------------------------------------- STAT CARD */
.po-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem; margin-bottom: 1.15rem; }
.po-stat {
  position: relative; overflow: hidden; background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
}
.po-stat::after { content: ''; position: absolute; width: 70px; height: 70px; right: -28px; top: -30px; border-radius: 50%; background: var(--c-accent-soft); }
.po-stat:nth-child(2)::after { background: var(--c-support-soft); }
.po-stat:nth-child(3)::after { background: #F1EAF9; }
.po-stat:nth-child(4)::after { background: var(--c-warn-soft); }
.po-stat-lbl { font-size: 12.5px; color: var(--c-muted); margin-bottom: .3rem; display: flex; align-items: center; gap: .35rem; }
.po-stat-val { font-size: 25px; font-weight: 600; color: var(--c-ink); line-height: 1.1; }
.po-stat-unit { font-size: 13px; color: var(--c-muted); font-weight: 400; margin-left: .2rem; }
.po-stat-foot { font-size: 12px; color: var(--c-muted); margin-top: .35rem; }

/* --------------------------------------------------------------- HEROES */
.po-dashboard-hero, .po-people-hero {
  position: relative; overflow: hidden; border-radius: 24px; margin-bottom: 1.25rem;
  background:
    radial-gradient(circle at 76% 15%, rgba(131,95,219,.62), transparent 27%),
    radial-gradient(circle at 4% 105%, rgba(242,107,94,.42), transparent 32%),
    linear-gradient(125deg, #2D2440 0%, #432D5A 58%, #2E615F 135%);
  box-shadow: 0 18px 44px rgba(45,36,64,.16);
}
.po-dashboard-hero::before, .po-people-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255,255,255,.85) .8px, transparent .8px);
  background-size: 22px 22px; mask-image: linear-gradient(90deg, #000, transparent 74%);
}
.po-dashboard-hero { min-height: 286px; display: flex; align-items: center; padding: 2.1rem 2.35rem; }
.po-dashboard-hero-copy, .po-people-hero-copy { position: relative; z-index: 2; }
.po-dashboard-hero-copy { width: 52%; }
.po-hero-eyebrow { display: inline-flex; align-items: center; gap: .45rem; color: #FFC0B5; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; }
.po-dashboard-hero h1, .po-people-hero h1 { color: #fff; font-size: clamp(27px, 3vw, 40px); font-weight: 800; line-height: 1.22; letter-spacing: -.03em; margin: .7rem 0 .4rem; }
.po-dashboard-hero p, .po-people-hero p { color: rgba(255,255,255,.74); font-size: 14px; margin: 0; }
.po-dashboard-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.po-dashboard-hero-actions .btn { padding: .55rem .92rem; }
.po-btn-hero-ghost { border-color: rgba(255,255,255,.2); color: #fff; background: rgba(255,255,255,.08); }
.po-btn-hero-ghost:hover { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.15); }
.po-dashboard-hero-art { position: absolute; right: -2.5%; bottom: -12%; width: min(74%, 880px); height: auto; filter: drop-shadow(0 18px 24px rgba(19,11,31,.25)); }

.po-people-hero { min-height: 220px; display: flex; align-items: center; padding: 1.8rem 2.1rem; }
.po-people-hero-copy { width: 68%; }
.po-people-hero h1 { font-size: clamp(25px, 2.4vw, 34px); }
.po-people-hero .po-page-actions { margin: 1.15rem 0 0; position: relative; z-index: 3; }
.po-people-hero .btn-secondary { background: rgba(255,255,255,.92); border-color: rgba(255,255,255,.45); }
.po-people-hero-art { position: absolute; right: -6rem; bottom: -6.5rem; width: min(64%, 760px); height: auto; opacity: .96; filter: drop-shadow(0 16px 24px rgba(19,11,31,.25)); }

/* ------------------------------------------------------------------- BADGE */
.po-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: 12px; font-weight: 500; padding: .2rem .55rem; border-radius: 20px; line-height: 1.5; white-space: nowrap; }
.po-badge.solid  { background: var(--c-accent); color: #fff; }
.po-badge.soft   { background: var(--c-support-soft); color: var(--c-support); }
.po-badge.line   { background: #fff; color: var(--c-ink-soft); border: 1px solid var(--c-line); }
.po-badge.warn   { background: var(--c-warn-soft); color: var(--c-warn); }
.po-badge.danger { background: var(--c-danger-soft); color: var(--c-danger); }
.po-badge.mute   { background: var(--c-line-soft); color: var(--c-muted); }

/* ------------------------------------------------------------------ LAYOUT */
.po-split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.1rem; align-items: start; }
@media (max-width: 1200px) { .po-split { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------- EMPTY STATE */
.po-empty { text-align: center; padding: 2.6rem 1rem; }
.po-empty i { font-size: 40px; color: var(--c-line); display: block; margin-bottom: .7rem; }
.po-empty-title { font-size: 14.5px; font-weight: 600; color: var(--c-ink-soft); margin-bottom: .25rem; }
.po-empty-text { font-size: 13px; color: var(--c-muted); margin-bottom: .9rem; }

/* --------------------------------------------------------------- SETTINGS */
.po-settings-page { width: 100%; max-width: none; margin: 0; }
.po-settings-hero {
  min-height: 225px; display: flex; align-items: center; position: relative; overflow: hidden;
  padding: 2rem 2.4rem; border-radius: 20px; margin-bottom: 1.8rem;
  background: radial-gradient(circle at 85% 50%, var(--c-sidebar-hi), var(--c-sidebar) 58%);
  box-shadow: 0 14px 30px rgba(42,50,64,.12);
}
.po-settings-hero::before {
  content: ''; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent 20%, #000);
}
.po-settings-hero-copy { position: relative; z-index: 1; max-width: 590px; }
.po-settings-eyebrow { display: inline-flex; align-items: center; gap: .45rem; color: #F7B39B; font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.po-settings-hero h1 { margin: .7rem 0 .55rem; color: #fff; font-size: clamp(24px, 2.5vw, 36px); font-weight: 700; line-height: 1.24; }
.po-settings-hero p { margin: 0; color: #D7DCE4; font-size: 14px; line-height: 1.6; }
.po-settings-hero-art { position: absolute; right: 1.2rem; bottom: -1.9rem; width: min(39%, 380px); height: auto; filter: drop-shadow(0 6px 12px rgba(0,0,0,.15)); }
.po-settings-section-heading, .po-settings-workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.po-settings-kicker { display: block; color: var(--c-accent-dark); font-size: 11px; font-weight: 700; letter-spacing: .04em; margin-bottom: .2rem; }
.po-settings-section-heading h2, .po-settings-workspace-heading h2 { color: var(--c-ink); font-size: 19px; font-weight: 700; margin: 0; }
.po-settings-section-count { color: var(--c-muted); font-size: 12.5px; white-space: nowrap; }
.po-settings-groups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-bottom: 2rem; }
.po-settings-group {
  min-width: 0; min-height: 170px; display: flex; flex-direction: column; align-items: flex-start;
  padding: 1rem 1.05rem .85rem; border: 1px solid var(--c-line); border-radius: 14px;
  background: var(--c-card); color: var(--c-ink); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.po-settings-group:hover, .po-settings-group:focus-visible { color: var(--c-ink); transform: translateY(-3px); border-color: var(--c-accent-line); box-shadow: var(--shadow); }
.po-settings-group:focus-visible, .po-settings-subnav-link:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.po-settings-group.active { border-color: var(--c-accent); box-shadow: 0 0 0 2px var(--c-accent-soft), var(--shadow-sm); }
.po-settings-group-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--c-accent-soft); color: var(--c-accent-dark); font-size: 19px; margin-bottom: .8rem; }
.po-settings-group:nth-child(5n+2) .po-settings-group-icon { background: var(--c-support-soft); color: var(--c-support); }
.po-settings-group:nth-child(5n+3) .po-settings-group-icon { background: var(--c-warn-soft); color: var(--c-warn); }
.po-settings-group:nth-child(5n+4) .po-settings-group-icon { background: var(--c-line-soft); color: var(--c-ink-soft); }
.po-settings-group:nth-child(5n+5) .po-settings-group-icon { background: var(--c-danger-soft); color: var(--c-danger); }
.po-settings-group-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.po-settings-group-description { color: var(--c-muted); font-size: 11.5px; line-height: 1.45; margin: .25rem 0 .65rem; }
.po-settings-group-foot { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: auto; color: var(--c-muted); font-size: 11.5px; }
.po-settings-group-foot i { color: var(--c-accent); font-size: 14px; }
.po-settings-workspace { border-top: 1px solid var(--c-line); padding-top: 1.45rem; }
.po-settings-current { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .7rem; border-radius: 20px; background: var(--c-accent-soft); color: var(--c-accent-dark); font-size: 12px; font-weight: 600; white-space: nowrap; }
.po-settings-subnav { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.1rem; }
.po-settings-subnav-link { display: inline-flex; align-items: center; gap: .4rem; padding: .48rem .75rem; border-radius: 8px; border: 1px solid var(--c-line); background: #fff; color: var(--c-ink-soft); font-size: 13px; transition: background .15s, border-color .15s; }
.po-settings-subnav-link:hover { background: var(--c-line-soft); color: var(--c-ink); }
.po-settings-subnav-link.active { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent-dark); font-weight: 600; }
.po-settings-panel > .po-card, .po-settings-panel > form > .po-card { margin-bottom: 1.1rem; }
@media (max-width: 1399px) { .po-settings-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .po-settings-hero { min-height: 210px; padding: 1.5rem; }
  .po-settings-hero-copy { max-width: 70%; }
  .po-settings-hero-art { right: -2.5rem; bottom: -1rem; width: 53%; opacity: .75; }
  .po-settings-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .po-settings-hero { min-height: 190px; }
  .po-settings-hero-copy { max-width: 100%; }
  .po-settings-hero p { max-width: 75%; font-size: 12.5px; }
  .po-settings-hero-art { width: 47%; opacity: .42; }
  .po-settings-groups { grid-template-columns: 1fr; }
  .po-settings-group { min-height: 0; }
  .po-settings-current, .po-settings-section-count { display: none; }
}
@media (prefers-reduced-motion: reduce) { .po-settings-group, .po-settings-subnav-link { transition: none; } }

.po-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .4rem .9rem; font-size: 13.5px; }
.po-kv dt { color: var(--c-muted); font-weight: 400; }
.po-kv dd { margin: 0; color: var(--c-ink); }

.po-perm-group { border: 1px solid var(--c-line); border-radius: var(--radius-sm); margin-bottom: .7rem; }
.po-perm-group-head { background: var(--c-line-soft); padding: .5rem .8rem; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.po-perm-list { padding: .6rem .8rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .35rem .8rem; }

/* -------------------------------------------------------------------- TOAST */
.po-toast-wrap { position: fixed; top: calc(var(--topbar-h) + 12px); right: 18px; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; }
.po-toast {
  background: #fff; border: 1px solid var(--c-line); border-left: 3px solid var(--c-support);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .65rem .9rem;
  font-size: 13.5px; min-width: 260px; max-width: 380px; display: flex; align-items: flex-start; gap: .55rem;
  animation: poToastIn .18s ease-out;
}
.po-toast.error { border-left-color: var(--c-danger); }
.po-toast i { font-size: 15px; color: var(--c-support); }
.po-toast.error i { color: var(--c-danger); }
@keyframes poToastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------- LOGIN */
.po-auth-body { margin: 0; background: #f7f4fa; }
.po-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3.5rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 7% 12%, rgba(242, 107, 94, .16), transparent 28rem),
    radial-gradient(circle at 96% 92%, rgba(92, 58, 148, .16), transparent 30rem),
    #f8f6fa;
  position: relative;
}
.po-login::before,
.po-login::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}
.po-login::before { width: 240px; height: 240px; top: -110px; right: 9%; border: 1px solid rgba(92, 58, 148, .12); }
.po-login::after { width: 130px; height: 130px; bottom: -65px; left: 7%; background: rgba(244, 174, 78, .12); }
.po-login-shell {
  width: min(1120px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr);
  overflow: hidden;
  border: 1px solid rgba(74, 54, 97, .08);
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(44, 27, 69, .16);
  position: relative;
  z-index: 1;
}
.po-login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 680px;
  padding: 2.15rem 2.4rem 1.7rem;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 28%, rgba(180, 124, 255, .44), transparent 20rem),
    radial-gradient(circle at 15% 83%, rgba(255, 119, 107, .3), transparent 18rem),
    linear-gradient(145deg, #251938 0%, #56328a 60%, #7451ad 100%);
}
.po-login-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .2;
  background-image: radial-gradient(rgba(255, 255, 255, .7) .8px, transparent .8px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.po-login-brand,
.po-login-mobile-brand {
  display: flex;
  align-items: center;
  gap: .72rem;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  position: relative;
  z-index: 2;
}
.po-login-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff9a78, #f26b5e 55%, #d95786);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(44, 16, 49, .22);
}
.po-login-visual-copy { position: relative; z-index: 2; margin-top: 4.5rem; max-width: 490px; }
.po-login-eyebrow,
.po-login-kicker {
  display: block;
  margin-bottom: .8rem;
  color: #ffb7a8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}
.po-login-visual-copy h1 { margin: 0 0 1rem; font-size: clamp(36px, 4.2vw, 54px); font-weight: 700; line-height: 1.14; letter-spacing: -.045em; }
.po-login-visual-copy p { max-width: 440px; margin: 0; color: rgba(255, 255, 255, .72); font-size: 14px; line-height: 1.8; }
.po-login-hero {
  position: absolute;
  right: -16%;
  bottom: 32px;
  width: 82%;
  max-width: 570px;
  height: 330px;
  object-fit: cover;
  object-position: 65% center;
  border-radius: 110px 0 0 110px;
  filter: drop-shadow(0 24px 30px rgba(22, 8, 39, .22));
}
.po-login-benefits { position: relative; z-index: 3; display: flex; gap: 1.3rem; margin-top: auto; font-size: 11.5px; color: rgba(255, 255, 255, .78); }
.po-login-benefits span { display: flex; align-items: center; gap: .4rem; }
.po-login-benefits i { color: #ffb7a8; }
.po-login-panel { display: flex; flex-direction: column; justify-content: center; padding: 3.6rem clamp(2rem, 4vw, 4rem); background: rgba(255, 255, 255, .98); }
.po-login-mobile-brand { display: none; color: #2d2340; margin-bottom: 3rem; }
.po-login-heading { margin-bottom: 1.8rem; }
.po-login-heading .po-login-kicker { color: #e6685c; letter-spacing: .08em; margin-bottom: .5rem; }
.po-login-heading h2 { margin: 0; color: #251d32; font-size: 32px; font-weight: 700; letter-spacing: -.035em; }
.po-login-heading p { margin: .55rem 0 0; color: #857c90; font-size: 13.5px; }
.po-login-alert { display: flex; align-items: center; gap: .65rem; border: 0; border-radius: 14px; padding: .8rem 1rem; font-size: 13px; }
.po-login-form { display: grid; gap: 1.15rem; }
.po-login-field .form-label { margin-bottom: .45rem; color: #483e54; font-size: 12.5px; font-weight: 600; }
.po-login-field .input-group { border: 1px solid #e6e0eb; border-radius: 14px; background: #faf9fb; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.po-login-field .input-group:focus-within { border-color: rgba(112, 75, 166, .75); background: #fff; box-shadow: 0 0 0 4px rgba(112, 75, 166, .09); }
.po-login-field .input-group-text,
.po-login-field .form-control,
.po-login-field .po-password-toggle { min-height: 52px; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.po-login-field .input-group-text { padding-left: 1rem; color: #7d6c93; }
.po-login-field .form-control { padding-left: .35rem; color: #2f263a; font-size: 14px; }
.po-login-field .form-control::placeholder { color: #b2aab9; }
.po-login-field .po-password-toggle { color: #78668f; border-radius: 0 14px 14px 0 !important; padding-inline: 1rem; }
.po-login-options { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: -.1rem; color: #736b7c; font-size: 12.5px; }
.po-login-options .form-check { display: flex; align-items: center; gap: .4rem; margin: 0; }
.po-login-options .form-check-input { margin: 0; border-color: #d1c8d8; }
.po-login-options .form-check-input:checked { border-color: #6d4aa1; background-color: #6d4aa1; }
.po-login-help { color: #70509d; font-weight: 600; }
.po-login-submit {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin-top: .2rem;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(120deg, #f26b5e, #e95e73);
  box-shadow: 0 12px 25px rgba(233, 94, 115, .25);
  font-size: 14px;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease;
}
.po-login-submit:hover,
.po-login-submit:focus-visible { color: #fff; transform: translateY(-1px); box-shadow: 0 16px 30px rgba(233, 94, 115, .32); }
.po-login-demo { display: flex; align-items: center; gap: .75rem; margin-top: 1.5rem; padding: .85rem; border: 1px solid #eee8f4; border-radius: 14px; background: #faf8fc; }
.po-login-demo-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #7250a4; background: #eee8f8; }
.po-login-demo strong,
.po-login-demo span { display: block; }
.po-login-demo strong { margin-bottom: .15rem; color: #45384f; font-size: 11.5px; }
.po-login-demo div > span { color: #857b8e; font-size: 11px; }
.po-login-demo code { padding: .08rem .28rem; border-radius: 5px; color: #684593; background: #f0ebf6; font-size: 10.5px; }
.po-login-foot { text-align: center; font-size: 11.5px; color: #9b929f; margin-top: 1.5rem; }

@media (max-width: 900px) {
  .po-login { padding: 1rem; }
  .po-login-shell { width: min(520px, 100%); min-height: auto; grid-template-columns: 1fr; border-radius: 28px; }
  .po-login-visual { min-height: 230px; padding: 1.5rem; }
  .po-login-brand { display: none; }
  .po-login-visual-copy { margin-top: .25rem; max-width: 300px; }
  .po-login-visual-copy h1 { font-size: 31px; margin-bottom: .55rem; }
  .po-login-visual-copy p { display: none; }
  .po-login-hero { width: 60%; height: 190px; right: -13%; bottom: 0; border-radius: 70px 0 0 0; }
  .po-login-benefits { gap: .8rem; font-size: 10px; }
  .po-login-panel { padding: 2rem; }
  .po-login-mobile-brand { display: flex; margin-bottom: 1.7rem; }
  .po-login-heading h2 { font-size: 27px; }
}

@media (max-width: 520px) {
  .po-login { display: block; min-height: 100dvh; padding: 0; background: #fff; }
  .po-login-shell { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .po-login-visual { min-height: 180px; border-radius: 0 0 28px 28px; }
  .po-login-visual-copy { margin-top: 0; }
  .po-login-visual-copy h1 { font-size: 27px; }
  .po-login-eyebrow { font-size: 9px; margin-bottom: .45rem; }
  .po-login-hero { width: 58%; height: 155px; }
  .po-login-benefits { display: none; }
  .po-login-panel { justify-content: flex-start; padding: 1.7rem 1.35rem 2rem; }
  .po-login-mobile-brand { margin-bottom: 1.5rem; }
  .po-login-heading { margin-bottom: 1.35rem; }
}

/* ------------------------------------------------------------------ HELPERS */
.po-text-muted { color: var(--c-muted); }
.po-text-sm { font-size: 12.5px; }
.po-mono { font-family: 'Menlo', 'Consolas', monospace; font-size: 12.5px; }
.po-divider { height: 1px; background: var(--c-line-soft); margin: .9rem 0; }
.po-row-action { display: flex; gap: .3rem; justify-content: flex-end; }
.po-color-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -1px; }

/* ------------------------------------------------------------------ MOBILE */
.po-sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .po-sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.po-sidebar-open .po-sidebar { transform: none; }
  body.po-sidebar-open .po-sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1025; }
  .po-topbar { left: 0; }
  .po-content { margin-left: 0; }
  .po-content-inner { padding: 1rem .9rem 2.5rem; }
  .po-topbar-search { display: none; }
  .po-user-name, .po-user-role { display: none; }
  .po-dashboard-hero { min-height: 260px; padding: 1.7rem; }
  .po-dashboard-hero-copy { width: 61%; }
  .po-dashboard-hero-art { width: 82%; right: -17%; }
  .po-people-hero-copy { width: 76%; }
  .po-people-hero-art { width: 72%; right: -17%; opacity: .75; }
}

@media (max-width: 640px) {
  .po-page-head { padding: .9rem; }
  .po-page-actions { width: 100%; }
  .po-dashboard-hero, .po-people-hero { min-height: 310px; padding: 1.4rem; align-items: flex-start; }
  .po-dashboard-hero-copy, .po-people-hero-copy { width: 100%; }
  .po-dashboard-hero h1, .po-people-hero h1 { font-size: 26px; }
  .po-dashboard-hero p, .po-people-hero p { max-width: 75%; }
  .po-dashboard-hero-art { width: 118%; right: -35%; bottom: -9%; opacity: .5; }
  .po-people-hero-art { width: 112%; right: -38%; bottom: -4.8rem; opacity: .38; }
  .po-people-hero .po-page-actions { gap: .4rem; }
  .po-people-hero .po-page-actions .btn { font-size: 12px; padding: .42rem .65rem; }
}

/* ============================================================================
   EMPLOYEE — ประวัติพนักงาน
   ============================================================================ */
.po-emp-head { display: flex; gap: 1.1rem; align-items: flex-start; flex-wrap: wrap; }
.po-emp-photo {
  width: 92px; height: 92px; border-radius: 12px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--c-line); background: var(--c-line-soft);
}
.po-emp-photo-empty {
  width: 92px; height: 92px; border-radius: 12px; flex: 0 0 auto;
  background: var(--c-accent-soft); color: var(--c-accent-dark);
  display: grid; place-items: center; font-size: 30px; font-weight: 600;
}
.po-emp-name { font-size: 20px; font-weight: 600; margin: 0 0 .1rem; }
.po-emp-meta { font-size: 13.5px; color: var(--c-muted); }
.po-emp-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }

.po-emp-tabs { display: flex; gap: .2rem; overflow-x: auto; border-bottom: 1px solid var(--c-line); margin-bottom: 1.1rem; }
.po-emp-tab {
  display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .75rem; white-space: nowrap;
  font-size: 13.5px; color: var(--c-muted); border-bottom: 2px solid transparent; cursor: pointer;
}
.po-emp-tab:hover { color: var(--c-ink); }
.po-emp-tab.active { color: var(--c-accent-dark); border-bottom-color: var(--c-accent); font-weight: 600; }
.po-emp-pane { display: none; }
.po-emp-pane.active { display: block; }

/* timeline */
.po-timeline { position: relative; padding-left: 26px; }
.po-timeline::before {
  content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--c-line);
}
.po-tl-item { position: relative; padding-bottom: 1.1rem; }
.po-tl-dot {
  position: absolute; left: -26px; top: 2px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; background: var(--c-line-soft); color: var(--c-muted);
  border: 2px solid var(--c-card);
}
.po-tl-dot.solid { background: var(--c-accent); color: #fff; }
.po-tl-dot.soft { background: var(--c-support-soft); color: var(--c-support); }
.po-tl-dot.warn { background: var(--c-warn-soft); color: var(--c-warn); }
.po-tl-dot.danger { background: var(--c-danger-soft); color: var(--c-danger); }
.po-tl-date { font-size: 12px; color: var(--c-muted); }
.po-tl-title { font-size: 13.8px; font-weight: 600; }
.po-tl-detail { font-size: 13px; color: var(--c-ink-soft); }

/* ตารางรายการย่อยในประวัติ */
.po-sub-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.po-sub-title { font-size: 14.5px; font-weight: 600; margin: 0; }
.po-sub-actions { margin-left: auto; }

/* directory */
.po-dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.po-dir-card {
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: .85rem; display: flex; gap: .7rem; align-items: flex-start; box-shadow: var(--shadow-sm);
}
.po-dir-avatar {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: 0 0 auto;
  background: var(--c-accent-soft); color: var(--c-accent-dark);
  display: grid; place-items: center; font-weight: 600; font-size: 15px;
}

/* import preview */
.po-import-row.has-error { background: var(--c-danger-soft); }
.po-import-row.has-warning { background: var(--c-warn-soft); }
.po-import-msg { font-size: 12px; line-height: 1.6; }
.po-import-msg .err { color: var(--c-danger); }
.po-import-msg .warn { color: var(--c-warn); }

.po-dropzone {
  border: 2px dashed var(--c-line); border-radius: var(--radius); padding: 2rem 1rem;
  text-align: center; background: #FCFCFD;
}
.po-dropzone i { font-size: 34px; color: var(--c-line); display: block; margin-bottom: .6rem; }

/* ============================================================================
   ORG CHART + WORKFLOW
   ============================================================================ */
.po-org-tree { overflow-x: auto; padding: .5rem 0 1rem; }
.po-org-node {
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-card);
  padding: .55rem .75rem; min-width: 210px; box-shadow: var(--shadow-sm);
}
.po-org-node.is-gap { border-color: var(--c-warn); }
.po-org-name { font-size: 13.8px; font-weight: 600; }
.po-org-code { font-size: 11.5px; color: var(--c-muted); font-family: 'Menlo', 'Consolas', monospace; }
.po-org-manager { font-size: 12px; color: var(--c-ink-soft); margin-top: .2rem; }
.po-org-counts { display: flex; gap: .35rem; margin-top: .4rem; flex-wrap: wrap; }

.po-org-children { list-style: none; margin: 0; padding-left: 28px; position: relative; }
.po-org-children > li { position: relative; padding: .4rem 0 .4rem 20px; }
.po-org-children > li::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--c-line);
}
.po-org-children > li:last-child::before { bottom: auto; height: 22px; }
.po-org-children > li::after {
  content: ''; position: absolute; left: 0; top: 22px; width: 18px; border-top: 1px solid var(--c-line);
}
.po-org-root { list-style: none; margin: 0; padding: 0; }
.po-org-root > li { margin-bottom: .6rem; }

.po-org-toggle {
  border: 0; background: transparent; color: var(--c-muted); font-size: 12px;
  padding: 0 .25rem; cursor: pointer;
}
.po-org-collapsed > .po-org-children { display: none; }

/* แถวตารางแบบมีระดับชั้น */
.po-depth-0 { font-weight: 600; }
.po-indent { display: inline-block; }

/* ขั้นตอนอนุมัติ */
.po-steps { display: flex; flex-direction: column; gap: 0; }
.po-step { display: flex; gap: .7rem; padding: .6rem 0; position: relative; }
.po-step:not(:last-child)::before {
  content: ''; position: absolute; left: 11px; top: 32px; bottom: -6px; width: 2px; background: var(--c-line);
}
.po-step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 11px; background: var(--c-line-soft); color: var(--c-muted); z-index: 1;
}
.po-step-dot.approved { background: var(--c-support-soft); color: var(--c-support); }
.po-step-dot.pending { background: var(--c-warn-soft); color: var(--c-warn); }
.po-step-dot.rejected { background: var(--c-danger-soft); color: var(--c-danger); }
.po-step-title { font-size: 13.8px; font-weight: 600; }
.po-step-meta { font-size: 12.5px; color: var(--c-muted); }
.po-step-remark {
  font-size: 12.5px; color: var(--c-ink-soft); background: var(--c-line-soft);
  border-radius: var(--radius-sm); padding: .35rem .6rem; margin-top: .3rem;
}

/* แถวในกล่องอนุมัติ */
.po-inbox-row {
  display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--c-line-soft);
}
.po-inbox-row:hover { background: #FAFBFC; }
.po-inbox-main { flex: 1; min-width: 0; }
.po-inbox-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ตัวออกแบบขั้นอนุมัติ */
.po-step-editor { border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: .7rem; margin-bottom: .6rem; }
.po-step-editor-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.po-step-badge {
  width: 24px; height: 24px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent-dark);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: 0 0 auto;
}

/* ============================================================================
   ROSTER — ตารางกะรายเดือน (พนักงาน x 31 วัน)
   ============================================================================ */
.po-roster-wrap {
  overflow: auto; max-height: calc(100vh - 300px); border: 1px solid var(--c-line);
  border-radius: var(--radius); background: var(--c-card);
}
.po-roster { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; }

.po-roster th, .po-roster td {
  border-right: 1px solid var(--c-line-soft); border-bottom: 1px solid var(--c-line-soft);
  padding: 0; text-align: center; white-space: nowrap;
}

/* หัวแถวบน */
.po-roster thead th {
  position: sticky; top: 0; z-index: 3; background: var(--c-line-soft);
  color: var(--c-ink-soft); font-weight: 600; padding: .3rem .25rem; font-size: 11.5px;
}
.po-roster thead th.is-weekend { background: #E9ECF2; }
.po-roster thead th.is-holiday { background: var(--c-danger-soft); color: var(--c-danger); }

/* สองคอลัมน์ซ้ายตรึงไว้ */
.po-roster .col-emp {
  position: sticky; left: 0; z-index: 2; background: var(--c-card);
  text-align: left; padding: .35rem .6rem; min-width: 190px; max-width: 190px;
  border-right: 1px solid var(--c-line);
}
.po-roster thead .col-emp { z-index: 5; background: var(--c-line-soft); }
.po-roster .col-sum {
  position: sticky; left: 190px; z-index: 2; background: var(--c-card);
  min-width: 86px; border-right: 1px solid var(--c-line); font-size: 11.5px; color: var(--c-muted);
}
.po-roster thead .col-sum { z-index: 5; background: var(--c-line-soft); }

.po-roster tbody tr:hover .col-emp,
.po-roster tbody tr:hover .col-sum { background: #FAFBFC; }

.po-emp-cell-name { font-weight: 600; font-size: 12.5px; color: var(--c-ink); }
.po-emp-cell-sub { font-size: 11px; color: var(--c-muted); }

/* ช่องกะ */
.po-cell {
  width: 38px; height: 34px; cursor: pointer; position: relative; user-select: none;
}
.po-cell.is-weekend { background: #F7F8FA; }
.po-cell.is-holiday { background: #FDF3F2; }
.po-cell.is-selected { outline: 2px solid var(--c-accent); outline-offset: -2px; z-index: 1; }
.po-cell:hover { background: var(--c-accent-soft); }

.po-chip {
  display: block; margin: 3px; border-radius: 4px; color: #fff; font-size: 11px;
  font-weight: 600; line-height: 26px; height: 26px; overflow: hidden;
}
.po-chip.off { background: var(--c-line); color: var(--c-muted); }
.po-cell.is-empty .po-chip { display: none; }

/* แถบเครื่องมือเลือกกะ */
.po-shift-picker { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.po-shift-btn {
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: #fff;
  padding: .25rem .55rem; font-size: 12.5px; display: inline-flex; align-items: center; gap: .35rem;
  cursor: pointer;
}
.po-shift-btn:hover { background: var(--c-line-soft); }
.po-shift-btn.active { border-color: var(--c-accent); background: var(--c-accent-soft); color: var(--c-accent-dark); font-weight: 600; }
.po-shift-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* แถบสรุปคนต่อกะต่อวัน */
.po-coverage td { font-size: 11px; color: var(--c-muted); height: 24px; }
.po-coverage .col-emp { font-weight: 600; color: var(--c-ink-soft); font-size: 11.5px; }

.po-roster-legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: 12.5px; color: var(--c-muted); }
.po-roster-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.po-roster-filter-toggle { display: none; align-items: center; gap: .4rem; }
.po-roster-mobile { display: none; }

@media (max-width: 767px) {
  .po-roster-filter-card .po-card-head { border-bottom: 0; }
  .po-roster-filter-toggle { display: inline-flex; }
  .po-roster-filter-chevron { transition: transform .18s ease; }
  .po-roster-filter-card.is-open .po-roster-filter-chevron { transform: rotate(180deg); }
  .po-roster-filter-body { display: none; border-top: 1px solid var(--c-line-soft); }
  .po-roster-filter-card.is-open .po-roster-filter-body { display: block; }
  .po-roster-shift-card { position: sticky; top: calc(var(--topbar-h) + .4rem); z-index: 12; box-shadow: 0 12px 32px rgba(45,36,64,.12); }
  .po-roster-shift-card .po-card-body { padding: .75rem; }
  .po-roster-shift-card .d-flex.mb-2 { display: none !important; }
  .po-shift-picker { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .1rem; scrollbar-width: none; }
  .po-shift-picker::-webkit-scrollbar { display: none; }
  .po-shift-btn { min-height: 39px; flex: 0 0 auto; border-radius: 11px; }
  .po-roster-desktop { display: none; }
  .po-roster-mobile { display: block; }
  .po-roster-mobile-head { display: flex; align-items: center; justify-content: space-between; margin: 1.15rem 0 .75rem; }
  .po-roster-mobile-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
  .po-roster-mobile-head > span { padding: .3rem .55rem; border-radius: 9px; color: var(--c-muted); background: var(--c-line-soft); font-size: 11px; }
  .po-roster-mobile-kicker { display: block; margin-bottom: .15rem; color: var(--c-accent); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
  .po-roster-week-tabs { display: flex; gap: .45rem; margin: 0 -.9rem .8rem; padding: 0 .9rem .25rem; overflow-x: auto; scrollbar-width: none; }
  .po-roster-week-tabs::-webkit-scrollbar { display: none; }
  .po-roster-week-tabs button { min-width: 104px; display: flex; flex-direction: column; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--c-line); border-radius: 12px; color: var(--c-muted); background: #fff; }
  .po-roster-week-tabs button span { font-size: 11px; font-weight: 600; }
  .po-roster-week-tabs button small { font-size: 9.5px; }
  .po-roster-week-tabs button.active { border-color: var(--c-accent); color: var(--c-accent-dark); background: var(--c-accent-soft); box-shadow: 0 5px 14px rgba(242,107,94,.12); }
  .po-roster-mobile-week { display: none; }
  .po-roster-mobile-week.is-active { display: grid; gap: .7rem; }
  .po-roster-employee-card { overflow: hidden; border: 1px solid var(--c-line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
  .po-roster-employee-card > header { display: flex; align-items: center; gap: .65rem; padding: .75rem; border-bottom: 1px solid var(--c-line-soft); }
  .po-roster-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--c-accent-dark); background: linear-gradient(145deg, var(--c-accent-soft), #F1EAF9); font-size: 11px; font-weight: 700; }
  .po-roster-employee-card header > div { min-width: 0; flex: 1; }
  .po-roster-employee-card header strong, .po-roster-employee-card header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .po-roster-employee-card header strong { color: var(--c-ink); font-size: 12.5px; }
  .po-roster-employee-card header small { color: var(--c-muted); font-size: 9.5px; }
  .po-roster-total { text-align: right; color: var(--c-ink-soft); font-size: 10.5px; }
  .po-roster-total small { color: var(--c-muted); font-size: 9px; }
  .po-roster-mobile-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .po-roster-mobile-cell { width: 100%; height: auto; min-width: 0; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; border: 0; border-right: 1px solid var(--c-line-soft); border-radius: 0; background: #fff; }
  .po-roster-mobile-cell:last-child { border-right: 0; }
  .po-roster-mobile-cell.is-weekend { background: #F7F8FA; }
  .po-roster-mobile-cell.is-holiday { background: #FFF4F2; }
  .po-roster-mobile-cell:disabled { cursor: default; opacity: 1; }
  .po-roster-mobile-date { display: flex; flex-direction: column; align-items: center; color: var(--c-muted); font-size: 8.5px; line-height: 1.2; }
  .po-roster-mobile-date b { color: var(--c-ink-soft); font-size: 11px; }
  .po-roster-mobile-cell .po-chip { width: calc(100% - 8px); margin: 0 4px; line-height: 23px; height: 23px; font-size: 9.5px; }
  .po-roster-mobile-cell.is-empty .po-chip { display: none; }
  .po-roster-mobile-cell > i { color: #C9C1CF; font-size: 12px; }
  .po-roster-mobile-note { display: flex; align-items: flex-start; gap: .5rem; margin-top: .8rem; padding: .7rem .8rem; border-radius: 12px; color: var(--c-muted); background: var(--c-line-soft); font-size: 10.5px; line-height: 1.5; }
  .po-roster-mobile-note i { color: var(--c-accent); font-size: 14px; }
}

/* ============================================================================
   ATTENDANCE — บันทึกเวลา
   ============================================================================ */
/* ตารางรายเดือนใช้โครงเดียวกับตารางกะ แต่ช่องกว้างกว่าเพราะต้องแสดงเวลา */
.po-att-wrap {
  overflow: auto; max-height: calc(100vh - 300px); border: 1px solid var(--c-line);
  border-radius: var(--radius); background: var(--c-card);
}
.po-att { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; }
.po-att th, .po-att td {
  border-right: 1px solid var(--c-line-soft); border-bottom: 1px solid var(--c-line-soft);
  padding: 0; text-align: center; white-space: nowrap;
}
.po-att thead th {
  position: sticky; top: 0; z-index: 3; background: var(--c-line-soft);
  color: var(--c-ink-soft); font-weight: 600; padding: .3rem .25rem; font-size: 11.5px;
}
.po-att thead th.is-weekend { background: #E9ECF2; }
.po-att thead th.is-holiday { background: var(--c-danger-soft); color: var(--c-danger); }
.po-att .col-emp {
  position: sticky; left: 0; z-index: 2; background: var(--c-card); text-align: left;
  padding: .35rem .6rem; min-width: 190px; max-width: 190px; border-right: 1px solid var(--c-line);
}
.po-att thead .col-emp { z-index: 5; background: var(--c-line-soft); }
.po-att .col-sum {
  position: sticky; left: 190px; z-index: 2; background: var(--c-card); min-width: 96px;
  border-right: 1px solid var(--c-line); font-size: 11px; color: var(--c-muted); padding: .2rem .35rem;
}
.po-att thead .col-sum { z-index: 5; background: var(--c-line-soft); }

.po-att-cell { width: 52px; height: 38px; cursor: pointer; position: relative; }
.po-att-cell:hover { background: var(--c-accent-soft); }
.po-att-cell.is-weekend { background: #F7F8FA; }
.po-att-cell.is-holiday { background: #FDF3F2; }
.po-att-cell.is-locked { cursor: not-allowed; }

.po-att-time { font-size: 10.5px; line-height: 1.25; color: var(--c-ink); }
.po-att-flag {
  display: inline-block; font-size: 10px; border-radius: 3px; padding: 0 3px; line-height: 15px;
}
.po-att-flag.normal { background: var(--c-support-soft); color: var(--c-support); }
.po-att-flag.late { background: var(--c-warn-soft); color: var(--c-warn); }
.po-att-flag.absent { background: var(--c-danger-soft); color: var(--c-danger); }
.po-att-flag.leave { background: #EDEBF7; color: #5B4B8A; }
.po-att-flag.dayoff, .po-att-flag.holiday { background: var(--c-line-soft); color: var(--c-muted); }
.po-att-flag.incomplete { background: var(--c-warn-soft); color: var(--c-warn); }

/* ------------------------------------------------------- หน้าลงเวลา */
.po-checkin-hero {
  position: relative; display: flex; align-items: center; min-height: 252px;
  max-width: 960px; margin: 0 auto 1.25rem; padding: 2rem 2.35rem;
  overflow: hidden; border-radius: 24px;
  background:
    radial-gradient(circle at 78% 20%, rgba(131,95,219,.5), transparent 30%),
    radial-gradient(circle at 5% 110%, rgba(242,107,94,.38), transparent 34%),
    linear-gradient(125deg, #2D2440 0%, #432D5A 65%, #2E615F 140%);
  box-shadow: 0 18px 44px rgba(45,36,64,.16);
}
.po-checkin-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255,255,255,.85) .8px, transparent .8px);
  background-size: 22px 22px; mask-image: linear-gradient(90deg, #000, transparent 74%);
}
.po-checkin-hero-copy { position: relative; z-index: 2; max-width: 48%; }
.po-checkin-hero h1 { color: #fff; font-size: clamp(27px, 3vw, 38px); font-weight: 800; line-height: 1.22; margin: .7rem 0 .45rem; }
.po-checkin-hero p { color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.65; margin: 0; }
.po-checkin-hero-art { position: absolute; right: -1.5%; bottom: -15%; width: min(53%, 500px); height: auto; filter: drop-shadow(0 16px 24px rgba(19,11,31,.22)); }

.po-checkin { max-width: 520px; margin: 0 auto; }
.po-checkin-clock {
  text-align: center; padding: 1.4rem 1rem 1rem;
}
.po-checkin-time { font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -1px; }
.po-checkin-date { font-size: 13.5px; color: var(--c-muted); margin-top: .35rem; }

.po-checkin-shift {
  background: var(--c-line-soft); border-radius: var(--radius); padding: .7rem .9rem;
  display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem;
}
.po-checkin-shift-swatch { width: 6px; height: 34px; border-radius: 3px; flex: 0 0 auto; }

.po-checkin-btn {
  width: 100%; border: 0; border-radius: 14px; padding: 1rem; font-size: 17px; font-weight: 600;
  color: #fff; background: var(--c-accent); box-shadow: 0 6px 18px rgba(212, 97, 63, .28);
}
.po-checkin-btn:disabled { background: var(--c-muted); box-shadow: none; }
.po-checkin-btn.out { background: var(--c-support); box-shadow: 0 6px 18px rgba(23, 140, 136, .25); }
.po-checkin-btn.break { background: var(--c-warn); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
/* ปุ่มรอง เมื่อมีสองทางให้เลือก เช่น เริ่มพัก / เลิกงาน */
.po-checkin-btn.secondary { background: #fff; color: var(--c-ink); border: 1px solid var(--c-line); box-shadow: none; font-size: 15px; padding: .8rem; }

.po-method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .5rem; }
.po-method {
  border: 1px solid var(--c-line); border-radius: var(--radius); background: #fff;
  padding: .7rem .4rem; text-align: center; font-size: 12.5px; cursor: pointer;
}
.po-method i { display: block; font-size: 20px; margin-bottom: .25rem; color: var(--c-ink-soft); }
.po-method.active { border-color: var(--c-accent); background: var(--c-accent-soft); color: var(--c-accent-dark); }
.po-method.active i { color: var(--c-accent-dark); }
.po-method:disabled, .po-method.disabled { opacity: .45; cursor: not-allowed; }

.po-checkin-log {
  display: flex; align-items: center; gap: .6rem; padding: .5rem 0;
  border-bottom: 1px solid var(--c-line-soft); font-size: 13px;
}

@media (max-width: 767px) {
  .po-checkin-hero { min-height: 220px; padding: 1.5rem; }
  .po-checkin-hero-copy { max-width: 56%; }
  .po-checkin-hero-art { width: 62%; right: -7%; bottom: -17%; }
}

@media (max-width: 520px) {
  .po-checkin-hero { min-height: 205px; padding: 1.3rem; border-radius: 20px; }
  .po-checkin-hero-copy { max-width: 64%; }
  .po-checkin-hero h1 { font-size: 25px; }
  .po-checkin-hero p { font-size: 11.5px; }
  .po-checkin-hero-art { width: 64%; right: -6%; bottom: -12%; opacity: .78; }
}

/* กล้อง */
.po-camera-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #000;
  aspect-ratio: 4 / 3;
}
.po-camera-wrap video, .po-camera-wrap canvas { width: 100%; height: 100%; object-fit: cover; }
.po-camera-hint {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; text-align: center;
}

/* จอ QR ประจำจุด */
.po-qr-screen {
  min-height: 100vh; display: grid; place-items: center; background: var(--c-sidebar); padding: 1.5rem;
}
.po-qr-card { background: #fff; border-radius: 18px; padding: 2rem; text-align: center; max-width: 460px; width: 100%; }
.po-qr-box { display: grid; place-items: center; padding: 1rem 0; }
.po-qr-timer { font-size: 13.5px; color: var(--c-muted); }

/* ============================================================================
   LEAVE & OT — การลาและล่วงเวลา
   ============================================================================ */
/* การ์ดยอดคงเหลือบนหน้าใบลา */
.po-balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.po-balance {
  border: 1px solid var(--c-line); border-radius: var(--radius); padding: .7rem .85rem; background: var(--c-card);
}
.po-balance-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; }
.po-balance-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.po-balance-name { font-size: 13px; font-weight: 600; }
.po-balance-num { font-size: 22px; font-weight: 600; line-height: 1.1; }
.po-balance-unit { font-size: 12px; color: var(--c-muted); margin-left: .2rem; font-weight: 400; }
.po-balance-sub { font-size: 11.5px; color: var(--c-muted); }
.po-balance-bar { height: 4px; border-radius: 2px; background: var(--c-line-soft); margin-top: .45rem; overflow: hidden; }
.po-balance-bar span { display: block; height: 100%; background: var(--c-accent); }

/* ปฏิทินการลาของทีม ใช้โครงตารางเดียวกับตารางกะ */
.po-cal-cell { width: 34px; height: 30px; }
.po-cal-mark {
  display: block; margin: 4px 3px; height: 22px; border-radius: 4px; color: #fff;
  font-size: 10px; line-height: 22px; text-align: center; font-weight: 600;
}
.po-cal-mark.half { background-image: linear-gradient(135deg, currentColor 50%, transparent 50%); }
.po-cal-mark.pending { opacity: .5; }
.po-cal-count { font-size: 11px; color: var(--c-muted); }
.po-cal-count.warn { color: var(--c-danger); font-weight: 600; }

/* ตารางสิทธิ์การลา */
.po-ent-cell { min-width: 96px; padding: .3rem .4rem !important; cursor: pointer; }
.po-ent-cell:hover { background: var(--c-accent-soft); }
.po-ent-main { font-size: 13.5px; font-weight: 600; }
.po-ent-sub { font-size: 11px; color: var(--c-muted); }
.po-ent-low { color: var(--c-danger); }

/* ผลการนับวันในฟอร์มใบลา */
.po-calc-box {
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: #FBFCFD; padding: .7rem .85rem; font-size: 13px;
}
.po-calc-days { font-size: 20px; font-weight: 600; }
.po-calc-skip { font-size: 12px; color: var(--c-muted); margin-top: .3rem; line-height: 1.7; }

/* ============================================================================
   PAYROLL — เงินเดือน
   ============================================================================ */
.po-pay-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }

/* สลิปเงินเดือน */
.po-slip {
  max-width: 760px; margin: 0 auto; background: var(--c-card);
  border: 1px solid var(--c-line); border-radius: var(--radius);
}
.po-slip-head { padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--c-line); }
.po-slip-org { font-size: 16px; font-weight: 600; }
.po-slip-title { font-size: 13.5px; color: var(--c-muted); }
.po-slip-body { padding: 1.2rem 1.4rem; }

.po-slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 640px) { .po-slip-cols { grid-template-columns: 1fr; } }

.po-slip-section-title {
  font-size: 13px; font-weight: 600; color: var(--c-ink-soft);
  border-bottom: 1px solid var(--c-line); padding-bottom: .35rem; margin-bottom: .5rem;
}
.po-slip-line {
  display: flex; justify-content: space-between; gap: .6rem; font-size: 13px; padding: .22rem 0;
}
.po-slip-line-name { min-width: 0; }
.po-slip-line-detail { font-size: 11.5px; color: var(--c-muted); }
.po-slip-line-amount { font-family: 'Menlo', 'Consolas', monospace; white-space: nowrap; }
.po-slip-total {
  display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600;
  border-top: 1px solid var(--c-line); margin-top: .4rem; padding-top: .4rem;
}
.po-slip-net {
  background: var(--c-accent-soft); border-radius: var(--radius-sm); padding: .8rem 1rem;
  display: flex; justify-content: space-between; align-items: center; margin-top: 1rem;
}
.po-slip-net-label { font-size: 13.5px; font-weight: 600; color: var(--c-accent-dark); }
.po-slip-net-value { font-size: 24px; font-weight: 600; color: var(--c-accent-dark); }
.po-slip-baht { font-size: 12.5px; color: var(--c-muted); text-align: right; margin-top: .3rem; }

.po-slip-foot {
  padding: .9rem 1.4rem; border-top: 1px solid var(--c-line);
  font-size: 12px; color: var(--c-muted);
}

/* ตารางสรุปงวด */
.po-pay-num { font-family: 'Menlo', 'Consolas', monospace; text-align: right; white-space: nowrap; }
.po-pay-net { font-weight: 600; }
.po-pay-row-locked { background: #FAFBFC; }

/* กล่องอธิบายวิธีคิดภาษี */
.po-tax-calc { font-size: 12.5px; }
.po-tax-calc dt { color: var(--c-muted); font-weight: 400; }
.po-tax-calc dd { font-family: 'Menlo', 'Consolas', monospace; text-align: right; margin: 0; }

/* ============================================================================
   REPORTS — รายงานและแบบภาษี
   ============================================================================ */
/* กราฟแท่งแนวนอนแบบไม่ต้องใช้ไลบรารี */
.po-bar-row { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; font-size: 13px; }
.po-bar-label { width: 150px; flex: 0 0 auto; color: var(--c-ink-soft); }
.po-bar-track { flex: 1; height: 18px; background: var(--c-line-soft); border-radius: 4px; overflow: hidden; }
.po-bar-fill { height: 100%; background: var(--c-accent); border-radius: 4px; }
.po-bar-value { width: 90px; flex: 0 0 auto; text-align: right; font-family: 'Menlo', 'Consolas', monospace; }

/* กราฟแท่งแนวตั้ง 12 เดือน */
.po-col-chart {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px;
  align-items: end; height: 160px; padding-top: .5rem;
}
.po-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.po-col-bar { background: var(--c-accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.po-col-bar.support { background: var(--c-support); }
.po-col-bar.mute { background: var(--c-line); }
.po-col-label { font-size: 10.5px; color: var(--c-muted); text-align: center; margin-top: .3rem; }
.po-col-value { font-size: 10.5px; text-align: center; margin-bottom: .2rem; color: var(--c-ink-soft); }

/* การ์ดลิงก์รายงาน */
.po-report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.po-report-card {
  border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1rem;
  background: var(--c-card); text-decoration: none; color: inherit; display: block;
}
.po-report-card:hover { border-color: var(--c-accent); background: var(--c-accent-soft); }
.po-report-card i { font-size: 22px; color: var(--c-accent); display: block; margin-bottom: .5rem; }
.po-report-card-title { font-size: 14px; font-weight: 600; margin-bottom: .2rem; }
.po-report-card-text { font-size: 12.5px; color: var(--c-muted); line-height: 1.5; }

/* เอกสาร 50 ทวิ */
.po-doc {
  max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 2rem 2.2rem; font-size: 13.5px;
}
.po-doc-head { text-align: center; margin-bottom: 1.4rem; }
.po-doc-title { font-size: 17px; font-weight: 600; }
.po-doc-sub { font-size: 13px; color: var(--c-muted); margin-top: .2rem; }
.po-doc-box {
  border: 1px solid var(--c-ink-soft); border-radius: var(--radius-sm);
  padding: .8rem 1rem; margin-bottom: 1rem;
}
.po-doc-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.po-doc-table th, .po-doc-table td {
  border: 1px solid var(--c-ink-soft); padding: .45rem .6rem; font-size: 13px;
}
.po-doc-table th { background: var(--c-line-soft); font-weight: 600; }
.po-doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.2rem; }
.po-doc-sign-line { border-top: 1px dotted var(--c-ink-soft); margin-top: 2.6rem; padding-top: .35rem; text-align: center; }

/* แถบสถานะการยื่นแบบ 12 เดือน */
.po-filing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .5rem; }
.po-filing {
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: .5rem .6rem; font-size: 12px;
}
.po-filing.filed { border-color: var(--c-support); background: var(--c-support-soft); }
.po-filing.overdue { border-color: var(--c-danger); background: var(--c-danger-soft); }
.po-filing.empty { opacity: .5; }
.po-filing-month { font-weight: 600; margin-bottom: .15rem; }

/* ============================================================================
   ESS & LINE — พื้นที่พนักงานและการแจ้งเตือน
   ============================================================================ */
.po-ess { max-width: 560px; margin: 0 auto; }

.po-ess-hero {
  background: var(--c-sidebar); color: #fff; border-radius: var(--radius);
  padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem;
}
.po-ess-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 18px; font-weight: 600;
}
.po-ess-name { font-size: 16px; font-weight: 600; }
.po-ess-meta { font-size: 12.5px; opacity: .75; }

/* ปุ่มลัด 2x3 */
.po-ess-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.po-ess-action {
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: .85rem .4rem; text-align: center; text-decoration: none; color: inherit; position: relative;
}
.po-ess-action:hover { border-color: var(--c-accent); background: var(--c-accent-soft); }
.po-ess-action i { display: block; font-size: 21px; color: var(--c-accent); margin-bottom: .3rem; }
.po-ess-action span { font-size: 12.5px; }
.po-ess-badge {
  position: absolute; top: 6px; right: 8px; background: var(--c-danger); color: #fff;
  border-radius: 9px; font-size: 10.5px; line-height: 16px; min-width: 16px; padding: 0 4px; text-align: center;
}

/* แถวกะรายวัน */
.po-ess-day {
  display: flex; align-items: center; gap: .7rem; padding: .5rem 0;
  border-bottom: 1px solid var(--c-line-soft); font-size: 13px;
}
.po-ess-day:last-child { border-bottom: 0; }
.po-ess-day.today { background: var(--c-accent-soft); margin: 0 -.85rem; padding-left: .85rem; padding-right: .85rem; }
.po-ess-day-date { width: 88px; flex: 0 0 auto; color: var(--c-ink-soft); }
.po-ess-day-swatch { width: 5px; height: 26px; border-radius: 3px; flex: 0 0 auto; }

/* กระดิ่งแจ้งเตือน */
.po-bell { position: relative; }
.po-bell-count {
  position: absolute; top: -4px; right: -4px; background: var(--c-danger); color: #fff;
  border-radius: 9px; font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 3px; text-align: center;
}

.po-notify-item {
  display: flex; gap: .8rem; padding: .8rem .2rem; border-bottom: 1px solid var(--c-line-soft);
  text-decoration: none; color: inherit;
}
.po-notify-item:hover { background: var(--c-line-soft); }
.po-notify-item.unread { background: var(--c-accent-soft); }
.po-notify-icon {
  width: 34px; height: 34px; border-radius: 50%; background: var(--c-line-soft);
  display: grid; place-items: center; flex: 0 0 auto; color: var(--c-ink-soft);
}
.po-notify-item.unread .po-notify-icon { background: #fff; color: var(--c-accent); }
.po-notify-title { font-size: 13.5px; font-weight: 600; }
.po-notify-body { font-size: 12.5px; color: var(--c-muted); line-height: 1.5; }
.po-notify-time { font-size: 11.5px; color: var(--c-muted); margin-top: .2rem; }

/* ประกาศ */
.po-ann {
  display: block; padding: .85rem 0; border-bottom: 1px solid var(--c-line-soft);
  text-decoration: none; color: inherit;
}
.po-ann:last-child { border-bottom: 0; }
.po-ann-title { font-size: 14px; font-weight: 600; margin-bottom: .2rem; }
.po-ann-excerpt { font-size: 12.5px; color: var(--c-muted); line-height: 1.6; }
.po-ann-meta { font-size: 11.5px; color: var(--c-muted); margin-top: .3rem; }
.po-ann-body { font-size: 14px; line-height: 1.9; white-space: pre-line; }
.po-ann-unread-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-accent); margin-right: .35rem; vertical-align: middle;
}

/* หน้าผูกบัญชี LINE */
.po-line-bind { max-width: 420px; margin: 3rem auto; text-align: center; }
.po-line-logo {
  width: 64px; height: 64px; border-radius: 16px; background: #06C755; color: #fff;
  display: grid; place-items: center; font-size: 30px; margin: 0 auto 1rem;
}

/* ============================================================================
   SEARCHABLE SELECT — ช่องเลือกที่พิมพ์ค้นหาได้
   ============================================================================ */
.po-ss { position: relative; }
.po-ss-native { position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0; padding: 0; border: 0; }

.po-ss-toggle {
  text-align: left; width: 100%; cursor: pointer; background-image: none; position: relative;
  padding-right: 2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-ss-toggle::after {
  content: ''; position: absolute; right: .8rem; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid var(--c-muted); border-bottom: 1.5px solid var(--c-muted);
  transform: translateY(-70%) rotate(45deg);
}
.po-ss-toggle.po-ss-placeholder { color: var(--c-muted); }
.po-ss.po-ss-open .po-ss-toggle { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }

.po-ss-panel {
  display: none; position: absolute; z-index: 1080; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  box-shadow: 0 8px 26px rgba(20, 26, 38, .16); overflow: hidden;
}
.po-ss.po-ss-open .po-ss-panel { display: block; }
.po-ss.po-ss-up .po-ss-panel { top: auto; bottom: calc(100% + 4px); }

.po-ss-search { padding: .5rem; border-bottom: 1px solid var(--c-line-soft); }
.po-ss-list { max-height: 240px; overflow-y: auto; }

.po-ss-item { padding: .45rem .75rem; font-size: 13.5px; cursor: pointer; }
.po-ss-item:hover, .po-ss-item.hover { background: var(--c-accent-soft); }
.po-ss-item.active { background: var(--c-accent); color: #fff; }
.po-ss-item.disabled { color: var(--c-muted); cursor: not-allowed; }
.po-ss-empty { padding: .9rem .75rem; font-size: 13px; color: var(--c-muted); text-align: center; }

/* ในโมดัล ต้องให้ panel ทับขอบโมดัลได้ */
.modal-body { overflow: visible; }

/* ช่องที่ล็อกเป็นตัวเอง แสดงเป็นข้อความอ่านอย่างเดียว */
.po-self-field {
  background: var(--c-line-soft); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: .5rem .75rem; font-size: 14px; display: flex; align-items: center; gap: .5rem;
}
.po-self-field i { color: var(--c-muted); }

/* กล่องแสดงชื่อผู้ใช้และรหัสผ่านเริ่มต้น */
.po-cred-row {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); margin-bottom: .5rem;
  background: var(--c-card);
}
.po-cred-label { width: 120px; flex: 0 0 auto; font-size: 13px; color: var(--c-muted); }
.po-cred-value {
  flex: 1; min-width: 0; font-family: 'Menlo', 'Consolas', monospace;
  font-size: 15px; font-weight: 600; letter-spacing: .3px; word-break: break-all;
}

/* หัวข้อย่อยในเอกสารราชการ */
.po-doc-section-title {
  font-size: 14px; font-weight: 600; margin: 1.4rem 0 .5rem;
  padding-bottom: .3rem; border-bottom: 2px solid var(--c-ink-soft);
}
.po-doc-section-title:first-of-type { margin-top: .6rem; }

/* ============================================================================
   DASHBOARD — ก้อนเพิ่มเติม
   ============================================================================ */
.po-todo-bar { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.po-todo {
  display: flex; align-items: center; gap: .8rem; padding: .8rem 1.1rem;
  background: var(--c-accent-soft); border: 1px solid var(--c-accent);
  border-radius: var(--radius); text-decoration: none; color: inherit; min-width: 190px;
}
.po-todo:hover { background: var(--c-accent); color: #fff; }
.po-todo:hover i, .po-todo:hover .po-todo-lbl { color: #fff; }
.po-todo i { font-size: 22px; color: var(--c-accent-dark); }
.po-todo-num { font-size: 22px; font-weight: 600; line-height: 1.1; }
.po-todo-lbl { font-size: 12.5px; color: var(--c-ink-soft); }

.po-today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .8rem; }
.po-today { text-align: center; padding: .6rem .3rem; border-radius: var(--radius-sm); background: var(--c-line-soft); }
.po-today-num { font-size: 22px; font-weight: 600; line-height: 1.2; }
.po-today-lbl { font-size: 12px; color: var(--c-muted); margin-top: .15rem; }

.po-dashboard-chip {
  display: inline-flex; align-items: center; min-height: 34px; padding: .4rem .85rem;
  border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-card);
  color: var(--c-ink); font-size: 12.5px; font-weight: 600; line-height: 1.25;
  text-decoration: none; white-space: nowrap;
}
.po-dashboard-chip:hover { border-color: var(--c-accent); color: var(--c-accent-dark); }
.po-dashboard-chip.warn { border-color: var(--c-warn); background: var(--c-warn-soft); }

/* แถบความคืบหน้าของเงินเบิกและเงินประกัน */
.po-progress {
  height: 7px; background: var(--c-line-soft); border-radius: 4px; overflow: hidden;
}
.po-progress-fill {
  height: 100%; background: var(--c-accent); border-radius: 4px; transition: width .2s;
}

/* ฟีเจอร์ที่ยังไม่ได้พัฒนา แสดงจาง ๆ ให้เห็นว่ามีใน roadmap แต่ยังติ๊กไม่ได้ */
.po-feature-soon { opacity: .5; }
.po-feature-soon .form-check-label { cursor: not-allowed; }

/* รายการในใบเบิกค่าใช้จ่าย */
.po-expense-item {
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: .65rem .75rem; margin-bottom: .5rem; background: var(--c-card);
}

/* ขั้นตอนของรอบประเมิน */
.po-flow { display: flex; gap: .35rem; flex-wrap: wrap; }
.po-flow-step {
  flex: 1 1 120px; padding: .5rem .7rem; border-radius: var(--radius-sm);
  background: var(--c-line-soft); color: var(--c-muted); font-size: 12.5px; position: relative;
}
.po-flow-step .po-flow-no { font-weight: 600; margin-right: .3rem; }
.po-flow-step.done { background: var(--c-support-soft); color: var(--c-support); }
.po-flow-step.current { background: var(--c-accent); color: #fff; font-weight: 600; }

/* การกระจายเกรด */
.po-dist { display: flex; align-items: flex-end; gap: .6rem; height: 130px; padding-top: .5rem; }
.po-dist-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.po-dist-bar { width: 100%; max-width: 56px; background: var(--c-accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.po-dist-num { font-size: 12.5px; font-weight: 600; margin-bottom: .2rem; }
.po-dist-lbl { font-size: 12.5px; color: var(--c-muted); margin-top: .3rem; }

/* ปุ่มให้คะแนน 1-5 */
.po-rate { display: flex; gap: .35rem; flex-wrap: wrap; }
.po-rate input { position: absolute; opacity: 0; pointer-events: none; }
.po-rate label {
  min-width: 44px; text-align: center; padding: .4rem .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--c-line); cursor: pointer; font-weight: 600; background: var(--c-card);
}
.po-rate label:hover { border-color: var(--c-accent); }
.po-rate input:checked + label { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.po-rate input:focus-visible + label { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.po-review-item { padding: .9rem 0; border-bottom: 1px solid var(--c-line-soft); }
.po-review-item:last-child { border-bottom: 0; }

/* คะแนนเทียบ ตนเอง กับ ผู้อื่น */
.po-gap-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px 70px; gap: .5rem; align-items: center; padding: .35rem 0; font-size: 13.5px; }
.po-gap-row.head { font-size: 12px; color: var(--c-muted); border-bottom: 1px solid var(--c-line-soft); }
.po-score-big { font-size: 30px; font-weight: 600; line-height: 1.1; }

/* บอร์ดผู้สมัคร */
.po-kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.po-kanban-col {
  flex: 0 0 240px; background: var(--c-line-soft); border-radius: var(--radius); padding: .6rem;
  min-height: 160px; transition: background .15s;
}
.po-kanban-col.drop { background: var(--c-accent-soft); outline: 2px dashed var(--c-accent); }
.po-kanban-head { display: flex; align-items: center; gap: .4rem; font-size: 13px; font-weight: 600; margin-bottom: .5rem; }
.po-kanban-count { margin-left: auto; background: var(--c-card); border-radius: 999px; padding: 0 .5rem; font-size: 12px; }
.po-kanban-card {
  display: block; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: .55rem .65rem; margin-bottom: .45rem; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
}
.po-kanban-card[draggable="true"] { cursor: grab; }
.po-kanban-card:hover { border-color: var(--c-accent); color: inherit; }
.po-kanban-card.dragging { opacity: .45; }
.po-kanban-name { font-weight: 600; font-size: 13.5px; }
.po-kanban-meta { font-size: 12px; color: var(--c-muted); }
.po-stars { color: var(--c-warn); font-size: 12px; letter-spacing: 1px; }

/* หน้าเว็บรับสมัครสาธารณะ */
.po-careers { max-width: 920px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.po-careers-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.5rem; }
.po-careers-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: var(--c-card); border: 1px solid var(--c-line); }
.po-careers-mark { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; font-weight: 700; background: var(--c-accent); color: #fff; }
.po-job-card {
  display: block; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: .7rem; text-decoration: none; color: inherit;
}
.po-job-card:hover { border-color: var(--c-accent); color: inherit; }
.po-job-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: 13px; color: var(--c-muted); margin-top: .3rem; }
.po-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ระดับทักษะ 5 จุด */
.po-level { display: inline-flex; gap: 3px; vertical-align: middle; }
.po-level i { width: 10px; height: 10px; border-radius: 50%; background: var(--c-line); display: inline-block; }
.po-level i.on { background: var(--c-accent); }
.po-level.req i.on { background: var(--c-support); }

/* ตารางทักษะ */
.po-matrix { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.po-matrix th, .po-matrix td { border-bottom: 1px solid var(--c-line-soft); padding: .35rem .4rem; }
.po-matrix thead th { position: sticky; top: 0; background: var(--c-card); z-index: 1; }
.po-matrix th.skill { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 130px; font-weight: 500; vertical-align: bottom; }
.po-matrix td.cell { text-align: center; width: 36px; min-width: 36px; font-weight: 600; }
.po-matrix td.cell.ok { background: var(--c-support-soft); color: var(--c-support); }
.po-matrix td.cell.gap { background: var(--c-danger-soft); color: var(--c-danger); }
.po-matrix td.cell.extra { background: var(--c-accent-soft); color: var(--c-accent-dark); }
.po-matrix td.cell.none { color: var(--c-muted); }
.po-matrix td.name { position: sticky; left: 0; background: var(--c-card); white-space: nowrap; min-width: 190px; }

/* กำแพงคำชื่นชม */
.po-kudos { display: flex; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid var(--c-line-soft); }
.po-kudos:last-child { border-bottom: 0; }
.po-kudos-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--c-accent-soft); color: var(--c-accent-dark); font-weight: 600;
}
.po-kudos-value { display: inline-block; font-size: 12px; padding: .1rem .55rem; border-radius: 999px; background: var(--c-support-soft); color: var(--c-support); }
.po-kudos-points { font-weight: 600; color: var(--c-accent); }
.po-kudos.hidden-item { opacity: .45; }
.po-points-big { font-size: 34px; font-weight: 700; color: var(--c-accent); line-height: 1.1; }
.po-reward-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; background: var(--c-card); }
.po-reward-card img { width: 100%; height: 130px; object-fit: cover; }
.po-reward-img-empty { height: 130px; display: grid; place-items: center; font-size: 36px; background: var(--c-line-soft); color: var(--c-muted); }
.po-enps { font-size: 40px; font-weight: 700; line-height: 1; }
.po-bar-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--c-line-soft); }
.po-bar-stack span { display: block; height: 100%; }

/* ------------------------------------------------------------ Open API */
.po-code { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: .8rem 1rem; font-size: 12.5px; line-height: 1.6; max-height: 360px; overflow: auto; white-space: pre; margin-bottom: .8rem; }
.po-api-method { display: inline-block; min-width: 52px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: .1rem .35rem; border-radius: 4px; background: var(--c-line-soft); color: var(--c-ink); }
.po-api-method.get { background: #dcfce7; color: #166534; }
.po-api-method.post { background: #dbeafe; color: #1e40af; }
.po-api-method.patch { background: #fef3c7; color: #92400e; }
.po-docs h2 { font-size: 17px; margin: 1.6rem 0 .6rem; }
.po-docs h2:first-child { margin-top: 0; }
.po-docs h3 { font-size: 14.5px; margin: 1.1rem 0 .4rem; }
.po-docs p, .po-docs li { font-size: 14px; line-height: 1.8; }
.po-docs-nav { position: sticky; top: 1rem; }
.po-docs-nav a { display: block; padding: .25rem 0; font-size: 13.5px; color: var(--c-muted); }
.po-docs-nav a:hover { color: var(--c-ink); }

/* ------------------------------------------------------------ คู่มือการใช้งาน */
.po-help-search { max-width: 520px; }
.po-help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin-bottom: 1.4rem; }
.po-help-card { display: flex; gap: .75rem; padding: .9rem 1rem; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-card); color: var(--c-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.po-help-card:hover { border-color: var(--c-accent); box-shadow: var(--shadow-sm); color: var(--c-ink); }
.po-help-card i.po-help-icon { font-size: 22px; color: var(--c-accent-dark); line-height: 1; margin-top: .1rem; }
.po-help-card-title { font-weight: 600; }
.po-help-card-text { font-size: 13px; color: var(--c-muted); line-height: 1.6; margin-top: .15rem; }
.po-help-group { font-size: 13px; font-weight: 700; color: var(--c-muted); text-transform: none; margin: .4rem 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.po-help-nav a { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: 6px; font-size: 13.5px; color: var(--c-ink); text-decoration: none; }
.po-help-nav a:hover { background: var(--c-line-soft); }
.po-help-nav a.active { background: var(--c-line-soft); color: var(--c-accent-dark); font-weight: 600; }
.po-help-nav .po-help-group { margin-top: .9rem; }
.po-help-body { font-size: 14.5px; line-height: 1.9; }
.po-help-body h2 { font-size: 17px; font-weight: 700; margin: 1.6rem 0 .5rem; padding-top: .2rem; }
.po-help-body h2:first-child { margin-top: 0; }
.po-help-body h3 { font-size: 15px; font-weight: 600; margin: 1rem 0 .3rem; }
.po-help-body ol.po-steps { counter-reset: step; list-style: none; padding-left: 0; }
.po-help-body ol.po-steps > li { counter-increment: step; position: relative; padding-left: 2.3rem; margin-bottom: .55rem; }
.po-help-body ol.po-steps > li::before { content: counter(step); position: absolute; left: 0; top: .15rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--c-accent); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.po-help-tip, .po-help-warn { border-radius: 8px; padding: .65rem .9rem; margin: .8rem 0; font-size: 13.5px; line-height: 1.8; }
.po-help-tip { background: #eff6ff; border-left: 3px solid #3b82f6; }
.po-help-warn { background: #fffbeb; border-left: 3px solid #f59e0b; }
.po-help-tip::before { content: "เคล็ดลับ · "; font-weight: 700; }
.po-help-warn::before { content: "ข้อควรระวัง · "; font-weight: 700; }
.po-help-menu { font-weight: 600; white-space: nowrap; }
.po-help-menu i { font-size: 11px; }
.po-help-body details { border: 1px solid var(--c-line); border-radius: 8px; padding: .55rem .9rem; margin-bottom: .5rem; }
.po-help-body details summary { cursor: pointer; font-weight: 600; }
.po-help-body details[open] summary { margin-bottom: .3rem; }
.po-help-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--c-line); font-size: 13.5px; }

/* ============================================================================
   ESS SUPER APP — พื้นที่พนักงานแบบ mobile-first
   ============================================================================ */
.po-ess-superapp-body { background: #F6F3F8; }
.po-ess-superapp-body .po-content-inner { max-width: none; padding: 0; }
.po-ess-superapp { max-width: none; margin: 0 auto; padding: 1.4rem 1.5rem 4rem; }

.po-ess-app-hero {
  position: relative; min-height: 285px; overflow: hidden; padding: 1.4rem 1.75rem 5.5rem;
  border-radius: 26px; color: #fff;
  background:
    radial-gradient(circle at 78% 10%, rgba(133,93,221,.72), transparent 28%),
    radial-gradient(circle at 5% 105%, rgba(242,107,94,.62), transparent 36%),
    linear-gradient(125deg, #2D2440 0%, #523365 59%, #277D75 145%);
  box-shadow: 0 18px 48px rgba(45,36,64,.16);
}
.po-ess-app-hero::before {
  content: ''; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.9) .8px, transparent .8px);
  background-size: 20px 20px; mask-image: linear-gradient(90deg, #000, transparent 78%);
}
.po-ess-app-topline { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; }
.po-ess-app-brand { display: flex; align-items: center; gap: .55rem; font-size: 14px; font-weight: 800; letter-spacing: -.02em; }
.po-ess-app-brand span {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(145deg, #FF8A72, #F26B5E 58%, #D95786); box-shadow: 0 8px 18px rgba(16,8,28,.22);
}
.po-ess-app-tools { display: flex; align-items: center; gap: .45rem; }
.po-ess-app-tools > a {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); color: #fff;
}
.po-ess-app-tools > a:hover { color: #fff; background: rgba(255,255,255,.2); }
.po-ess-app-tools img, .po-ess-app-tools b { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; display: grid; place-items: center; background: #fff; color: #6A405D; font-size: 11px; }
.po-ess-app-bell span { position: absolute; right: -3px; top: -4px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 3px; background: #FFCF61; color: #5C3A15; font-size: 9px; font-weight: 800; }
.po-ess-app-greeting { position: relative; z-index: 2; margin-top: 2.5rem; width: 52%; }
.po-ess-app-kicker { display: inline-flex; align-items: center; gap: .4rem; font-size: 10px; font-weight: 800; letter-spacing: .13em; color: #FFC0B5; }
.po-ess-app-greeting h1 { margin: .65rem 0 .25rem; font-size: clamp(29px, 3.1vw, 43px); font-weight: 800; line-height: 1.2; letter-spacing: -.035em; }
.po-ess-app-greeting p { margin: 0; color: rgba(255,255,255,.72); }
.po-ess-app-mascot { position: absolute; right: -3%; bottom: -28%; width: min(72%, 870px); height: auto; filter: drop-shadow(0 18px 25px rgba(18,10,30,.3)); }

.po-ess-time-card {
  position: relative; z-index: 4; width: calc(100% - 4rem); min-height: 138px; margin: -4.25rem auto 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 105px minmax(170px, auto); align-items: center; gap: 1.4rem;
  padding: 1.15rem 1.35rem; border: 1px solid rgba(233,228,237,.88); border-radius: 20px;
  background: rgba(255,255,255,.96); box-shadow: 0 18px 44px rgba(45,36,64,.13); backdrop-filter: blur(18px);
}
.po-ess-time-date { color: var(--c-muted); font-size: 12px; }
.po-ess-time-value { margin: .25rem 0 .2rem; color: var(--c-ink); font-size: 29px; font-weight: 800; letter-spacing: -.04em; }
.po-ess-time-shift { display: flex; align-items: center; gap: .4rem; color: var(--c-muted); font-size: 11.5px; }
.po-ess-time-shift > span { width: 7px; height: 7px; border-radius: 50%; }
.po-ess-progress { position: relative; width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--c-support) var(--progress), #EDE8F0 0); }
.po-ess-progress::before { content: ''; position: absolute; width: 64px; height: 64px; border-radius: 50%; background: #fff; }
.po-ess-progress > div { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 1px; }
.po-ess-progress strong { font-size: 19px; line-height: 1; }
.po-ess-progress span { color: var(--c-muted); font-size: 10px; }
.po-ess-time-action { display: flex; justify-content: flex-end; }
.po-ess-time-action > .btn { min-width: 160px; padding: .65rem 1rem; }
.po-ess-time-action > span:not(.po-badge) { max-width: 210px; color: var(--c-muted); font-size: 12px; }

.po-ess-quick-chips { display: flex; justify-content: center; gap: .55rem; margin: 1rem auto 1.5rem; overflow-x: auto; scrollbar-width: none; }
.po-ess-quick-chips::-webkit-scrollbar { display: none; }
.po-ess-quick-chips a { display: inline-flex; align-items: center; gap: .35rem; padding: .43rem .75rem; border: 1px solid var(--c-line); border-radius: 999px; background: #fff; color: var(--c-ink-soft); font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.po-ess-quick-chips a:hover { border-color: var(--c-accent-line); color: var(--c-accent-dark); }
.po-ess-quick-chips b { min-width: 16px; height: 16px; display: grid; place-items: center; border-radius: 8px; background: var(--c-danger); color: #fff; font-size: 9px; }

.po-ess-launcher-section { margin-bottom: 1.4rem; padding: 1.25rem 1.35rem 1.35rem; border: 1px solid var(--c-line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.po-ess-section-head, .po-ess-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.po-ess-section-head { margin-bottom: 1.05rem; }
.po-ess-section-head span, .po-ess-feed-title > div > span { color: var(--c-accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.po-ess-section-head h2, .po-ess-feed-title h2 { margin: .15rem 0 0; font-size: 18px; font-weight: 800; }
.po-ess-section-head > a, .po-ess-panel-head > a { font-size: 11.5px; white-space: nowrap; }
.po-ess-launcher { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .65rem; }
.po-ess-launcher-item { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .68rem .25rem; border-radius: 15px; color: var(--c-ink-soft); transition: transform .16s, background .16s; }
.po-ess-launcher-item:hover { transform: translateY(-3px); color: var(--c-ink); background: var(--c-line-soft); }
.po-ess-launcher-item > i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; font-size: 21px; }
.po-ess-launcher-item > span { width: 100%; overflow: hidden; text-overflow: ellipsis; text-align: center; font-size: 11.5px; white-space: nowrap; }
.po-ess-launcher-item > b { position: absolute; right: calc(50% - 28px); top: 3px; min-width: 17px; height: 17px; padding: 0 3px; display: grid; place-items: center; border-radius: 9px; background: var(--c-danger); color: #fff; font-size: 9px; }
.po-ess-launcher-item.coral > i { background: #FFF0ED; color: #E95F52; }
.po-ess-launcher-item.violet > i { background: #F1EBFF; color: #7654C9; }
.po-ess-launcher-item.mint > i { background: #E5F6F3; color: #238D85; }
.po-ess-launcher-item.amber > i { background: #FFF3DC; color: #B77A1C; }

.po-ess-super-grid { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(390px, 1.45fr) minmax(260px, .9fr); gap: 1rem; align-items: start; }
.po-ess-profile-card, .po-ess-panel, .po-ess-super-feed { margin-bottom: 1rem; border: 1px solid var(--c-line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.po-ess-profile-card { padding: 1rem; }
.po-ess-profile-head { display: flex; align-items: center; gap: .7rem; }
.po-ess-profile-head > img, .po-ess-profile-head > div { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; object-fit: cover; background: linear-gradient(145deg, var(--c-accent-soft), #F1EAF9); color: var(--c-accent-dark); font-weight: 800; }
.po-ess-profile-head > span { min-width: 0; }
.po-ess-profile-head strong, .po-ess-profile-head small { display: block; }
.po-ess-profile-head strong { overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; white-space: nowrap; }
.po-ess-profile-head small { color: var(--c-muted); font-size: 10.5px; }
.po-ess-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: .9rem; border-top: 1px solid var(--c-line-soft); padding-top: .8rem; }
.po-ess-mini-stats span { text-align: center; border-right: 1px solid var(--c-line-soft); }
.po-ess-mini-stats span:last-child { border-right: 0; }
.po-ess-mini-stats strong, .po-ess-mini-stats small { display: block; }
.po-ess-mini-stats strong { font-size: 17px; }
.po-ess-mini-stats small { color: var(--c-muted); font-size: 9.5px; }
.po-ess-panel { padding: 1rem; }
.po-ess-panel-head { margin-bottom: .7rem; }
.po-ess-panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 800; }

.po-ess-super-feed { overflow: hidden; }
.po-ess-feed-title { padding: 1rem 1.1rem; border-bottom: 1px solid var(--c-line-soft); }
.po-ess-feed-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: .75rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--c-line-soft); color: inherit; }
.po-ess-feed-card:last-child { border-bottom: 0; }
.po-ess-feed-card:hover { color: inherit; background: #FCF9FD; }
.po-ess-feed-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--c-support-soft); color: var(--c-support); font-size: 17px; }
.po-ess-feed-icon.pinned { background: var(--c-accent-soft); color: var(--c-accent-dark); }
.po-ess-feed-meta { color: var(--c-muted); font-size: 10.5px; }
.po-ess-feed-meta span { color: var(--c-ink-soft); font-weight: 700; }
.po-ess-feed-meta b { margin-left: .35rem; padding: .08rem .35rem; border-radius: 8px; background: var(--c-accent); color: #fff; font-size: 8.5px; }
.po-ess-feed-card h3 { margin: .3rem 0 .2rem; font-size: 14px; font-weight: 800; }
.po-ess-feed-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--c-muted); font-size: 11.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.po-ess-feed-more { display: inline-block; margin-top: .45rem; color: var(--c-accent-dark); font-size: 10.5px; font-weight: 700; }
.po-ess-feed-empty { min-height: 190px; display: grid; place-items: center; align-content: center; gap: .5rem; color: var(--c-muted); }
.po-ess-feed-empty i { font-size: 28px; color: var(--c-accent-line); }

.po-ess-balance-item { margin-bottom: .75rem; }
.po-ess-balance-item:last-child { margin-bottom: 0; }
.po-ess-balance-item > div:first-child { display: flex; align-items: center; gap: .4rem; font-size: 11.5px; }
.po-ess-balance-item > div:first-child span { width: 7px; height: 7px; border-radius: 50%; }
.po-ess-balance-item > div:first-child strong { margin-left: auto; font-size: 11.5px; }
.po-ess-balance-bar { height: 5px; margin-top: .35rem; overflow: hidden; border-radius: 3px; background: var(--c-line-soft); }
.po-ess-balance-bar i { display: block; height: 100%; border-radius: inherit; }
.po-ess-payslip-card > a { display: flex; flex-direction: column; padding: .85rem; border-radius: 14px; background: linear-gradient(135deg, #F6F0FF, #FFF1EC); color: var(--c-ink); }
.po-ess-payslip-card > a > span { color: var(--c-muted); font-size: 10.5px; }
.po-ess-payslip-card > a > strong { margin: .15rem 0; font-size: 23px; }
.po-ess-payslip-card > a > strong small { font-size: 10px; font-weight: 500; }
.po-ess-payslip-card > a > em { color: var(--c-muted); font-size: 10.5px; font-style: normal; }
.po-ess-line-card { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; border-radius: 18px; background: #E9FAEF; color: #176C38; }
.po-ess-line-card > i { font-size: 26px; }
.po-ess-line-card > div { min-width: 0; flex: 1; }
.po-ess-line-card strong, .po-ess-line-card span { display: block; }
.po-ess-line-card strong { font-size: 12.5px; }
.po-ess-line-card span { font-size: 9.5px; opacity: .75; }
.po-ess-line-card > a { padding: .3rem .55rem; border-radius: 8px; background: #06C755; color: #fff; font-size: 10px; }
.po-ess-bottom-nav { display: none; }

@media (min-width: 992px) {
  .po-ess-superapp-body { --sidebar-w: 78px; }
  .po-ess-superapp-body .po-brand { justify-content: center; padding: 0; }
  .po-ess-superapp-body .po-brand-text { display: none; }
  .po-ess-superapp-body .po-nav-tools, .po-ess-superapp-body .po-nav::before { display: none; }
  .po-ess-superapp-body .po-nav { padding-left: .55rem; padding-right: .55rem; }
  .po-ess-superapp-body .po-nav-head { height: 1px; margin: .7rem .35rem; padding: 0; overflow: hidden; background: rgba(255,255,255,.1); font-size: 0; }
  .po-ess-superapp-body .po-nav-head-icon { display: none; }
  .po-ess-superapp-body .po-nav-item { position: relative; justify-content: center; margin: 2px 0; padding: .5rem; font-size: 0; }
  .po-ess-superapp-body .po-nav-item i { font-size: 15px; }
  .po-ess-superapp-body .po-nav-badge { position: absolute; right: 1px; top: 1px; margin: 0; font-size: 9px; }
}

@media (max-width: 1199px) {
  .po-ess-launcher { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .po-ess-super-grid { grid-template-columns: minmax(220px, .8fr) minmax(390px, 1.4fr); }
  .po-ess-super-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
}

@media (max-width: 767px) {
  .po-ess-superapp-body .po-topbar, .po-ess-superapp-body .po-sidebar { display: none; }
  .po-ess-superapp-body .po-content { margin-left: 0; padding-top: 0; }
  .po-ess-superapp-body .po-content-inner { padding: 0 0 6.5rem; }
  .po-ess-superapp { padding: 0 0 1.5rem; }
  .po-ess-app-hero { min-height: 292px; padding: 1.05rem 1.15rem 5.7rem; border-radius: 0 0 28px 28px; }
  .po-ess-app-greeting { width: 68%; margin-top: 2.25rem; }
  .po-ess-app-greeting h1 { font-size: 27px; }
  .po-ess-app-greeting p { font-size: 11.5px; }
  .po-ess-app-mascot { width: 114%; right: -43%; bottom: -13%; opacity: .82; }
  .po-ess-time-card { width: calc(100% - 1.5rem); min-height: 154px; margin-top: -4.8rem; grid-template-columns: minmax(0, 1fr) 78px; gap: .75rem; padding: 1rem; border-radius: 18px; }
  .po-ess-time-date { font-size: 10.5px; }
  .po-ess-time-value { font-size: 23px; }
  .po-ess-progress { width: 70px; height: 70px; }
  .po-ess-progress::before { width: 55px; height: 55px; }
  .po-ess-progress strong { font-size: 17px; }
  .po-ess-time-action { grid-column: 1 / -1; }
  .po-ess-time-action > .btn { width: 100%; }
  .po-ess-quick-chips { justify-content: flex-start; margin: .9rem 0 1.15rem; padding: 0 .8rem; }
  .po-ess-launcher-section { margin: 0 .75rem 1rem; padding: 1rem .75rem; border-radius: 19px; }
  .po-ess-section-head h2, .po-ess-feed-title h2 { font-size: 16px; }
  .po-ess-launcher { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; }
  .po-ess-launcher-item { padding: .55rem .1rem; }
  .po-ess-launcher-item > i { width: 45px; height: 45px; border-radius: 14px; font-size: 19px; }
  .po-ess-launcher-item > span { font-size: 10.5px; }
  .po-ess-super-grid { display: flex; flex-direction: column; gap: 0; padding: 0 .75rem; }
  .po-ess-super-left, .po-ess-super-feed, .po-ess-super-right { width: 100%; }
  .po-ess-super-feed { order: 1; }
  .po-ess-super-left { order: 2; }
  .po-ess-super-right { order: 3; display: block; }
  .po-ess-profile-card { display: none; }
  .po-ess-panel, .po-ess-super-feed { border-radius: 18px; }
  .po-ess-bottom-nav {
    position: fixed; left: .6rem; right: .6rem; bottom: .55rem; z-index: 1050;
    display: flex; align-items: flex-end; justify-content: space-around; min-height: 62px; padding: .35rem .45rem;
    border: 1px solid rgba(233,228,237,.92); border-radius: 20px; background: rgba(255,255,255,.94);
    box-shadow: 0 15px 38px rgba(45,36,64,.2); backdrop-filter: blur(18px);
  }
  .po-ess-bottom-nav > a { position: relative; min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: .1rem; color: var(--c-muted); font-size: 9px; }
  .po-ess-bottom-nav > a i { font-size: 18px; }
  .po-ess-bottom-nav > a.active { color: var(--c-accent); }
  .po-ess-bottom-nav > a.main { margin-top: -1.15rem; color: var(--c-ink); }
  .po-ess-bottom-nav > a.main i { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #FF8A72, var(--c-accent)); color: #fff; font-size: 22px; box-shadow: 0 8px 20px rgba(242,107,94,.3); }
  .po-ess-bottom-nav > a > b { position: absolute; top: -3px; right: 5px; min-width: 15px; height: 15px; display: grid; place-items: center; border-radius: 8px; background: var(--c-danger); color: #fff; font-size: 8px; }
}

/* Private, two-pane chat. Its controls never inherit roster or dashboard chip styles. */
.po-chat-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100dvh - var(--topbar-h) - 5rem); min-height: 480px; overflow: hidden; border: 1px solid var(--c-line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.po-chat-list { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--c-line); }
.po-chat-list-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.15rem 1rem; border-bottom: 1px solid var(--c-line); }
.po-chat-eyebrow { color: var(--c-accent); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.po-chat-list-head h1 { margin: .15rem 0 0; color: var(--c-ink); font-size: 20px; font-weight: 800; }
.po-chat-new { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .7rem; border: 0; border-radius: 11px; background: var(--c-accent); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.po-chat-new:hover, .po-chat-send:hover { filter: brightness(.95); }
.po-chat-list-scroll { overflow-y: auto; min-height: 0; flex: 1; }
.po-chat-item { display: flex; align-items: center; gap: .7rem; padding: .85rem .9rem; border-bottom: 1px solid var(--c-line-soft); color: var(--c-ink); text-decoration: none; }
.po-chat-item:hover, .po-chat-item.active { background: var(--c-accent-soft); color: var(--c-ink); }
.po-chat-item-main { display: block; min-width: 0; flex: 1; }
.po-chat-item-top { display: flex; align-items: baseline; gap: .5rem; }
.po-chat-item-top strong { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.po-chat-item-top small { color: var(--c-muted); font-size: 10px; white-space: nowrap; }
.po-chat-preview { display: block; overflow: hidden; margin-top: .2rem; color: var(--c-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.po-chat-avatar { display: inline-grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 13px; background: #F2EAF8; color: #7958A8; font-size: 13px; font-weight: 800; }
.po-chat-avatar.small { width: 28px; height: 28px; flex-basis: 28px; border-radius: 10px; font-size: 10px; }
.po-chat-unread { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 .35rem; border-radius: 99px; background: var(--c-accent); color: #fff; font-size: 10px; font-weight: 800; }
.po-chat-list-empty { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 3rem 1rem; color: var(--c-muted); text-align: center; font-size: 12px; }
.po-chat-list-empty i { margin-bottom: .4rem; color: #B6A5D1; font-size: 38px; }
.po-chat-list-empty strong { color: var(--c-ink); font-size: 14px; }
.po-chat-thread { display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.po-chat-thread-head { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; border-bottom: 1px solid var(--c-line); }
.po-chat-thread-person { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.po-chat-thread-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.po-chat-thread-person small { color: var(--c-muted); font-size: 11px; }
.po-chat-private { color: var(--c-muted); font-size: 11px; white-space: nowrap; }
.po-chat-back { color: var(--c-ink); font-size: 18px; }
.po-chat-messages { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: .45rem; overflow-y: auto; padding: 1.2rem; background: #FAF8FC; }
.po-chat-day { align-self: center; margin: .65rem 0; padding: .2rem .75rem; border-radius: 99px; background: #ECE8F0; color: var(--c-muted); font-size: 11px; }
.po-chat-row { display: flex; align-items: flex-end; gap: .45rem; max-width: 78%; }
.po-chat-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.po-chat-bubble { display: flex; flex-direction: column; gap: .35rem; padding: .55rem .85rem; border-radius: 16px 16px 16px 4px; background: #fff; box-shadow: var(--shadow-sm); color: var(--c-ink); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.po-chat-row.mine .po-chat-bubble { border-radius: 16px 16px 4px 16px; background: var(--c-accent); color: #fff; }
.po-chat-bubble img { display: block; width: auto; max-width: min(260px, 58vw); max-height: 300px; border-radius: 9px; object-fit: contain; }
.po-chat-image-link { display: block; cursor: zoom-in; }
.po-chat-image-preview { display: block; max-width: 100%; max-height: calc(100dvh - 10rem); margin: auto; border-radius: 12px; object-fit: contain; }
.po-chat-row time { flex: 0 0 auto; padding-bottom: .15rem; color: var(--c-muted); font-size: 10px; }
.po-chat-composer { position: relative; display: flex; align-items: flex-end; gap: .55rem; padding: .7rem; border-top: 1px solid var(--c-line); background: #fff; }
.po-chat-image-button, .po-chat-send { display: inline-grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 0; border-radius: 13px; cursor: pointer; font-size: 18px; }
.po-chat-image-button { background: #F3EDF8; color: #7958A8; }
.po-chat-send { background: var(--c-accent); color: #fff; }
.po-chat-composer textarea { min-width: 0; max-height: 120px; flex: 1; resize: none; padding: .65rem .85rem; border: 1px solid var(--c-line); border-radius: 14px; outline: 0; font: inherit; font-size: 13px; line-height: 1.45; }
.po-chat-composer textarea:focus { border-color: var(--c-accent); }
.po-chat-error { position: absolute; right: .7rem; bottom: 100%; padding: .4rem .65rem; border-radius: 8px; background: var(--c-danger-soft); color: var(--c-danger); font-size: 11px; }
.po-chat-welcome { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.po-chat-welcome > i { color: #B6A5D1; font-size: 62px; }
.po-chat-welcome h2 { margin: .7rem 0 .2rem; font-size: 19px; font-weight: 800; }
.po-chat-welcome p { color: var(--c-muted); font-size: 13px; }
@media (max-width: 991.98px) {
  .po-chat-page .po-content-inner { padding: .65rem .65rem 0; }
  .po-chat-shell { height: calc(100dvh - var(--topbar-h) - 5.7rem); min-height: 360px; grid-template-columns: 1fr; border-radius: 18px; }
  .po-chat-shell.has-current .po-chat-list, .po-chat-shell:not(.has-current) .po-chat-thread { display: none; }
  .po-chat-row { max-width: 88%; }
  .po-chat-private { display: none; }
}

@media (max-width: 380px) {
  .po-ess-app-greeting { width: 78%; }
  .po-ess-time-value { font-size: 20px; }
  .po-ess-launcher-item > i { width: 41px; height: 41px; }
}

/* ------------------------------------------------------------------ DESKTOP NAVIGATION RAIL
   ใช้แนวทางเดียวกับระบบบริหารโรงเรียน: แถบไอคอนแคบ อ่านง่าย และคืนพื้นที่ให้เนื้อหา */
@media (min-width: 992px) {
  /* ขยายเมนูให้อ่านง่ายขึ้น (ตัวอักษร 10px เดิมเล็กเกินไป) */
  :root { --sidebar-w: 108px; }

  .po-sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--c-line);
    box-shadow: none;
    z-index: 1040;
  }

  .po-brand {
    height: auto;
    justify-content: center;
    padding: 14px 0 8px;
    border-bottom: 0;
    background: #fff;
  }

  .po-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.35rem;
  }

  .po-brand-text,
  .po-nav-tools {
    display: none;
  }

  .po-nav {
    width: 100%;
    padding: 4px 8px 12px;
  }

  .po-nav::before {
    display: none;
  }

  .po-nav-head {
    display: none;
  }

  .po-nav-head-icon,
  .po-nav-head-chevron {
    display: none;
  }

  .po-nav-item,
  .po-sidebar .po-nav-item.po-nav-group-hidden {
    position: relative;
    min-height: 96px;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px auto;
    align-content: center;
    align-items: center;
    justify-items: center;
    gap: 4px;
    margin: 0;
    padding: 6px 2px;
    border: 0;
    border-radius: 14px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    transform: none;
    box-shadow: none;
  }

  .po-nav-item:hover {
    color: var(--c-ink);
    background: transparent;
    border: 0;
    transform: none;
    box-shadow: none;
  }

  .po-nav-item i {
    width: 54px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #6b5d78;
    background: #f0ecf3;
    font-size: 1.5rem;
    transition: background .15s, color .15s;
  }

  .po-nav-item:hover i {
    color: var(--c-ink);
    background: #f4f5f7;
  }

  .po-nav-item.active {
    color: var(--c-accent-dark);
    background: transparent;
    border: 0;
    font-weight: 700;
    box-shadow: none;
  }

  .po-nav-item.active i {
    color: var(--c-accent);
    background: var(--c-accent-soft);
    box-shadow: none;
  }

  .po-nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    min-width: 17px;
    height: 17px;
    margin: 0;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    line-height: 17px;
  }
}

@media (max-width: 991.98px) {
  :root { --sidebar-w: 292px; }
}

/* Mobile navigation follows the school's five-slot tab bar and app-grid menu. */
.po-mobile-brand, .po-mobile-bottom-nav, .po-mobile-menu { display: none; }
.po-mobile-menu[hidden], .po-mobile-menu-empty[hidden], .po-mobile-nav-badge[hidden] { display: none !important; }

@media (max-width: 991.98px) {
  body:not(.po-ess-superapp-body) #poSidebarToggle { display: none !important; }
  .po-mobile-brand {
    width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
    border-radius: 12px; background: linear-gradient(145deg, #FF8A72, var(--c-accent) 55%, #D95786);
    color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 5px 12px rgba(242,107,94,.18);
  }
  .po-mobile-brand:hover { color: #fff; }
  body:not(.po-ess-superapp-body) .po-content-inner { padding-bottom: 7rem; }
  .po-mobile-bottom-nav {
    position: fixed; z-index: 1050; left: 0; right: 0; bottom: 0;
    min-height: 68px; display: flex; align-items: stretch; padding: .35rem .35rem calc(.45rem + env(safe-area-inset-bottom));
    border: 1px solid #EFE9F1; border-radius: 20px 20px 0 0; background: rgba(255,255,255,.96);
    box-shadow: 0 -6px 28px rgba(45,36,64,.1); backdrop-filter: blur(18px);
  }
  .po-mobile-bottom-nav > a, .po-mobile-bottom-nav > button {
    position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; border: 0; background: transparent; color: #95899E; font: inherit; font-size: 10.5px;
    line-height: 1.2; text-decoration: none;
  }
  .po-mobile-bottom-nav > a:hover, .po-mobile-bottom-nav > button:hover,
  .po-mobile-bottom-nav > .active { color: var(--c-accent-dark); }
  .po-mobile-bottom-nav > a > i { font-size: 21px; line-height: 1.25; }
  .po-mobile-bottom-nav > .active { font-weight: 700; }
  .po-mobile-menu-trigger > i {
    width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; margin-top: -24px;
    border-radius: 16px; background: linear-gradient(145deg, #FF8A72, var(--c-accent)); color: #fff;
    box-shadow: 0 8px 18px rgba(242,107,94,.32); font-size: 22px;
  }
  .po-mobile-nav-badge {
    position: absolute; top: 0; left: 55%; min-width: 17px; height: 17px; padding: 1px 4px;
    border: 2px solid #fff; border-radius: 999px; background: #EF4444; color: #fff;
    font-size: 9px; line-height: 13px;
  }
  .po-mobile-menu {
    position: fixed; z-index: 1045; inset: 0; display: block; overflow-y: auto;
    padding: 1.4rem max(1rem, env(safe-area-inset-left)) calc(6.5rem + env(safe-area-inset-bottom));
    background: linear-gradient(160deg, #FFFDFE, #F8F4FA 72%);
  }
  body.po-mobile-menu-open { overflow: hidden; }
  .po-mobile-menu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: .4rem 0 1.3rem; }
  .po-mobile-menu-head span { color: var(--c-accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
  .po-mobile-menu-head h1 { margin: .4rem 0 .15rem; color: var(--c-ink); font-size: 27px; font-weight: 800; line-height: 1.4; }
  .po-mobile-menu-head p { margin: 0; color: var(--c-muted); font-size: 12px; }
  .po-mobile-menu-close {
    width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--c-line); border-radius: 11px;
    background: #fff; color: var(--c-ink-soft);
  }
  .po-mobile-menu-search {
    height: 46px; display: flex; align-items: center; gap: .65rem; margin-bottom: 1.1rem; padding: 0 .9rem;
    border: 1px solid #E7E0EB; border-radius: 14px; background: #fff; color: #84778F;
  }
  .po-mobile-menu-search:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(242,107,94,.1); }
  .po-mobile-menu-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--c-ink); font: inherit; font-size: 13px; }
  .po-mobile-menu-group { margin-bottom: .9rem; padding: 1rem .55rem 1.1rem; border: 1px solid #ECE6EF; border-radius: 18px; background: #fff; box-shadow: 0 6px 18px rgba(45,36,64,.035); }
  .po-mobile-menu-group h2 { margin: 0 .45rem 1rem; color: var(--c-ink); font-size: 14px; font-weight: 700; }
  .po-mobile-menu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem .1rem; }
  .po-mobile-menu-tile { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .4rem; color: var(--c-ink-soft); font-size: 11px; line-height: 1.25; text-align: center; text-decoration: none; }
  .po-mobile-menu-tile:hover, .po-mobile-menu-tile.active { color: var(--c-accent-dark); }
  .po-mobile-menu-tile > i { width: 51px; height: 51px; display: grid; place-items: center; border-radius: 16px; background: #FFF0EC; color: var(--c-accent); font-size: 22px; }
  .po-mobile-menu-group:nth-child(4n+2) .po-mobile-menu-tile > i { background: #F2ECF9; color: #7958A8; }
  .po-mobile-menu-group:nth-child(4n+3) .po-mobile-menu-tile > i { background: #E9F7F5; color: #258E87; }
  .po-mobile-menu-group:nth-child(4n+4) .po-mobile-menu-tile > i { background: #FFF4E4; color: #B77B1F; }
  .po-mobile-menu-tile.active > i { box-shadow: inset 0 0 0 2px currentColor; }
  .po-mobile-menu-tile > span { overflow-wrap: anywhere; }
  .po-mobile-menu-tile > b { position: absolute; top: -5px; right: 7%; min-width: 17px; padding: 1px 4px; border-radius: 99px; background: #EF4444; color: #fff; font-size: 9px; }
  .po-mobile-menu-empty { padding: 2rem; color: var(--c-muted); text-align: center; font-size: 13px; }
  .po-ess-superapp-body .po-mobile-bottom-nav, .po-ess-superapp-body .po-mobile-brand { display: none; }
}

@media (max-width: 380px) {
  .po-mobile-bottom-nav > a, .po-mobile-bottom-nav > button { font-size: 9.5px; }
  .po-mobile-menu-tile > i { width: 46px; height: 46px; }
}

@media (max-width: 520px) {
  .po-topbar-company { min-width: 0; }
  .po-topbar-company > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .po-topbar-help, .po-topbar-me { display: none; }
}

/* Dashboard mobile: school-style app header, floating daily card and launcher. */
@media (max-width: 991.98px) {
  .po-dashboard-page .po-topbar { display: none; }
  .po-dashboard-page .po-content { padding-top: 0; }
  .po-dashboard-page .po-content-inner { padding: 0 .9rem 7rem; }
  .po-dashboard-mobile { margin-bottom: 1.15rem; }
  .po-dashboard-mobile-hero {
    position: relative; min-height: 280px; overflow: hidden; margin: 0 -.9rem; padding: 1rem 1.1rem 5rem;
    border-radius: 0 0 27px 27px; color: #fff;
    background: radial-gradient(circle at 85% 8%, rgba(129,91,214,.55), transparent 42%),
      linear-gradient(150deg, #332541, #56366B 68%, #356663 145%);
  }
  .po-dashboard-mobile-hero::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(42,29,56,.35), transparent 75%);
  }
  .po-dashboard-mobile-top { position: relative; z-index: 3; display: flex; align-items: center; gap: .48rem; }
  .po-dashboard-mobile-logo {
    width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center;
    border-radius: 11px; background: linear-gradient(145deg, #FF8A72, var(--c-accent));
    font-weight: 800; box-shadow: 0 6px 14px rgba(21,10,29,.14);
  }
  .po-dashboard-mobile-top > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .po-dashboard-mobile-top-spacer { flex: 1; }
  .po-dashboard-mobile-top > a {
    width: 33px; height: 33px; flex: 0 0 33px; display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.15); border-radius: 11px;
    background: rgba(255,255,255,.1); color: #fff; font-size: 17px;
  }
  .po-dashboard-mobile-top > a:hover { color: #fff; background: rgba(255,255,255,.2); }
  .po-dashboard-mobile-top > .po-dashboard-mobile-avatar { background: #fff; color: var(--c-accent-dark); font-size: 10px; font-weight: 800; }
  .po-dashboard-mobile-greeting { position: relative; z-index: 2; width: 66%; margin-top: 1.45rem; }
  .po-dashboard-mobile-greeting h1 { margin: .6rem 0 .25rem; color: #fff; font-size: clamp(22px, 5.5vw, 27px); font-weight: 800; line-height: 1.3; }
  .po-dashboard-mobile-greeting p { margin: 0; color: rgba(255,255,255,.8); font-size: 11.5px; line-height: 1.55; }
  .po-dashboard-mobile-art { position: absolute; z-index: 1; width: min(94%, 480px); height: auto; right: -1%; bottom: -2%; opacity: .58; }
  .po-dashboard-mobile-float {
    position: relative; z-index: 3; min-height: 146px; display: flex; align-items: center; gap: .75rem;
    margin-top: -4.1rem; padding: 1rem 1.1rem; border: 1px solid var(--c-line);
    border-radius: 20px; background: #fff; box-shadow: 0 14px 34px rgba(45,36,64,.15);
  }
  .po-dashboard-mobile-float-main { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: .13rem; }
  .po-dashboard-mobile-date { color: var(--c-muted); font-size: 10.5px; }
  .po-dashboard-mobile-float-main > strong { color: var(--c-ink); font-size: clamp(17px, 4.5vw, 23px); line-height: 1.25; }
  .po-dashboard-mobile-float-main > span:not(.po-dashboard-mobile-date) { color: var(--c-muted); font-size: 11px; }
  .po-dashboard-mobile-float-main > a { margin-top: .55rem; padding: .4rem .7rem; font-size: 11px; }
  .po-dashboard-mobile-ring {
    width: 84px; height: 84px; flex: 0 0 84px; display: grid; place-items: center;
    border-radius: 50%; background: conic-gradient(var(--c-support) var(--progress), #EDE8F0 0);
  }
  .po-dashboard-mobile-ring::before { content: ''; width: 66px; height: 66px; border-radius: 50%; background: #fff; grid-area: 1 / 1; }
  .po-dashboard-mobile-ring > div, .po-dashboard-mobile-ring > i { position: relative; z-index: 1; grid-area: 1 / 1; text-align: center; }
  .po-dashboard-mobile-ring strong, .po-dashboard-mobile-ring span { display: block; }
  .po-dashboard-mobile-ring strong { color: var(--c-ink); font-size: 18px; line-height: 1.2; }
  .po-dashboard-mobile-ring span { color: var(--c-muted); font-size: 9px; }
  .po-dashboard-mobile-ring.is-empty { background: #F3EDF8; color: #7958A8; font-size: 25px; }
  .po-dashboard-mobile-apps { margin-top: 1rem; padding: 1rem .7rem .85rem; border: 1px solid var(--c-line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
  .po-dashboard-mobile-apps-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: 0 .35rem .45rem; }
  .po-dashboard-mobile-apps-head h2 { margin: 0; color: var(--c-ink); font-size: 15px; font-weight: 800; }
  .po-dashboard-mobile-apps-head span { color: var(--c-muted); font-size: 10.5px; }
  .po-dashboard-mobile-app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .15rem; }
  .po-dashboard-mobile-app-grid > button { border: 0; background: transparent; font: inherit; cursor: pointer; }
  .po-dashboard-mobile-app-grid .po-ess-launcher-item { padding: .55rem .1rem; }
  .po-dashboard-mobile-app-grid .po-ess-launcher-item > i { width: 46px; height: 46px; font-size: 20px; }
.po-dashboard-mobile-app-grid .po-ess-launcher-item > span { font-size: 10.5px; }
  .po-dashboard-page .po-todo-bar { margin-top: .1rem; }
}

/* Desktop dashboard uses the same left / work / follow-up reading order as the school dashboard. */
.po-dashboard-profile-who { display: flex; align-items: center; gap: .75rem; }
.po-dashboard-profile-avatar { display: grid; width: 52px; height: 52px; flex: 0 0 52px; place-items: center; border-radius: 16px; background: #F3EAF7; color: #7958A8; font-size: 18px; font-weight: 800; }
.po-dashboard-profile-who strong, .po-dashboard-profile-who small { display: block; }
.po-dashboard-profile-who strong { color: var(--c-ink); font-size: 14px; }
.po-dashboard-profile-who small { color: var(--c-muted); font-size: 12px; }
.po-dashboard-profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: 1rem 0; padding: .8rem 0; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); text-align: center; }
.po-dashboard-profile-stats strong, .po-dashboard-profile-stats span { display: block; }
.po-dashboard-profile-stats strong { color: var(--c-ink); font-size: 19px; }
.po-dashboard-profile-stats span { color: var(--c-muted); font-size: 10px; }
.po-dashboard-feed .po-card-head { gap: .7rem; }
.po-dashboard-feed-actions { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--c-line); color: var(--c-muted); font-size: 12px; }
.po-dashboard-feed-actions > span:nth-child(2) { flex: 1; }
.po-dashboard-feed-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 11px; background: var(--c-accent-soft); color: var(--c-accent-dark); font-size: 11px; font-weight: 800; }
.po-dashboard-feed-post { display: flex; gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--c-line-soft); color: var(--c-ink); text-decoration: none; }
.po-dashboard-feed-post:last-child { border-bottom: 0; }
.po-dashboard-feed-post:hover { background: #FCFAFD; color: var(--c-ink); }
.po-dashboard-feed-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 12px; background: #F0ECFC; color: #7958A8; }
.po-dashboard-feed-icon.kudos { background: #FFF0EC; color: var(--c-accent); }
.po-dashboard-feed-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: .2rem; }
.po-dashboard-feed-meta { display: flex; justify-content: space-between; gap: .5rem; color: var(--c-muted); font-size: 11px; }
.po-dashboard-feed-meta strong { color: var(--c-ink-soft); }
.po-dashboard-feed-meta time { white-space: nowrap; }
.po-dashboard-feed-title { font-size: 13px; }
.po-dashboard-feed-body { display: -webkit-box; overflow: hidden; color: var(--c-muted); font-size: 12px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.po-dashboard-feed-empty { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2rem; color: var(--c-muted); text-align: center; font-size: 12px; }
.po-dashboard-feed-empty i { color: #B6A5D1; font-size: 30px; }
.po-dashboard-feed-empty strong { color: var(--c-ink); font-size: 13px; }
.po-dashboard-chat-row { display: flex; align-items: center; gap: .55rem; padding: .5rem 0; border-bottom: 1px solid var(--c-line-soft); color: var(--c-ink); text-decoration: none; }
.po-dashboard-chat-row:last-child { border: 0; }
.po-dashboard-chat-row > span:nth-child(2) { display: block; min-width: 0; flex: 1; }
.po-dashboard-chat-row strong, .po-dashboard-chat-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-dashboard-chat-row strong { font-size: 12px; }
.po-dashboard-chat-row small { color: var(--c-muted); font-size: 11px; }
.po-dashboard-chat-row b { display: grid; min-width: 19px; height: 19px; place-items: center; border-radius: 99px; background: var(--c-accent); color: #fff; font-size: 10px; }
@media (min-width: 992px) {
  .po-dashboard-hero { min-height: 194px; }
  .po-dashboard-hero-art { width: min(48%, 660px); right: 0; bottom: -20%; }
  .po-dashboard-layout {
    display: grid; grid-template-columns: minmax(280px, 26%) minmax(0, 1fr);
    gap: 1rem; align-items: start;
  }
  .po-dashboard-layout > div { min-width: 0; }
  .po-dashboard-layout-left .po-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .po-dashboard-layout-left .po-stat { min-width: 0; padding: .85rem; }
  .po-dashboard-layout-left .po-stat-lbl { font-size: 11.5px; line-height: 1.3; }
  .po-dashboard-layout-left .po-stat-val { font-size: 23px; }
  .po-dashboard-layout-main > .po-split { display: block; }
  /* จอกลาง คอลัมน์ขวาลงไปอยู่ด้านล่างเต็มความกว้าง เรียงการ์ดเป็นแถว */
  .po-dashboard-layout-right {
    grid-column: 1 / -1; display: grid; gap: 1rem; align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .po-dashboard-layout-right > .po-card { margin-bottom: 0; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .po-dashboard-settings-action { display: none; }
}

@media (min-width: 1500px) {
  .po-dashboard-layout {
    grid-template-columns: minmax(290px, 22%) minmax(0, 1fr) minmax(300px, 24%);
  }
  .po-dashboard-layout-right { grid-column: auto; display: block; }
  .po-dashboard-layout-right > .po-card { margin-bottom: 1.1rem; }
}

@media (max-width: 380px) {
  .po-dashboard-mobile-greeting { width: 72%; }
  .po-dashboard-mobile-art { right: -5%; opacity: .5; }
  .po-dashboard-mobile-ring { width: 72px; height: 72px; flex-basis: 72px; }
  .po-dashboard-mobile-ring::before { width: 56px; height: 56px; }
  .po-dashboard-mobile-ring strong { font-size: 15px; }
}

/* ---------------------------------------------------------------- ช่องวันที่ พ.ศ. (thai-date.js) */
.po-bd { position: relative; display: block; }
.po-bd.po-bd-inline { display: inline-block; vertical-align: middle; }
.po-bd-input { padding-right: 2.2rem; font-variant-numeric: tabular-nums; }
.po-bd-input.is-invalid { background-image: none; padding-right: 2.2rem; }
.po-bd-btn {
  position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
  width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--c-muted); border-radius: 6px; cursor: pointer;
}
.po-bd-btn:hover { background: var(--c-accent-soft); color: var(--c-accent-dark); }
.po-bd-input:disabled + .po-bd-btn, .po-bd-input[readonly] + .po-bd-btn { pointer-events: none; opacity: .4; }

.po-bd-pop {
  display: none; position: fixed; z-index: 2000; width: 284px; padding: .6rem;
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(20, 26, 38, .18); font-size: 13px;
}
.po-bd-pop.is-open { display: block; }
.po-bd-head { display: flex; align-items: center; gap: .3rem; margin-bottom: .45rem; }
.po-bd-head select {
  flex: 1; min-width: 0; font-size: 13px; padding: .25rem .35rem; color: var(--c-ink);
  border: 1px solid var(--c-line); border-radius: 6px; background: var(--c-card);
}
.po-bd-head .po-bd-year { flex: 0 0 76px; }
.po-bd-nav {
  flex: 0 0 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--c-ink); cursor: pointer;
}
.po-bd-nav:hover { background: var(--c-accent-soft); }
.po-bd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.po-bd-dow { text-align: center; font-size: 11.5px; color: var(--c-muted); padding: .2rem 0; }
.po-bd-day {
  height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--c-ink);
  font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.po-bd-day:hover { background: var(--c-accent-soft); }
.po-bd-day.is-today { box-shadow: inset 0 0 0 1px var(--c-accent); }
.po-bd-day.is-selected { background: var(--c-accent); color: #fff; }
.po-bd-day:disabled { color: var(--c-muted); opacity: .4; cursor: not-allowed; background: transparent; }
.po-bd-foot { display: flex; justify-content: space-between; margin-top: .35rem; border-top: 1px solid var(--c-line-soft); padding-top: .3rem; }
.po-bd-foot .btn { font-size: 12.5px; text-decoration: none; }

/* ช่องที่ติด validation แต่อยู่ในแท็บที่ซ่อน / dropdown ค้นหา */
.po-ss.is-invalid .po-ss-toggle { border-color: var(--bs-form-invalid-border-color, #dc3545); }

/* ---------------------------------------------------------------- แดชบอร์ด: แถวแบบย่อ */
.po-dashboard-log-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.po-dashboard-log-row {
  display: flex; align-items: flex-start; gap: .75rem; padding: .55rem 1rem;
  border-bottom: 1px solid var(--c-line-soft);
}
.po-dashboard-log-text { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.po-dashboard-dates-head {
  display: flex; align-items: center; gap: .4rem; padding: .55rem 1rem .25rem;
  font-size: 11.5px; font-weight: 600; color: var(--c-muted); letter-spacing: .02em;
}
.po-dashboard-date-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: .5rem;
  padding: .4rem 1rem; font-size: 13px; color: inherit; text-decoration: none;
}
a.po-dashboard-date-row:hover { background: var(--c-accent-soft); color: inherit; }
.po-dashboard-date-day { font-weight: 600; font-variant-numeric: tabular-nums; }
.po-dashboard-date-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-dashboard-date-meta { font-size: 11.5px; color: var(--c-muted); white-space: nowrap; }
.po-dashboard-date-more { padding: .3rem 1rem .6rem; font-size: 12px; color: var(--c-muted); }
.po-dashboard-dates-head + .po-dashboard-date-row { padding-top: .25rem; }
.po-card-body.flush > .po-dashboard-date-row:last-child, .po-card-body.flush > .po-dashboard-date-more:last-child { padding-bottom: .75rem; }

/* ---------------------------------------------------------------- คีย์เวลาจากบัตรตอก (timesheet) */
.ts-bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem .9rem;
  background: var(--c-line-soft); border: 1px solid var(--c-line); border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 13px;
}
.ts-bar .save-state { margin-left: auto; display: flex; align-items: center; gap: .4rem; color: var(--c-muted); }
.ts-bar .save-state.saving { color: #2F6FB0; }
.ts-bar .save-state.saved { color: var(--c-support); }
.ts-bar .save-state.error { color: var(--c-danger); }
.ts-spin { animation: tsSpin .8s linear infinite; display: inline-block; }
@keyframes tsSpin { to { transform: rotate(360deg); } }

.ts-wrap {
  overflow: auto; max-height: calc(100vh - 260px); background: var(--c-card);
  border: 1px solid var(--c-line); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.ts { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: max-content; }
.ts thead th {
  position: sticky; top: 0; z-index: 3; background: var(--c-line-soft); border-bottom: 1px solid var(--c-line);
  border-right: 1px solid var(--c-line-soft); padding: .3rem .2rem; font-weight: 600; font-size: 12px;
  color: var(--c-ink-soft); text-align: center; white-space: nowrap;
}
.ts thead th .dow { display: block; font-size: 11px; font-weight: 400; opacity: .75; }
.ts thead th.weekend { background: #EEF1F6; color: var(--c-muted); }
.ts thead th.holiday { background: var(--c-warn-soft); color: var(--c-warn); }
.ts .fix-1, .ts .fix-2 { position: sticky; z-index: 4; background: var(--c-card); border-right: 1px solid var(--c-line); text-align: left; }
.ts .fix-1 { left: 0; width: 96px; min-width: 96px; }
.ts .fix-2 { left: 96px; width: 210px; min-width: 210px; }
.ts thead .fix-1, .ts thead .fix-2 { z-index: 5; background: var(--c-line-soft); }
.ts tbody .fix-1, .ts tbody .fix-2 { padding: .3rem .5rem; }
.ts tbody .fix-2 b { font-weight: 600; display: block; line-height: 1.25; }
.ts tbody .fix-2 span { font-size: 11.5px; color: var(--c-muted); display: block; }
.ts .btn-fill-row { padding: .05rem .45rem; font-size: 11px; }
.ts .sum-col {
  position: sticky; right: 0; z-index: 4; background: #FBFAFC; border-left: 1px solid var(--c-line);
  min-width: 140px; padding: .25rem .5rem; font-size: 12px; white-space: nowrap;
}
.ts thead .sum-col { z-index: 5; background: var(--c-line-soft); }
.ts .sum-col .s-late { color: var(--c-warn); }
.ts .sum-col .s-absent { color: var(--c-danger); }
.ts tbody td { border-bottom: 1px solid var(--c-line-soft); border-right: 1px solid var(--c-line-soft); padding: 0; height: 38px; }
.ts-cell {
  width: 84px; height: 100%; border: 0; background: transparent; text-align: center; font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--c-ink); padding: .2rem; outline: none;
}
.ts-cell:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--c-accent); border-radius: 3px; }
.ts-cell::placeholder { color: #CFC8D6; }
.ts td.st-empty { background: #fff; }
.ts td.st-normal, .ts-legend .st-normal-dot { background: var(--c-support-soft); }
.ts td.st-late, .ts-legend .st-late-dot { background: var(--c-warn-soft); }
.ts td.st-absent, .ts-legend .st-absent-dot { background: var(--c-danger-soft); }
.ts td.st-leave, .ts-legend .st-leave-dot { background: #E6F0FB; }
.ts td.st-half, .ts-legend .st-half-dot { background: #F3E8FB; }
.ts td.st-holiday, .ts-legend .st-holiday-dot { background: #F0EAD8; }
.ts td.st-dayoff, .ts-legend .st-dayoff-dot { background: #EFF2F6; }
.ts td.st-out, .ts-legend .st-out-dot { background: repeating-linear-gradient(45deg, #F5F7FA, #F5F7FA 4px, #EBEFF4 4px, #EBEFF4 8px); }
.ts td.locked .ts-cell { color: var(--c-muted); cursor: not-allowed; }
.ts td.dirty { box-shadow: inset 0 0 0 2px var(--c-accent); }
.ts td.ts-error { box-shadow: inset 0 0 0 2px var(--c-danger); }
.ts-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: 12.5px; color: var(--c-ink-soft); margin-top: .7rem; }
.ts-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.ts-legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }

/* ------------------------------------------------- ตัวเลือกพนักงานหลายคน */
.po-emp-picker-menu { min-width: 300px; max-width: 360px; }
.po-emp-picker-list { max-height: 280px; overflow-y: auto; }
.po-emp-picker-list .form-check { padding: .2rem .25rem .2rem 1.75rem; border-radius: 8px; font-size: 13px; cursor: pointer; }
.po-emp-picker-list .form-check:hover { background: var(--c-line-soft); }

/* --------------------------------------------------------- ปฏิทินตารางเวร */
.po-duty { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.po-duty th, .po-duty td { border: 1px solid #333; }
.po-duty caption { caption-side: top; text-align: center; font-size: 20px; font-weight: 700; color: var(--c-ink); padding: .5rem; border: 1px solid #333; border-bottom: 0; background: #FDF3E3; }
.po-duty th { text-align: center; font-size: 17px; font-weight: 700; padding: .35rem .2rem; color: #111; }
.po-duty th.d1 { background: #FFF200; } .po-duty th.d2 { background: #FF3EA5; color: #fff; }
.po-duty th.d3 { background: #12A150; color: #fff; } .po-duty th.d4 { background: #F58220; color: #fff; }
.po-duty th.d5 { background: #19A7E0; color: #fff; } .po-duty th.d6 { background: #6B3FA0; color: #fff; }
.po-duty th.d7 { background: #E5241D; color: #fff; }
.po-duty td { height: 92px; vertical-align: top; padding: .3rem .4rem 1.3rem; position: relative; }
.po-duty td.is-out { background: #F4F4F6; }
.po-duty td.is-holiday { background: #FFF1F0; }
.po-duty-day { position: absolute; right: .4rem; bottom: .1rem; font-size: 19px; line-height: 1; color: #C0241D; }
.po-duty td.is-out .po-duty-day { color: #C4C4CC; }
.po-duty-name { display: block; font-size: 15px; font-weight: 700; line-height: 1.35; text-align: center; }
.po-duty-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .6rem; font-size: 13.5px; }
.po-duty-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
@media print {
  .po-duty-card { border: 0 !important; box-shadow: none !important; }
  .po-duty td { height: 30mm; }
}

/* ------------------------------------------------------------- งานวันนี้ */
.po-today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.1rem; align-items: start; }
.po-today-grid .po-card { margin-bottom: 0; }
.po-today-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.1rem; border-bottom: 1px solid var(--c-line-soft); }
.po-today-row:last-child { border-bottom: 0; }
.po-today-name { font-weight: 600; font-size: 14px; }
@media (max-width: 640px) { .po-today-grid { grid-template-columns: 1fr; } }
