/* Radcomp Staff Portal – front-end styles. Accent colour comes from Settings (--rsp-accent). */
:root {
	--rsp-accent: #c7305e;
	--rsp-text: #3c434a;
	--rsp-muted: #757b82;
	--rsp-border: #e3e5e8;
	--rsp-bg: #f6f7f8;
	--rsp-card: #ffffff;
	--rsp-link: #2ea8d8;
	--rsp-ok: #1e8e5a;
	--rsp-warn: #b7791f;
	--rsp-bad: #c0392b;
	--rsp-radius: 10px;
}

.rsp-portal, .rsp-standalone, .rsp-login, .rsp-kiosk { color: var(--rsp-text); font-size: 14px; line-height: 1.45; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.rsp-portal h1, .rsp-portal h2, .rsp-portal h3, .rsp-portal h4, .rsp-standalone h2, .rsp-standalone h3, .rsp-kiosk h1, .rsp-kiosk h2, .rsp-kiosk h3, .rsp-login h2 { font-family: inherit; letter-spacing: normal; }
.rsp-form > .rsp-btn, .rsp-form > button { align-self: flex-start; }
.rsp-portal *, .rsp-standalone *, .rsp-login *, .rsp-kiosk * { box-sizing: border-box; }
.rsp-portal a, .rsp-standalone a { color: var(--rsp-link); text-decoration: none; }
.rsp-portal a:hover, .rsp-standalone a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.rsp-portal { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 100%; }
.rsp-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.rsp-menu-toggle { display: none; }

/* ---------- Sidebar ---------- */
.rsp-sidebar { background: #f7f7f7; border-radius: var(--rsp-radius); padding: 18px 10px; position: sticky; top: 20px; }
.rsp-brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 6px; font-weight: 700; font-size: 17px; }
.rsp-brand img { max-height: 36px; width: auto; }
.rsp-user { padding: 0 12px 14px; color: var(--rsp-muted); font-size: 12px; border-bottom: 1px solid var(--rsp-border); margin-bottom: 8px; }
.rsp-nav { display: flex; flex-direction: column; gap: 2px; }
.rsp-nav__link, .rsp-nav__group > summary { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; color: var(--rsp-text) !important; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.rsp-nav__link:hover, .rsp-nav__group > summary:hover { background: #ececec; }
.rsp-nav__link.is-active { color: var(--rsp-link) !important; background: #eef6fa; }
.rsp-nav .dashicons { color: #222; width: 20px; height: 20px; font-size: 20px; }
.rsp-nav__group > summary { list-style: none; }
.rsp-nav__group > summary::-webkit-details-marker { display: none; }
.rsp-nav__group > summary::after { content: "\f347"; font-family: dashicons; margin-left: auto; color: var(--rsp-muted); font-weight: 400; }
.rsp-nav__group[open] > summary::after { content: "\f343"; }
.rsp-nav__sub { display: flex; flex-direction: column; margin: 2px 0 6px 18px; padding: 4px; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.rsp-nav__sub .rsp-nav__link { font-weight: 500; padding: 9px 12px; }

/* ---------- Cards ---------- */
.rsp-card { background: var(--rsp-card); border: 1px solid var(--rsp-border); border-radius: var(--rsp-radius); }
.rsp-card__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 18px 20px 0; }
.rsp-card__title { font-size: 19px; font-weight: 700; margin: 0 0 4px; color: #50575e; line-height: 1.25; }
.rsp-card__sub { margin: 0; color: var(--rsp-muted); font-size: 13px; }
.rsp-card__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.rsp-card__body { padding: 18px 20px; }
.rsp-card__body > :first-child { margin-top: 0; }
.rsp-card__body > :last-child { margin-bottom: 0; }
.rsp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.rsp-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 18px; align-items: start; }

/* ---------- Forms ---------- */
.rsp-form { display: flex; flex-direction: column; gap: 14px; }
.rsp-form--narrow { max-width: 460px; }
.rsp-form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.rsp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.rsp-field { display: flex; flex-direction: column; gap: 5px; margin: 0; min-width: 0; }
.rsp-field > span, .rsp-label { font-weight: 700; font-size: 13px; color: #50575e; }
.rsp-field small, .rsp-help { color: var(--rsp-muted); font-size: 12px; font-weight: 400; }
.rsp-portal input[type=text], .rsp-portal input[type=email], .rsp-portal input[type=tel], .rsp-portal input[type=number], .rsp-portal input[type=date], .rsp-portal input[type=time], .rsp-portal input[type=month], .rsp-portal input[type=datetime-local], .rsp-portal input[type=url], .rsp-portal input[type=password], .rsp-portal input[type=file], .rsp-portal select, .rsp-portal textarea,
.rsp-standalone input[type=text], .rsp-standalone input[type=email], .rsp-standalone input[type=tel], .rsp-standalone input[type=number], .rsp-standalone input[type=date], .rsp-standalone input[type=time], .rsp-standalone input[type=month], .rsp-standalone input[type=datetime-local], .rsp-standalone input[type=url], .rsp-standalone input[type=password], .rsp-standalone input[type=file], .rsp-standalone select, .rsp-standalone textarea,
.rsp-kiosk input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .rsp-kiosk select, .rsp-kiosk textarea, .rsp-login input[type=text], .rsp-login input[type=password] {
	width: 100%; max-width: 100%; padding: 9px 11px; border: 1px solid #c3c4c7; border-radius: 6px; background: #fff; font-size: 14px; color: var(--rsp-text); min-height: 40px; box-shadow: none;
}
.rsp-portal textarea, .rsp-standalone textarea { min-height: 80px; resize: vertical; }
.rsp-portal input:focus, .rsp-portal select:focus, .rsp-portal textarea:focus, .rsp-standalone input:focus, .rsp-standalone select:focus, .rsp-standalone textarea:focus { outline: 2px solid color-mix(in srgb, var(--rsp-accent) 35%, transparent); border-color: var(--rsp-accent); }
.rsp-check { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; cursor: pointer; }
.rsp-check input { width: 16px; height: 16px; margin: 0; }
.rsp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rsp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--rsp-border); border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; cursor: pointer; }
.rsp-chip input { margin: 0; }

/* ---------- Buttons ---------- */
.rsp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-weight: 700; font-size: 14px; line-height: 1.2; cursor: pointer; border: 1px solid #222; background: #fff; color: var(--rsp-accent) !important; text-decoration: none !important; min-height: 40px; white-space: nowrap; }
.rsp-btn:hover { background: #fff5f8; }
.rsp-btn--primary { background: var(--rsp-accent); border-color: var(--rsp-accent); color: #fff !important; }
.rsp-btn--primary:hover { filter: brightness(.93); background: var(--rsp-accent); }
.rsp-btn--light { border-color: var(--rsp-border); color: var(--rsp-link) !important; }
.rsp-btn--danger { border-color: var(--rsp-bad); color: var(--rsp-bad) !important; }
.rsp-btn--ok { border-color: var(--rsp-ok); color: var(--rsp-ok) !important; }
.rsp-btn--sm { padding: 5px 11px; min-height: 30px; font-size: 12px; }
.rsp-btn[disabled] { opacity: .5; cursor: not-allowed; }
.rsp-link-btn { background: none; border: 0; padding: 0; color: var(--rsp-link); cursor: pointer; font: inherit; font-weight: 600; }

/* ---------- Tables ---------- */
.rsp-table-wrap { overflow-x: auto; }
.rsp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rsp-table th { text-align: left; font-weight: 700; color: #50575e; padding: 12px 10px; border-bottom: 1px solid var(--rsp-border); white-space: nowrap; }
.rsp-table td { padding: 12px 10px; border-bottom: 1px solid #f0f0f1; vertical-align: middle; }
.rsp-table tr:last-child td { border-bottom: 0; }
.rsp-table tr.is-selected td { background: #fdf3f6; }
.rsp-table .rsp-num { text-align: right; font-variant-numeric: tabular-nums; }
.rsp-table tfoot td { font-weight: 700; border-top: 2px solid var(--rsp-border); }

/* ---------- Badges, notices, misc ---------- */
.rsp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef0f2; color: #50575e; white-space: nowrap; }
.rsp-badge--approved, .rsp-badge--published, .rsp-badge--active, .rsp-badge--complete, .rsp-badge--closed, .rsp-badge--submitted-ok, .rsp-badge--sent { background: #e6f4ec; color: var(--rsp-ok); }
.rsp-badge--pending, .rsp-badge--submitted, .rsp-badge--draft, .rsp-badge--open, .rsp-badge--new, .rsp-badge--pending_investigation { background: #fdf3e2; color: var(--rsp-warn); }
.rsp-badge--declined, .rsp-badge--rejected, .rsp-badge--deregistered, .rsp-badge--sick, .rsp-badge--incomplete { background: #fbeaea; color: var(--rsp-bad); }
.rsp-notice { padding: 12px 16px; border-radius: 8px; border-left: 4px solid var(--rsp-ok); background: #edf7f1; font-weight: 600; }
.rsp-notice--error { border-color: var(--rsp-bad); background: #fbeeee; }
.rsp-notice--warning { border-color: var(--rsp-warn); background: #fdf6e7; }
.rsp-notice--info { border-color: var(--rsp-link); background: #eef7fb; }
.rsp-empty { color: var(--rsp-muted); padding: 10px 0; margin: 0; }
.rsp-muted { color: var(--rsp-muted); }
.rsp-small { font-size: 12px; }
.rsp-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; background: #e9eaec; color: #777; font-weight: 700; flex: none; }
.rsp-person { display: flex; align-items: center; gap: 12px; }
.rsp-person strong { display: block; }
.rsp-progress { height: 10px; background: #eceef0; border-radius: 999px; overflow: hidden; }
.rsp-progress > span { display: block; height: 100%; background: var(--rsp-link); border-radius: 999px; }
.rsp-progress.is-complete > span { background: var(--rsp-ok); }
.rsp-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rsp-checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid #f0f0f1; border-radius: 8px; }
.rsp-checklist .dashicons-yes-alt { color: var(--rsp-ok); }
.rsp-checklist .dashicons-marker { color: #c3c4c7; }
.rsp-kv { display: grid; grid-template-columns: minmax(100px, 160px) minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.rsp-kv dt { font-weight: 700; color: #50575e; }
.rsp-kv dd { margin: 0; }
.rsp-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--rsp-border); margin-bottom: 16px; }
.rsp-tabs a { padding: 9px 14px; border-radius: 8px 8px 0 0; font-weight: 700; color: var(--rsp-muted) !important; text-decoration: none !important; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.rsp-tabs a.is-active { color: var(--rsp-text) !important; background: #fff; border-color: var(--rsp-border); }
.rsp-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.rsp-stat { border: 1px solid var(--rsp-border); border-radius: var(--rsp-radius); padding: 14px 16px; background: #fff; }
.rsp-stat b { display: block; font-size: 24px; color: var(--rsp-text); }
.rsp-stat span { color: var(--rsp-muted); font-size: 12px; font-weight: 600; }
.rsp-danger-zone { border: 1px solid #f1c6c6; background: #fff8f8; border-radius: var(--rsp-radius); padding: 14px 16px; }
.rsp-week-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Roster / shift grids ---------- */
.rsp-grid-wrap { overflow-x: auto; border: 1px solid var(--rsp-border); border-radius: var(--rsp-radius); background: #fff; }
.rsp-grid { border-collapse: collapse; min-width: 100%; }
.rsp-grid th { position: sticky; top: 0; background: #fff; text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--rsp-border); font-size: 13px; z-index: 1; }
.rsp-grid th small { display: block; color: var(--rsp-muted); font-weight: 600; font-size: 11px; }
.rsp-grid td { padding: 12px 10px; border-bottom: 1px solid #f0f0f1; vertical-align: top; }
.rsp-grid td.rsp-grid__emp { min-width: 190px; position: sticky; left: 0; background: #fff; z-index: 1; }
.rsp-grid__emp strong { display: block; }
.rsp-grid__emp small { display: block; color: var(--rsp-muted); font-size: 11px; }
.rsp-cell { width: 290px; min-width: 260px; }
.rsp-cell__times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rsp-cell__times label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--rsp-muted); font-weight: 600; }
.rsp-cell .rsp-check { margin: 8px 0; font-size: 12px; }
.rsp-cell textarea { min-height: 56px !important; font-size: 12px; }
.rsp-cell select { min-height: 34px; font-size: 12px; padding: 5px 8px; margin-top: 6px; }
.rsp-cell.is-locked { background: #f6f7f7; }
.rsp-cell.is-leave { background: #f1f1f1; }
.rsp-cell.is-sick { background: #fdecec; }
.rsp-cell.is-changed { box-shadow: inset 3px 0 0 var(--rsp-warn); }
.rsp-cell__flag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .03em; padding: 2px 8px; border-radius: 4px; background: #e9e9e9; color: #555; margin-bottom: 6px; }
.rsp-cell__flag--sick { background: #f8d7d7; color: var(--rsp-bad); }
.rsp-cell__flag--leave { background: #e2e2e2; }
.rsp-cell__flag--site { background: #e8eef8; color: #2d5aa0; }
.rsp-save-state { font-size: 12px; color: var(--rsp-muted); min-height: 16px; }
.rsp-save-state.is-error { color: var(--rsp-bad); }

/* Employee week view (My Roster) */
.rsp-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.rsp-day { border: 1px solid var(--rsp-border); border-radius: var(--rsp-radius); padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.rsp-day.is-today { border-color: var(--rsp-accent); box-shadow: 0 0 0 1px var(--rsp-accent); }
.rsp-day.is-off { background: #fafafa; }
.rsp-day__name { font-weight: 800; }
.rsp-day__date { color: var(--rsp-muted); font-size: 12px; }
.rsp-day__time { font-size: 18px; font-weight: 700; }
.rsp-day.is-off .rsp-day__time { color: var(--rsp-muted); font-weight: 600; font-size: 15px; }

/* Modal (native <dialog>) */
.rsp-modal { border: 0; border-radius: 12px; padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.rsp-modal::backdrop { background: rgba(20, 20, 30, .45); }
.rsp-modal__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--rsp-border); }
.rsp-modal__head h3 { margin: 0; font-size: 17px; }
.rsp-modal__body { padding: 18px 20px; }
.rsp-modal__close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--rsp-muted); }

/* Login */
.rsp-login { max-width: 440px; margin: 30px auto; }
.rsp-login__logo { max-height: 60px; margin-bottom: 10px; }
.rsp-login form p { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.rsp-login .login-remember label { flex-direction: row; display: flex; gap: 6px; align-items: center; }
.rsp-login input[type=submit] { background: var(--rsp-accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 20px; font-weight: 700; cursor: pointer; }

/* Signature pad */
.rsp-signature { border: 1px dashed #c3c4c7; border-radius: 8px; background: #fff; touch-action: none; width: 100%; height: 160px; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.rsp-portal { grid-template-columns: 1fr; gap: 14px; }
	.rsp-menu-toggle { display: inline-flex; align-items: center; gap: 6px; justify-self: start; border: 1px solid var(--rsp-border); background: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
	.rsp-sidebar { display: none; position: static; }
	.rsp-portal.is-menu-open .rsp-sidebar { display: block; }
	.rsp-split { grid-template-columns: 1fr; }
	.rsp-kv { grid-template-columns: 1fr; }
}
@media print {
	.rsp-sidebar, .rsp-menu-toggle, .rsp-card__actions, .rsp-btn, form.rsp-filters { display: none !important; }
	.rsp-portal { display: block; }
}
