/* Employee Surveys (#/employee-surveys): the page frame, shared widgets and
   the Dashboard. Prefix es-. The tabs have their own sheets:
   esboard-next.css (esb-), esreport-next.css (esr-), esadmin-next.css (esa-).
   Colors, sizes and breakpoints come from the tokens (tests/next-css-tokens).

   The look: soft rounded cards, pill tabs and buttons, and a friendly color
   per kind of thing (sky = people and counts, mint = good, sun = satisfaction
   and passives, coral = at risk, violet = milestones and NPS). */

:root {
  --es-sky: #2F7FC1;    --es-sky-soft: #E8F2FB;    --es-sky-ink: #1D5A8C;    --es-sky-mid: #BCDAF2;
  --es-mint: #13A08A;   --es-mint-soft: #E2F6F1;   --es-mint-ink: #0B6B5C;
  --es-sun: #F2B33D;    --es-sun-soft: #FEF4DD;    --es-sun-ink: #855706;
  --es-coral: #EB6A4F;  --es-coral-soft: #FDECE7;  --es-coral-ink: #A23A22;
  --es-violet: #7A6AD8; --es-violet-soft: #F0EEFC; --es-violet-ink: #4D3FAE;
  --es-rose: #E0648C;   --es-rose-soft: #FCEAF0;   --es-rose-ink: #9E3258;
  --es-slate: #9AA8AF;  --es-slate-soft: #EEF2F3;  --es-slate-ink: #4E616C;
  --es-r: 20px;         /* cards */
  --es-r-lg: 24px;      /* the page header */
  --es-r-md: 14px;      /* panels inside a card, inputs */
  --es-shadow: 0 1px 2px rgba(16, 32, 36, 0.04), 0 10px 28px -14px rgba(16, 32, 36, 0.16);
  --es-shadow-up: 0 2px 4px rgba(16, 32, 36, 0.05), 0 20px 40px -16px rgba(16, 32, 36, 0.24);
  --es-hero-bg:
    radial-gradient(circle at 92% -20%, #D9EEF9 0, rgba(217, 238, 249, 0) 42%),
    radial-gradient(circle at 70% 140%, #DDF4EC 0, rgba(221, 244, 236, 0) 46%),
    linear-gradient(120deg, #FFFFFF 0%, #F3F9F8 100%);
}

/* One place sets the color a tone means: --es-tone, its soft fill, its ink. */
.es-page [data-tone="sky"]    { --es-tone: var(--es-sky);    --es-tone-soft: var(--es-sky-soft);    --es-tone-ink: var(--es-sky-ink); }
.es-page [data-tone="mint"]   { --es-tone: var(--es-mint);   --es-tone-soft: var(--es-mint-soft);   --es-tone-ink: var(--es-mint-ink); }
.es-page [data-tone="sun"]    { --es-tone: var(--es-sun);    --es-tone-soft: var(--es-sun-soft);    --es-tone-ink: var(--es-sun-ink); }
.es-page [data-tone="coral"]  { --es-tone: var(--es-coral);  --es-tone-soft: var(--es-coral-soft);  --es-tone-ink: var(--es-coral-ink); }
.es-page [data-tone="violet"] { --es-tone: var(--es-violet); --es-tone-soft: var(--es-violet-soft); --es-tone-ink: var(--es-violet-ink); }
.es-page [data-tone="rose"]   { --es-tone: var(--es-rose);   --es-tone-soft: var(--es-rose-soft);   --es-tone-ink: var(--es-rose-ink); }
.es-page [data-tone="slate"]  { --es-tone: var(--es-slate);  --es-tone-soft: var(--es-slate-soft);  --es-tone-ink: var(--es-slate-ink); }
.es-page [data-tone="teal"]   { --es-tone: var(--teal);      --es-tone-soft: var(--teal-soft);      --es-tone-ink: var(--brand-ink); }

.es { display: flex; flex-direction: column; gap: 0; }
.es-body { min-height: 240px; }
.es-loading { padding: 24px 4px; color: var(--muted); font-size: var(--fs-md); }
.es-muted { color: var(--muted); font-size: var(--fs-sm); margin: 4px 0 0; }
.es-i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ---------- Page frame: a rounded header with pill tabs ---------- */
.es-hero {
  position: relative; margin-bottom: 18px; padding: 26px 28px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--es-r-lg); background: var(--es-hero-bg); box-shadow: var(--es-shadow);
}
.es-hero .ivy-title { letter-spacing: -0.02em; }
.es-hero .ivy-eyebrow { color: var(--es-mint-ink); }

.es-page .es-tabs {
  display: flex; gap: 4px; width: max-content; max-width: 100%; margin-bottom: 22px; padding: 5px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); box-shadow: var(--es-shadow);
}
.es-page .es-tabs .es-tab {
  height: 36px; min-height: 36px; margin: 0; padding: 0 16px; border: 0; border-radius: var(--r-pill);
  color: var(--fg-soft); transition: background-color 0.15s, color 0.15s;
}
.es-page .es-tabs .es-tab:hover { background: var(--surface-hover); color: var(--fg); }
.es-page .es-tabs .es-tab.is-active { background: var(--teal); color: var(--on-solid); box-shadow: 0 4px 12px -4px rgba(12, 95, 102, 0.5); }

/* Shared controls on these pages: rounder cards, pill buttons and inputs. */
.es-page .ivy-card { border-color: var(--line-soft); border-radius: var(--es-r); box-shadow: var(--es-shadow); }
.es-page .ivy-btn { border-radius: var(--r-pill); }
.es-page .ivy-seg { padding: 4px; border-radius: var(--r-pill); }
.es-page .ivy-seg > button, .es-page .ivy-seg > a { border-radius: var(--r-pill); }
.es-page .ivy-chip { border-radius: var(--r-pill); }
.es-page .ivy-table-wrap, .es-page .ivy-table { border-radius: var(--es-r); }
.es-page input[type="text"], .es-page input[type="search"], .es-page input[type="email"], .es-page input[type="tel"],
.es-page input[type="number"], .es-page input[type="date"], .es-page select, .es-page textarea { border-radius: var(--es-r-md); }

.es-bell { position: relative; }
.es-bell-n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
  border-radius: var(--r-pill); background: var(--es-coral); color: var(--on-solid); font-size: var(--fs-2xs); font-weight: 700;
}

