/* Privacy Services Intake — visual styles
   Light, calm UI tuned to the design mockup: neutral background, soft
   panels, purple accent. Used by both the Requester and Admin views. */

:root {
  --bg: #f4f4f7;
  --panel: #ffffff;
  --ink: #1a1a1f;
  --muted: #5f6470;
  --line: #e3e4ea;
  --line-strong: #c9cad2;
  --accent: #6b3fd4;
  --accent-soft: #ede7fb;
  --accent-ink: #4a25a8;
  --ok: #1f8a5b;
  --ok-soft: #e3f5ec;
  --warn: #b85c00;
  --warn-soft: #fbeede;
  --danger: #b8273c;
  --danger-soft: #fbe4e8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

/* Top bar */
header.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 12px 24px; display: flex; align-items: center; gap: 16px;
}
.brand { font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; }
.brand .dot {
  display: inline-block; width: 10px; height: 10px;
  background: var(--accent); border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
}
.spacer { flex: 1; }
.view-toggle {
  display: inline-flex; background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px;
}
.view-toggle button {
  border: 0; background: transparent;
  padding: 6px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.view-toggle button:hover { color: var(--ink); }
.view-toggle button.active {
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow);
}

main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Generic */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 16px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 {
  font-size: 14px; margin: 0 0 8px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
p.lede { color: var(--muted); margin: 0 0 16px; }
.crumbs {
  display: flex; gap: 6px; align-items: center;
  color: var(--muted); font-size: 13px; margin-bottom: 12px;
}
.crumbs button {
  border: 0; background: transparent; padding: 0;
  color: var(--accent-ink); cursor: pointer;
}
.crumbs button:hover { color: var(--accent); }
.crumbs span.sep { opacity: 0.5; }
.pill {
  display: inline-block; padding: 2px 8px;
  background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px; font-size: 12px; font-weight: 500;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.muted { background: var(--bg); color: var(--muted); }

/* Card grid */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all 0.15s ease;
  text-align: left; color: var(--ink);
  font-family: inherit; font-size: inherit;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card .name { font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.ico { display: inline-block; font-size: 1.1em; line-height: 1; }
h1 .ico { font-size: 0.9em; margin-right: 8px; vertical-align: -2px; }
.svc-item .ico { font-size: 14px; line-height: 1; }
.kv .v .ico { margin-right: 6px; }
.card .desc { color: var(--muted); font-size: 13px; }
.card .meta { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.card.add {
  border: 1.5px dashed var(--line); background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; font-weight: 500;
}
.card.add:hover { border-color: var(--accent); color: var(--accent-ink); }

/* Form */
.form-grid { display: grid; gap: 16px; }
.field label.fl { display: block; font-weight: 500; margin-bottom: 4px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=date],
.field textarea, .field select {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font-family: inherit; font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}
.field textarea { min-height: 80px; resize: vertical; }
.opts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.opts label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.opts input[type=radio], .opts input[type=checkbox] { accent-color: var(--accent); }
.file-mock {
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; color: var(--muted); font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-weight: 500;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn.primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 6px 8px; }
.btn.ghost:hover { color: var(--ink); background: var(--bg); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.sm { padding: 4px 10px; font-size: 13px; }

.actions-row {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}

/* Admin layout */
.admin-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.sidebar .svc-item {
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.sidebar .svc-item:hover { background: var(--bg); }
.sidebar .svc-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.sidebar .svc-item .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.sidebar .svc-item.active .count { color: var(--accent-ink); }

.editor-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.editor-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.field-row {
  display: grid; grid-template-columns: 1fr 140px 80px auto; gap: 10px;
  align-items: center; padding: 10px 12px;
  background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 6px;
}
.field-row .lbl { font-weight: 500; }
.field-row .typ { color: var(--muted); font-size: 13px; }
.field-row .req-cell { font-size: 12px; color: var(--muted); }
.field-row .req-cell.req-yes { color: var(--accent-ink); font-weight: 500; }
.row-actions { display: flex; gap: 4px; }

.rt-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; background: var(--panel);
}
.rt-card .rt-head { display: flex; align-items: center; gap: 10px; }
.rt-card .rt-head .rt-name { font-weight: 600; }
.rt-card .rt-head .rt-actions { margin-left: auto; display: flex; gap: 4px; }
.rt-card .rt-desc { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }

/* Modal */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(20, 20, 30, 0.4);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--panel); border-radius: var(--radius);
  width: min(560px, 92vw); max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* Submitted preview */
.submitted { padding: 24px; text-align: center; }
.submitted .check {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; margin-bottom: 12px;
}
.submitted-data { margin-top: 20px; text-align: left; }
.kv {
  display: grid; grid-template-columns: 240px 1fr; gap: 6px 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.kv .k { color: var(--muted); }
.kv .v { font-weight: 500; word-break: break-word; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white;
  padding: 10px 16px; border-radius: 999px; font-size: 13px;
  opacity: 0; transition: opacity 0.2s ease;
  pointer-events: none; z-index: 200;
}
.toast.show { opacity: 1; }

.empty {
  padding: 40px; text-align: center; color: var(--muted);
  border: 1.5px dashed var(--line); border-radius: var(--radius);
}

details.advanced > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 8px 0; }
