/*
  Hours & pay review (class/class.hours_review.php): the drawer off Settings → Payments for the
  pilot — the scope, the tiles, the ledger of pay lines, the state buttons, the rate explainer,
  the line drawer. hr_ classes; the mchat shell around it is inline like the other drawers.
  no rem units (bootstrap_old makes a rem 10px). px throughout.
*/

.hr_drawer, .hr_line_drawer { --hr_teal: #0f7777; --hr_teal_dark: #0f5e63; --hr_ink: #16211f; --hr_muted: #6b7a7e; --hr_line: #d3e2e3; --hr_ok: #1a7f37; --hr_ok_bg: #e6f4ea; --hr_wait: #b45309; --hr_wait_bg: #fff4e5; --hr_bad: #b42318; --hr_bad_bg: #fdecec; --hr_tint: #fff6dc; color: var(--hr_ink); font-size: 14px; }
.hr_drawer *, .hr_line_drawer * { box-sizing: border-box; }
.hr_none { padding: 18px 14px; color: #8a9a9f; font-size: 13px; }

/* ---- header tools ---- */
.hr_tools_wrap { position: relative; flex: none; }
.hr_pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; background: #fff; border: 1px solid var(--hr_line); border-radius: 10px; box-shadow: 0 10px 30px rgba(11,61,64,.2); padding: 6px; }
.hr_pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 7px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--hr_ink); cursor: pointer; white-space: nowrap; }
.hr_pop button:hover { background: #eaf4f4; }
.hr_pop button i { color: var(--hr_teal_dark); font-size: 16px; width: 20px; text-align: center; flex: none; }
.hr_pop button small { display: block; font-weight: 400; font-size: 11.5px; color: var(--hr_muted); margin-top: 1px; }
.hr_pop button.hr_cur { color: var(--hr_muted); }
.hr_pop button.hr_danger, .hr_pop button.hr_danger i { color: var(--hr_bad); }
.hr_tools_menu { width: 290px; }

/* ---- scope + tiles ---- */
.hr_scope { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.hr_scope .form-control { height: 36px; border: 1px solid var(--hr_line); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; box-shadow: none; width: auto; }
.hr_scope .hr_event { flex: 1 1 220px; min-width: 0; }
.hr_scope .hr_q { flex: 0 1 170px; }
.hr_chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hr_chip { border: 1px solid var(--hr_line); background: #fff; border-radius: 16px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--hr_muted); cursor: pointer; }
.hr_chip.on { background: var(--hr_teal); border-color: var(--hr_teal); color: #fff; }
.hr_chip .hr_n { opacity: .75; margin-left: 4px; }
.hr_summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.hr_tile { background: #fff; border: 1px solid var(--hr_line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.hr_k { font-size: 10.5px; font-weight: 700; color: var(--hr_teal_dark); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr_tile .hr_v { font-size: 20px; font-weight: 800; margin-top: 2px; line-height: 1.1; }
.hr_tile .hr_v small { display: block; font-size: 11px; font-weight: 400; color: var(--hr_wait); }
.hr_tile_wait .hr_v { color: var(--hr_wait); } .hr_tile_bad .hr_v { color: var(--hr_bad); } .hr_tile_money .hr_v { color: var(--hr_ok); }

/* ---- the ledger ---- */
.hr_group_head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 4px 8px; }
.hr_group_head b { font-size: 15px; }
.hr_group_head span { color: var(--hr_muted); font-size: 13px; }
.hr_ledger { background: #fff; border: 1px solid var(--hr_line); border-radius: 12px; overflow: visible; box-shadow: 0 1px 2px rgba(11,61,64,.06); }
.hr_head { display: grid; grid-template-columns: 20px 1.5fr .9fr 1.2fr .9fr 150px; gap: 10px; padding: 9px 12px; background: #f3f8f8; border-bottom: 1px solid var(--hr_line); border-radius: 12px 12px 0 0; font-size: 11px; font-weight: 700; color: var(--hr_teal_dark); letter-spacing: .06em; text-transform: uppercase; }
.hr_person { border-bottom: 1px solid #e4eeee; position: relative; }
.hr_person:last-child { border-bottom: 0; }
.hr_person.hr_hidden { display: none; }
.hr_row { display: grid; grid-template-columns: 20px 1.5fr .9fr 1.2fr .9fr 150px; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; }
.hr_row:hover { background: #f6fbfb; }
.hr_caret { color: var(--hr_muted); font-size: 12px; }
.hr_name { font-weight: 700; font-size: 15px; min-width: 0; }
.hr_name small { display: block; font-weight: 400; color: var(--hr_muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr_stat { min-width: 0; position: relative; }
.hr_v { font-weight: 600; }
.hr_money { font-variant-numeric: tabular-nums; }
.hr_short { color: var(--hr_wait); font-weight: 800; }
.hr_is_void .hr_name, .hr_is_void .hr_stat { opacity: .5; text-decoration: line-through; }
.hr_punct { font-size: 13px; vertical-align: -1px; margin-right: 5px; }
.hr_punct_ok { color: var(--hr_ok); } .hr_punct_bad { color: var(--hr_bad); } .hr_punct_none { color: #c9d3d5; }
.hr_rate_name { display: inline-block; max-width: 100%; text-align: center; font-weight: 600; font-size: 12.5px; color: var(--hr_teal_dark); background: #e8f1f1; border: 1px solid transparent; border-radius: 4px; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; vertical-align: middle; }
.hr_rate_name:hover { background: #d7e9e9; border-color: #9fc9c9; }
.hr_rate_name.hr_is_open { background: var(--hr_teal); color: #fff; border-color: var(--hr_teal); }
.hr_rate_none { color: var(--hr_wait); background: var(--hr_wait_bg); font-weight: 700; }
.hr_rate_pop { position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); width: 320px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--hr_line); border-radius: 10px; box-shadow: 0 10px 30px rgba(11,61,64,.2); padding: 14px; font-size: 13px; text-align: left; cursor: default; text-decoration: none; }
.hr_rate_pop h4 { margin: 0 0 2px; font-size: 14px; font-weight: 800; }
.hr_rp_pays { color: var(--hr_teal_dark); font-weight: 700; margin-bottom: 8px; }
.hr_rp_k { font-size: 10.5px; font-weight: 700; color: var(--hr_muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 4px; }
.hr_rate_pop ul { margin: 0; padding-left: 18px; line-height: 1.5; }
.hr_rp_calc { background: #f6fbfb; border: 1px solid var(--hr_line); border-radius: 6px; padding: 8px 10px; font-family: Menlo, Consolas, monospace; font-size: 12px; margin-top: 4px; }
.hr_rp_calc b { color: var(--hr_ok); }
.hr_rp_foot { font-size: 11.5px; color: var(--hr_muted); margin-top: 10px; line-height: 1.45; }
.hr_rp_link { display: inline-block; margin-top: 8px; color: var(--hr_teal_dark); font-weight: 700; text-decoration: none; }

/* ---- the state button ---- */
.hr_btn { border: 1px solid var(--hr_line); background: #fff; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--hr_ink); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; }
.hr_btn_sm { padding: 6px 10px; font-size: 12.5px; }
.hr_btn:disabled { opacity: .45; cursor: default; }
.hr_primary { background: var(--hr_teal); border-color: var(--hr_teal); color: #fff; }
.hr_state_wait { background: #fff; border: 1.5px dashed #22b8cf; color: var(--hr_ok); }
.hr_state_ok { background: var(--hr_ok_bg); border-color: #bfe3c8; color: var(--hr_ok); }
.hr_state_bad { background: var(--hr_bad_bg); border-color: #f3c2bd; color: var(--hr_bad); }
.hr_state_void { background: #f1f3f3; border-color: #d9dfe0; color: var(--hr_muted); }
.hr_approve { justify-self: end; }
.hr_split { display: inline-flex; position: relative; }
.hr_split .hr_btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 104px; }
.hr_split_caret { padding: 6px 8px; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; border-left-style: solid; }
.hr_state_menu { min-width: 200px; }
@keyframes hr_approved_pulse { 0% { transform: scale(1); } 40% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(26,127,55,.18); } 100% { transform: scale(1); } }
.hr_just { animation: hr_approved_pulse .45s ease-out; }

/* ---- footer ---- */
.hr_foot { flex: none; background: #fff; border-top: 1px solid var(--hr_line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.hr_foot_in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hr_tot { flex: 1 1 100%; font-size: 12.5px; color: var(--hr_muted); }
.hr_tot b { color: var(--hr_ink); font-size: 14px; }
.hr_tot .hr_money { color: var(--hr_ok); }
.hr_foot_in .hr_btn { flex: 1; }

/* ---- the line drawer ---- */
.hr_card { background: #fff; border: 1px solid var(--hr_line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(11,61,64,.06); }
.hr_d_name { font-size: 18px; font-weight: 800; }
.hr_d_sub { font-size: 13px; color: var(--hr_muted); margin-top: 3px; }
.hr_d_rate { margin-top: 10px; position: relative; }
.hr_d_title { font-size: 12px; font-weight: 700; color: var(--hr_teal_dark); letter-spacing: .08em; text-transform: uppercase; margin: 20px 0 8px; padding-left: 4px; }
.hr_tt { display: flex; align-items: center; gap: 6px; line-height: 1.7; white-space: nowrap; font-size: 13.5px; }
.hr_tt_k { width: 30px; font-size: 10px; font-weight: 700; color: var(--hr_muted); text-transform: uppercase; letter-spacing: .05em; }
.hr_tt_s { width: 70px; }
.hr_tt_arrow { color: var(--hr_teal); font-size: 12px; }
.hr_tt_dim { color: #c9d3d5; }
.hr_tt_t { font-weight: 700; }
.hr_t_good { color: var(--hr_ok); } .hr_t_bad { color: var(--hr_bad); }
.hr_tt_none { color: #b8c4c6; }
.hr_tt_note { display: block; color: var(--hr_muted); font-size: 11.5px; margin-top: 4px; }
.hr_delta { font-size: 10.5px; font-weight: 700; border-radius: 8px; padding: 1px 6px; margin-left: 3px; }
.hr_d_good { background: var(--hr_ok_bg); color: var(--hr_ok); } .hr_d_bad { background: var(--hr_bad_bg); color: var(--hr_bad); } .hr_d_on { background: #f1f3f3; color: var(--hr_muted); }
.hr_who_note { margin-top: 10px; font-size: 12.5px; color: var(--hr_bad); background: var(--hr_bad_bg); border-radius: 8px; padding: 6px 10px; }
.hr_edit_row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hr_edit_row label { font-size: 10.5px; font-weight: 700; color: var(--hr_muted); text-transform: uppercase; margin: 0; }
.hr_edit { height: 34px; border: 1px solid var(--hr_line); border-radius: 7px; padding: 0 8px; font: inherit; font-size: 16px; font-weight: 700; background: #fff; }
.hr_edit_amount { width: 100px; text-align: right; }
.hr_needs { border-color: var(--hr_wait); background: var(--hr_wait_bg); }
.hr_edit:focus { outline: none; border-color: var(--hr_teal); }
.hr_edit_hint { font-size: 12px; color: var(--hr_muted); }
.hr_amount_line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 18px; font-weight: 800; }
.hr_amt_wrap { display: inline-flex; align-items: center; gap: 4px; }
.hr_rule { font-size: 11.5px; font-weight: 400; color: var(--hr_muted); }
.hr_rule.hr_keyed { background: var(--hr_tint); border-radius: 4px; padding: 1px 5px; }
.hr_d_actions { display: flex; gap: 8px; margin-top: 14px; }
.hr_d_actions .hr_btn { flex: 1; }
.hr_d_buttons { display: flex; justify-content: flex-end; margin-top: 16px; }
.hr_d_foot { font-size: 12px; color: #8a9a9f; line-height: 1.45; margin-top: 10px; text-align: right; }

/* ---- phone ---- */
@media (max-width: 600px)
{
  .hr_summary { grid-template-columns: repeat(2, 1fr); }
  .hr_summary .hr_tile:first-child { grid-column: 1 / -1; }
  .hr_head { display: none; }
  .hr_row { grid-template-columns: 14px 1.4fr .8fr 1fr auto; gap: 6px 8px; padding: 10px 10px; }
  .hr_rate { display: none; }
  .hr_name { font-size: 14px; } .hr_name small { font-size: 11px; }
  .hr_row .hr_split .hr_btn:first-child { min-width: 0; padding: 6px 9px; }
  .hr_row .hr_split .hr_btn:first-child span { display: none; }
  .hr_scope .hr_q { flex: 1 1 120px; }
}
