/* bluOps Eye design system. One set of tokens and components for every staff and customer screen.
   Rules: no inline styles (the pages run under a strict CSP), sentence-case labels, classes prefixed "eye-". */

:root {
  color-scheme: light;
  --eye-font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --eye-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --eye-bg: #f3f6f6;
  --eye-surface: #ffffff;
  --eye-surface-2: #f8fbfb;
  --eye-line: #cbdbdd;
  --eye-line-soft: #dde6e6;
  --eye-text: #182f3a;
  --eye-muted: #4a646a;
  --eye-brand: #075e67;
  --eye-brand-strong: #123941;
  --eye-on-brand: #ffffff;
  --eye-selected: #e6f1ef;
  --eye-focus: #b5670a;

  --eye-ok: #17693a;      --eye-ok-bg: #e7f4ec;
  --eye-warn: #8a5300;    --eye-warn-bg: #fdf3e1;
  --eye-bad: #a3301f;     --eye-bad-bg: #fbeeea;
  --eye-info: #0b5f8a;    --eye-info-bg: #e6f1f8;

  --eye-s1: .25rem; --eye-s2: .5rem; --eye-s3: .75rem; --eye-s4: 1rem; --eye-s5: 1.5rem; --eye-s6: 2rem;
  --eye-radius: 6px; --eye-radius-lg: 10px;
  --eye-shadow: 0 8px 28px rgba(18, 57, 65, .18);
  --eye-nav-width: 15rem;
}

:root[data-theme="dark"] { color-scheme: dark;
  --eye-bg: #0f1b20; --eye-surface: #17272d; --eye-surface-2: #1c2f36; --eye-line: #33505a; --eye-line-soft: #284048;
  --eye-text: #e4eef0; --eye-muted: #a3babf; --eye-brand: #58c2cc; --eye-brand-strong: #0c2a31; --eye-on-brand: #06262b;
  --eye-selected: #20424a; --eye-focus: #f0a94a;
  --eye-ok: #6fd39a; --eye-ok-bg: #173526; --eye-warn: #f3c16b; --eye-warn-bg: #3a2c10;
  --eye-bad: #f59a8a; --eye-bad-bg: #3d1d17; --eye-info: #7cc4ec; --eye-info-bg: #14303f;
  --eye-shadow: 0 8px 28px rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark;
    --eye-bg: #0f1b20; --eye-surface: #17272d; --eye-surface-2: #1c2f36; --eye-line: #33505a; --eye-line-soft: #284048;
    --eye-text: #e4eef0; --eye-muted: #a3babf; --eye-brand: #58c2cc; --eye-brand-strong: #0c2a31; --eye-on-brand: #06262b;
    --eye-selected: #20424a; --eye-focus: #f0a94a;
    --eye-ok: #6fd39a; --eye-ok-bg: #173526; --eye-warn: #f3c16b; --eye-warn-bg: #3a2c10;
    --eye-bad: #f59a8a; --eye-bad-bg: #3d1d17; --eye-info: #7cc4ec; --eye-info-bg: #14303f;
    --eye-shadow: 0 8px 28px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { font: 16px/1.5 var(--eye-font); }
body { margin: 0; background: var(--eye-bg); color: var(--eye-text); overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--eye-s3); }
h1 { font-size: 1.75rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 var(--eye-s3); }
a { color: var(--eye-brand); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--eye-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.eye-muted { color: var(--eye-muted); }
.eye-small { font-size: .9rem; }
.eye-mono { font-family: var(--eye-mono); font-size: .88rem; }
.eye-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eye-skip { position: absolute; left: -999px; top: 0; background: var(--eye-surface); padding: var(--eye-s2) var(--eye-s3); z-index: 10; }
.eye-skip:focus { left: var(--eye-s2); top: var(--eye-s2); }

/* Shell */
.eye-shell { display: grid; grid-template-columns: var(--eye-nav-width) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.eye-top { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--eye-s4); padding: var(--eye-s2) var(--eye-s4);
  background: var(--eye-brand-strong); color: #fff; }
.eye-top a { color: #fff; }
.eye-brand { font-weight: 700; letter-spacing: .02em; text-decoration: none; font-size: 1.05rem; }
.eye-top-spacer { flex: 1; }
.eye-who { font-size: .92rem; text-align: right; line-height: 1.25; }
.eye-who span { display: block; opacity: .8; font-size: .82rem; }
.eye-nav { background: var(--eye-surface); border-right: 1px solid var(--eye-line); padding: var(--eye-s3) var(--eye-s2); }
.eye-nav ul { list-style: none; margin: 0; padding: 0; }
.eye-nav a { display: block; padding: var(--eye-s2) var(--eye-s3); border-radius: var(--eye-radius); color: var(--eye-text); text-decoration: none; font-weight: 600; }
.eye-nav a:hover { background: var(--eye-surface-2); }
.eye-nav a[aria-current="page"] { background: var(--eye-selected); color: var(--eye-brand); }
.eye-nav-rule { border: 0; border-top: 1px solid var(--eye-line-soft); margin: var(--eye-s3) var(--eye-s2); }
.eye-main { padding: var(--eye-s5); min-width: 0; align-content: start; }
.eye-main.eye-holding { min-height: 1000vh; } /* keeps the scroll position while a view reloads in place */
.eye-main > header { margin-bottom: var(--eye-s4); }
.eye-centered { max-width: 30rem; margin: var(--eye-s6) auto; }

/* Layout helpers */
.eye-stack { display: grid; gap: var(--eye-s4); min-width: 0; }
.eye-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--eye-s2) var(--eye-s3); }
.eye-split { display: grid; grid-template-columns: minmax(16rem, .8fr) minmax(0, 1.6fr); gap: var(--eye-s4); align-items: start; }
.eye-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--eye-s4); }
.eye-panel { background: var(--eye-surface); border: 1px solid var(--eye-line); border-radius: var(--eye-radius-lg); padding: var(--eye-s4) var(--eye-s5); min-width: 0; }

