/* =============================================================================
 * money.css — Ops v4 · the three money screens (Hours, Budget, Pay). A7 owns it.
 *
 * Boards: Hours.dc.html, Budget2.dc.html, Pay.dc.html
 *
 * ── THIS FILE DOES NOT RESTYLE THE KIT ──────────────────────────────────────
 * The date tile, the big green button, the sheet, the undo toast, the face and
 * the readiness ring all come from web/js/ops-v4/kit/lres-ops-v4-kit.js with
 * their styles inline. Nothing here targets `.opsv4-tile`, `.opsv4-face`,
 * `.opsv4-sheet` or `.opsv4-strip`. A second set of yellows for a date tile is
 * exactly what SimpleKit.dc.html exists to prevent.
 *
 * ── FOUR STATUS COLOURS, AND NO FIFTH ───────────────────────────────────────
 * Only these four carry meaning, and they are the kit's:
 *     done    #009A42   nothing to do
 *     needs   #F59E0B   one tap sorts it
 *     blocked #DC2626   cannot proceed
 *     notyet  #D1D5DB   future, nothing expected
 * Everything else below is surface: greys for structure, and the board's two
 * shift tints (#FFF7D6 day, #E8F0FA night) which are DateTiles option G's own
 * row colours, reused rather than reinvented so a day shift is the same yellow
 * on every screen in the build.
 * ========================================================================== */

