/*
  Pay Runs (Sales Associate commissions)
  - Date range filters with click-to-open date picker (handled in JS)
  - Month accordion with employee sub-accordions
  - Detailed tables: Funded, Chargebacks, Loaded/Not Paid
*/

.pr-filters {
  padding: 16px;
}

.pr-filter-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.pr-filter-row-2 {
  margin-top: 10px;
}

.pr-date-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  cursor: pointer;
}

.pr-date-sep {
  font-size: 16px;
  line-height: 1;
  padding-bottom: 10px;
  color: rgba(0,0,0,.55);
}

.pr-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.pr-quick .label {
  font-size: 12px;
  color: rgba(0,0,0,.65);
}

.pr-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.pr-hint {
  margin-top: 10px;
}

.pr-status {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.pr-months {
  padding: 8px 16px 16px;
}

/* Month accordion */
.pr-month {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: #fff;
  margin-top: 12px;
  overflow: hidden;
}

.pr-month > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.pr-month > summary::-webkit-details-marker {
  display: none;
}

.pr-month-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pr-month-title .chev {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-size: 14px;
}

.pr-month[open] > summary .chev {
  transform: rotate(90deg);
}

.pr-month-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pr-pill {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  background: rgba(0,0,0,.03);
}

.pr-month-body {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(0,0,0,.06);
}

/* Employee accordion */
.pr-emp {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
  margin-top: 10px;
  overflow: hidden;
}

.pr-emp > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,.02);
}

.pr-emp > summary::-webkit-details-marker { display:none; }

.pr-emp-name {
  font-weight: 700;
}

.pr-emp-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pr-emp-body {
  padding: 10px 12px 12px;
}

.pr-subtitle {
  margin: 12px 0 6px;
  font-weight: 700;
  font-size: 14px;
}

.pr-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
}

.pr-table {
  width: 100%;
}

.pr-table th {
  white-space: nowrap;
}

.pr-amount {
  font-variant-numeric: tabular-nums;
}

.pr-amount.negative {
  color: #b42318;
}

.pr-amount.positive {
  color: #067647;
}

.pr-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.pr-impact-card {
  margin-top: 14px;
}

.pr-impact-list {
  display: grid;
  gap: 10px;
  padding: 12px 16px 16px;
}

.pr-impact-empty {
  padding: 8px 0;
}

.pr-impact-item {
  border: 1px solid rgba(248,113,113,.22);
  border-radius: 10px;
  background: rgba(255,247,237,.72);
  padding: 12px;
}

.pr-impact-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pr-impact-title {
  font-weight: 800;
}

.pr-impact-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(248,113,113,.34);
  background: rgba(254,226,226,.92);
  color: #b91c1c;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pr-impact-message {
  margin-top: 8px;
  color: #334155;
}

.pr-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 12px;
  margin-top: 10px;
  color: #475569;
  font-size: 12px;
}

@media (max-width: 700px) {
  .pr-date-sep { display: none; }
  .pr-date-wrap,
  .pr-quick { min-width: 100%; }
}
/* Harmonize payruns look with payouts */
.payouts-filters {
  padding: 16px;
}

.payouts-date-field label {
  font-size: 12px;
  color: rgba(0,0,0,.65);
  margin-bottom: 2px;
}

.payouts-date-input {
  width: 100%;
}

.payouts-export-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#prGraceBadge{padding:8px 10px;border:1px solid rgba(0,0,0,.08);border-radius:10px;background:rgba(0,0,0,.03)}

