/* TaxAlpha PH's own pieces, on top of TaxDAT's style.css + future.css (the Future look). Colours come from the shared tokens. */

/* the mark: TaxDAT's height (40 px, the same 176-unit box), wider for the pointed right side */
.tdmark.tc{width:auto;aspect-ratio:214/176}
.tdlock .appname{font-size:24px}
/* Sign out in the menu links' colour (as Audit log), not TaxDAT's yellow */
.topbar nav .tcol a#signout{color:var(--ink2)}
.topbar nav .tcol a#signout:hover{color:var(--ink)}

/* The whole screen: no page width cap */
.wrap{max-width:none}

/* Scrollbars as Knewmer0's (owner 11/20/2026): a thin faint line while the cursor is elsewhere, wider only on the scrolling
   box nearest the cursor (.sb-on, set by app.js), no arrow buttons. The thumb is drawn inside a transparent border, so only
   its look changes, never the layout. Never set scrollbar-width / scrollbar-color outside the Firefox fallback: Chrome would
   then ignore these rules. */
::-webkit-scrollbar{width:10px;height:10px;background:transparent}
::-webkit-scrollbar-button{display:none;width:0;height:0}
::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background:transparent}
::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ink2) 35%,transparent);background-clip:padding-box;border:4px solid transparent;border-radius:10px;min-height:28px}
.sb-on::-webkit-scrollbar-thumb{background-color:color-mix(in srgb,var(--ink2) 60%,transparent);border-width:2px}
::-webkit-scrollbar-thumb:hover,::-webkit-scrollbar-thumb:active{background-color:var(--ink2);border-width:1px}
@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ink2) 50%,transparent) transparent}}

/* The page itself never scrolls (owner 11/20/2026): the top bar, each page's heading and its search / filter / question
   boxes stay where they are; only the page's list or content (`.scrollarea`, one per page) scrolls, with its own
   scrollbar. Sign-in screens scroll as before, and so do phones and small windows (under 900 x 600), where the top
   bar and headings would leave the list no room. */
