/* ============================================================
   ECG Feedback — supplement to shared.css
   shared.css owns the design tokens, base, fonts, dark mode and the
   app shell (fixed nav + sidebar). This file carries the components
   that are specific to the Feedback app, mapped onto the SAME tokens
   so the two stay in sync. Mirror of Event Manager's em.css.
   ============================================================ */

/* ── Topbar logo (the ring mark / company logo in .nav-logo) ── */
.brand-mark{ width:28px; height:28px; border-radius:50%; border:3px solid var(--brand);
  display:inline-block; box-sizing:border-box; }
.brand-logo{ height:30px; width:auto; max-width:160px; display:inline-block; object-fit:contain; }
.brand-name{ font-weight:600; letter-spacing:.2px; }
/* shared.css inverts .nav-logo img in dark mode for the black ECG mark; keep
   a coloured per-company logo as-is. */
[data-theme="dark"] .nav-logo img.brand-logo,
:root:not([data-theme="light"]) .nav-logo img.brand-logo{ filter:none; }

/* ── Sidebar links are text-only, matching GAL's nav (shared .side-link) ── */

/* ── Topbar user menu (dropdown under the .nav-user-btn) ── */
.menu{
  position:absolute; right:18px; top:calc(var(--nav-h) - 2px); z-index:400;
  background:var(--surface); border:1px solid var(--border-soft); border-radius:10px;
  box-shadow:var(--shadow-lg); min-width:220px; padding:6px;
}
.menu-item{
  display:flex; align-items:center; gap:8px; width:100%; padding:9px 10px; border-radius:6px;
  background:transparent; border:0; color:var(--text); cursor:pointer; font:inherit; text-align:left;
}
.menu-item:hover{ background:var(--surface-hover); }
.menu-sep{ height:1px; background:var(--border-softer); margin:4px 0; }

/* Round initials avatar (topbar user button + list rows) */
.avatar{ width:26px; height:26px; border-radius:50%; background:var(--brand); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; letter-spacing:.5px; flex:none; }

/* ── Page header (bare <h1> + .sub inside shared .page-head) ── */
.page-head h1{ font-size:22px; margin:0; color:var(--text); }
.page-head .sub{ color:var(--text-muted); font-size:13px; }

/* ── Buttons — Feedback markup uses a bare .btn as the PRIMARY button,
   plus its own -ghost / -danger / -sm / -block modifiers. Kept on the
   shared tokens so they match .btn--primary etc. ── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 14px; border:1px solid transparent; border-radius:var(--radius-sm);
  background:var(--brand); color:#fff; font:inherit; font-weight:500; cursor:pointer;
  transition:background .15s, transform .05s, box-shadow .15s;
  box-shadow:0 2px 6px rgba(26,155,216,.18); white-space:nowrap; text-decoration:none;
}
.btn:hover{ background:var(--brand-hover); }
.btn:active{ transform:translateY(1px); }
.btn:disabled{ opacity:.6; cursor:not-allowed; }
.btn-block{ width:100%; }
.btn-ghost{ background:var(--surface); color:var(--text-mid); border-color:var(--border-soft); box-shadow:none; }
.btn-ghost:hover{ background:var(--surface-hover); color:var(--text); border-color:var(--border); }
.btn-danger{ background:rgba(239,68,68,.10); color:#b91c1c; border-color:rgba(239,68,68,.30); box-shadow:none; }
.btn-danger:hover{ background:rgba(239,68,68,.18); border-color:rgba(239,68,68,.45); }
[data-theme="dark"] .btn-danger,
:root:not([data-theme="light"]) .btn-danger{ background:rgba(239,68,68,.18); color:#fecaca; border-color:rgba(239,68,68,.45); }
.btn-sm{ padding:6px 10px; font-size:13px; }

/* ── Fields / inputs (Feedback uses .input / .select / .textarea classes) ── */
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.field label{ font-size:12px; color:var(--text-muted); font-weight:500; }
.field .hint{ font-size:11px; color:var(--text-light); margin-top:2px; }
.input,.select{
  width:100%; height:38px; padding:0 11px; font:inherit; color:var(--text);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  box-sizing:border-box; line-height:36px;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
/* Native <select> clips text at a fixed line-height, so let the browser
   centre it (same fix as Event Manager's em.css). */
.select{ padding-right:30px; line-height:normal; }
.textarea{
  width:100%; padding:9px 11px; font:inherit; color:var(--text);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  box-sizing:border-box; transition:border-color .15s, box-shadow .15s, background .15s;
}
.input:hover,.select:hover,.textarea:hover{ border-color:var(--text-light); }
.input:focus,.select:focus,.textarea:focus{
  outline:none; border-color:var(--brand); background:var(--brand-soft);
  box-shadow:0 0 0 3px var(--brand-ring);
}
[data-theme="dark"] .input:focus,
[data-theme="dark"] .select:focus,
[data-theme="dark"] .textarea:focus{ background:var(--surface-alt); }
.input-with-icon{ position:relative; }
.input-with-icon .input,
.input-with-icon .select{ padding-left:38px; }
.input-with-icon svg{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; color:var(--text-light); pointer-events:none;
}
.row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:520px){ .row{ grid-template-columns:1fr; } }