/* Controls */
button, input, select, textarea { font: inherit; color: inherit; }
.eye-btn { border: 1px solid var(--eye-brand); border-radius: var(--eye-radius); background: var(--eye-brand); color: var(--eye-on-brand);
  font-weight: 600; padding: .4rem .8rem; cursor: pointer; text-decoration: none; display: inline-block; }
.eye-btn.is-secondary { background: var(--eye-surface); color: var(--eye-brand); }
.eye-btn.is-quiet { background: transparent; border-color: transparent; color: inherit; }
.eye-top .eye-btn.is-quiet { color: #fff; border-color: rgba(255, 255, 255, .35); }
.eye-btn:disabled { opacity: .55; cursor: default; }
.eye-field { display: block; }
.eye-field > span { display: block; font-weight: 600; margin-bottom: var(--eye-s1); }
.eye-field > small { display: block; color: var(--eye-muted); margin-top: var(--eye-s1); }
.eye-input, .eye-field input, .eye-field select, .eye-field textarea { display: block; width: 100%; padding: .45rem .6rem;
  border: 1px solid var(--eye-line); border-radius: var(--eye-radius); background: var(--eye-surface); }
.eye-field textarea { min-height: 5rem; resize: vertical; }

/* Picker (searchable choice of a person, customer, product ...) */
.eye-picker { position: relative; }
.eye-picker ul { position: absolute; z-index: 5; left: 0; right: 0; margin: var(--eye-s1) 0 0; padding: var(--eye-s1); list-style: none;
  background: var(--eye-surface); border: 1px solid var(--eye-line); border-radius: var(--eye-radius); box-shadow: var(--eye-shadow); max-height: 16rem; overflow: auto; }
.eye-picker li { padding: var(--eye-s2) var(--eye-s3); border-radius: var(--eye-radius); cursor: pointer; }
.eye-picker li[aria-selected="true"], .eye-picker li:hover { background: var(--eye-selected); }
.eye-picker li small { display: block; color: var(--eye-muted); }

/* Lists, tables, pills */
.eye-list { list-style: none; margin: 0; padding: 0; }
.eye-list > li + li { border-top: 1px solid var(--eye-line-soft); }
.eye-list-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: var(--eye-s3) var(--eye-s2); border-radius: var(--eye-radius);
  cursor: pointer; text-decoration: none; color: inherit; }
.eye-list-item:hover { background: var(--eye-surface-2); }
.eye-list-item[aria-current="true"] { background: var(--eye-selected); }
.eye-list-item strong { display: block; }
.eye-list-item small { color: var(--eye-muted); }
.eye-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.eye-table th, .eye-table td { text-align: left; vertical-align: top; padding: var(--eye-s2) var(--eye-s3); border-bottom: 1px solid var(--eye-line-soft); }
.eye-table th { background: var(--eye-surface-2); font-weight: 650; white-space: nowrap; overflow-wrap: normal; }
.eye-table-wrap { overflow-x: auto; }
.eye-pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: .05rem .55rem; border-radius: 999px;
  border: 1px solid var(--eye-line); background: var(--eye-surface-2); white-space: nowrap; }
