/* Defeem Group of Companies — Feem purple theme (same look as Feem Meeting Room). */
:root {
  --brand: #8b3893;
  --brand-deep: #43174d;
  --bg: #f5f4f7;
  --surface: #ffffff;
  --surface-2: #f3f1f5;
  --text: #221c27;
  --muted: #6a6372;
  --border: #e2dee7;
  --line: #eeebf1;
  --accent: #7b2d86;
  --accent-text: #ffffff;
  --danger: #b42318;
  --ok: #1f7a4d;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
[hidden] { display: none !important; }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: var(--surface);
  border-top: 4px solid var(--brand); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(34, 28, 39, .06);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-width: 0; }
.brand .logo { height: 36px; width: auto; display: block; }
.brand-text { display: grid; gap: 1px; padding-left: 14px; border-left: 1px solid var(--border); min-width: 0; }
.brand-text .company { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text h1 { font-size: 17px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top nav { display: flex; gap: 8px; align-items: center; }

main { padding: 20px 20px 48px; max-width: 1100px; margin: 0 auto; }
main.narrow { max-width: 720px; }

button, .btn {
  font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
button:hover, .btn:hover { background: var(--surface-2); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
button.big { font-size: 17px; padding: 14px 20px; width: 100%; font-weight: 600; }

input, select, textarea {
  font: inherit; font-size: 15px; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.req { color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card h2 { font-size: 17px; margin: 0 0 12px; color: var(--brand-deep); }
.card h3 { font-size: 15px; margin: 18px 0 8px; }

.msg { padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.msg.err { background: #fdecea; color: var(--danger); }
.msg.ok { background: #e7f5ee; color: var(--ok); }

/* ---------- Trainee form ---------- */
.training-head { background: var(--brand-deep); color: #fff; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.training-head .kicker { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.training-head h2 { margin: 4px 0 8px; font-size: 21px; color: #fff; }
.training-head .meta { font-size: 14px; opacity: .92; display: flex; flex-wrap: wrap; gap: 4px 16px; }

.scale-key { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.q { padding: 12px 0; border-top: 1px solid var(--line); }
.scale-key + .q, #recommendCard .q { border-top: 0; }
.q .qtext { font-size: 15px; margin-bottom: 8px; }
.q.missing .qtext { color: var(--danger); font-weight: 600; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rating button, .choice button {
  padding: 10px 2px 8px; font-size: 18px; font-weight: 700; display: grid; gap: 2px; justify-items: center; line-height: 1.1;
}
.rating button small { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.rating button[aria-pressed="true"], .choice button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.rating button[aria-pressed="true"] small { color: #f1e3f3; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choice button { font-size: 16px; }
.progress { position: sticky; top: 0; z-index: 5; height: 5px; background: var(--line); }
.progress span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.done-box { text-align: center; padding: 36px 20px; }
.done-box .tick { font-size: 54px; color: var(--ok); }

/* ---------- HR pages ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.open { background: #e7f5ee; color: var(--ok); }
.score { font-weight: 700; }
.score.good { color: var(--ok); }
.score.mid { color: #9a6700; }
.score.low { color: var(--danger); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: 12.5px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 700; color: var(--brand-deep); margin-top: 4px; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 500; }

.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--brand); }
.dist { display: inline-flex; gap: 2px; align-items: flex-end; height: 22px; }
.dist i { display: block; width: 8px; background: var(--brand); opacity: .75; border-radius: 2px 2px 0 0; }

.qr-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-box .qr { width: 150px; height: 150px; flex: none; border: 1px solid var(--border); border-radius: 6px; }
.link-line { font-family: Consolas, monospace; font-size: 13.5px; background: var(--surface-2); padding: 6px 10px; border-radius: 6px; word-break: break-all; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.comment-list { margin: 0; padding: 0; list-style: none; }
.comment-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.comment-list li .who { font-size: 12.5px; color: var(--muted); }

dialog { border: 1px solid var(--border); border-radius: 12px; padding: 20px; width: min(480px, 94vw); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(20, 10, 25, .45); }
dialog h2 { margin-top: 0; font-size: 18px; }

@media (max-width: 600px) {
  header.top { padding: 10px 14px; }
  .brand .logo { height: 28px; }
  .brand-text { padding-left: 10px; }
  .brand-text h1 { font-size: 15px; }
  main { padding: 14px 12px 40px; }
  .card { padding: 14px 14px; }
}

@media print {
  body { background: #fff; font-size: 12px; }
  header.top, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .card, .kpi { border-color: #ccc; break-inside: avoid; }
  .bar span, .dist i { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