/* A round icon on a soft color */
.es-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px;
  border-radius: 12px; background: var(--es-tone-soft, var(--es-slate-soft)); color: var(--es-tone-ink, var(--es-slate-ink));
}
.es-ico .es-i { width: 17px; height: 17px; vertical-align: 0; }

/* Avatars: initials on the --av-* colors */
.es-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: var(--r-pill);
  color: var(--on-solid); font-weight: 700; letter-spacing: 0.02em; background: var(--av-0);
  box-shadow: 0 0 0 3px var(--card), 0 4px 10px -4px rgba(16, 32, 36, 0.35);
}
.es-avatar--sm { width: 28px; height: 28px; font-size: var(--fs-3xs); box-shadow: none; }
.es-avatar--md { width: 36px; height: 36px; font-size: var(--fs-xs); box-shadow: none; }
.es-avatar--lg { width: 56px; height: 56px; font-size: var(--fs-lg); }
.es-avatar[data-av="1"] { background: var(--av-1); }
.es-avatar[data-av="2"] { background: var(--av-2); }
.es-avatar[data-av="3"] { background: var(--av-3); }
.es-avatar[data-av="4"] { background: var(--av-4); }
.es-avatar[data-av="5"] { background: var(--av-5); }

/* Locations picker (a details popover of checkboxes) */
.es-pick { position: relative; }
.es-pick > summary { list-style: none; }
.es-pick > summary::-webkit-details-marker { display: none; }
.es-pick-pop {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; min-width: 240px; padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--es-r-md); box-shadow: var(--shadow-pop);
}
.es-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: var(--fs-base); color: var(--fg); cursor: pointer; }
.es-check:hover { background: var(--surface-hover); }

/* ---------- Dashboard ---------- */
.es-dash-filters { margin-bottom: 14px; }
.es-dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.es-tile {
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; min-height: 150px;
  color: var(--fg); text-decoration: none; transition: box-shadow 0.18s, transform 0.18s;
}
a.es-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--es-shadow-up); }
.es-tile--wide { grid-column: span 2; }
.es-tile-head { display: flex; align-items: center; gap: 10px; }
.es-tile-title { flex: 1; min-width: 0; font-size: var(--fs-base); font-weight: 650; color: var(--fg); line-height: 1.3; }
.es-tile-go {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none;
  border-radius: var(--r-pill); background: var(--surface-sunk); color: var(--muted); transition: background-color 0.15s, color 0.15s;
}
a.es-tile:hover .es-tile-go { background: var(--teal); color: var(--on-solid); }
.es-tile-sub { font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }
.es-big {
  font-family: var(--font-display); font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  color: var(--es-tone, var(--fg));
}
.es-tile-viz { display: flex; justify-content: center; align-items: center; padding: 2px 0; }
.es-tile-viz--stars { flex-direction: column; gap: 8px; padding: 6px 0 2px; }

/* half-circle gauges (recommendation, NPS) */
.es-semi { width: 100%; max-width: 200px; height: auto; }
.es-arc-track { fill: none; stroke: var(--surface-sunk); stroke-width: 18; stroke-linecap: round; }
.es-arc { fill: none; stroke: var(--es-tone, var(--teal)); stroke-width: 18; stroke-linecap: round; }
.es-arc--flat { stroke-linecap: butt; }
.es-arc-target { stroke: var(--fg); stroke-width: 2.5; stroke-linecap: round; }
.es-arc-text { fill: var(--fg); font-family: var(--font-display); font-size: var(--fs-kpi); font-weight: 800; }

