/* Styles for src/routes/attendance.tsx pages. Same tokens as app.css and finance.css. */

.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.att-kpis, .prep-kpis { margin-top: 0; }

/* Input tables: compact number fields in each cell */
.att-table input, .prep-table input { min-width: 0; width: 100%; max-width: 9.5rem; padding: .4rem .55rem; font-variant-numeric: tabular-nums; }
.prep-table input[name^=adjl_] { max-width: 12rem; }
.att-table td, .prep-table td { vertical-align: middle; }
.att-table tr.att-ok td:first-child b::after { content: " ✓"; color: var(--ok); font-weight: 700; }
.att-by { font-size: .74rem; margin-top: 2px; }
.att-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .9rem; }
.att-actions form { margin: 0; }
.att-actions .small-note { margin: 0; }
.att-form { margin: 0; }
.form fieldset.plain { border: 0; padding: 0 2px; margin: .5rem 0 0; background: none; box-shadow: none; min-width: 0; }

/* Add-a-claim line */
.claim-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 9rem auto; gap: .6rem; align-items: end; margin: .9rem 0 1rem; }
.claim-add.me { grid-template-columns: minmax(0, 2fr) 9rem auto; }
.claim-add label { margin: 0; }
.claim-add .btn { min-height: 40px; }

/* Claims table: reason box with approve / reject next to it */
.claims-table .claim-label { font-weight: 600; overflow-wrap: anywhere; }
.claim-reason { margin-top: 3px; font-size: .78rem; color: var(--text-2); font-style: italic; overflow-wrap: anywhere; }
.claim-decide { display: flex; gap: .4rem; align-items: center; margin: 0; min-width: 0; }
.claim-decide input { min-width: 0; width: 13rem; padding: .35rem .55rem; font-size: .85rem; }
.claim-decide .row-actions { flex-wrap: nowrap; }
.claims-table td.claim-act { width: 1%; white-space: nowrap; }

/* Number fields without spinners, so amounts fit the narrow cells */
.att-table input[type=number], .prep-table input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.att-table input::-webkit-outer-spin-button, .att-table input::-webkit-inner-spin-button,
.prep-table input::-webkit-outer-spin-button, .prep-table input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.prep-table th, .prep-table td { padding-inline: .35rem; }
.prep-table td:first-child { min-width: 8.5rem; }
.prep-table input { padding: .4rem .45rem; }

/* SOP timeline */
.tl { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: 2px; }
.tl li { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .5rem .6rem; border-radius: 10px; font-size: .9rem; }
.tl li.now { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.tl li.past { color: var(--text-2); }
.tl li.past .tl-d::before { content: "✓ "; color: var(--ok); }
.tl-d { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .82rem; }

/* Cut-off checklist */
.checklist { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem .7rem; border-radius: 12px; background: var(--surface-2); font-size: .92rem; overflow-wrap: anywhere; }
.ck-dot { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--border); color: var(--text-2); }
.checklist li.ok .ck-dot { background: var(--ok-bg); color: var(--ok); }
.checklist li.warn .ck-dot { background: var(--warn-bg); color: var(--warn); }
.checklist li.bad .ck-dot { background: var(--bad-bg); color: var(--bad); }
.checklist li.bad { box-shadow: inset 3px 0 0 var(--bad); }
.checklist li.info .ck-dot { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-style: italic; }

@media (max-width: 900px) {
  .claim-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .claim-add.me { grid-template-columns: minmax(0, 1fr) 9rem; }
  .claim-add .btn { grid-column: 1 / -1; justify-self: start; }
}

/* Phones: tables become cards (cards-sm in finance.css); fields sit to the right of their label */
@media (max-width: 600px) {
  .att-table input, .prep-table input { max-width: 10.5rem; }
  .prep-table input[name^=adjl_] { max-width: 10.5rem; }
  .att-table td, .prep-table td { align-items: center; }
  .att-table td .cell, .claims-table td .cell { display: block; text-align: right; min-width: 0; }
  .claims-table tfoot tr { display: flex; justify-content: space-between; }
  .claims-table tfoot th { padding: 0; border: 0; }
  .claims-table tfoot th:empty { display: none; }
  .claims-table td.claim-act { width: auto; white-space: normal; display: block; }
  .claim-decide { flex-wrap: wrap; }
  .claim-decide input { width: 100%; }
  .claim-add, .claim-add.me { grid-template-columns: minmax(0, 1fr); }
  .claim-add .btn { justify-self: stretch; }
  .att-actions .btn { flex: 1 1 auto; }
  .tl li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "d b" "t t"; gap: .2rem .75rem; }
  .tl-d { grid-area: d; } .tl-t { grid-area: t; } .tl li .badge { grid-area: b; }
}
