/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   ui/shared/roster_policy_editor.css                                                             [CREW-DEM-4 D4.6b5a]
   THE stylesheet of the shared Roster Policy editor (roster_policy_editor.js).
   Loaded by Ops Settings (ui/gbc_dashboard.html) — one OCC visual language, the accepted D4.2D / D4.3 Crew Complement
   workspace: light workspace, white OCC cards with a 4px left accent, compact uppercase labels, white controls, blue
   primary action, red outlined Withdraw, amber for a missing prerequisite, collapsed Technical evidence.

   Every rule is scoped to the component root (#gbc-rpe.gbc-rpe) so it never reaches the host page, and it is specific
   enough to hold against the host's own panel theme (the Ops Settings dark overrides target .os-card etc.).
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

#gbc-rpe.gbc-rpe { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: #334155; font-size: 12px; line-height: 1.5; max-width: 1180px; }
#gbc-rpe.gbc-rpe *, #gbc-rpe.gbc-rpe *::before, #gbc-rpe.gbc-rpe *::after { box-sizing: border-box; }
#gbc-rpe.gbc-rpe [hidden] { display: none !important; }

/* read-only notice — the same `attest_crew_staffing_policy` gate the authority applies */
#gbc-rpe.gbc-rpe .os-rp-ro { margin: 0 0 14px; padding: 9px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5; background: #fffbeb; border: 1px solid #f59e0b; color: #92400e; }

/* cards */
#gbc-rpe.gbc-rpe .os-card { background: #ffffff !important; border: 1px solid #e2e8f0 !important; border-left: 4px solid #93c5fd !important; border-radius: 8px !important; margin: 0 0 16px; padding: 0 0 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); overflow: visible; }
#gbc-rpe.gbc-rpe #os-rp-register-card.os-card { border-left-color: #cbd5e1 !important; }
#gbc-rpe.gbc-rpe .os-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #ffffff !important; border-bottom: 1px solid #e2e8f0 !important; padding: 12px 16px; border-radius: 8px 8px 0 0; }
#gbc-rpe.gbc-rpe .os-card-title { color: #0f172a !important; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: none; }
#gbc-rpe.gbc-rpe .os-card-count { color: #475569 !important; font-size: 11px; font-weight: 600; max-width: 60%; text-align: right; }
#gbc-rpe.gbc-rpe .os-rp-guide { background: #ffffff !important; color: #475569 !important; font-size: 12px; line-height: 1.6; padding: 12px 16px 4px; max-width: 132ch; }
#gbc-rpe.gbc-rpe .os-rp-sec { padding: 0 0 4px; }
#gbc-rpe.gbc-rpe .os-rp-sec + .os-rp-sec { border-top: 1px solid #f1f5f9; margin-top: 8px; }
#gbc-rpe.gbc-rpe .os-rp-subhead { margin: 14px 16px 0; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
#gbc-rpe.gbc-rpe .os-rp-note { margin: 8px 16px 0; padding: 8px 12px; font-size: 11.5px; line-height: 1.55; border-radius: 6px; background: #f8fafc !important; border: 1px dashed #cbd5e1 !important; color: #475569 !important; }

/* status strip and the plain resolution line */
#gbc-rpe.gbc-rpe .os-rp-strip { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; padding: 8px 12px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .01em; background: #f8fafc !important; border: 1px solid #cbd5e1 !important; color: #475569 !important; }
#gbc-rpe.gbc-rpe .os-rp-strip:empty { display: none; }
#gbc-rpe.gbc-rpe .os-rp-strip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: currentColor; }
#gbc-rpe.gbc-rpe .os-rp-strip.is-ok { background: #eff6ff !important; border-color: #93c5fd !important; color: #1d4ed8 !important; }
#gbc-rpe.gbc-rpe .os-rp-strip.is-required { background: #fffbeb !important; border-color: #f59e0b !important; color: #92400e !important; }
#gbc-rpe.gbc-rpe .os-rp-strip.is-optional { background: #f8fafc !important; border-color: #cbd5e1 !important; border-style: dashed !important; color: #475569 !important; }
#gbc-rpe.gbc-rpe .os-rp-strip.is-inconsistent { background: #fef2f2 !important; border-color: #fca5a5 !important; color: #b91c1c !important; }
#gbc-rpe.gbc-rpe .os-rp-line { margin: 8px 16px 0; font-size: 12.5px; line-height: 1.6; color: #0f172a; max-width: 132ch; }

/* forms — compact uppercase labels, white controls */
#gbc-rpe.gbc-rpe .os-rp-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; padding: 10px 16px 0; }
#gbc-rpe.gbc-rpe .os-rp-form label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; min-width: 0; }
#gbc-rpe.gbc-rpe .os-rp-form label.os-rp-check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: #334155; padding-top: 18px; }
#gbc-rpe.gbc-rpe .os-rp-form input, #gbc-rpe.gbc-rpe .os-rp-form select, #gbc-rpe.gbc-rpe .os-rp-seg input, #gbc-rpe.gbc-rpe .os-rp-seg select {
    height: 32px; padding: 0 10px; font: inherit; font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #0f172a !important;
    background: #ffffff !important; border: 1px solid #cbd5e1 !important; border-radius: 6px; min-width: 0; width: 100%; }
#gbc-rpe.gbc-rpe .os-rp-form input[type="checkbox"] { height: 16px; width: 16px; }
#gbc-rpe.gbc-rpe .os-rp-form input[readonly] { background: #f8fafc !important; color: #475569 !important; }
#gbc-rpe.gbc-rpe .os-rp-form input:focus, #gbc-rpe.gbc-rpe .os-rp-form select:focus { outline: 2px solid #93c5fd; outline-offset: 1px; border-color: #3b82f6 !important; }
#gbc-rpe.gbc-rpe select option:disabled { color: #94a3b8; }

/* mode tiles — three radio cards, one sentence each */
#gbc-rpe.gbc-rpe .os-rp-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; padding: 12px 16px 0; }
#gbc-rpe.gbc-rpe .os-rp-mode { display: grid; grid-template-columns: 18px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #ffffff; cursor: pointer; }
#gbc-rpe.gbc-rpe .os-rp-mode:hover { border-color: #93c5fd; }
#gbc-rpe.gbc-rpe .os-rp-mode:has(input:checked) { border-color: #2563eb; box-shadow: inset 0 0 0 1px #2563eb; background: #eff6ff; }
#gbc-rpe.gbc-rpe .os-rp-mode input { grid-row: 1 / span 2; margin: 2px 0 0; }
#gbc-rpe.gbc-rpe .os-rp-mode-t { font-size: 13px; font-weight: 700; color: #0f172a; }
#gbc-rpe.gbc-rpe .os-rp-mode-s { font-size: 11.5px; line-height: 1.5; color: #475569; }

/* pattern blocks */
#gbc-rpe.gbc-rpe .os-rp-segs { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; }
#gbc-rpe.gbc-rpe .os-rp-seg { display: grid; grid-template-columns: 96px 76px 28px; gap: 6px; align-items: center; padding: 6px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; }
#gbc-rpe.gbc-rpe .os-rp-seg .os-row-btn { height: 28px; padding: 0; }
#gbc-rpe.gbc-rpe .os-rp-segs-act { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px 0; }
#gbc-rpe.gbc-rpe .os-rp-pattern-code { font-size: 12px; font-weight: 600; color: #1d4ed8; }

/* actions — blue primary, red outlined Withdraw, the signed-in line */
#gbc-rpe.gbc-rpe .os-rp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px 0; }
#gbc-rpe.gbc-rpe .os-add-btn { height: 34px; padding: 0 16px; border-radius: 6px; border: 1px solid #1d4ed8 !important; background: #2563eb !important; color: #ffffff !important; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
#gbc-rpe.gbc-rpe .os-add-btn:disabled { background: #cbd5e1 !important; border-color: #cbd5e1 !important; color: #64748b !important; cursor: not-allowed; }
#gbc-rpe.gbc-rpe .os-row-btn { height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid #cbd5e1 !important; background: #ffffff !important; color: #334155 !important; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
#gbc-rpe.gbc-rpe .os-row-btn:disabled { color: #94a3b8 !important; cursor: not-allowed; }
#gbc-rpe.gbc-rpe .os-rp-withdraw-btn { border-color: #dc2626 !important; color: #b91c1c !important; }
#gbc-rpe.gbc-rpe .os-rp-withdraw-confirm { background: #dc2626 !important; border-color: #b91c1c !important; }
#gbc-rpe.gbc-rpe .os-rp-actor { font-size: 11.5px; color: #64748b; }
#gbc-rpe.gbc-rpe .os-rp-withdraw { margin: 12px 16px 0; padding: 0 0 12px; border: 1px solid #fca5a5; border-radius: 8px; background: #fef2f2; }
#gbc-rpe.gbc-rpe .os-rp-withdraw .os-rp-subhead { color: #b91c1c; }
#gbc-rpe.gbc-rpe .os-rp-withdraw .os-rp-note { border-color: #fca5a5 !important; background: #ffffff !important; color: #7f1d1d !important; margin: 0; flex: 1 1 260px; }

/* messages */
#gbc-rpe.gbc-rpe .os-rp-msg { margin: 10px 16px 0; font-size: 12.5px; line-height: 1.6; max-width: 132ch; }
#gbc-rpe.gbc-rpe .os-rp-msg:empty { display: none; }
#gbc-rpe.gbc-rpe .os-rp-msg.is-ok { padding: 9px 12px; border-radius: 6px; background: #eff6ff; border: 1px solid #93c5fd; color: #1e3a8a; }
#gbc-rpe.gbc-rpe .os-rp-msg.is-refused { padding: 9px 12px; border-radius: 6px; background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }

/* register */
#gbc-rpe.gbc-rpe .os-rp-scroll { overflow-x: auto; padding: 10px 16px 0; }
#gbc-rpe.gbc-rpe .os-rp-table { min-width: 880px; }
#gbc-rpe.gbc-rpe .os-table { width: 100%; border-collapse: collapse; font-size: 12px; background: #ffffff !important; }
#gbc-rpe.gbc-rpe .os-table th { text-align: left; padding: 8px 10px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b !important; background: #f8fafc !important; border-bottom: 1px solid #e2e8f0 !important; white-space: nowrap; }
#gbc-rpe.gbc-rpe .os-table td { padding: 9px 10px; vertical-align: top; color: #0f172a !important; border-bottom: 1px solid #f1f5f9 !important; background: #ffffff !important; }
#gbc-rpe.gbc-rpe .os-rp-empty td { color: #64748b !important; }
#gbc-rpe.gbc-rpe .os-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
#gbc-rpe.gbc-rpe .os-pill.ok { background: #dbeafe; color: #1e40af; }
#gbc-rpe.gbc-rpe .os-pill.warn { background: #fef3c7; color: #92400e; }
#gbc-rpe.gbc-rpe .os-pill.off { background: #f1f5f9; color: #475569; }
#gbc-rpe.gbc-rpe .os-rp-history { margin-top: 6px; }
#gbc-rpe.gbc-rpe .os-rp-history summary { cursor: pointer; font-size: 11px; font-weight: 600; color: #2563eb; }
#gbc-rpe.gbc-rpe .os-rp-history ul { margin: 6px 0 0; padding-left: 16px; font-size: 11.5px; line-height: 1.6; color: #334155; }

/* technical evidence — collapsed, monospace, the only place a code lives */
#gbc-rpe.gbc-rpe .os-rp-tech { margin: 12px 16px 0; }
#gbc-rpe.gbc-rpe .os-rp-tech summary { cursor: pointer; font-size: 11px; font-weight: 600; color: #64748b; }
#gbc-rpe.gbc-rpe .os-rp-tech-body { margin-top: 6px; padding: 8px 10px; border-radius: 6px; background: #0f172a !important; color: #cbd5e1 !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* narrow hosts */
@media (max-width: 720px) {
  #gbc-rpe.gbc-rpe .os-rp-form { grid-template-columns: 1fr; }
  #gbc-rpe.gbc-rpe .os-rp-modes { grid-template-columns: 1fr; }
  #gbc-rpe.gbc-rpe .os-card-count { max-width: 100%; text-align: left; }
}