/* stars (satisfaction) */
.es-stars { width: 168px; height: auto; }
.es-stars-off path { fill: var(--surface-sunk); }
.es-stars-on path { fill: var(--es-sun); }

/* donut (at risk) */
.es-tile-split { display: flex; align-items: center; gap: 16px; }
.es-tile-split .es-key { flex-direction: column; align-items: flex-start; gap: 8px; }
.es-donut { width: 104px; height: 104px; flex: none; }
.es-donut-ok { fill: none; stroke: var(--es-mint); stroke-width: 15; }
.es-donut-risk { fill: none; stroke: var(--es-coral); stroke-width: 15; }
.es-donut-text { fill: var(--fg); font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; }

/* color key under a chart */
.es-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); font-weight: 600; color: var(--fg-soft); }
.es-key li { display: inline-flex; align-items: center; gap: 6px; }
.es-key i { width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--es-tone, var(--teal)); }

/* participation: pill bars */
.es-part { display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.es-part-row { display: flex; flex-direction: column; gap: 6px; }
.es-part-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.es-part-label strong { font-size: var(--fs-base); font-weight: 650; color: var(--fg); }
.es-part-label span { font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.es-pill { position: relative; height: 26px; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; }
.es-pill-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--es-sky-soft), var(--es-sky-mid)); }
.es-pill-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; font-size: var(--fs-sm); font-weight: 750; color: var(--fg); }

/* turnover: grouped bars */
.es-tbars { display: flex; gap: 22px; align-items: flex-end; height: 170px; padding-top: 18px; }
.es-tbars-group { flex: 1; display: flex; flex-direction: column; gap: 8px; height: 100%; min-width: 0; }
.es-tbars-cols { flex: 1; display: flex; align-items: flex-end; gap: 6px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.es-tbars-col { position: relative; flex: 1; min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--teal); }
.es-tbars-col span { position: absolute; top: -18px; left: -4px; right: -4px; text-align: center; font-size: var(--fs-2xs); font-weight: 650; color: var(--fg-soft); }
.es-tbars-col[data-s="1"], .es-legend i[data-s="1"] { background: var(--es-coral); }
.es-tbars-col[data-s="2"], .es-legend i[data-s="2"] { background: var(--es-sky); }
.es-tbars-col[data-s="3"], .es-legend i[data-s="3"] { background: var(--es-slate); }
.es-tbars-label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-align: center; }
.es-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--fg-soft); }
.es-legend span { display: inline-flex; align-items: center; gap: 6px; }
.es-legend i { display: inline-block; width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--teal); }

/* news feed summary: today and tomorrow as colored rows */
.es-feedsum { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; font-size: var(--fs-base); }
.es-feedsum-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.es-feedsum-head strong { font-size: var(--fs-md); }
.es-feedsum-head span { font-size: var(--fs-sm); color: var(--muted); }
.es-feedsum-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.es-feedsum-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: var(--es-r-md);
  background: var(--es-tone-soft, var(--surface-sunk)); color: var(--fg); font-weight: 550;
}
.es-feedsum-list .es-ico { width: 28px; height: 28px; border-radius: 10px; background: var(--card); }
.es-feedsum-list .es-ico .es-i { width: 15px; height: 15px; }

@media (max-width: 1100px) {
  .es-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .es-hero { padding: 20px 18px; border-radius: var(--es-r); }
  .es-page .es-tabs { width: auto; border-radius: var(--es-r-md); }
  .es-dash { grid-template-columns: minmax(0, 1fr); }
  .es-tile--wide { grid-column: auto; }
  .es-feedsum { grid-template-columns: 1fr; }
  .es-bell span:not(.es-bell-n) { display: none; }
  .es-hero { padding-right: 64px; }
  .es-hero .ivy-head-actions { position: absolute; top: 16px; right: 16px; }
  .es-hero .es-bell { width: var(--ctl-h); padding: 0; justify-content: center; }
  .es-hero .es-bell-n { position: absolute; top: -6px; right: -6px; }
}
@media print {
  .es-head .ivy-head-actions, .ivy-tabs, .es-dash-filters { display: none; }
  .es-hero { box-shadow: none; background: none; }
}

/* You said, we did (dashboard): what the building changed, for staff to see. */
.es-saiddid { display: grid; gap: 10px; padding: 18px 20px; margin: 0 0 16px; }
.es-saiddid-title { margin: 0; font-size: var(--fs-lg); }
.es-saiddid-form { display: grid; gap: 10px; }
.es-saiddid-field { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 600; }
.es-saiddid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.es-saiddid-list li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-soft); }
