/* Freshdesk's own values, lifted from the helpdesk page CSS so this sits
   beside it without looking like a different product. Light only - so is theirs. */
:root {
  --page:        #ebeff3;  /* --app-bg */
  --card:        #ffffff;  /* --color-fill-surface */
  --card-2:      #f5f7f9;  /* --table-header */
  --hover:       #f3f5f7;  /* --table-row-hover */
  --line:        #ebeff3;  /* --app-border-secondary */
  --line-strong: #c9d3db;  /* --color-boundary-divider */
  --ink:         #12334c;  /* --color-text-primary */
  --ink-2:       #485a68;  /* --color-text-secondary */
  --muted:       #6f7c87;  /* --app-info-color */
  --blue:        #2c5cc5;  /* --fw-blue, what actually renders on their buttons */
  --blue-soft:   #eef2fb;
  --good:        #00795c;  /* --color-text-semantic-success */
  --good-soft:   #e5f2ee;
  --warn:        #ac5000;  /* --color-text-semantic-warning */
  --warn-soft:   #fbefe4;
  --crit:        #cd2629;  /* --color-text-semantic-error */
  --crit-soft:   #fbe9e9;
  --shift:       #f5a524;  /* rostered-hours outline - amber, blue's complement */
  --heat:        #2c5cc5;
  --heat-ai:     #4c91ff;  /* --color-fill-semantic-info */
  --shadow:      0 2px 4px rgba(18, 52, 77, .16);  /* .widget-item */
  --f: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
  --r: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--f);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; display: flex; flex-direction: column; gap: 16px; padding: 0 20px 40px; }
.n, .num { font-variant-numeric: tabular-nums; }

/* ---------- filter bar, like theirs above the stat cards ---------- */

.toolbar {
  margin: 0 -20px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar .filters { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; font-size: 14px; }
.toolbar .filters b { font-weight: 400; color: var(--muted); margin-right: 6px; }
.toolbar .filters span { color: var(--ink); }
.toolbar .stamp { font-size: 13px; color: var(--muted); }

/* ---------- page heading ---------- */

header.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
h1 { font-size: 16px; font-weight: 600; margin: 0; text-wrap: balance; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.seg { display: flex; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.seg .segbtn, .seg button {
  font: 400 13px/1 var(--f);
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
}
.seg .segbtn:last-child, .seg button:last-child { border-right: 0; }
.seg .segbtn:hover, .seg button:hover { background: var(--hover); }
.seg .segbtn.on, .seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.seg .segbtn:focus-visible, .seg button:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--blue); }

/* ---------- notice ---------- */

.mock {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-size: 13px;
}
.mock b { font-weight: 600; color: var(--ink); }

/* ---------- stat cards ---------- */

.tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tile {
  flex: 1 1 180px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tile .label { font-size: 14px; font-weight: 400; color: var(--ink-2); }
.tile .value { font-size: 30px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 0.5em; font-weight: 700; color: var(--muted); margin-left: 3px; }
.tile .foot { font-size: 12px; color: var(--muted); }
.delta { font-weight: 600; }
.delta.up { color: var(--good); }
.delta.down { color: var(--crit); }

/* ---------- panels, their .widget-item ---------- */

section.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.panel > h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.panel > h2 span { font-size: 12px; font-weight: 400; color: var(--muted); }

.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.cols > .wide { flex: 3 1 640px; }
.cols > .narrow { flex: 1 1 300px; }

/* ---------- table, their .fresh-table: no row rules, hover only ---------- */

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 12px 8px; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 20px; white-space: normal; }
th:last-child, td:last-child { padding-right: 20px; }
thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card-2);
  vertical-align: bottom;
  line-height: 1.3;
}
tbody td { padding-top: 10px; padding-bottom: 10px; }
tbody tr { transition: background-color .2s ease; }
tbody tr:hover td { background: var(--hover); }
tbody tr.ai-row td { background: var(--blue-soft); }
tbody tr.total td { background: var(--card-2); font-weight: 600; }
td.n { font-variant-numeric: tabular-nums; }

.who { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }
.ai-row .dot { background: var(--heat-ai); }
.who .name { font-weight: 600; white-space: nowrap; }
.who .tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--blue);
  border-radius: 10px;
  padding: 0 7px;
}