/* ── Card / list table (Feedback's .card is a flush container: no padding) ── */
.card{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:0; margin-bottom:0; }
.toolbar{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:12px 14px; border-bottom:1px solid var(--border-softer); margin-bottom:0; }
.toolbar .grow{ flex:1; min-width:160px; }
.table-wrap{ overflow-x:auto; background:transparent; border:0; box-shadow:none; }
table.list{ width:100%; border-collapse:collapse; }
table.list th, table.list td{ padding:10px 14px; text-align:left; border-bottom:1px solid var(--border-softer); }
table.list th{ font-size:11px; color:var(--text-muted); font-weight:600; letter-spacing:.6px; text-transform:uppercase; background:var(--surface-alt); position:sticky; top:0; }
table.list tr:last-child td{ border-bottom:0; }
table.list tbody tr{ transition:background .12s; }
table.list tbody tr:hover{ background:var(--surface-hover); }
table.list td.actions{ text-align:right; white-space:nowrap; }
.kebab-wrap{ display:inline-block; }
.kebab-btn{ padding:4px 8px; line-height:0; }
.kebab-menu{
  position:fixed; z-index:1000; min-width:170px; background:var(--surface);
  border:1px solid var(--border-soft); border-radius:10px; box-shadow:var(--shadow-md);
  padding:6px; display:flex; flex-direction:column;
}
.kebab-item{ display:block; width:100%; text-align:left; border:0; background:transparent;
  padding:9px 12px; border-radius:7px; font-size:14px; color:var(--text); cursor:pointer; }
.kebab-item:hover{ background:var(--surface-hover); }
.kebab-item.danger{ color:var(--red); }

.muted{ color:var(--text-muted); }
.dim{ color:var(--text-light); }
.empty{ padding:36px 18px; text-align:center; color:var(--text-muted); }