.eye-pill.is-ok { color: var(--eye-ok); background: var(--eye-ok-bg); border-color: transparent; }
.eye-pill.is-warn { color: var(--eye-warn); background: var(--eye-warn-bg); border-color: transparent; }
.eye-pill.is-bad { color: var(--eye-bad); background: var(--eye-bad-bg); border-color: transparent; }
.eye-pill.is-info { color: var(--eye-info); background: var(--eye-info-bg); border-color: transparent; }
.eye-dl { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr); gap: var(--eye-s1) var(--eye-s4); margin: 0; }
.eye-dl dt { font-weight: 650; color: var(--eye-muted); } .eye-dl dd { margin: 0; }

.eye-grow { flex: 1; min-width: 12rem; }
.eye-fieldset { border: 1px solid var(--eye-line); border-radius: var(--eye-radius); padding: var(--eye-s3) var(--eye-s4); margin: 0; min-width: 0; display: grid; gap: var(--eye-s3); }
.eye-fieldset legend { font-weight: 650; padding: 0 var(--eye-s1); }
.eye-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--eye-s3); margin-bottom: var(--eye-s4); }
.eye-metric { border: 1px solid var(--eye-line-soft); border-radius: var(--eye-radius); background: var(--eye-surface-2); padding: var(--eye-s3); }
.eye-metric span { display: block; font-size: .86rem; color: var(--eye-muted); font-weight: 600; }
.eye-metric strong { font-size: 1.4rem; }
.eye-check { display: flex; gap: var(--eye-s2); align-items: baseline; }
.eye-check small { display: block; }
.eye-search { width: auto; min-width: 16rem; }
.eye-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(9.5rem, 1fr); gap: var(--eye-s3); overflow-x: auto; align-items: start; padding-bottom: var(--eye-s2); }
.eye-board-column { background: var(--eye-surface-2); border: 1px solid var(--eye-line); border-radius: var(--eye-radius-lg); padding: var(--eye-s3); min-height: 8rem; }
.eye-board-column h2 { font-size: 1rem; margin: 0 0 var(--eye-s2); }
.eye-card { background: var(--eye-surface); border: 1px solid var(--eye-line); border-radius: var(--eye-radius); margin-bottom: var(--eye-s2); }
.eye-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--eye-s3); }
.eye-message { padding: var(--eye-s3); border: 1px solid var(--eye-line); border-radius: var(--eye-radius); background: var(--eye-surface-2); margin-right: var(--eye-s6); }
.eye-message-staff { background: var(--eye-selected); margin-right: 0; margin-left: var(--eye-s6); }
.eye-message p:last-child { margin-bottom: 0; }
.eye-draft-slot:empty { display: none; }
.eye-pre { white-space: pre-wrap; margin: 0 0 var(--eye-s3); }
.eye-code { font-family: var(--eye-mono); font-size: .85rem; white-space: pre-wrap; background: var(--eye-surface-2);
  border: 1px solid var(--eye-line-soft); border-radius: var(--eye-radius); padding: var(--eye-s3); margin: 0; overflow-x: auto; }
.eye-list-row { padding: var(--eye-s2) 0; }
.eye-shot { max-width: 100%; border: 1px solid var(--eye-line); border-radius: var(--eye-radius); }
.eye-tabs { border-bottom: 1px solid var(--eye-line); padding-bottom: var(--eye-s2); }
.eye-tab { padding: var(--eye-s1) var(--eye-s3); border-radius: var(--eye-radius); font-weight: 600; text-decoration: none; color: var(--eye-text); }
.eye-tab-button { background: none; border: 0; cursor: pointer; }
.eye-tab[aria-pressed="true"], .eye-tab[aria-current="page"] { background: var(--eye-selected); color: var(--eye-brand); }
.eye-filters select { padding: .3rem .5rem; border: 1px solid var(--eye-line); border-radius: var(--eye-radius); background: var(--eye-surface); }
a.eye-list-item small { margin-top: var(--eye-s1); }

/* The four states every list and panel must design: loading, empty, error, no permission */
.eye-state { text-align: center; padding: var(--eye-s6) var(--eye-s4); color: var(--eye-muted); }
.eye-state strong { display: block; color: var(--eye-text); font-size: 1.05rem; margin-bottom: var(--eye-s1); }
.eye-state .eye-btn { margin-top: var(--eye-s3); }
.eye-spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid var(--eye-brand); border-right-color: transparent; border-radius: 50%;
  animation: eye-spin 1s linear infinite; vertical-align: -2px; margin-right: var(--eye-s2); }