@media screen and (min-width:900px) and (min-height:600px){
body:has(#main){height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
body:has(#main) #root{flex:1;min-height:0}
body:has(#main) .wrap{height:100%;box-sizing:border-box;display:flex;flex-direction:column;padding-bottom:12px}
body:has(#main) .topbar{position:relative;top:0;flex:none}
body:has(#main) #main{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
#main>*{flex:none}
#main>.scrollarea{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;
  margin-right:-14px;padding-right:12px;margin-bottom:0}          /* the scrollbar sits just outside the content's edge */
#main>.scrollarea>:last-child{margin-bottom:8px}
/* Table pages (Users, Audit log), as Knewmer0's tables: the table's own box scrolls, its scrollbar on
   the table, and the column headings stay at the top while the rows move under them */
#main>.scrollarea:has(>.panel>.tablewrap){display:flex;flex-direction:column;overflow:hidden;margin-right:0;padding-right:0}
#main>.scrollarea>.panel:has(>.tablewrap){flex:0 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden;margin-bottom:0}
#main>.scrollarea>.panel>.tablewrap{flex:0 1 auto;min-height:0;overflow:auto}
#main>.scrollarea>.panel>.tablewrap>table>thead th{position:sticky;top:0;z-index:2}
}

/* ================= Screens (Task 11): sidebar, client/year picker, grids ================= */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.picker{display:flex;gap:8px;align-items:center;flex:1 1 280px;max-width:420px;min-width:0}
.picker select{flex:1 1 auto;min-width:0}
.picker input{flex:0 0 92px;width:92px}

/* the sidebar: a column beside the page on wide screens, a strip across the top on narrow ones */
.shell{display:flex;gap:18px;align-items:flex-start;min-width:0}
.side{flex:none;width:190px;display:flex;flex-direction:column;gap:2px;padding:6px 0}
.side h4{margin:14px 10px 4px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink2)}
.side h4:first-child{margin-top:2px}
.side a{color:var(--ink2);text-decoration:none;font-weight:600;padding:8px 12px;border-radius:var(--r-sm,10px);white-space:nowrap}
.side a:hover{color:var(--ink);background:var(--hover,var(--accent-soft))}
.side a.on{color:var(--ink);background:var(--accent-soft);box-shadow:inset 3px 0 0 var(--accent)}
#main{flex:1 1 auto;min-width:0}
@media (max-width:899px){
  .shell{flex-direction:column;gap:10px;align-items:stretch}
  .side{width:auto;flex-direction:row;align-items:center;overflow-x:auto;gap:4px;padding:0 0 6px;border-bottom:1px solid var(--line)}
  .side h4{margin:0 4px 0 8px;flex:none}
  .side h4:first-child{margin-left:0}
}
@media screen and (min-width:900px) and (min-height:600px){
  body:has(#main) .shell{flex:1;min-height:0;align-items:stretch}
  body:has(#main) .side{overflow-y:auto}
}

/* page heading with its buttons */
.pghead{display:flex;flex-wrap:wrap;gap:8px 16px;justify-content:space-between;align-items:flex-start;margin-bottom:12px}
.pghead .sub{margin:0;max-width:70ch}
.pghead h1{margin:0 0 4px}
.filt{margin-bottom:10px;gap:10px}
.filt .segs{display:inline-flex;margin:0;flex:none}
.filt .segs button{flex:none;padding:7px 14px}
.filt input[type=search]{width:260px;max-width:100%}
.gnote{margin:0 0 10px}

/* tables as a panel */
.panel.tp{padding:0}
.tp>.tablewrap{border:0;border-radius:var(--r,12px)}
table.list td.n,table.list th.n,table.g td.n,table.g th.n{text-align:right;font-variant-numeric:tabular-nums}
table.list tfoot td,table.g tfoot td{font-weight:700;border-top:2px solid var(--line);padding:10px 12px;font-variant-numeric:tabular-nums;white-space:nowrap}
table.list tfoot td.n{text-align:right}
table.list td{white-space:nowrap}
table.list td .chip{white-space:nowrap}
.chip.ok{background:color-mix(in srgb,var(--accent) 18%,var(--panel));color:var(--accent)}
.chip.info{background:var(--accent-soft);color:var(--blue)}
.gapbad,.badtxt{color:var(--bad);font-weight:700}
input.bad{border-color:var(--bad)!important;background:var(--bad-bg)!important}
.plist{max-height:260px;overflow:auto;margin:6px 0 0;padding-left:20px}

/* the payroll grid: the employee column stays while the rest scrolls sideways inside its own box */
table.gridtab{width:auto;min-width:100%}
table.gridtab th,table.gridtab td{white-space:nowrap}
table.gridtab td input{width:116px;text-align:right}
table.gridtab td.nm,table.gridtab th.sticky,table.gridtab tfoot td.sticky{min-width:190px;max-width:260px;overflow:hidden;text-overflow:ellipsis}
table.gridtab td.sticky,table.gridtab th.sticky{position:sticky;left:0;z-index:1;background:var(--panel)}
table.gridtab thead th.sticky{z-index:4;background:var(--surface2,var(--chip))}
table.gridtab td.nm a{font-weight:600;text-decoration:none}
table.gridtab .dm{display:none}
table.gridtab.dm-open .dm{display:table-cell}
table.gridtab.dm-open .dmsum{display:none}
table.gridtab td.dmsum{color:var(--ink2)}
table.gridtab .linkbtn{text-transform:none;letter-spacing:0;font-size:12px}
table.gridtab td input[readonly]{color:var(--ink2)}
table.rectab td input.retin,table.setuptab td input,table.setuptab td select{width:140px;text-align:right}
table.setuptab td input[type=date],table.setuptab td input[data-f=region],table.setuptab td input[data-f=item],table.setuptab td select{text-align:left}

/* forms and previews */
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
@media (max-width:560px){.row3{grid-template-columns:1fr}}
.dialog.wide .row3{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
fieldset.ticks{border:1px solid var(--line);padding:8px 12px 12px}
fieldset.ticks legend{font-size:12px;font-weight:600;color:var(--ink2);padding:0 6px}
.staffbox{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow:auto}
details.prevbox{border:1px solid var(--line);border-radius:var(--r-sm,10px);padding:8px 12px}
details.prevbox summary{cursor:pointer;font-weight:600;color:var(--ink2)}
.pv{margin-top:12px;display:flex;flex-direction:column;gap:10px}
.pv .tablewrap.pvt{max-height:220px}
.pvs,.pvh{margin:0}
.kv{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.kv>div{display:flex;flex-direction:column;gap:2px}
.kv span{font-size:12px;color:var(--ink2)}
.kv b{font-size:18px;font-variant-numeric:tabular-nums}
.kv small{color:var(--ink2);font-size:12px}
.shouldbe{margin-top:12px;flex:none}
.outgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr));gap:16px;align-content:start}
.outgrid>.panel{display:flex;flex-direction:column;min-width:0}
details.needs summary{cursor:pointer;list-style:none}
details.needs .problems{margin-top:8px}
@media screen and (min-width:900px) and (min-height:600px){
  #main>.scrollarea.outgrid{display:grid}
  #main>.scrollarea>.shouldbe{margin-top:12px}
}
@media (max-width:899px){
  .picker{max-width:none;flex-basis:100%}
  .pghead .bar{width:100%}
}
table.gridtab td input{border-color:var(--line2)}
@media (max-width:640px){table.gridtab td.nm,table.gridtab th.sticky,table.gridtab tfoot td.sticky{min-width:130px;max-width:150px}}