/* ── Chips / role badges ── */
.chip{
  display:inline-block; padding:2px 9px; border-radius:999px; font-size:11px; font-weight:600;
  letter-spacing:.4px; text-transform:uppercase; border:1px solid transparent;
}
.chip.role-admin { background:#5b21b610; color:#7c3aed; border-color:#7c3aed40; }
.chip.role-hr    { background:#1a9bd810; color:var(--brand); border-color:var(--brand-ring); }
.chip.role-head  { background:#0d948810; color:#0d9488; border-color:#0d948840; }
.chip.role-senior{ background:#10b98110; color:#10b981; border-color:#10b98140; }
.chip.role-junior{ background:#f59e0b10; color:#b45309; border-color:#f59e0b40; }
[data-theme="dark"] .chip.role-junior{ color:#fbbf24; }
.chip.status-inactive{ background:#ef444410; color:var(--red); border-color:#ef444440; }

/* ── Modal (Feedback's head / scrolling body / foot layout) ── */
.modal-overlay{
  position:fixed; inset:0; z-index:400; background:rgba(15,23,42,.45);
  display:flex; align-items:center; justify-content:center; padding:20px;
  backdrop-filter:blur(2px);
}
[data-theme="dark"] .modal-overlay,
:root:not([data-theme="light"]) .modal-overlay{ background:rgba(0,0,0,.65); }
.modal{
  background:var(--surface); border:1px solid var(--border-soft); border-radius:14px;
  box-shadow:var(--shadow-lg); width:100%; max-width:640px; max-height:calc(100vh - 40px);
  display:flex; flex-direction:column; overflow:hidden; padding:0;
}
.modal-head{ display:flex; align-items:center; gap:10px; padding:14px 18px; border-bottom:1px solid var(--border-softer); margin-bottom:0; }
.modal-head h2{ margin:0; font-size:16px; color:var(--text); }
.modal-body{ padding:18px; overflow-y:auto; }
.modal-foot{ display:flex; gap:8px; justify-content:flex-end; padding:12px 18px; border-top:1px solid var(--border-softer); background:var(--surface-alt); margin-top:0; }

.section-title{ font-size:11px; letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted); margin:14px 0 8px; }
.section-title:first-child{ margin-top:0; }

/* ── Toast ── */
.toast{
  position:fixed; right:18px; bottom:18px; z-index:600;
  padding:11px 14px; background:var(--text); color:#fff; border-radius:8px;
  box-shadow:var(--shadow-lg); max-width:380px; font-size:13px;
}
.toast.success{ background:var(--green); }
.toast.error{ background:var(--red); }

/* ── Juniors widget ── */
.juniors{ display:flex; flex-direction:column; gap:6px; background:var(--surface-alt); border:1px solid var(--border-softer); border-radius:8px; padding:6px; }
.junior-row{ display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:6px; background:var(--surface); }
.junior-row .grow{ flex:1; }
.junior-row .name{ font-weight:500; }
.junior-row .meta{ font-size:12px; color:var(--text-muted); }

/* ── Alert ── */
.alert{
  margin:0 0 14px; padding:10px 12px;
  border:1px solid color-mix(in srgb, var(--red) 30%, transparent);
  background:color-mix(in srgb, var(--red) 8%, var(--surface));
  color:var(--red); border-radius:var(--radius-sm); font-size:13px;
}

/* ── Dashboard ── */
.dash-co{ margin-bottom:22px; }
.dash-co-head{ display:flex; align-items:center; margin-bottom:10px; }
.dash-co-head h2{ margin:0; font-size:16px; font-weight:600; color:var(--text); }
.dash-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; }
.dash-box{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:16px 18px; display:flex; flex-direction:column; gap:4px; transition:box-shadow .12s, transform .12s; }
.dash-box:hover{ box-shadow:var(--shadow-md); transform:translateY(-1px); }
.dash-box-clickable{ cursor:pointer; }
.dash-box-clickable:hover{ border-color:var(--brand); }
.dash-box-clickable:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.dash-box-val{ font-size:28px; font-weight:700; line-height:1; letter-spacing:-.02em; }
.dash-box-lbl{ font-size:12px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.8px; }
@media (max-width:520px){ .dash-grid{ grid-template-columns:repeat(2,1fr); } }

/* ── Form editor ── */
.editor-head{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:14px 16px; background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow-sm); margin-bottom:18px; }
.editor-head .name-input{ border:0; padding:6px 8px; font-size:18px; font-weight:600; background:transparent; color:var(--text); flex:1 1 220px; min-width:200px; }
.editor-head .name-input:focus{ outline:none; background:var(--brand-soft); border-radius:6px; }
.editor-head .desc-input{ border:1px solid var(--border-soft); padding:6px 9px; border-radius:6px; background:var(--surface); color:var(--text); flex:1 1 100%; font-size:13px; }
.editor-head .desc-input:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring); }
.editor-head .actions{ display:flex; gap:8px; align-items:center; flex-shrink:0; }
.group-card{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); margin-bottom:14px; box-shadow:var(--shadow-sm); overflow:hidden; }
.group-head{ display:flex; gap:10px; align-items:center; padding:10px 14px; background:var(--surface-alt); border-bottom:1px solid var(--border-softer); }
.group-head .title-input{ border:0; padding:5px 6px; background:transparent; font-size:15px; font-weight:600; color:var(--text); flex:1; min-width:160px; }
.group-head .title-input:focus{ outline:none; background:var(--surface); border-radius:6px; box-shadow:0 0 0 3px var(--brand-ring); }
.group-body{ padding:8px; }
.question-row{ border:1px solid var(--border-softer); border-radius:8px; padding:10px 12px; margin-bottom:8px; background:var(--surface); }
.question-row + .question-row{ margin-top:0; }
.question-row .q-text{ width:100%; border:0; background:transparent; font-size:14px; font-weight:500; color:var(--text); padding:4px 0; }
.question-row .q-text:focus{ outline:none; }
.question-row .q-desc{ width:100%; border:0; background:transparent; font-size:12px; color:var(--text-muted); padding:2px 0; resize:none; font-family:inherit; min-height:18px; }
.question-row .q-desc:focus{ outline:none; color:var(--text); }
.q-meta{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:8px; font-size:12px; }
.q-meta select.select-sm{ padding:5px 8px; font-size:12px; width:auto; height:auto; line-height:normal; }
.q-toggle{ display:inline-flex; align-items:center; gap:5px; color:var(--text-mid); cursor:pointer; }
.q-toggle input{ margin:0; accent-color:var(--brand); }
.scale-editor{ margin-top:6px; display:flex; flex-wrap:wrap; gap:6px; }
.scale-pill{ display:inline-flex; align-items:center; gap:4px; background:var(--brand-soft); color:var(--brand); border:1px solid var(--brand-ring); border-radius:999px; padding:3px 4px 3px 10px; font-size:12px; }
.scale-pill button{ background:transparent; border:0; color:var(--brand); cursor:pointer; border-radius:50%; width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; font-size:14px; line-height:1; }
.scale-pill button:hover{ background:rgba(0,0,0,.07); }
.scale-add{ background:transparent; border:1px dashed var(--border); color:var(--text-muted); border-radius:999px; padding:3px 10px; font-size:12px; cursor:pointer; }
.scale-add:hover{ border-color:var(--brand); color:var(--brand); }

/* ── Form preview (rendered like the real fill-in form) ── */
.preview-form{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:24px 28px; }
.preview-form h2{ margin:0 0 4px; font-size:20px; }
.preview-form .form-desc{ color:var(--text-muted); font-size:13px; margin-bottom:18px; }
.preview-group{ margin-bottom:20px; }
.preview-group h3{ margin:0 0 10px; font-size:12px; font-weight:600; letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted); padding-bottom:6px; border-bottom:1px solid var(--border-softer); }
.preview-q{ padding:12px 0; border-bottom:1px dashed var(--border-softer); }
.preview-q:last-child{ border-bottom:0; }
.preview-q-text{ font-size:16px; font-weight:600; line-height:1.35; }
.preview-q-desc{ font-size:13px; color:var(--text-muted); margin-top:3px; }
.preview-q-controls{ margin-top:10px; }
.scale-radios{ display:flex; flex-wrap:wrap; gap:14px 18px; }
.scale-radio{ display:inline-flex; align-items:center; gap:8px; font-size:15px; color:var(--text-mid); cursor:pointer; }
.scale-radio input{ accent-color:var(--brand); width:20px; height:20px; margin:0; }
.preview-textarea{ margin-top:8px; width:100%; min-height:54px; resize:vertical; border:1px solid var(--border-softer); border-radius:6px; padding:8px 10px; background:var(--surface-alt); color:var(--text-mid); font:inherit; font-size:13px; }
.preview-textarea::placeholder{ color:var(--text-light); }
.preview-textarea:focus{ outline:none; border-color:var(--brand-ring); background:var(--surface); color:var(--text); }
.req-asterisk{ color:var(--red); margin-left:4px; }