@keyframes eye-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .eye-spinner { animation: none; } }

/* Notices and dialogs */
.eye-notice { border-left: 4px solid var(--eye-info); background: var(--eye-info-bg); padding: var(--eye-s2) var(--eye-s3); border-radius: var(--eye-radius); }
.eye-notice.is-ok { border-color: var(--eye-ok); background: var(--eye-ok-bg); }
.eye-notice.is-warn { border-color: var(--eye-warn); background: var(--eye-warn-bg); }
.eye-notice.is-bad { border-color: var(--eye-bad); background: var(--eye-bad-bg); }
dialog.eye-dialog { width: min(34rem, calc(100% - 2rem)); border: 1px solid var(--eye-line); border-radius: var(--eye-radius-lg);
  background: var(--eye-surface); color: inherit; padding: var(--eye-s5); box-shadow: var(--eye-shadow); }
dialog.eye-dialog::backdrop { background: rgba(18, 57, 65, .55); }

/* Technical details: IDs, hashes and raw JSON stay behind this disclosure */
.eye-tech { border-top: 1px solid var(--eye-line-soft); padding-top: var(--eye-s2); }
.eye-tech summary { cursor: pointer; color: var(--eye-muted); font-weight: 600; font-size: .92rem; }
.eye-tech pre { font-family: var(--eye-mono); font-size: .85rem; white-space: pre-wrap; background: var(--eye-surface-2);
  border: 1px solid var(--eye-line-soft); border-radius: var(--eye-radius); padding: var(--eye-s3); margin: var(--eye-s2) 0 0; }

@media (max-width: 52rem) {
  .eye-shell { grid-template-columns: 1fr; }
  .eye-nav { border-right: 0; border-bottom: 1px solid var(--eye-line); }
  .eye-nav ul { display: flex; flex-wrap: wrap; gap: var(--eye-s1); }
  .eye-split { grid-template-columns: 1fr; }
  .eye-main { padding: var(--eye-s4); }
}

/* Go to anything */
dialog.eye-goto { margin-top: 12vh; }
dialog.eye-goto .eye-input { width: 100%; }
dialog.eye-goto .eye-list { max-height: 50vh; overflow: auto; }

/* History on a record */
.eye-history li { padding: var(--eye-s2) 0; }

/* Agent draft beside a manual form */
.eye-draft { border: 1px dashed var(--eye-line); border-radius: var(--eye-radius); padding: var(--eye-s3); background: var(--eye-surface-2); }

/* Agent draft beside a manual form */
.eye-draft { border: 1px dashed var(--eye-line); border-radius: var(--eye-radius); padding: var(--eye-s3); background: var(--eye-surface-2); }

/* Automation: journey steps and runs */
.eye-steps { padding-left: var(--eye-s5); }
.eye-run { padding: var(--eye-s3) 0; }

/* Phone width: My work, a ticket and an agent draft must be usable with one thumb. */
@media (max-width: 40rem) {
  .eye-top { flex-wrap: wrap; gap: var(--eye-s2); padding: var(--eye-s2); }
  .eye-top-spacer { display: none; }
  .eye-who { display: none; }
  .eye-nav { padding: var(--eye-s1) var(--eye-s2); overflow-x: auto; }
  .eye-nav ul { display: flex; flex-wrap: nowrap; gap: var(--eye-s1); white-space: nowrap; }
  .eye-nav li[aria-hidden="true"] { display: none; }
  .eye-main { padding: var(--eye-s3); }
  .eye-split { grid-template-columns: minmax(0, 1fr); }
  .eye-dl { grid-template-columns: minmax(0, 1fr); }
  .eye-dl dt { margin-top: var(--eye-s2); }
  .eye-draft .eye-row .eye-btn, .eye-run .eye-row .eye-btn { flex: 1 1 100%; min-height: 2.75rem; }
  .eye-list-item { padding-top: var(--eye-s3); padding-bottom: var(--eye-s3); }
  .eye-table-wrap { overflow-x: auto; }
  .eye-pre { overflow-wrap: anywhere; }
  dialog.eye-dialog { width: calc(100% - 1rem); padding: var(--eye-s3); }
  input, select, textarea { max-width: 100%; }
}
