/* =========================================================
   CALL FLOW — ADMIN CONSOLE
   One stylesheet for the whole console (light theme,
   green sidebar). Replaces styles.css and admin.css.
   ========================================================= */

:root {
  --bg: #eae4d8;
  --card: #f6f2e8;
  --input: #fbf8f1;
  --soft: #eee8db;
  --hero-a: #faf7ef;
  --hero-b: #f1ebdd;
  --hero-c: #f6e7dc;
  --line: #dbd3c1;
  --line-strong: #cbc1ac;

  --text: #16204d;
  --text-2: #394572;
  --muted: #6b7799;
  --faint: #98a3bf;

  --blue: #3b82f6;
  --cyan: #1aa7d6;
  --purple: #7c5cff;
  --pink: #ee3f8f;
  --coral: #ff5d6c;
  --orange: #ff8a3d;
  --yellow: #ffc13d;
  --teal: #12b3a0;
  --green: #12a877;
  --red: #e5384f;

  --grad-hot: linear-gradient(120deg, #ee3f8f 0%, #ff6a5c 55%, #ff9a3d 100%);
  --grad-green: linear-gradient(120deg, #0fa37f 0%, #17c08e 100%);
  --grad-teal-gold: linear-gradient(110deg, #0e9486 0%, #4fb582 55%, #ffb82e 100%);
  --grad-purple: linear-gradient(135deg, #5b6cf0 0%, #8a5cf0 100%);
  --grad-cool: linear-gradient(135deg, #25b8e6 0%, #3b82f6 100%);
  --grad-warm: linear-gradient(135deg, #ff6478 0%, #ff9a3d 100%);

  --shadow: 0 12px 34px rgba(40, 56, 120, 0.10), 0 2px 8px rgba(40, 56, 120, 0.05);
  --shadow-soft: 0 6px 18px rgba(40, 56, 120, 0.07);
  --sidebar-w: 270px;
}


/* ---------- base ---------- */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(620px 420px at 100% 100%, rgba(255, 190, 150, 0.35), transparent 70%),
    radial-gradient(560px 380px at 78% 108%, rgba(255, 170, 205, 0.30), transparent 70%),
    radial-gradient(520px 360px at 20% -8%, rgba(150, 190, 255, 0.28), transparent 70%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
[hidden] { display: none !important; }
::selection { background: rgba(124, 92, 255, 0.28); }

* { scrollbar-width: thin; scrollbar-color: rgba(60, 80, 140, 0.28) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(60, 80, 140, 0.24); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(60, 80, 140, 0.4); }

.muted { color: var(--muted); }
.subtle { color: var(--muted); font-size: 14px; }

.section-label {
  margin-bottom: 4px;
  color: var(--pink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes cfPageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}


/* ---------- shell ---------- */

.console {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

body.menu-hidden .console { grid-template-columns: 0 minmax(0, 1fr); }
body.menu-hidden .sidebar { display: none; }

.console-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px 26px 0;
}

.page-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 6px 36px 0;
}


/* ---------- sidebar ---------- */

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 22px 16px 18px;
  overflow: hidden;
  color: #e9fff8;
  background:
    radial-gradient(420px 300px at 0% 0%, rgba(47, 211, 155, 0.30), transparent 70%),
    linear-gradient(172deg, #0a4a45 0%, #0b3d52 50%, #2b1f68 100%);
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar-leaves {
  position: absolute !important;
  inset: auto 0 0 0;
  z-index: 0 !important;
  width: 100%;
  height: 52%;
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 22px; }

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ee3f8f, #a53df0);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.30), inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  font-size: 26px;
  font-weight: 900;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: #fff; font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }
.brand-text small { margin-top: 3px; color: rgba(233, 255, 248, 0.75); font-size: 13px; font-weight: 600; }

.main-navigation { display: flex; flex-direction: column; gap: 6px; }

.nav-button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(245, 255, 252, 0.92);
  font-size: 15.5px;
  font-weight: 700;
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease;
}

.nav-icon { flex: none; width: 23px; height: 23px; }
.nav-chevron { display: none; margin-left: auto; font-size: 24px; font-style: normal; line-height: 1; }

.nav-button:hover { background: rgba(255, 255, 255, 0.10); }

.nav-button.active {
  color: #fff;
  background: var(--grad-hot);
  box-shadow: 0 12px 24px rgba(238, 63, 143, 0.38);
}

.nav-button.active .nav-chevron { display: block; }

.nav-button:focus-visible,
.sb-btn:focus-visible,
.menu-button:focus-visible { outline: 2px solid #ffd24d; outline-offset: 2px; }

.sidebar-spacer { flex: 1 1 auto; min-height: 16px; }

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 10px;
  border-radius: 16px;
  background: rgba(8, 14, 50, 0.62);
  backdrop-filter: blur(6px);
}

.sb-user-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }

.sb-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b6cf0, #8a5cf0);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.sb-user-head div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.25; }
.sb-user-head strong { max-width: 150px; overflow: hidden; color: #fff; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }

.sb-user-head small {
  margin-top: 3px;
  padding: 1px 9px;
  border-radius: 99px;
  background: rgba(47, 211, 155, 0.28);
  color: #b7ffe4;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sb-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(245, 255, 252, 0.92);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.sb-btn svg { flex: none; width: 19px; height: 19px; }
.sb-btn:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }


/* ---------- top bar ---------- */

.top-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.menu-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
}
.menu-button svg { width: 24px; height: 24px; }
.menu-button:hover { background: rgba(60, 80, 140, 0.09); }

.crumbs { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 17px; }
.crumbs strong { font-weight: 800; }
.crumbs i { color: var(--faint); font-style: normal; font-size: 20px; line-height: 1; }
.crumbs span { overflow: hidden; color: var(--muted); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }

.top-chips { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.chip svg { width: 18px; height: 18px; color: var(--text); }
.chip-date b { padding-left: 10px; border-left: 1px solid var(--line-strong); font-weight: 700; font-variant-numeric: tabular-nums; }

.chip-online { border-color: #cfeee1; background: #e5f7ee; color: #14684c; }
.chip-online i { width: 12px; height: 12px; border-radius: 50%; background: #17c06f; box-shadow: 0 0 0 4px rgba(23, 192, 111, 0.18); }
.chip-online.offline { border-color: #f6cdd3; background: #fdecee; color: #a52c3f; }
.chip-online.offline i { background: var(--red); box-shadow: 0 0 0 4px rgba(229, 56, 79, 0.18); }

.top-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b6cf0, #8a5cf0);
  box-shadow: 0 6px 14px rgba(91, 108, 240, 0.35);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}


/* ---------- hero ---------- */

.hero {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 160px;
  margin-top: 14px;
  padding: 24px 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(420px 260px at 90% 40%, rgba(255, 214, 160, 0.75), transparent 70%),
    radial-gradient(360px 220px at 70% 100%, rgba(255, 190, 215, 0.55), transparent 70%),
    linear-gradient(110deg, var(--hero-a) 0%, var(--hero-b) 55%, var(--hero-c) 100%);
  box-shadow: var(--shadow);
}

.page-heading-content { position: relative; z-index: 1; max-width: 640px; }

.hero-kicker { margin-bottom: 6px; color: var(--text-2); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }

.hero h1 { font-size: clamp(28px, 3vw, 42px); font-weight: 900; line-height: 1.1; letter-spacing: -0.035em; }

.h1-accent {
  background: linear-gradient(90deg, #ee3f8f, #ff7a45);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-subtitle { margin-top: 8px; color: var(--text-2); font-size: 16px; }

.hero-art { position: absolute; right: 0; top: 50%; width: min(470px, 46%); height: auto; transform: translateY(-50%); pointer-events: none; }


/* ---------- buttons ---------- */

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.primary-button { background: var(--grad-hot); box-shadow: 0 10px 22px rgba(238, 63, 143, 0.28); }
.secondary-button { border-color: var(--line-strong); background: var(--input); color: var(--text); box-shadow: var(--shadow-soft); }
.danger-button { border-color: #f8cdd5; background: #fdeef1; color: var(--red); }

.primary-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.secondary-button:hover:not(:disabled) { background: #f1ebdd; border-color: var(--blue); }
.danger-button:hover:not(:disabled) { background: #fbdfe5; }

button:disabled { cursor: not-allowed; opacity: 0.5; box-shadow: none; transform: none; }

.mini-button {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--input);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
}
.mini-button:hover:not(:disabled) { background: #f1edff; border-color: var(--purple); color: #5b3fd0; }


/* ---------- form controls ---------- */

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background-color: var(--input);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2316204d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

textarea { min-height: 96px; resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

input:disabled, select:disabled, textarea:disabled { background-color: var(--soft); color: var(--muted); cursor: not-allowed; }

label { color: var(--text); font-size: 13px; font-weight: 700; }

.field { margin: 0 0 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.field .required { margin-left: 3px; color: var(--pink); }
.field-help { margin-top: 6px; color: var(--muted); font-size: 12.5px; }


/* ---------- context row (Calling and Export) ---------- */

#global-caller-context { margin-bottom: 20px; }

body[data-page="setup"] #global-caller-context,
body[data-page="campaigns"] #global-caller-context,
body[data-page="queue"] #global-caller-context,
body[data-page="registry"] #global-caller-context,
body[data-page="dashboard"] #global-caller-context { display: none; }

.campaign-setup-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.campaign-setup-item,
.campaign-meta-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.campaign-setup-item label,
.campaign-meta-item span {
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* the little coloured tile at the left of every box */
.campaign-setup-item::after {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 5px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
  pointer-events: none;
}
.caller-setup-item::after { background-color: #e3eeff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%2212%22 cy=%228%22 r=%224%22/%3E%3Cpath d=%22M4.5 20c.8-4 3.7-6 7.5-6s6.7 2 7.5 6%22/%3E%3C/svg%3E"); }
.campaign-setup-campaign::after { background-color: #dcf6ea; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312a877' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2Z%22/%3E%3C/svg%3E"); }
.campaign-setup-description::after { background-color: #fff0d2; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M6 3.5h8.5L19 8v12.5H6V3.5Z%22/%3E%3Cpath d=%22M14 3.5V8h5M9 12h7M9 15.5h7%22/%3E%3C/svg%3E"); }
.campaign-setup-assigned::after { background-color: #eee7ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c5cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223.2%22/%3E%3Cpath d=%22M3 19c.6-3.4 2.8-5 6-5s5.4 1.6 6 5%22/%3E%3Ccircle cx=%2217%22 cy=%229%22 r=%222.5%22/%3E%3Cpath d=%22M16.5 14.2c2.6.1 4.1 1.5 4.5 4.3%22/%3E%3C/svg%3E"); }

.campaign-setup-item input,
.campaign-setup-item select { min-height: 46px; padding-left: 54px; font-weight: 600; }

.campaign-setup-item strong {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 6px 14px 6px 54px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--input);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}


/* ---------- calling page ---------- */

#calling-page, #export-page, #setup-page { animation: cfPageEnter 0.35s ease both; }

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.5fr);
  gap: 20px;
  align-items: start;
}

.contact-card,
.form-card,
.blank-page {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.contact-card { position: relative; padding: 22px 24px 24px; border-color: #b8ead6; box-shadow: 0 0 0 1px rgba(23, 192, 111, 0.12), var(--shadow); overflow: hidden; }

.contact-card > .section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: none;
}

.contact-card > .section-label::before {
  content: "";
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background-color: #14b07c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223.2%22/%3E%3Cpath d=%22M3 19c.6-3.4 2.8-5 6-5s5.4 1.6 6 5%22/%3E%3Ccircle cx=%2217%22 cy=%229%22 r=%222.5%22/%3E%3Cpath d=%22M16.5 14.2c2.6.1 4.1 1.5 4.5 4.3%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px;
  box-shadow: 0 8px 18px rgba(20, 176, 124, 0.35);
}

.contact-name { color: var(--text); font-size: clamp(25px, 2.4vw, 31px); font-weight: 900; line-height: 1.13; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.contact-number { margin: 4px 0 20px; color: var(--blue); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }

.contact-priority-duration { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-summary-left,
.contact-summary-right { display: grid; gap: 12px; align-content: start; }

.priority-block,
.call-count-block,
.duration-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.priority-block span,
.call-count-block span,
.duration-item span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }

.priority-block strong,
.call-count-block strong,
.duration-item strong { font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; }

.priority-block strong { color: #e07a12; }
.call-count-block strong { color: var(--blue); }
.duration-item strong { color: var(--text); }
.total-duration-item strong { color: var(--green); }

.call-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 20px; }

.call-controls .primary-button { background: var(--grad-green); box-shadow: 0 10px 22px rgba(15, 163, 127, 0.32); }
.call-controls .danger-button { min-height: 52px; }
.call-controls .primary-button { min-height: 52px; }

.call-state, .recording-note { display: none !important; }

.call-status-field { margin: 0 0 16px; }
.call-status-field label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 800; }

.next-person-row .primary-button,
.next-person-row button { width: 100%; min-height: 54px; background: var(--grad-teal-gold); box-shadow: 0 10px 22px rgba(14, 148, 134, 0.28); font-size: 16px; }

.empty-state,
.empty-form-state { padding: 6px 0 14px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.form-card { overflow: hidden; }

.form-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
}

#calling-page .form-card-heading {
  background: linear-gradient(110deg, #d83fb0 0%, #f0457f 45%, #ff9444 100%);
  color: #fff;
}

#calling-page .form-card-heading > div { position: relative; padding-left: 62px; }
#calling-page .form-card-heading > div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 14px;
  background-color: rgba(255, 255, 255, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M6 3.5h8.5L19 8v12.5H6V3.5Z%22/%3E%3Cpath d=%22M14 3.5V8h5M9 12h7M9 15.5h7%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px;
}

#calling-page .form-card-heading .section-label { margin-bottom: 1px; color: rgba(255, 255, 255, 0.88); }
#calling-page .form-card-heading h2 { color: #fff; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }

.count-badge {
  padding: 7px 14px;
  border-radius: 99px;
  background: #fff;
  color: #e5387a;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

#response-form { padding: 22px 24px 4px; }

.form-actions { padding: 6px 24px 24px; }
.form-actions .primary-button { width: 100%; min-height: 52px; background: var(--grad-green); box-shadow: 0 10px 22px rgba(15, 163, 127, 0.30); font-size: 16px; }
.save-message { margin-top: 10px; color: var(--green); font-size: 14px; font-weight: 700; }

.blank-page { padding: 26px; }
.blank-page .form-card-heading { padding: 0 0 18px; }
.blank-page .form-card-heading h2 { color: var(--text); font-size: 22px; font-weight: 900; }

#export-page.blank-page { padding: 0; border: 0; background: none; box-shadow: none; }
#export-page > .blank-page { background: var(--card); }

#export-sheet-actions { margin-top: 18px; }
#export-sheet-actions > div { display: flex !important; flex-wrap: wrap; gap: 12px; }
#export-sheet-actions .primary-button,
#export-sheet-actions .secondary-button,
#export-sheet-actions .danger-button { flex: 0 1 auto; }


/* ---------- setup page ---------- */

.setup-page-heading,
.setup-section-heading { margin-bottom: 18px; }

.setup-page-heading h2,
.setup-section-heading h2 { font-size: 23px; font-weight: 900; letter-spacing: -0.02em; }

.setup-sync-section { margin-top: 34px; }

.setup-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.setup-sheet-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 128px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.setup-sheet-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }

.setup-sheet-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 15px; color: #fff; background: var(--grad-purple); }
.setup-sheet-queue .setup-sheet-icon { background: var(--grad-cool); }
.setup-sheet-registry .setup-sheet-icon { background: var(--grad-warm); }
.setup-sheet-icon svg { width: 26px; height: 26px; }

.setup-sheet-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.setup-sheet-copy strong { font-size: 16px; font-weight: 800; }
.setup-sheet-copy span { color: var(--muted); font-size: 13px; line-height: 1.45; }

.setup-sheet-arrow { position: absolute; right: 16px; top: 12px; color: var(--faint); font-size: 18px; }

.sync-button-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.sync-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.sync-action-button { width: 100%; min-height: 56px; text-align: center; line-height: 1.3; }

.sync-status { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

.admin-accounts { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line-strong); }
.admin-add { margin-top: 16px; }


/* ---------- sign-in and dialogs ---------- */

.auth-locked { overflow: hidden; }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(620px 420px at 100% 100%, rgba(255, 190, 150, 0.45), transparent 70%),
    radial-gradient(560px 380px at 0% 0%, rgba(47, 211, 155, 0.30), transparent 70%),
    radial-gradient(520px 360px at 85% 0%, rgba(150, 190, 255, 0.35), transparent 70%),
    var(--bg);
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, 100%);
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--input);
  box-shadow: 0 30px 70px rgba(40, 56, 120, 0.22);
}

.auth-card h2 { margin: 4px 0 0; font-size: 24px; font-weight: 900; }
.auth-brand { display: flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 900; }
.auth-brand .brand-mark { width: 42px; height: 42px; font-size: 22px; }
.auth-note { color: var(--muted); font-size: 14px; line-height: 1.5; }

.auth-card label,
.cf-modal label { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 800; }

.auth-card input,
.cf-modal input,
.cf-modal select { height: 46px; border-radius: 12px; }

.auth-submit { min-height: 48px; border-radius: 12px; }

.cf-form-error { min-height: 18px; color: var(--red); font-size: 13px; font-weight: 700; }

.cf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 28, 70, 0.45);
  backdrop-filter: blur(4px);
}

.cf-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: var(--input);
  box-shadow: 0 30px 70px rgba(20, 28, 70, 0.35);
}

.cf-modal h3 { font-size: 19px; font-weight: 900; }
.cf-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }


/* ---------- dashboard ---------- */

/* The toolbar stays put; only #dash-body scrolls. */
body[data-page="dashboard"] .page-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 0 0;
}

#dashboard-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  animation: cfPageEnter 0.35s ease both;
}

.dash-toolbar {
  position: relative;
  z-index: 5;
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
}

.dash-toolbar h2 { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }

.dash-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.dash-controls select,
.dash-date-button { width: auto; min-height: 44px; padding: 8px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; }

.dash-controls select { padding-right: 38px; box-shadow: var(--shadow-soft); }

.dash-date { position: relative; }

.dash-date-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  background: var(--input);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  white-space: nowrap;
}

.dash-date-button svg { width: 17px; height: 17px; color: var(--pink); }
.dash-date-button.has-value { border-color: var(--purple); background: #f3efff; color: #4b30b8; }
.dash-date-button:hover { border-color: var(--blue); }

.date-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(340px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--input);
  box-shadow: 0 26px 60px rgba(30, 44, 110, 0.28);
}

.date-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }

.date-tab {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.date-tab.active { background: var(--grad-hot); color: #fff; }

.date-fields { display: grid; gap: 10px; margin-top: 14px; }
.date-fields label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.date-fields input { min-height: 42px; }

.date-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.date-quick button {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--soft);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.date-quick button:hover { background: #f1edff; border-color: var(--purple); color: #4b30b8; }

.date-error { min-height: 18px; margin-top: 8px; color: var(--red); font-size: 12.5px; font-weight: 700; }

.date-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.date-actions .primary-button,
.date-actions .secondary-button { min-height: 40px; padding: 8px 16px; }

#dash-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 32px 0;
}

.dash-kpis { display: grid; gap: 14px; margin-bottom: 18px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.dash-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--tone-a), var(--tone-b));
  box-shadow: 0 14px 28px rgba(60, 60, 140, 0.22);
}

.dash-kpi::after { content: ""; position: absolute; right: -28px; top: -28px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }

.dash-kpi span { position: relative; z-index: 1; color: rgba(255, 255, 255, 0.9); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.dash-kpi strong { position: relative; z-index: 1; color: #fff; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.15; }
.dash-kpi small { position: relative; z-index: 1; color: rgba(255, 255, 255, 0.85); font-size: 12px; }

.tone-pink   { --tone-a: #e8408c; --tone-b: #a53df0; }
.tone-teal   { --tone-a: #12b3a0; --tone-b: #2a8be0; }
.tone-blue   { --tone-a: #3d7bf0; --tone-b: #5a47e0; }
.tone-purple { --tone-a: #7c4ff0; --tone-b: #b04df0; }
.tone-orange { --tone-a: #ff8a3d; --tone-b: #ee3f8f; }
.tone-navy   { --tone-a: #2c3a94; --tone-b: #4a4fc0; }

.dash-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-wide { grid-column: 1 / -1; }

.dash-card {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.dash-card h3 { margin-bottom: 14px; font-size: 16px; font-weight: 800; }
.dash-card h4 { margin: 16px 0 8px; color: var(--text-2); font-size: 13px; }

.all-good { color: var(--green); font-weight: 700; }
.good { color: var(--green); }
.bad { color: var(--red); }

.dash-error,
.dash-alert {
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid #f8cdd5;
  border-radius: 12px;
  background: #fdeef1;
  color: #a52c3f;
  font-size: 14px;
  font-weight: 700;
}

.dash-empty { padding: 30px 0; color: var(--muted); }

.bar-row { margin-bottom: 16px; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.bar-label span { color: var(--muted); }

.stack-bar { display: flex; height: 12px; overflow: hidden; border-radius: 99px; background: #ddd5c4; }
.stack-bar i { display: block; height: 100%; }

.seg-done { background: var(--teal); }
.seg-claimed { background: var(--orange); }
.seg-pending { background: #bcc6e2; }

.bar-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; }

.daily-chart { display: flex; align-items: flex-end; gap: 5px; height: 180px; }
.daily-col { position: relative; display: flex; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; height: 100%; }
.daily-col i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #8a6bff, #ee3f8f); }
.daily-col small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.daily-value { margin-bottom: 3px; color: var(--text-2); font-size: 11px; font-weight: 800; }

.status-row { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.status-row b { text-align: right; }
.mini-bar { height: 9px; overflow: hidden; border-radius: 99px; background: #ddd5c4; }
.mini-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #25b8e6, #7c5cff); }

.table-scroll { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th { padding: 8px 10px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.dash-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table a { margin-right: 6px; color: #5b3fd0; font-weight: 800; text-decoration: none; }
.row-actions { white-space: nowrap; }
.row-actions .mini-button { margin-right: 6px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #e6dfd0; color: var(--text-2); font-size: 11px; font-weight: 800; }
.pill-synced { background: #dcf6ea; color: #0f7a58; }
.pill-failed { background: #fdeef1; color: #b3304a; }
.pill-pending { background: #fff3d6; color: #a96a00; }

.health-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.health-row:last-child { border-bottom: 0; }


/* ---------- smaller screens ---------- */

@media (max-width: 1180px) {
  .campaign-setup-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-sheet-grid, .sync-button-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-art { opacity: 0.45; }
}

@media (max-height: 820px) {
  .hero { min-height: 112px; padding-top: 14px; padding-bottom: 14px; }
  .page-subtitle { display: none; }
  .hero-art { width: auto; height: 120px; }
}

/* compact hero on the dashboard: whole picture, just smaller */
body[data-page="dashboard"] .hero { min-height: 100px; padding-top: 12px; padding-bottom: 12px; }
body[data-page="dashboard"] .hero h1 { font-size: 26px; }
body[data-page="dashboard"] .page-subtitle { display: none; }
body[data-page="dashboard"] .hero-art { width: auto; height: 100px; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 1fr; }
}


/* ---------- phones: sidebar becomes a strip on top, whole page scrolls ---------- */

@media (max-width: 860px) {

  body { overflow: auto; }

  .console, body.menu-hidden .console { display: block; height: auto; }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    overflow: visible;
  }

  .sidebar-leaves { display: none; }
  .brand { padding: 0; }
  .brand-text small { display: none; }
  .sidebar-spacer { display: none; }

  .main-navigation { flex-direction: row; order: 3; width: 100%; overflow-x: auto; }
  .nav-button { width: auto; flex: none; min-height: 40px; padding: 0 14px; }
  .nav-chevron { display: none !important; }

  .sidebar-user { margin-left: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 10px; }
  .sb-user-head { margin: 0; }
  .sb-user-head div { display: none; }
  .sb-btn { width: auto; padding: 7px 10px; }

  .menu-button { display: none; }

  .console-main { padding: 12px 14px 0; }

  .page-area,
  body[data-page="dashboard"] .page-area { overflow: visible; display: block; padding: 18px 0 30px; }

  #dashboard-page { display: block; }
  #dash-body { overflow: visible; padding-right: 0; }

  .top-bar { flex-wrap: wrap; }
  .top-chips { margin-left: 0; justify-content: flex-start; }
  .hero { padding: 20px; }
  .hero-art { display: none; }

  .campaign-setup-row,
  .setup-sheet-grid,
  .sync-button-grid,
  .dash-grid { grid-template-columns: 1fr; }

  .contact-priority-duration { grid-template-columns: 1fr; }

  .date-pop { right: auto; left: 0; }
}


/* ---------- campaigns and questionnaire builder ---------- */

.cf-check { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 700 !important; }
.cf-modal input[type="checkbox"], .cmp-page input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.cf-hint { margin: -4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.campaigns-page { padding-bottom: 90px; }
.cmp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cmp-head h2 { margin: 6px 0 2px; font-size: 24px; font-weight: 900; }
.cmp-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.cmp-id { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; }
.cmp-error { padding: 10px 14px; border-radius: 12px; background: #fdeef1; color: var(--red); font-weight: 700; }
.cmp-empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 16px; }
.cmp-note { padding: 10px 14px; border-radius: 12px; background: #f6e7dc; color: var(--text-2); font-size: 13px; font-weight: 700; }

.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.cmp-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow-soft); }
.cmp-card.cmp-off { opacity: 0.78; }
.cmp-card-top { display: flex; justify-content: space-between; gap: 10px; }
.cmp-card h3 { margin: 0 0 2px; font-size: 17px; font-weight: 900; }
.cmp-pill { align-self: flex-start; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.cmp-pill.on { background: #d9f3e8; color: #0b7a55; }
.cmp-pill.off { background: #e9e3d4; color: var(--muted); }
.cmp-desc { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.cmp-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.cmp-stats i { color: var(--muted); font-style: normal; }
.cmp-meta { color: var(--muted); font-size: 12.5px; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cmp-actions button { min-height: 38px; padding: 0 14px; font-size: 13px; }

.cmp-questions { display: flex; flex-direction: column; gap: 10px; }
.cmp-q { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.cmp-q.open { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.cmp-q-off { opacity: 0.65; }
.cmp-q-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.cmp-q-head:hover { background: var(--soft); }
.cmp-q-num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--grad-green); color: #fff; font-size: 13px; font-weight: 900; }
.cmp-q-title { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-q-sum { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cmp-q-caret { color: var(--muted); }
.cmp-q-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.cmp-q-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; color: var(--text-2); }
.cmp-q-body textarea, .cmp-q-body input:not([type="checkbox"]), .cmp-q-body select { width: 100%; border-radius: 10px; }
.cmp-q-body input:not([type="checkbox"]), .cmp-q-body select { height: 42px; }
.cmp-label { color: var(--text-2); font-size: 13px; font-weight: 800; }
.cmp-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.cmp-row > select, .cmp-row > input { flex: 1 1 160px; width: auto !important; }
.cmp-grow { flex: 1 1 200px; }
.cmp-req { padding-bottom: 10px; }
.cmp-cond { align-items: center; }
.cmp-opts { display: flex; flex-direction: column; gap: 8px; }
.cmp-opt { display: flex; align-items: center; gap: 6px; }
.cmp-opt input { flex: 1; }
.cmp-opt .cmp-opt-rule { flex: 0 1 180px; }
.cmp-opt-off input { opacity: 0.55; text-decoration: line-through; }
.cmp-bulk { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cmp-bulk textarea { width: 100%; }
.cmp-q-tools { padding-top: 6px; border-top: 1px solid var(--line); }
.cmp-danger { color: var(--red); border-color: #f8cdd5; }
.cmp-add-row { margin-top: 14px; }

.cmp-savebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px -6px -26px 0;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--input);
  box-shadow: 0 -6px 24px rgba(40, 56, 120, 0.12);
}
.cmp-save-text { flex: 1; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.cmp-save-text.dirty { color: #b45f06; }
.cmp-save-text.bad { color: var(--red); }

.cmp-preview { width: min(560px, 100%); max-height: 86vh; }
.cmp-preview-body { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; }

@media (max-width: 860px) {
  .cmp-savebar { flex-wrap: wrap; }
  .cmp-q-sum { display: none; }
}


/* ---------- queue tab ---------- */

.queue-page { padding-bottom: 40px; }
.q-toolbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.q-campaign { display: flex; flex-direction: column; gap: 6px; min-width: 260px; font-size: 13px; font-weight: 800; color: var(--text-2); }
.q-campaign select { height: 44px; border-radius: 12px; }
.q-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.q-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--input); color: var(--text-2); font-size: 13px; font-weight: 800; }
.q-chip b { padding: 1px 8px; border-radius: 999px; background: var(--soft); font-size: 12px; }
.q-chip.on { border-color: transparent; background: var(--grad-green); color: #fff; }
.q-chip.on b { background: rgba(255, 255, 255, 0.25); }
.q-search { width: 240px; height: 44px; border-radius: 12px; }

.q-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-soft); }
.q-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.q-table th { padding: 12px 14px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.q-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.q-table tr:last-child td { border-bottom: 0; }
.q-table tr.q-off td { opacity: 0.6; }
.q-priority { height: 36px; border-radius: 9px; padding: 0 8px; font-size: 13px; }
.q-actions { white-space: nowrap; text-align: right; }
.q-actions .mini-button { margin-left: 6px; }
.q-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.q-pill.wait { background: #d9f3e8; color: #0b7a55; }
.q-pill.live { background: #fdebc8; color: #8a5a00; }
.q-pill.done { background: #e1e6f8; color: #3a4a96; }
.q-pill.off { background: #e9e3d4; color: var(--muted); }
.q-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.q-import { width: min(680px, 100%); }
.q-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.q-problems { margin: 0; padding-left: 18px; color: var(--red); font-size: 13px; line-height: 1.55; }


/* ---------- Submission Registry ---------- */
.registry-page { display: block; }
.r-toolbar { align-items: flex-end; }
.r-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); }
.r-field input, .r-field select { min-height: 38px; }
.r-summary { margin-bottom: 10px; }
.r-link { text-decoration: none; display: inline-flex; align-items: center; }
.r-inline { padding: 6px 10px; font-size: 12px; }
.r-nowrap { white-space: nowrap; }
.r-table td.r-q, .r-table th.r-q { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cmp-actions-2 { margin-top: 8px; }


/* ---------- Queue and System Registry: the top part stays put, only the list scrolls ---------- */
body[data-page="queue"] .page-area,
body[data-page="registry"] .page-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 0 0;
}

body[data-page="queue"] .hero,
body[data-page="registry"] .hero { min-height: 100px; padding-top: 12px; padding-bottom: 12px; }
body[data-page="queue"] .hero h1,
body[data-page="registry"] .hero h1 { font-size: 26px; }
body[data-page="queue"] .page-subtitle,
body[data-page="registry"] .page-subtitle { display: none; }
body[data-page="queue"] .hero-art,
body[data-page="registry"] .hero-art { width: auto; height: 100px; }

#queue-page,
#registry-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0;
}
#queue-page[style*="display: none"],
#registry-page[style*="display: none"] { display: none; }

#queue-body,
#reg-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#queue-body .q-table-wrap,
#reg-body .q-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#queue-body .q-table th,
#reg-body .q-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
}

#queue-page .q-pager,
#registry-page .q-pager { flex: none; padding: 10px 0 14px; margin-top: 0; }

#queue-page .cmp-head,
#queue-page .q-toolbar,
#queue-page .cmp-error,
#registry-page .cmp-head,
#registry-page .q-toolbar,
#registry-page .cmp-error,
#registry-page .r-summary { flex: none; }

@media (max-width: 1000px) {
  body[data-page="queue"] .page-area,
  body[data-page="registry"] .page-area { overflow: visible; display: block; padding: 18px 0 30px; }
  #queue-body .q-table-wrap, #reg-body .q-table-wrap { overflow-x: auto; }
}

/* keep the Queue / Registry heading and its buttons on one row */
#queue-page .cmp-head, #registry-page .cmp-head { flex-wrap: nowrap; align-items: flex-end; margin-bottom: 10px; }
#queue-page .cmp-head > div:first-child, #registry-page .cmp-head > div:first-child { flex: 1 1 auto; min-width: 0; }
#queue-page .cmp-head h2, #registry-page .cmp-head h2 { margin: 2px 0; }
#queue-page .cmp-head-tools { flex: none; }
@media (max-width: 1000px) { #queue-page .cmp-head, #registry-page .cmp-head { flex-wrap: wrap; } }