.opsv4-money {
    font-family: Inter, Arial, sans-serif;
    color: #0F1419;
    background: #F4F5F7;
    min-height: 100%;
    padding: 22px 32px 28px;
    box-sizing: border-box;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.opsv4-money-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.opsv4-money-head-text { flex-grow: 1; min-width: 260px; }

.opsv4-money-eyebrow {
    font-size: 14px;
    font-weight: 700;
    color: #6B7280;
}

.opsv4-money-h1 {
    margin: 2px 0 0;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.6px;
}

.opsv4-money-h2 { margin: 0; font-size: 18px; font-weight: 800; }

.opsv4-money-lede {
    font-size: 16px;
    color: #4B5563;
    margin-top: 2px;
}

/* One big green button per screen. Its 56px floor lives in the kit; this only
   gives it somewhere to sit. */
.opsv4-money-cta { width: 300px; flex-shrink: 0; }

.opsv4-money-views {
    display: flex;
    background: #E9EBEE;
    border-radius: 16px;
    padding: 4px;
    flex-shrink: 0;
}

.opsv4-money-view {
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #6B7280;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4-money-view.is-on {
    background: #FFFFFF;
    color: #0F1419;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.opsv4-money-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.opsv4-money-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.opsv4-hours-list,
.opsv4-budget-lines,
.opsv4-pay-list { flex: 1 1 560px; }

.opsv4-hours-detail { flex: 0 1 620px; }
.opsv4-budget-changes { flex: 0 1 560px; }

.opsv4-pay-aside {
    flex: 0 1 440px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Shared bits ──────────────────────────────────────────────────────────── */

.opsv4-r { text-align: right; }
.opsv4-strong { font-weight: 800; }
.opsv4-changed { color: #1F4E79; font-weight: 800; }
.opsv4-needs { color: #B45309; font-weight: 800; }
.opsv4-blocked { color: #B91C1C; font-weight: 800; }

.opsv4-hours-name { display: block; font-size: 13px; font-weight: 800; }
.opsv4-hours-sub { display: block; font-size: 12px; color: #6B7280; }

.opsv4-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
}

.opsv4-badge-approved { background: #E6F4EC; color: #064a23; }
.opsv4-badge-ready    { background: #F1F3F5; color: #374151; }
.opsv4-badge-changed  { background: #E8F0FA; color: #1F4E79; }
.opsv4-badge-check    { background: #FEF3C7; color: #92400E; }
.opsv4-badge-missing  { background: #FEE2E2; color: #991B1B; }
/* Budget lines: over is amber (somebody looks), under is green, on is neutral. */
.opsv4-badge-over     { background: #FEF3C7; color: #92400E; }
.opsv4-badge-under    { background: #E6F4EC; color: #064a23; }
.opsv4-badge-on       { background: #F7F8FA; color: #6B7280; }

.opsv4-note {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.opsv4-note-plain   { background: #F4F5F7; color: #4B5563; }
.opsv4-note-needs   { background: #FEF3C7; color: #78350F; }
.opsv4-note-blocked { background: #FEE2E2; color: #7F1D1D; }

.opsv4-btn-go {
    height: 46px;
    padding: 0 16px;
    border: none;
    border-radius: 14px;
    background: #009A42;
    color: #FFFFFF;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4-btn-go.is-disabled,
.opsv4-btn-go:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    cursor: not-allowed;
}

.opsv4-btn-plain {
    height: 46px;
    padding: 0 16px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    background: #FFFFFF;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.opsv4-chip {
    height: 38px;
    padding: 0 12px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    background: #FFFFFF;
    color: #1F2937;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4-chip.is-on { border-color: #0F1419; background: #0F1419; color: #FFFFFF; }
.opsv4-chip-sm { height: 32px; padding: 0 10px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.opsv4-chip-sm.is-on { border-color: #009A42; background: #E6F4EC; color: #064a23; }

.opsv4-toggle {
    flex-grow: 1;
    height: 44px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    background: #FFFFFF;
    color: #374151;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4-toggle.is-on { border-color: #009A42; background: #E6F4EC; color: #064a23; }

.opsv4-link-danger {
    border: none;
    background: none;
    color: #B91C1C;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4-money :focus-visible { outline: 3px solid #009A42; outline-offset: 2px; }

/* ── Hours: the everyone grid ─────────────────────────────────────────────── */

.opsv4-hours-grid {
    display: grid;
    grid-template-columns: 220px repeat(5, minmax(0, 1fr)) 96px;
    gap: 6px;
    align-items: center;
}

.opsv4-hours-grid-head {
    font-size: 11px;
    font-weight: 800;
    color: #374151;
    padding: 0 6px;
}

.opsv4-hours-grid-head > span:first-child { padding: 6px; color: #6B7280; }
.opsv4-hours-status-head { padding: 6px; text-align: right; color: #6B7280; }

.opsv4-hours-col {
    padding: 6px 0;
    text-align: center;
    border-radius: 8px;
}

/* DateTiles option G's own two row tints, reused not reinvented. */
.opsv4-hours-col.is-day { background: #FFF7D6; }
.opsv4-hours-col.is-night { background: #E8F0FA; }
.opsv4-hours-col.is-weekend { box-shadow: inset 0 4px 0 #1F4E79; }

.opsv4-hours-row {
    width: 100%;
    padding: 4px 6px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #FFFFFF;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.opsv4-hours-row.is-selected { border-color: #0F1419; background: #F4F5F7; }

.opsv4-hours-who {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-align: left;
}

.opsv4-hours-cell {
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.opsv4-hours-cell.is-off { background: #F7F8FA; }

.opsv4-hours-key {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: #4B5563;
    padding-top: 6px;
}

/* ── Hours: the one timesheet ─────────────────────────────────────────────── */

.opsv4-hours-detail-head { display: flex; align-items: center; gap: 12px; }
.opsv4-hours-detail-head > div { flex-grow: 1; }
.opsv4-hours-detail-title { font-size: 20px; font-weight: 800; }

.opsv4-hours-table {
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    overflow: hidden;
}

.opsv4-hours-tr {
    display: grid;
    grid-template-columns: 1fr 0.8fr 1.1fr 0.9fr 0.9fr 0.8fr 0.7fr;
    gap: 6px;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid #F1F3F5;
    font-size: 13px;
}

.opsv4-hours-th {
    border-top: none;
    background: #F7F8FA;
    font-size: 11px;
    font-weight: 800;
    color: #6B7280;
}

.opsv4-hours-tf {
    background: #E6F4EC;
    color: #064a23;
    font-weight: 800;
}

.opsv4-hours-tr.is-noshow { background: #FEF2F2; color: #9CA3AF; }

.opsv4-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 7px;
    color: #374151;
}

.opsv4-tag-day    { background: #FFF7D6; }
.opsv4-tag-night  { background: #E8F0FA; }
.opsv4-tag-sick   { background: #1F4E79; color: #FFFFFF; }
.opsv4-tag-noshow { background: #FEE2E2; color: #B91C1C; }

.opsv4-hours-money {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #F1F3F5;
    font-size: 13px;
}

.opsv4-hours-money-deduct { background: #FEF2F2; }
.opsv4-hours-money-extra  { background: #F0FDF4; }

/* A deduction that has not cleared BOTH gates — contract permits it, and the
   operative agreed in the app — is shown but not counted. Dimmed and struck so
   nobody reads it as money already taken. */
.opsv4-hours-money.is-held { opacity: 0.6; text-decoration: line-through; }

.opsv4-hours-fix { display: flex; gap: 8px; }

.opsv4-hours-editlabel {
    font-size: 12px;
    font-weight: 800;
    color: #6B7280;
    margin-top: 2px;
}

.opsv4-hours-edits { display: flex; gap: 6px; flex-wrap: wrap; }

.opsv4-hours-log {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    background: #F4F5F7;
    font-size: 12px;
}

.opsv4-hours-log > span:first-child { flex-grow: 1; }

.opsv4-hours-signs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
}

.opsv4-sign {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #F4F5F7;
}

.opsv4-sign.is-done { background: #E6F4EC; }
.opsv4-sign-role { font-size: 11px; font-weight: 800; color: #6B7280; }
.opsv4-sign-words { font-size: 13px; font-weight: 800; }

.opsv4-hours-goesto {
    padding: 10px 12px;
    border-radius: 12px;
    background: #F4F5F7;
    font-size: 12px;
    color: #4B5563;
}

/* ── The five edit forms ──────────────────────────────────────────────────── */

.opsv4-form {
    border: 3px solid #0F1419;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opsv4-form-title { font-size: 15px; font-weight: 800; }

.opsv4-form-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.opsv4-form-key {
    width: 84px;
    font-size: 12px;
    font-weight: 800;
    color: #6B7280;
}

.opsv4-form-note { font-size: 12px; color: #6B7280; }
.opsv4-form-actions { display: flex; gap: 8px; }
.opsv4-form-actions .opsv4-btn-go { flex-grow: 1; }

/* ── Budget ───────────────────────────────────────────────────────────────── */

.opsv4-budget-kpis {
    flex-direction: row;
    align-items: center;
    gap: 34px;
    padding: 16px 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.opsv4-kpi-key { font-size: 12px; font-weight: 800; color: #6B7280; }
.opsv4-kpi-value { font-weight: 800; }
.opsv4-kpi-big { font-size: 26px; }
.opsv4-kpi-small { font-size: 22px; color: #374151; }
.opsv4-tone-done { color: #007A34; }
.opsv4-tone-blocked { color: #B91C1C; }
.opsv4-kpi-sub { font-size: 12px; color: #6B7280; }

.opsv4-budget-bar-wrap {
    flex-grow: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.opsv4-budget-bar {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: #F1F3F5;
}

.opsv4-budget-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 7px;
    background: #009A42;
}

.opsv4-budget-bar-fill.is-low { background: #DC2626; }

/* The 40% line on a 0–60% bar. */
.opsv4-budget-bar-floor {
    position: absolute;
    left: 66.6%;
    top: -5px;
    bottom: -5px;
    width: 3px;
    background: #0F1419;
    border-radius: 2px;
}

.opsv4-budget-tr {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.1fr;
    gap: 10px;
    align-items: center;
}

.opsv4-budget-th {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #6B7280;
}

.opsv4-budget-row {
    padding: 9px 10px;
    border-radius: 12px;
    background: #F4F5F7;
    font-size: 14px;
}

.opsv4-budget-name { display: block; font-size: 14px; font-weight: 800; }

.opsv4-budget-foot {
    margin-top: auto;
    font-size: 13px;
    color: #6B7280;
    padding-top: 6px;
}

.opsv4-budget-presets { display: flex; flex-direction: column; gap: 6px; }

.opsv4-budget-preset {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #F4F5F7;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.opsv4-budget-preset.is-open { border-color: #0F1419; }
.opsv4-budget-preset.is-made { background: #F7F8FA; opacity: 0.6; cursor: default; }
.opsv4-budget-preset-title { flex-grow: 1; font-size: 14px; font-weight: 700; }
.opsv4-budget-preset-made { font-size: 13px; font-weight: 800; color: #6B7280; }

.opsv4-kindtag {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    flex-shrink: 0;
    width: 64px;
    text-align: center;
}

.opsv4-kindtag-add  { background: #E6F4EC; color: #064a23; }
.opsv4-kindtag-out  { background: #FEE2E2; color: #991B1B; }
.opsv4-kindtag-swap { background: #E8F0FA; color: #1F4E79; }

.opsv4-budget-who { display: flex; gap: 8px; }

.opsv4-budget-effect {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 13px;
}

.opsv4-budget-fig { padding: 8px 10px; border-radius: 10px; background: #F4F5F7; }
.opsv4-budget-fig.is-ok { background: #E6F4EC; }
.opsv4-budget-fig.is-low { background: #FEE2E2; }

.opsv4-budget-logtitle { font-size: 14px; font-weight: 800; margin-top: 4px; }

/* ── Pay ──────────────────────────────────────────────────────────────────── */

.opsv4-pay-tr {
    display: grid;
    grid-template-columns: 1.6fr 1.3fr 0.8fr 0.9fr 0.9fr 0.9fr 0.9fr;
    gap: 8px;
    align-items: center;
}

.opsv4-pay-th {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #6B7280;
}

.opsv4-pay-row {
    padding: 8px 10px;
    border-radius: 12px;
    background: #F4F5F7;
    font-size: 14px;
}

.opsv4-pay-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
}

.opsv4-pay-total.is-sum { padding-top: 6px; border-top: 1px solid #F1F3F5; }

.opsv4-pay-when {
    background: #0F1419;
    color: #CBD5E1;
    font-size: 15px;
}

.opsv4-pay-when-key { font-size: 12px; font-weight: 800; color: #86EFAC; }

/* ── Narrow screens ───────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .opsv4-money { padding: 16px; }
    .opsv4-money-cta { width: 100%; }
    .opsv4-hours-grid { grid-template-columns: 150px repeat(5, minmax(0, 1fr)) 84px; }
    .opsv4-hours-tr,
    .opsv4-budget-tr,
    .opsv4-pay-tr { font-size: 12px; }
}