@media (max-width:760px){
  .preview-form{ padding:18px 16px; border-radius:10px; }
  .preview-form h2{ font-size:18px; }
  .preview-q-text{ font-size:15px; }
  .scale-radios{ gap:10px 14px; }
  .scale-radio{ font-size:15px; padding:4px 0; min-height:30px; }
  .scale-radio input{ width:22px; height:22px; }
  .preview-textarea{ font-size:13px; }
  .page-head h1{ font-size:18px; }
  .editor-head{ padding:10px; flex-direction:column; align-items:stretch; gap:8px; }
  .editor-head .name-input{ font-size:16px; width:100%; }
  .editor-head .desc-input{ width:100%; min-height:34px; }
  .editor-head .actions{ justify-content:flex-end; }
  .group-head{ flex-wrap:wrap; gap:6px; }
  .group-head .title-input{ width:100%; flex:1 0 100%; }
  .group-head .btn{ flex:0 0 auto; }
  .question-row{ padding:8px 10px; }
  .q-meta{ gap:8px 10px; }
  .q-meta select.select-sm{ flex:1 0 auto; }
  .scale-editor{ overflow-x:auto; flex-wrap:nowrap; padding-bottom:4px; }
  .scale-editor .scale-pill, .scale-editor .scale-add{ flex:0 0 auto; white-space:nowrap; }
  .table-wrap{ -webkit-overflow-scrolling:touch; }
  .table-wrap table.list{ min-width:640px; }
  .toolbar{ padding:10px; gap:6px; }
  .toolbar .grow{ flex:1 0 100%; }
}

/* ── Login page (two-panel card) ── */
.login-shell{ min-height:calc(100vh - var(--nav-h)); display:grid; place-items:center; padding:24px; }
.login-card{ width:100%; max-width:920px; background:var(--surface); border:1px solid var(--border-soft); border-radius:14px; box-shadow:var(--shadow-lg); overflow:hidden; display:grid; grid-template-columns:1fr 1px 1fr; }
@media (max-width:760px){
  .login-card{ grid-template-columns:1fr; max-width:420px; }
  .login-card .divider{ display:none; }
  .login-card .panel + .panel{ border-top:1px solid var(--border-softer); }
}
.login-card .panel{ padding:32px 28px; }
.login-card .panel-title{ text-align:center; font-size:11px; font-weight:600; letter-spacing:1.4px; color:var(--text-muted); text-transform:uppercase; margin:0 0 22px; }
.login-card .divider{ background:var(--border-softer); }
.muted-row{ text-align:center; font-size:12px; color:var(--text-muted); margin-top:14px; }
