:root{
  --bg:#f5f7fb;--panel:#fff;--text:#182033;--muted:#667085;--line:#d8dee8;--dark:#1f2937;
  --accent:#f6c90e;--accent2:#24314d;--ok:#18794e;--okbg:#e9f8ef;--bad:#b42318;--badbg:#fff0ee;--warn:#9a6700;--warnbg:#fff7d6;
  --shadow:0 10px 30px rgba(18,38,63,.08);--radius:16px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
a{color:inherit;text-decoration:none}
.topbar{height:72px;background:#fff;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;padding:0 24px;gap:24px;position:sticky;top:0;z-index:20}
.brand img{display:block;width:205px;max-height:52px;object-fit:contain;object-position:left center}.topbar-title{font-size:18px;font-weight:750;margin-left:auto;color:#344054}
.page-shell{max-width:1600px;margin:0 auto;padding:28px 22px 48px}
.card{background:var(--panel);border:1px solid #e5e7eb;border-radius:var(--radius);box-shadow:var(--shadow);padding:24px}
.login-card{max-width:430px;margin:7vh auto 0}.login-card h1{font-size:26px;margin:0 0 8px}.login-card p{margin:0 0 22px;color:var(--muted)}
label{display:block;font-size:13px;font-weight:700;margin:0 0 7px;color:#344054}
.input,input[type=password].input,input[type=text].input,input[type=email].input,input[type=number].input,select.input{width:100%;max-width:100%;min-width:0;height:43px;border:1px solid #cfd6df;border-radius:10px;background:#fff;padding:0 12px;font:inherit;color:var(--text);outline:none}
.input:focus{border-color:#8ca0bf;box-shadow:0 0 0 3px rgba(38,72,120,.09)}
.form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.form-row.three{grid-template-columns:repeat(3,minmax(0,1fr))}.form-group{margin-bottom:16px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:10px;padding:9px 15px;min-height:40px;font-weight:750;font-size:14px;cursor:pointer;background:#e9edf3;color:#24314d;white-space:nowrap}
.btn:hover{filter:brightness(.98)}.btn-primary{background:var(--accent2);color:#fff}.btn-yellow{background:var(--accent);color:#111827}.btn-success{background:#16794c;color:#fff}.btn-danger{background:#b42318;color:#fff}.btn-ghost{background:#fff;border:1px solid #d0d5dd}.btn-sm{min-height:34px;padding:7px 11px;font-size:13px}.btn[disabled]{opacity:.55;cursor:not-allowed}
.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.actions.right{justify-content:flex-end}.compact-actions .btn{width:84px;padding-left:10px;padding-right:10px}
.page-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}.page-head h1{font-size:27px;margin:0 0 5px}.page-head p{margin:0;color:var(--muted)}
.breadcrumbs{display:flex;gap:8px;color:var(--muted);font-size:13px;margin-bottom:12px}.breadcrumbs a:hover{text-decoration:underline}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.company-card{background:#fff;border:1px solid #e1e6ef;border-radius:14px;padding:18px;box-shadow:0 4px 16px rgba(18,38,63,.05);transition:.15s}.company-card:hover{transform:translateY(-1px);box-shadow:var(--shadow)}.company-card h3{margin:0 0 8px;font-size:18px}.company-card .meta{color:var(--muted);font-size:13px}
.tile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;max-width:900px}.big-tile{padding:26px;background:#fff;border:1px solid #e1e6ef;border-radius:16px;box-shadow:var(--shadow);min-height:155px;display:flex;flex-direction:column;justify-content:space-between}.big-tile .icon{font-size:31px}.big-tile h2{margin:14px 0 5px;font-size:21px}.big-tile p{margin:0;color:var(--muted)}
.pending-work-card{display:flex;align-items:center;justify-content:space-between;gap:18px;background:#fff;border:1px solid #e5c94e;border-radius:14px;padding:17px 20px;margin-bottom:18px;box-shadow:0 4px 16px rgba(18,38,63,.05)}.pending-work-card strong{display:block;font-size:18px;margin-bottom:3px}.pending-work-card small{color:var(--muted)}.pending-count{min-width:48px;height:40px;border-radius:999px;background:var(--accent);display:inline-flex;align-items:center;justify-content:center;font-weight:850;font-size:18px}
.toolbar{display:flex;gap:10px;align-items:center;justify-content:space-between;margin:0 0 14px;flex-wrap:wrap}.notice{border-radius:10px;padding:11px 13px;margin-bottom:14px;font-size:14px}.notice.success{background:var(--okbg);color:var(--ok)}.notice.error{background:var(--badbg);color:var(--bad)}.notice.warning{background:var(--warnbg);color:var(--warn)}
.table-list{width:100%;border-collapse:collapse}.table-list th,.table-list td{padding:13px 12px;border-bottom:1px solid #e8ebf0;text-align:left}.table-list th{font-size:12px;color:#667085;text-transform:uppercase;letter-spacing:.04em}.table-list tr:hover td{background:#fbfcfe}
.status{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:800}.status.pending{background:var(--warnbg);color:var(--warn)}.status.approved{background:var(--okbg);color:var(--ok)}.status.denied{background:var(--badbg);color:var(--bad)}
.period-head{background:#fff;border:1px solid #e1e6ef;border-radius:14px;padding:14px 16px;margin-bottom:12px;display:grid;grid-template-columns:1.25fr minmax(0,.8fr) minmax(0,.8fr);gap:12px;align-items:end;overflow:hidden}.period-head>div{min-width:0}.period-head .business{font-size:18px;font-weight:800;padding-bottom:8px}.period-head input{height:40px;width:100%;max-width:100%;min-width:0}
.autosave{font-size:12px;color:var(--muted);min-width:80px;text-align:right}
.view-switch{display:flex;align-items:center;gap:5px;margin:8px 0 10px;justify-content:flex-end}.view-switch>span{font-size:12px;color:var(--muted);font-weight:700;margin-right:3px}.view-choice{border:1px solid #d0d5dd;background:#fff;color:#344054;border-radius:8px;padding:6px 10px;font-weight:750;font-size:12px;cursor:pointer}.view-choice.active{background:#24314d;color:#fff;border-color:#24314d}
.sheet-wrap{overflow:auto;background:#fff;border:1px solid #cfd4dc;border-radius:6px;box-shadow:0 4px 18px rgba(16,24,40,.05);-webkit-overflow-scrolling:touch}
.payroll-sheet{border-collapse:collapse;table-layout:fixed;font-family:Arial,sans-serif;font-size:12px}.payroll-sheet th,.payroll-sheet td{border:1px solid #222;padding:0;text-align:center;height:38px;overflow:hidden}.payroll-sheet thead th{background:#c3c3c3;font-weight:800;color:#050505;line-height:1.05;padding:5px 3px;white-space:normal;overflow-wrap:anywhere}.payroll-sheet thead .group-row th{height:30px;font-size:14px}.payroll-sheet .rownum{padding:0 1px;font-variant-numeric:tabular-nums;font-weight:700}.employee-id-display{display:block;text-align:center;white-space:nowrap}
.payroll-sheet td input,.payroll-sheet td select{width:100%;height:37px;border:0;border-radius:0;padding:4px 6px;background:transparent;font:inherit;color:#111;outline:none;min-width:0}.payroll-sheet td input{text-align:right}.payroll-sheet td[data-label="Last Name"] input,.payroll-sheet td[data-label="First Name"] input,.payroll-sheet td[data-label="Middle Name"] input,.payroll-sheet td[data-label="SSN"] input{text-align:left}.payroll-sheet td input:focus,.payroll-sheet td select:focus{box-shadow:inset 0 0 0 2px #5b8def;background:#f9fbff}
.payroll-sheet td.formula{background:#f0f3f7}.payroll-sheet td.formula input{font-weight:700;color:#28364e}.payroll-sheet .status-cell select,.payroll-sheet .pay-type-cell select,.payroll-sheet .payment-method-cell select{height:37px;text-align:center;padding:0 3px;font-size:11px}.payroll-sheet .employee-status-label,.payroll-sheet .pay-type-label,.payroll-sheet .payment-method-label{display:flex;align-items:center;justify-content:center;height:37px;font-size:11px;font-weight:700;padding:0 2px}.payroll-sheet .employee-status-label.terminated{color:#555}
.payroll-sheet .withholding-cell{position:relative}.withholding-stack{display:grid;grid-template-rows:18px 19px;height:37px}.payroll-sheet .withholding-cell select{height:18px;font-size:10px;color:#5f6b7d;text-align:center;padding:0 2px;border:0;border-bottom:1px dashed #aeb6c2;background:transparent}.payroll-sheet .withholding-cell input{height:19px;padding:1px 5px;text-align:center;font-weight:700}.withholding-type-readonly{height:18px;display:flex;align-items:center;justify-content:center;font-size:10px;color:#667085;border-bottom:1px dashed #aeb6c2}
.payroll-sheet .fica-cell{cursor:default}.payroll-sheet .fica-rate{display:flex;align-items:center;justify-content:center;height:37px;font-weight:800;color:#28364e}.payroll-sheet .cell-locked{background:#292929!important}.payroll-sheet .cell-locked input{background:#292929!important;color:#7e8793!important;-webkit-text-fill-color:#7e8793!important;cursor:not-allowed}.payroll-sheet .salary-overtime input::placeholder{color:#7b8594;opacity:1}
.payroll-sheet tr.employee-terminated td{background:#dedede}.payroll-sheet tr.employee-terminated td.formula{background:#d3d6da}.payroll-sheet tr.employee-terminated td input,.payroll-sheet tr.employee-terminated td select{color:#666;-webkit-text-fill-color:#666}.payroll-sheet tr.employee-terminated td.cell-locked,.payroll-sheet tr.employee-terminated td.cell-locked input{background:#292929!important;color:#858b93!important;-webkit-text-fill-color:#858b93!important}.payroll-sheet input:disabled,.payroll-sheet select:disabled{opacity:1}
.payroll-sheet td.rate-changed{background:#ffe4e1!important;box-shadow:inset 0 0 0 2px #d92d20}.payroll-sheet td.rate-changed input{color:#b42318!important;-webkit-text-fill-color:#b42318!important;font-weight:850}.rate-change-legend{display:inline-flex;align-items:center;gap:7px;color:#9d241a;font-size:12px;font-weight:700;margin:2px 0 10px}.rate-change-dot{width:13px;height:13px;border-radius:3px;background:#ffe4e1;border:2px solid #d92d20}
.sheet-note{margin:10px 0 0;color:#667085;font-size:12px}.summary-strip{display:flex;gap:16px;flex-wrap:wrap;background:#fff;border:1px solid #e1e6ef;border-radius:12px;padding:12px 14px;margin-top:12px}.summary-strip b{font-variant-numeric:tabular-nums}
.modal-backdrop{display:none;position:fixed;inset:0;background:rgba(10,18,30,.48);z-index:100;align-items:center;justify-content:center;padding:20px}.modal-backdrop.open{display:flex}.modal{background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.25);width:min(520px,100%);padding:22px}.modal h2{margin:0 0 16px}.divider{height:1px;background:#e5e7eb;margin:20px 0}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.muted{color:var(--muted)}.small{font-size:12px}.danger-zone{border:1px solid #f1b9b5;background:#fff8f7}.client-home{max-width:1600px;margin:25px auto}.client-company{font-size:14px;color:var(--muted);margin-bottom:12px}.history-empty{padding:34px;text-align:center;color:var(--muted)}.status-box{background:#fff;border:1px solid #e1e6ef;border-radius:14px;padding:16px;margin-top:16px}.status-box h3{margin:0 0 10px}.status-controls{display:flex;gap:10px;flex-wrap:wrap}.field-help{font-size:11px;color:#7a8699;margin-top:5px}.hidden{display:none!important}
/* Admin column width editor: table width is always the sum of column widths, so resizing one column never stretches another. */
.layout-editor-wrap{overflow:auto}.payroll-sheet[data-layout-editor="1"] th[data-col-key]{position:relative;overflow:visible}.col-resizer{position:absolute;right:-5px;top:0;width:10px;height:100%;cursor:col-resize;z-index:5;touch-action:none}.col-resizer::after{content:"";position:absolute;left:4px;top:4px;bottom:4px;width:2px;background:rgba(36,49,77,.35)}.payroll-sheet[data-layout-editor="1"] th[data-col-key]:hover .col-resizer::after{background:#24314d}.layout-hint{background:#fff7d6;border:1px solid #efd77d;padding:11px 13px;border-radius:10px;margin-bottom:12px;color:#6f5600;font-size:13px}
/* Manual mobile payroll-card view. JS also activates this automatically on small screens unless Desktop is chosen. */
.payroll-sheet.mobile-view{display:block!important;width:100%!important;min-width:0!important;font-size:15px}.payroll-sheet.mobile-view colgroup,.payroll-sheet.mobile-view thead{display:none}.payroll-sheet.mobile-view tbody{display:block}.payroll-sheet.mobile-view tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;background:#fff;border:1px solid #cfd4dc;border-radius:12px;margin-bottom:14px;overflow:hidden;box-shadow:0 3px 12px rgba(16,24,40,.05)}.payroll-sheet.mobile-view tbody tr.employee-terminated{background:#e3e3e3}.payroll-sheet.mobile-view tbody td{display:block;height:auto;min-height:70px;border:0;border-bottom:1px solid #e5e7eb;border-right:1px solid #e5e7eb;padding:25px 8px 7px;position:relative;overflow:visible}.payroll-sheet.mobile-view tbody td:nth-child(even){border-right:0}.payroll-sheet.mobile-view tbody td::before{content:attr(data-label);position:absolute;top:6px;left:8px;right:6px;font-size:12px;line-height:1.05;text-transform:uppercase;letter-spacing:.015em;color:#5d6879;font-weight:850;text-align:left}.payroll-sheet.mobile-view tbody td.rownum{grid-column:1/2;min-height:57px;padding-top:25px}.payroll-sheet.mobile-view tbody td.payment-method-cell{grid-column:2/3;min-height:57px;padding-top:20px}.payroll-sheet.mobile-view tbody td.status-cell{grid-column:1/-1;min-height:61px;padding-top:22px}.payroll-sheet.mobile-view tbody td input,.payroll-sheet.mobile-view tbody td select{height:40px;font-size:17px;padding:3px 5px}.payroll-sheet.mobile-view tbody td input{text-align:right}.payroll-sheet.mobile-view .status-cell select,.payroll-sheet.mobile-view .pay-type-cell select,.payroll-sheet.mobile-view .payment-method-cell select{height:40px;font-size:16px}.payroll-sheet.mobile-view .employee-status-label,.payroll-sheet.mobile-view .pay-type-label,.payroll-sheet.mobile-view .payment-method-label,.payroll-sheet.mobile-view .fica-rate{height:40px;font-size:16px}.payroll-sheet.mobile-view .withholding-cell{grid-column:1/-1}.payroll-sheet.mobile-view .withholding-stack{grid-template-columns:1fr 1fr;grid-template-rows:40px;height:40px;gap:7px}.payroll-sheet.mobile-view .withholding-cell select,.payroll-sheet.mobile-view .withholding-cell input,.payroll-sheet.mobile-view .withholding-type-readonly{height:40px;border:1px solid #d7dce4!important;border-radius:7px!important;font-size:16px}.payroll-sheet.mobile-view .cell-locked{min-height:70px}.payroll-sheet.mobile-view .formula{background:#f4f6f8!important}.payroll-sheet.mobile-view tr.employee-terminated td.formula{background:#d7d9dd!important}.payroll-sheet.mobile-view td.rate-changed{background:#ffe4e1!important}
@media(max-width:900px){.grid{grid-template-columns:1fr 1fr}.form-row,.form-row.three,.settings-grid{grid-template-columns:1fr}.period-head{grid-template-columns:1fr 1fr}.period-head .business{grid-column:1/-1}.page-shell{padding-left:14px;padding-right:14px}.topbar{padding:0 14px}.brand img{width:175px}.page-head{align-items:stretch}.page-head .actions{justify-content:flex-start}}
@media(max-width:640px){
  body{font-size:16px}.topbar{height:62px}.brand img{width:155px}.topbar-title{display:none}.page-shell{padding:16px 10px 34px}.page-head{display:block}.page-head h1{font-size:25px}.page-head p{font-size:15px}.page-head .actions{margin-top:12px}.page-head .actions .btn{flex:1;min-width:88px}.period-head{grid-template-columns:minmax(0,1fr);padding:12px;gap:10px}.period-head .business{grid-column:auto;font-size:17px}.period-head label{font-size:14px}.period-head .input{font-size:16px;min-width:0;max-width:100%;width:100%}.tile-grid,.grid{grid-template-columns:1fr}.card{padding:16px}.summary-strip{position:sticky;bottom:0;z-index:15;box-shadow:0 -5px 18px rgba(16,24,40,.08);font-size:14px}.sheet-note{font-size:13px;line-height:1.45}.view-switch{justify-content:flex-start}.view-choice{font-size:13px;padding:7px 11px}.table-list th,.table-list td{padding:11px 8px}.pending-work-card{padding:14px 15px}.compact-actions .btn{width:auto}
}
