
.v162-help{margin:-2px 0 12px;color:var(--muted)}
.v162-table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:14px}
.v162-wide-table{min-width:920px;width:100%}
.v162-finance-kpis{margin-bottom:14px}
.v162-row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.v162-row-actions select{min-width:125px}
.v162-money{direction:ltr;display:inline-block;white-space:nowrap}
.v162-modal{position:fixed;inset:0;z-index:15000;display:flex;align-items:center;justify-content:center;padding:20px}
.v162-modal.hidden{display:none!important}
.v162-modal-backdrop{position:absolute;inset:0;background:rgba(17,33,47,.48);backdrop-filter:blur(5px)}
.v162-modal-panel{position:relative;width:min(720px,100%);max-height:min(88vh,840px);overflow:auto;background:rgba(255,255,255,.98);border:1px solid rgba(255,255,255,.8);border-radius:24px;padding:20px;box-shadow:0 30px 80px rgba(20,37,54,.24);direction:rtl}
.v162-modal-panel h2{margin:0 0 4px}
.v162-modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}
.v162-modal-grid .full{grid-column:1/-1}
.v162-field{display:flex;flex-direction:column;gap:6px}
.v162-field label{font-size:12px;color:var(--muted);font-weight:700}
.v162-field input,.v162-field select,.v162-field textarea{width:100%;box-sizing:border-box}
.v162-field textarea{min-height:100px;resize:vertical}
.v162-modal-actions{display:flex;gap:8px;justify-content:flex-start;flex-wrap:wrap;margin-top:18px;padding-top:14px;border-top:1px solid rgba(80,96,110,.14)}
.v162-meta-box{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.v162-meta-box>div{background:rgba(238,244,248,.72);border-radius:12px;padding:10px}
.v162-meta-box span{display:block;font-size:11px;color:var(--muted);margin-bottom:3px}
.v162-meta-box b{font-size:13px}
@media(max-width:980px){.v162-finance-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.v162-wide-table{min-width:820px}}
@media(max-width:680px){.v162-modal{padding:8px}.v162-modal-panel{padding:15px;border-radius:18px}.v162-modal-grid,.v162-meta-box{grid-template-columns:1fr}.v162-finance-kpis{grid-template-columns:1fr 1fr}.v162-wide-table{min-width:760px}}

/* v16.2.4 finance layout hardening */
#petty{max-width:1600px;margin-inline:auto}
#petty>.card{margin-bottom:14px}
#petty .v162-table-wrap{
  border:1px solid rgba(148,163,184,.14);
  background:rgba(255,255,255,.20);
}
#petty .v162-wide-table{min-width:1080px}
#petty .v162-wide-table th{white-space:nowrap;font-size:12px}
#petty .v162-wide-table td{font-size:12px}
.v164-attachment-btn{padding:6px 9px!important;font-size:11px!important;white-space:nowrap}
.v164-file-note{font-size:11px;color:var(--muted);margin-top:4px}
@media(max-width:1250px){
  #petty .v162-finance-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:620px){
  #petty{max-width:none}
  #petty .v162-finance-kpis{grid-template-columns:1fr!important}
  #petty .v162-wide-table{min-width:980px}
}
/* Task state is reinforced by the existing text status, so color is supplemental. */
#taskTable tbody tr.task-state-complete>td{background:rgba(34,197,94,.22)}
#taskTable tbody tr.task-state-progress>td{background:rgba(59,130,246,.18)}
#taskTable tbody tr.task-state-waiting>td{background:rgba(245,158,11,.20)}
#taskTable tbody tr.task-state-late>td{background:rgba(239,68,68,.20)}
#taskTable tbody tr.task-state-new>td{background:rgba(148,163,184,.10)}
#taskTable tbody tr.task-state-hold>td{background:rgba(139,92,246,.16)}
html[data-theme="dark"] #taskTable tbody tr.task-state-complete>td{background:rgba(34,197,94,.24)}
html[data-theme="dark"] #taskTable tbody tr.task-state-progress>td{background:rgba(59,130,246,.22)}
html[data-theme="dark"] #taskTable tbody tr.task-state-waiting>td{background:rgba(245,158,11,.22)}
html[data-theme="dark"] #taskTable tbody tr.task-state-late>td{background:rgba(239,68,68,.22)}
html[data-theme="dark"] #taskTable tbody tr.task-state-hold>td{background:rgba(167,139,250,.20)}
.badge.hold{background:rgba(139,92,246,.14);color:#6d28d9}
html[data-theme="dark"] .badge.hold{background:rgba(167,139,250,.20);color:#ddd6fe}
.task-comment-action{display:inline-flex;align-items:center;gap:5px}
.task-comment-action svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.task-recurrence-tag{display:inline-block;margin-top:3px;padding:2px 7px;border-radius:8px;background:rgba(59,130,246,.12);font-size:10px}
.v15-permission-category{grid-column:1/-1;margin:8px 0 0;font-size:12px;color:var(--corp)}
#v15PermissionSearch{width:100%;margin:10px 0}
#v162InvoiceImageFields input[type="file"]{margin-top:8px}

/* Reflow the health panels according to their own width, including when the
   sidebar or report layout makes the panel narrower than the viewport. */
#dashboard .health-glass{container:sector-health / inline-size}
#ceooverview{container:ceo-health / inline-size}
#execHealthPage{container:exec-health / inline-size}
@container sector-health (max-width: 900px){
  .health-layout{grid-template-columns:minmax(0,1fr)!important}
  .health-main,.health-mini-grid{grid-column:1!important}
}
@container sector-health (max-width: 610px){
  .health-mini-grid{grid-template-columns:minmax(0,1fr)!important}
}
@container ceo-health (max-width: 900px){
  .ceo-health-panel{grid-template-columns:minmax(0,1fr)!important}
  .ceo-health-main{flex-direction:column!important;text-align:center!important}
  .ceo-health-main .health-ring{flex:0 0 160px!important;width:160px!important;height:160px!important;aspect-ratio:1}
  .ceo-ring-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@container ceo-health (max-width: 500px){
  .ceo-ring-grid{grid-template-columns:minmax(0,1fr)!important}
}
@container exec-health (max-width: 900px){
  .exec-health-hero{grid-template-columns:minmax(0,1fr)!important}
  .exec-glass-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@container exec-health (max-width: 500px){
  .exec-glass-metrics{grid-template-columns:minmax(0,1fr)!important}
}
.health-layout,.health-mini-grid,.health-main,.health-mini,
.ceo-health-panel,.ceo-health-main,.ceo-ring-grid,.ceo-ring-card,
.exec-health-hero,.exec-glass-metrics,.exec-glass-metric{min-width:0}
.mini-ring .mini-ring-text{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;display:grid!important;place-items:center!important}

.task-date-field{display:grid;gap:4px;min-width:0}
.task-date-field small{font-size:10px;color:var(--muted);line-height:1.4}
.task-date-button{width:100%;min-height:41px;text-align:right;padding:9px 12px;border:1px solid rgba(148,163,184,.35);border-radius:12px;background:rgba(255,255,255,.72);color:var(--text);font:inherit;cursor:pointer}
.task-date-button:focus-visible,.task-date-day:focus-visible{outline:3px solid #2563eb;outline-offset:2px}
.task-date-dialog{width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:18px;border:1px solid rgba(148,163,184,.3);border-radius:22px;background:#f8fafc;color:#172638;box-shadow:0 26px 80px rgba(15,23,42,.28);direction:rtl}
.task-date-dialog::backdrop{background:rgba(15,23,42,.5);backdrop-filter:blur(3px)}
.task-date-dialog-head,.task-date-month-row,.task-date-dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.task-date-dialog-head h2{margin:0;font-size:17px}
.task-date-month-row{margin:14px 0 10px}
.task-date-weekdays,.task-date-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;text-align:center}
.task-date-weekdays span{font-size:10px;font-weight:700;color:#475569;overflow:hidden;text-overflow:clip}
.task-date-day{aspect-ratio:1;min-width:0;border:1px solid transparent;border-radius:10px;background:rgba(255,255,255,.82);color:#172638;font:inherit;font-size:13px;cursor:pointer}
.task-date-day:hover:not(:disabled){background:#dbeafe}
.task-date-day.today{border-color:#2563eb}
.task-date-day.selected{background:#1d4ed8;color:#fff}
.task-date-day.task-date-off{color:#94a3b8;background:rgba(148,163,184,.1);cursor:not-allowed}
.task-date-dialog-help{margin:12px 0;font-size:11px;line-height:1.65;color:#64748b}
.task-date-dialog-actions{justify-content:flex-start;flex-wrap:wrap}
html[data-theme="dark"] .task-date-button{background:rgba(255,255,255,.06);color:var(--text)}
html[data-theme="dark"] .task-date-dialog{background:#172635;color:#f8fafc}
html[data-theme="dark"] .task-date-day{background:#233445;color:#f8fafc}
html[data-theme="dark"] .task-date-day.selected{background:#2563eb}
html[data-theme="dark"] .task-date-day.task-date-off{background:#1d2d3b;color:#8190a0}