.pill { display: inline-block; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 9px; border-radius: 10px; }
.pill.good { color: var(--good); background: var(--good-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.crit { color: var(--crit); background: var(--crit-soft); }

.barcell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.bar { height: 6px; width: clamp(44px, 5.5vw, 92px); background: var(--card-2); border-radius: 3px; overflow: hidden; flex: none; }
.bar i { display: block; height: 100%; background: var(--blue); }
.ai-row .bar i { background: var(--heat-ai); }

/* ---------- queue panel ---------- */

.queue-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.chart { width: 100%; height: 150px; display: block; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; font-size: 14px; }
.stat-row + .stat-row { border-top: 1px solid var(--line); }
.stat-row .k { color: var(--ink-2); }
.stat-row .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- hourly strip ---------- */

.hours { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.hour-row { display: flex; align-items: center; gap: 16px; }
.hour-row .name { flex: 0 0 108px; font-weight: 600; font-size: 14px; }
.cells { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.cell { height: 24px; border-radius: 2px; background: var(--card-2); box-sizing: border-box; position: relative; }
/* The fill sits in its own layer so the shift outline above keeps full strength. */
.cell > i { display: block; height: 100%; width: 100%; border-radius: 2px; }
/* The hours this person is rostered on, so activity can be read against the shift. */
/* Drawn as its own layer so it sits ON TOP of the blue fill, not under it. */
.cell.shift::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--shift);
  border-radius: 2px;
  pointer-events: none;
}
.hour-row .tot { flex: 0 0 64px; text-align: right; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
/* The real span of their day, so a one-action hour is not read as a full hour. */
.hour-row .span { flex: 0 0 96px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.hour-axis .pad-span { flex: 0 0 96px; text-align: right; }
.hour-axis { display: flex; gap: 16px; font-size: 11px; color: var(--muted); }
.hour-axis .pad { flex: 0 0 108px; }
.hour-axis .pad-r { flex: 0 0 64px; text-align: right; }
.hour-axis .marks { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.hour-axis .marks span { text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- review list ---------- */

.qa-item { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding: 12px 20px; transition: background-color .2s ease; }
.qa-item + .qa-item { border-top: 1px solid var(--line); }
.qa-item:hover { background: var(--hover); }
.qa-item .tid { flex: 0 0 78px; font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
.qa-item .why { flex: 1 1 280px; color: var(--ink-2); font-size: 14px; }
.qa-item .meta { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

/* ---------- footnotes ---------- */

.notes { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.notes > div {
  flex: 1 1 230px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.notes h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.notes p { margin: 0; }

/* ---------- tag breakdown: wraps into columns rather than one long stack ---------- */

.tagwrap {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  column-gap: 56px;
  row-gap: 14px;
}
.tagrow { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tagrow .tname {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tagrow .tbar { flex: 0 0 84px; height: 8px; background: var(--card-2); border-radius: 4px; overflow: hidden; }
.tagrow .tbar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.tagrow .tnum { flex: 0 0 40px; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tagrow .tpct { flex: 0 0 46px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* queue panel: nesting shows what is a total, what adds up to it,
   and what is a slice of one of the lines above */
.stat-row.depth-0 .k { font-weight: 600; color: var(--ink); }
.stat-row.depth-1 .k { padding-left: 14px; }
.stat-row.depth-2 .k { padding-left: 28px; color: var(--muted); font-size: 13px; }
.stat-row.depth-2 .v { color: var(--muted); font-weight: 400; }

/* Sign-in page and the who-you-are line in the header. */
.loginpage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.loginbox {
  width: 320px;
  padding: 32px;
  border: 1px solid var(--line, #dcdcdc);
  border-radius: 10px;
  background: var(--card, #fff);
}

.loginbox h1 {
  margin: 0 0 4px;
  font-size: 20px;
}

.loginbox label {
  display: block;
  margin: 16px 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.loginbox input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line, #dcdcdc);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.loginbox button {
  width: 100%;
  margin-top: 20px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: #1b6ef3;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.loginproblem {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fdecec;
  color: #a11;
  font-size: 13px;
}

.whoami {
  margin: 8px 0 0;
  font-size: 12px;
  text-align: right;
  opacity: 0.75;
}