.pr-head-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
.pr-head-actions{display:flex;align-items:center;gap:10px}
.pr-history-card{margin-top:14px;overflow:hidden}
.pr-history-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 22px;border-bottom:1px solid rgba(15,23,42,.08);flex-wrap:wrap}
.pr-history-card .payouts-filter-row{
  display:grid !important;
  grid-template-columns:minmax(240px,2fr) minmax(130px,.7fr) minmax(150px,.8fr);
  gap:12px !important;
  align-items:end !important;
  margin:0 !important;
  padding:16px 22px 8px;
}
.pr-history-card .payouts-filter-row > div{min-width:0 !important;width:100%}
.pr-history-card .payouts-filter-row label{display:block;margin:0 0 6px;color:#526275;font-size:12px;font-weight:600}
.pr-history-card .payouts-filter-row .input{width:100%;min-height:44px}
.pr-history-list{padding:12px 22px 22px;display:flex;flex-direction:column;gap:12px}
.pr-history-item{border:1px solid rgba(0,0,0,.08);border-radius:12px;padding:12px;background:#fff}
.pr-history-item-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.pr-history-title{font-weight:700;margin-bottom:4px}
.pr-history-actions{display:flex;gap:8px;align-items:center}
.pr-pdf-btn{
  background:#D32F2F !important;
  border-color:#D32F2F !important;
  color:#fff !important;
  border-radius:999px;
  font-weight:800;
}
.pr-pdf-btn:hover:not(:disabled){
  background:#B71C1C !important;
  border-color:#B71C1C !important;
  color:#fff !important;
}
.pr-pdf-btn:disabled{opacity:.55;cursor:not-allowed}
.pr-processed-card,
.pr-bonus-card{margin-bottom:14px}
.pr-bonus-card{padding:0 !important;overflow:hidden}
.pr-bonus-summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:16px;
  cursor:pointer;
  list-style:none;
}
.pr-bonus-summary::-webkit-details-marker{display:none}
.pr-bonus-summary::marker{content:""}
.pr-bonus-body{padding:0 16px 16px;border-top:1px solid rgba(15,23,42,.08)}
.pr-bonus-chev{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  border-radius:999px;
  background:#f1f5f9;
  color:#334155;
  font-size:22px;
  line-height:1;
  transition:transform .18s ease, background .18s ease;
}
.pr-bonus-card[open] .pr-bonus-chev{transform:rotate(90deg);background:#e6fffb;color:#008f88}
.pr-bonus-grid{display:grid;grid-template-columns:repeat(12,1fr);gap:10px;align-items:end}
.pr-bonus-grid > div{min-width:0}
.pr-processed-actions{display:flex;gap:8px;flex-wrap:wrap}
.pr-payroll-status-cell{white-space:nowrap}
.pr-payroll-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:104px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  line-height:1;
}
.pr-payroll-status.is-created{background:#16a34a;border:1px solid #15803d;color:#fff}
.pr-payroll-status.is-pending{background:#facc15;border:1px solid #eab308;color:#111827}
@media (max-width: 900px){
  .pr-history-card .payouts-filter-row{grid-template-columns:1fr}
  .pr-bonus-grid > div{grid-column:span 12 !important}
}

/* [2026-08-27] Payroll page: the Employee Payroll PDF pill moved out of the filter
   card and onto the employee row, and selecting one Sales Associate now cues the
   month card the user has to open. */

.pr-emp-name-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.pr-emp-pdf-btn{
  border:1px solid rgba(185,28,28,.28);
  background:#b91c1c;
  color:#fff;
  font-weight:700;
  border-radius:999px;
  padding:.3rem .8rem;
  white-space:nowrap;
  line-height:1.2;
}
.pr-emp-pdf-btn:hover{ background:#991b1b; }
.pr-emp-pdf-btn:focus-visible{ outline:2px solid #b91c1c; outline-offset:2px; }

/* Month card cue: ring + soft pulse + an explicit "open this" hint, all of which
   disappear the moment the card is opened. */
.pr-month--cue{
  border:2px solid #0ea5a4 !important;
  border-radius:14px;
  box-shadow:0 0 0 4px rgba(14,165,164,.16);
  animation:prCuePulse 1.9s ease-in-out 3;
}
.pr-month--cue > summary{
  cursor:pointer;
  background:rgba(14,165,164,.06);
  border-radius:12px;
}
.pr-month--cue > summary .pr-emp-name::after{
  content:attr(data-cue-label);
  display:inline-block;
  margin-left:10px;
  padding:.16rem .55rem;
  border-radius:999px;
  background:#0ea5a4;
  color:#fff;
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.02em;
  vertical-align:middle;
}
.pr-month--cue > summary .chev{
  color:#0ea5a4;
  font-weight:900;
  animation:prCueNudge 1.1s ease-in-out infinite;
  display:inline-block;
}

@keyframes prCuePulse{
  0%,100%{ box-shadow:0 0 0 4px rgba(14,165,164,.16); }
  50%    { box-shadow:0 0 0 9px rgba(14,165,164,.05); }
}
@keyframes prCueNudge{
  0%,100%{ transform:translateX(0); }
  50%    { transform:translateX(3px); }
}
@media (prefers-reduced-motion: reduce){
  .pr-month--cue{ animation:none; }
  .pr-month--cue > summary .chev{ animation:none; }
}

.pr-advanced-btn{ margin-left:8px; }

/* [2026-08-27] Generic collapsible panel, mirroring .pr-bonus-card. Used on the
   pay run detail page so Diagnostics, Draft Payroll Controls and Processed
   Employees start collapsed instead of filling the screen. */
.pr-collapse-card{margin-bottom:14px;padding:0 !important;overflow:hidden}
.pr-collapse-summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:16px;
  cursor:pointer;
  list-style:none;
}
.pr-collapse-summary::-webkit-details-marker{display:none}
.pr-collapse-summary::marker{content:""}
.pr-collapse-summary:hover{background:rgba(15,23,42,.02)}
.pr-collapse-body{padding:0 16px 16px;border-top:1px solid rgba(15,23,42,.08)}
.pr-collapse-chev{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  flex:0 0 26px;
  border-radius:999px;
  background:#f1f5f9;
  color:#475569;
  font-size:1rem;
  transition:transform .15s ease, background .15s ease, color .15s ease;
}
.pr-collapse-card[open] .pr-collapse-chev{transform:rotate(90deg);background:#e6fffb;color:#008f88}
@media (prefers-reduced-motion: reduce){ .pr-collapse-chev{transition:none} }

/* [2026-08-27] Email recipients pill on the pay run detail hero. */
.pr-email-pill{ border-radius:999px; }
.pr-email-pill.is-active{ background:#0ea5a4; border-color:#0ea5a4; color:#fff; }
.pr-email-card{ border:1px solid rgba(14,165,164,.35) !important; }

/* [2026-08-27] The month cue hands off to the employee row once the month opens,
   so it stays obvious what to click next. */
.pr-emp--cue{
  border:2px solid #0ea5a4 !important;
  border-radius:12px;
  box-shadow:0 0 0 4px rgba(14,165,164,.16);
  animation:prCuePulse 1.9s ease-in-out 3;
}
.pr-emp--cue > summary{
  cursor:pointer;
  background:rgba(14,165,164,.06);
  border-radius:10px;
}
.pr-emp--cue > summary .pr-emp-name::after{
  content:attr(data-cue-label);
  display:inline-block;
  margin-left:10px;
  padding:.16rem .55rem;
  border-radius:999px;
  background:#0ea5a4;
  color:#fff;
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.02em;
  vertical-align:middle;
}
@media (prefers-reduced-motion: reduce){ .pr-emp--cue{ animation:none; } }

/* [2026-08-27] Start-here cue on the Sales Associate filter. Matches the month and
   employee row cues so the whole page reads as one guided path. */
.pr-field--cue{
  position:relative;
  padding:10px 12px;
  border-radius:12px;
  border:2px solid #0ea5a4;
  box-shadow:0 0 0 4px rgba(14,165,164,.14);
  background:rgba(14,165,164,.04);
  animation:prCuePulse 1.9s ease-in-out 3;
}
.pr-field--cue > label::after{
  content:attr(data-cue-label);
  display:inline-block;
  margin-left:8px;
  padding:.14rem .5rem;
  border-radius:999px;
  background:#0ea5a4;
  color:#fff;
  font-size:.66rem;
  font-weight:800;
  letter-spacing:.02em;
  vertical-align:middle;
}
@media (prefers-reduced-motion: reduce){ .pr-field--cue{ animation:none; } }

/* [2026-08-27] Payroll History cards. */
.ph-card{
  border:1px solid var(--border, rgba(15,23,42,.10));
  border-radius:14px;
  padding:0;
  margin-bottom:12px;
  overflow:hidden;
  background:#fff;
}
.ph-card-head{
  display:flex; justify-content:space-between; align-items:flex-start; gap:12px;
  padding:14px 16px; border-bottom:1px solid rgba(15,23,42,.07);
}
.ph-title{ font-weight:800; font-size:1.02rem; }
.ph-card-body{ padding:12px 16px; }
.ph-facts{ display:flex; flex-wrap:wrap; gap:18px; font-size:.9rem; }
.ph-approval{ margin-top:8px; }
.ph-card-foot{
  display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap;
  padding:12px 16px; background:rgba(15,23,42,.02); border-top:1px solid rgba(15,23,42,.07);
}
.ph-download{ background:#0ea5a4; border-color:#0ea5a4; color:#04211f; font-weight:700; border-radius:999px; }
.ph-download:hover{ background:#0b8b8a; }
.ph-pill{
  display:inline-block; padding:.22rem .68rem; border-radius:999px;
  font-size:.74rem; font-weight:800; letter-spacing:.02em;
  background:rgba(100,116,139,.14); color:#475569;
}
.ph-pill--ok{ background:rgba(4,120,87,.14); color:#047857; }
.ph-pill--warn{ background:rgba(180,83,9,.14); color:#b45309; }
.ph-pill--void{ background:rgba(185,28,28,.12); color:#b91c1c; }
.pr-history-btn{ margin-left:8px; }

/* [2026-08-27] Archive + permanent delete on Payroll History. The delete path is
   styled as a quiet ghost button until it is opened - it should be reachable, not
   inviting. */
.ph-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ph-check{ display:inline-flex; align-items:center; gap:7px; font-size:.88rem; cursor:pointer; }
.ph-check input{ width:15px; height:15px; }
.ph-card--archived{ opacity:.62; }
.ph-card--archived .ph-title{ text-decoration:line-through; text-decoration-thickness:1px; }
.ph-pill--muted{ background:rgba(100,116,139,.14); color:#475569; font-size:.68rem; vertical-align:middle; }
.ph-archived-note{ margin-top:6px; }
.ph-danger-ghost{
  background:transparent; color:#b91c1c; border:1px solid rgba(185,28,28,.32);
  border-radius:999px; font-weight:700;
}
.ph-danger-ghost:hover{ background:rgba(185,28,28,.08); border-color:rgba(185,28,28,.55); }
.ph-danger{
  background:#b91c1c; border-color:#b91c1c; color:#fff; font-weight:700; border-radius:999px;
}
.ph-danger:hover:not(:disabled){ background:#991b1b; }
.ph-danger:disabled{ opacity:.45; cursor:not-allowed; }
.ph-confirm{
  border-top:1px solid rgba(185,28,28,.22);
  background:rgba(185,28,28,.05);
  padding:14px 16px;
}
.ph-confirm-title{ font-weight:800; color:#b91c1c; margin-bottom:4px; }
.ph-confirm-body{ margin-bottom:10px; line-height:1.5; }
.ph-confirm-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.ph-confirm-row .input{ max-width:230px; }
.ph-notice{
  margin-top:12px; padding:11px 14px; border-radius:12px;
  font-size:.9rem; border:1px solid transparent;
}
.ph-notice--ok{ background:rgba(4,120,87,.10); border-color:rgba(4,120,87,.28); color:#047857; }
.ph-notice--err{ background:rgba(185,28,28,.09); border-color:rgba(185,28,28,.30); color:#b91c1c; }
