/* ======================================================================
   Worknestro — Today/Approvals styles (all sizes) + phone layout
   (max-width: 760px): sticky compact header, bottom tab bar, "More" sheet,
   tables as cards, full-width dialogs, swipeable tabs and boards.
   ====================================================================== */
.xd-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.xd-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.xd-list > li { min-width: 0; }
.xd-list li > a, .xd-list .xd-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 14px; text-decoration: none; color: inherit; min-width: 0; }
.xd-list li > a:hover { background: var(--surface-2); }
.xd-list .avatar { flex: 0 0 auto; }
.xd-li-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.xd-li-main strong { color: var(--t1); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xd-li-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xd-li-when { flex: 0 0 auto; white-space: nowrap; }
.xd-list li[data-k] { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding-right: 8px; }
.xd-list li[data-k]:hover { background: var(--surface-2); }
.xd-list li[data-k] .xd-row { flex: 1; }
.xd-acts { display: flex; gap: 8px; flex: 0 0 auto; }
.xd-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.xd-quick a { padding: 14px; border-radius: 16px; background: var(--surface-2); text-decoration: none; font-weight: 550; color: var(--t1); }
.xd-quick a:hover { background: var(--surface-3); outline: 1px solid var(--border-strong); }
.xd-empty { text-align: center; padding: 48px 24px; }
.nav-count { margin-left: 6px; background: var(--peach, #d3a27f); color: #1a1c20; border-radius: 10px; padding: 0 6px; font-size: 10px; font-weight: 700; line-height: 16px; }
#xdBar, #xdSheet { display: none; }
/* desktop menu: one row of modules, each with a drop-down of its pages (#nav stays hidden as the data source) */
#nav { display: none !important; }
#xdTop { flex-wrap: wrap; gap: 2px; row-gap: 4px; }
#xdTop > a { padding: 9px 10px; }
@media (min-width: 761px) { .sidebar:has(#xdTop) { gap: 16px; } }
#xdTop .xd-mod { position: relative; }
#xdTop .xd-mod > button { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 3px; padding: 9px 8px 9px 10px; border-radius: 50px;
  font-size: 12px; font-weight: 500; color: var(--t2); cursor: pointer; white-space: nowrap; }
#xdTop .xd-mod > button svg { width: 13px; height: 13px; opacity: .7; transition: transform .15s; }
#xdTop .xd-mod > button:hover, #xdTop .xd-mod.open > button { background: var(--surface); color: var(--t1); }
#xdTop .xd-mod.active > button { background: var(--t1); color: var(--bg); }
#xdTop .xd-mod.open > button svg { transform: rotate(180deg); }
#xdTop .xd-mod > button:focus-visible, #xdTop a:focus-visible { outline: 2px solid var(--olive, #a6bb8c); outline-offset: 2px; }
#xdTop .xd-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 70; min-width: 220px; padding: 6px;
  background: var(--surface, #23262b); border: 1px solid var(--border-strong, rgba(255,255,255,.14)); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
#xdTop .xd-mod.open .xd-menu { display: flex; flex-direction: column; gap: 2px; }
#xdTop .xd-menu a { border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--t1); }
#xdTop .xd-menu a:hover { background: var(--surface-2, rgba(255,255,255,.06)); }
#xdTop .xd-menu a.active { background: var(--surface-3, rgba(255,255,255,.12)); color: var(--t1); font-weight: 600; }
#xdTop .xd-menu hr { border: 0; border-top: 1px solid var(--border, rgba(255,255,255,.08)); margin: 4px 6px; }
@media (max-width: 1000px) { .xd-two { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
  html { -webkit-tap-highlight-color: transparent; }
  body.xd-noscroll { overflow: hidden; }
  /* header */
  .sidebar { position: sticky; top: 0; z-index: 40; flex-wrap: nowrap !important; gap: 12px; padding: 10px 16px !important; padding-top: calc(10px + env(safe-area-inset-top)) !important;
    background: rgba(26, 28, 32, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .nav, #logout, .sidebar-user > div:last-child { display: none !important; }
  .sidebar-footer { margin-left: auto; gap: 8px; }
  .sidebar-user { cursor: pointer; }
  .brand { min-width: 0; flex: 1 1 auto; }
  #brandName { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar { padding: 16px 16px 0 !important; }
  .topbar-right { display: none !important; }
  .topbar-left h1, .topbar-left h2 { font-size: 26px !important; letter-spacing: -.8px !important; }
  .content { padding: 10px 14px calc(100px + env(safe-area-inset-bottom)) !important; }
  .card { padding: 16px; border-radius: 20px; margin-bottom: 14px; }
  /* bottom tab bar */
  #xdBar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; justify-content: space-around; gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(20, 22, 25, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
  #xdBar a { flex: 1 1 0; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 5px; border-radius: 14px;
    color: var(--t3); font-size: 11px; font-weight: 550; text-decoration: none; }
  #xdBar a svg { width: 24px; height: 24px; }
  #xdBar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #xdBar a.on { color: var(--t1); }
  #xdBar a.on svg { stroke: #a6bb8c; }
  #xdBar a:active { background: var(--surface); }
  .xd-badge { position: absolute; top: 2px; left: calc(50% + 6px); background: #d3a27f; color: #1a1c20; font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 5px; border-radius: 9px; }
  /* more sheet */
  #xdSheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); }
  #xdSheet.open { display: block; }
  #xdSheet .xd-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0;
    padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); }
  .xd-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 14px; }
  .xd-me { display: flex; align-items: center; gap: 12px; padding: 4px 2px 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
  .xd-me > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .xd-me strong { color: var(--t1); font-size: 16px; }
  .xd-grp h4 { margin: 16px 2px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--t3); font-weight: 600; }
  .xd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .xd-grid a { display: flex; align-items: center; min-height: 48px; padding: 10px 14px; border-radius: 14px; background: var(--surface); color: var(--t1); text-decoration: none; font-size: 14px; font-weight: 500; }
  .xd-grid a:active { background: var(--surface-2); }
  .xd-wide { width: 100%; justify-content: center; margin-top: 18px; min-height: 48px; }
  .xd-ios { margin-top: 16px; text-align: center; font-size: 13px; }
  /* layout helpers */
  .tabs { flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: 0 0 auto; }
  .dm-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .dm-actions, .pm-filters { width: 100%; }
  .pm-filters > input, .pm-filters > select { flex: 1 1 140px; max-width: none !important; }
  .tk-grid3 { grid-template-columns: 1fr !important; }
  .pm-board { grid-auto-columns: 84vw !important; scroll-snap-type: x mandatory; }
  .pm-col { scroll-snap-align: start; }
  .xd-list li[data-k] { flex-direction: column; align-items: stretch; padding: 4px 0 10px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .xd-acts { padding-left: 50px; min-width: 0; }
  .xd-acts .btn { min-width: 0; }
  .content { overflow-x: hidden; }
  .xd-acts .btn { flex: 1; justify-content: center; }
  /* tables as cards */
  .pp-tbl { overflow: visible !important; border: 0 !important; background: none !important; }
  #content table:not(.xd-keep), #content table:not(.xd-keep) > tbody, #content table:not(.xd-keep) > tbody > tr, #content table:not(.xd-keep) > tbody > tr > td { display: block; width: auto !important; }
  #content table:not(.xd-keep) { min-width: 0 !important; }
  #content table:not(.xd-keep) > thead { display: none; }
  #content table:not(.xd-keep) > tbody > tr { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; border: 0 !important; }
  #content table:not(.xd-keep) > tbody > tr > td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0 !important; border: 0 !important; text-align: right; min-height: 0; white-space: normal; }
  #content table:not(.xd-keep) > tbody > tr > td::before { content: attr(data-label); color: var(--t3); font-size: 12px; text-align: left; flex: 0 0 auto; max-width: 44%; }
  #content table:not(.xd-keep) > tbody > tr > td:first-child { justify-content: flex-start; text-align: left; font-size: 15px; padding-bottom: 8px !important; }
  #content table:not(.xd-keep) > tbody > tr > td:first-child::before, #content table:not(.xd-keep) > tbody > tr > td[data-label=""]::before { display: none; }
  #content table:not(.xd-keep) > tbody > tr > td[data-label=""] { justify-content: flex-end; }
  #content table:not(.xd-keep) > tbody > tr > td:empty { display: none; }
  #content table:not(.xd-keep) > tfoot { display: block; }
  .pay-slip table, .pay-slip table * { display: revert !important; }
  .pay-slip td::before { display: none !important; }
  /* dialogs as bottom sheets */
  .m-overlay { align-items: flex-end !important; padding: 0 !important; }
  .m-dialog { width: 100% !important; max-width: none !important; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0 !important; padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important; }
  .bell-panel { position: fixed !important; left: 10px !important; right: 10px !important; top: calc(60px + env(safe-area-inset-top)) !important; width: auto !important; max-height: 70vh; }
}
.xd-demo-link { display: block; margin-top: 18px; text-align: center; font-size: 13px; color: var(--t2); }
