﻿/* ==========================================================================
   HelpDesk styles. One file, no build step. Colours are defined as tokens
   below and switch automatically for dark mode.
   The look follows the ITsys website: deep teal ink, a green-teal accent,
   a grotesk for headings and a mono for numbers, labels and badges.
   ========================================================================== */

:root {
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-2: #f6f9f9;
  --mist: #e6efee;
  --border: #d9e3e4;
  --border-soft: #e8eeef;
  --text: #0f2630;
  --body: #34484f;
  --muted: #4b5f66;
  --ink: #0f2630;          /* primary buttons, current tab */
  --ink-hover: #1e3c48;
  --on-ink: #ffffff;
  --primary: #0a7a69;      /* links, focus, accents */
  --primary-hover: #075c4f;
  --primary-soft: #ddf1ec;
  --primary-ink: #075c4f;  /* accent text on a soft background */
  --danger: #b03a2e;
  --danger-soft: #f8e1de;
  --warn-soft: #fbf3e3;
  --warn-border: #f0ddb8;
  --focus: 0 0 0 3px rgba(10, 122, 105, .25);
  --radius: 12px;
  --shadow: none;
  --pop-shadow: 0 1px 2px rgba(15, 38, 48, .06), 0 12px 32px -8px rgba(15, 38, 48, .22);

  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-display: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;

  --s-new-bg: #dcebfa;    --s-new-fg: #1f5c99;
  --s-open-bg: #ddf1ec;   --s-open-fg: #075c4f;
  --s-pending-bg: #fbefd9; --s-pending-fg: #8a5a12;
  --s-closed-bg: #eef2f2; --s-closed-fg: #5f7279;
  --p-1: #eef2f2; --p-1-fg: #5f7279;
  --p-2: #e6efee; --p-2-fg: #3e5259;
  --p-3: #fbefd9; --p-3-fg: #8a5a12;
  --p-4: #f8e1de; --p-4-fg: #9e3328;

  color-scheme: light;
}

/* Dark theme. theme.js sets data-theme on <html> before the page is drawn:
   the user's saved choice, otherwise their system setting. */
:root[data-theme="dark"] {
    --bg: #0b1a20;
    --surface: #10232b;
    --surface-2: #142b34;
    --mist: #17303a;
    --border: #24404b;
    --border-soft: #1b3540;
    --text: #e3ecee;
    --body: #c6d4d7;
    --muted: #b3c4c8;
    --ink: #e3ecee;
    --ink-hover: #ffffff;
    --on-ink: #0b1a20;
    --primary: #6fd6bf;
    --primary-hover: #9be6d4;
    --primary-soft: #123b36;
    --primary-ink: #7fe3cb;
    --danger: #f49a8f;
    --danger-soft: #43201c;
    --warn-soft: #2e2512;
    --warn-border: #5a4520;
    --focus: 0 0 0 3px rgba(111, 214, 191, .3);
    --pop-shadow: 0 16px 40px rgba(0, 0, 0, .45);

    --s-new-bg: #16324a;    --s-new-fg: #8cc2f2;
    --s-open-bg: #123b36;   --s-open-fg: #7fe3cb;
    --s-pending-bg: #3a2d12; --s-pending-fg: #f2c46b;
    --s-closed-bg: #1b2e35; --s-closed-fg: #a9bcc1;
    --p-1: #1b2e35; --p-1-fg: #a9bcc1;
    --p-2: #1b2e35; --p-2-fg: #c9d7da;
    --p-3: #3a2d12; --p-3-fg: #f2c46b;
    --p-4: #43201c; --p-4-fg: #f49a8f;

    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-family: var(--f-display); color: var(--text); }
h1 { font-size: 2rem; letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 600; }
h3 { font-family: var(--f-body); font-size: .76rem; font-weight: 600; margin-top: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .75rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); font-weight: 600; }
.btn.btn-danger-text { color: var(--danger); }
.btn.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.btn-danger:hover { filter: brightness(.92); }
/* The "×" popup: two choices, each a button with its explanation */
.remove-choice { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.remove-choice:has(.btn-danger) { border-color: var(--danger); background: var(--danger-soft); }
.form-actions > form { margin: 0; }
.push-right { margin-left: auto; }

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 16px 64px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Sidebar (signed in) / top bar (signed out, and on phones) ---------- */
.sidebar { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 10;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.sidebar-top { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; font-family: var(--f-display); font-size: 1rem; min-width: 0; }
.brand small { font-family: var(--f-body); font-weight: 500; color: var(--muted); font-size: .75rem; }
.sidebar-label { display: block; padding: 0 4px 6px; font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); }
.sidebar-new { width: 100%; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px;
  color: var(--body); font-weight: 600; }
.nav a:hover { background: var(--mist); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--primary-ink); background: var(--primary-soft); font-weight: 600; }
.nav-sep { height: 1px; background: var(--border-soft); margin: 8px 4px; flex: none; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); }

@media (min-width: 900px) {
  body.has-sidebar { display: flex; align-items: flex-start; }
  body.has-sidebar .sidebar {
    position: sticky; top: 0; flex: none; width: 248px; height: 100vh; flex-direction: column; align-items: stretch;
    gap: 18px; padding: 20px 14px 16px; border-bottom: 0; border-right: 1px solid var(--border);
  }
  body.has-sidebar .sidebar-top { flex: none; padding: 0 6px; }
  body.has-sidebar .container { flex: 1; padding: 32px 40px 64px; }
}
/* Short screens: let the sidebar scroll away with the page */
@media (min-width: 900px) and (max-height: 620px) {
  body.has-sidebar .sidebar { position: static; height: auto; min-height: 100vh; }
}
/* Phones and small tablets: one bar on top, the menu scrolls sideways */
@media (max-width: 899px) {
  body.has-sidebar .sidebar { flex-wrap: wrap; }
  body.has-sidebar .sidebar-top { flex: 1 1 auto; }
  body.has-sidebar .sidebar-switcher { order: 2; flex: 1 1 200px; }
  body.has-sidebar .sidebar-switcher .sidebar-label { display: none; }
  body.has-sidebar .sidebar-new { order: 3; width: auto; }
  body.has-sidebar .nav { order: 5; flex-direction: row; width: 100%; overflow-x: auto; scrollbar-width: none; }
  body.has-sidebar .nav a { white-space: nowrap; }
  body.has-sidebar .nav-sep { width: 1px; height: auto; margin: 6px 4px; }
  body.has-sidebar .sidebar-foot { order: 4; margin: 0 0 0 auto; padding: 0; border: 0; }
  body.has-sidebar .usermenu-name { display: none; }
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--body); cursor: pointer; padding: 0;
}
.theme-toggle:hover { color: var(--text); background: var(--mist); }
.theme-toggle svg { width: 17px; height: 17px; }
/* Show the icon of the theme you'd switch TO */
:root[data-theme="dark"] .icon-moon, :root:not([data-theme="dark"]) .icon-sun { display: none; }
.sidebar-top .theme-toggle { margin-left: auto; }   /* signed out: pushed to the right */

/* Notification bell */
.bellmenu { position: relative; }
.bellmenu summary { list-style: none; }
.bellmenu summary::-webkit-details-marker { display: none; }
.bell-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--body); cursor: pointer;
}
.bell-button:hover, .bellmenu[open] .bell-button { color: var(--text); background: var(--mist); }
.bellmenu[open] .bell-button { border-color: var(--primary); box-shadow: var(--focus); }
.bell-button svg { width: 18px; height: 18px; }
.bell-badge {
  position: absolute; top: -6px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #c2463a; color: #fff; font-size: .68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--surface);
}
.bell-badge[hidden] { display: none; }
.bell-panel {
  position: absolute; left: calc(100% + 8px); bottom: 0; width: min(380px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--pop-shadow); z-index: 40; overflow: hidden;
}
.bell-panel-head strong { font-family: var(--f-display); }
.bell-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell-link { background: none; border: 0; color: var(--primary); font: inherit; font-size: .82rem; cursor: pointer; padding: 0; }
.bell-link:hover { text-decoration: underline; }
.bell-list { max-height: 420px; overflow-y: auto; }
.bell-panel-foot { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--border); font-size: .88rem; font-weight: 500; }
.bell-empty { color: var(--muted); padding: 22px 14px; margin: 0; text-align: center; }
.bell-item {
  position: relative; display: flex; gap: 10px; padding: 11px 30px 11px 14px; color: var(--text);
  border-bottom: 1px solid var(--border); font-size: .88rem; line-height: 1.4;
}
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--surface-2); text-decoration: none; }
.bell-item.is-unread { background: var(--primary-soft); }
.bell-item.is-unread:hover { filter: brightness(.98); }
.bell-item.is-unread .avatar { background: var(--surface); }
.bell-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bell-item-text { overflow-wrap: anywhere; }
.bell-item-meta, .bell-item-time { color: var(--muted); font-size: .8rem; }
.bell-item-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-item-quote { color: var(--muted); font-size: .82rem; font-style: italic; overflow-wrap: anywhere; }
.bell-dot { position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.bell-page { padding: 0; overflow: hidden; }
@media (max-width: 899px) { .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; bottom: auto; width: auto; } }

.usermenu { position: relative; flex: 1; min-width: 0; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px;
  border-radius: 8px; min-width: 0; }
.usermenu summary:hover, .usermenu[open] summary { background: var(--mist); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.usermenu-name strong { font-size: .88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-name span { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-panel {
  position: absolute; left: 0; bottom: calc(100% + 8px); min-width: 230px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--pop-shadow); padding: 6px; z-index: 40;
}
@media (max-width: 899px) { .usermenu-panel { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); } }
.usermenu-who { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.usermenu-who span { color: var(--muted); font-size: .8rem; word-break: break-all; }
.usermenu-panel a, .usermenu-panel button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text);
  background: none; border: 0; font: inherit; cursor: pointer;
}
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--surface-2); text-decoration: none; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%; background: var(--mist); color: #3e5259;
  font-family: var(--f-mono); font-weight: 500; font-size: .72rem;
}
:root[data-theme="dark"] .avatar { color: var(--text); }
.avatar-sm { width: 26px; height: 26px; font-size: .66rem; }
.avatar-team { background: #0f2630; color: #7fd9c4; }
:root[data-theme="dark"] .avatar-team { background: #7fd9c4; color: #0b1a20; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); font-weight: 500; }
.btn-ghost:hover { background: var(--mist); }
.btn-sm { min-height: 32px; padding: 4px 11px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Page structure ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 6px; overflow-wrap: anywhere; }
.page-head p { margin: 0; }
.page-head .muted { color: var(--body); font-size: .97rem; max-width: 760px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; font-size: .88rem; margin-bottom: 8px; color: var(--primary-ink); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.05rem; }
.narrow { max-width: 560px; }

.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-gap { gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) {
  .layout-aside, .grid-2 { grid-template-columns: minmax(0, 1fr); }  /* minmax: a wide table scrolls in its box, not the page */
}

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .filters { flex: 1 1 420px; margin-bottom: 0; }

/* ---------- Tabs ---------- */
/* Tabs: every page uses .pill-tabs (styled with the Licences tabs further down). On its own above a list it
   keeps a gap below; inside a filter bar or the Licences tools row it doesn't. */
.pill-tabs { margin-bottom: 16px; }
.filters .pill-tabs { margin-bottom: 0; }
.count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px;
  font-size: .74rem; font-weight: 600; margin-left: 4px; color: var(--muted); }

/* ---------- Badges & tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; white-space: nowrap; line-height: 1.4; vertical-align: middle; }
.badge.status-new::before, .badge.status-open::before, .badge.status-pending::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-sm { font-size: .74rem; padding: 1px 8px; }
.badge-lg { font-size: .86rem; padding: 6px 12px; }
.status-new { background: var(--s-new-bg); color: var(--s-new-fg); }
.status-open { background: var(--s-open-bg); color: var(--s-open-fg); }
.status-pending { background: var(--s-pending-bg); color: var(--s-pending-fg); }
.status-closed { background: var(--s-closed-bg); color: var(--s-closed-fg); }
.prio-1 { background: var(--p-1); color: var(--p-1-fg); }
.prio-2 { background: var(--p-2); color: var(--p-2-fg); }
.prio-3 { background: var(--p-3); color: var(--p-3-fg); }
.prio-4 { background: var(--p-4); color: var(--p-4-fg); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.tag { font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-ink); }
.tag-warn { background: var(--warn-soft); color: var(--s-pending-fg); }

/* ---------- Flash messages & notices ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; }
.flash-success { border-color: var(--s-open-fg); background: var(--s-open-bg); color: var(--s-open-fg); }
.flash-error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.notice { background: var(--warn-soft); border: 1px solid var(--warn-border); padding: 10px 12px; border-radius: 8px; font-size: .9rem; }

/* ---------- Forms ---------- */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .inline-field > label { font-weight: 600; font-size: .9rem; color: var(--text); }
.optional { font-weight: 400; color: var(--muted); }
.help { color: var(--muted); font-size: .82rem; margin: 0; }
.help ul { padding-left: 18px; list-style: disc; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=tel],
input[type=date], input:not([type]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; min-height: 90px; }
.field-check label, .toggle { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
input[type=checkbox], input[type=radio] { min-height: 0; }
.errorlist { color: var(--danger); font-size: .85rem; }
.errorlist.nonfield { background: var(--danger-soft); padding: 10px 12px; border-radius: 8px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-field { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.inline-field select { width: auto; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline-form input { flex: 1 1 160px; width: auto; }

/* Image drop zone */
.dropzone { border: 1.5px dashed #bfd0d2; border-radius: 10px; padding: 14px; background: var(--surface-2); transition: border-color .15s, background .15s; }
:root[data-theme="dark"] .dropzone { border-color: var(--border); }
.dropzone-hint strong { color: var(--primary-ink); }
.dropzone.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-hint { margin: 0 0 4px; display: none; }
.js .dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.js .dropzone { cursor: pointer; }
.js .dropzone-hint { display: block; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbs:empty { display: none; }
.thumbs li { position: relative; }
.thumbs img { width: 104px; height: 78px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); display: block; }
.thumbs a:hover img { border-color: var(--primary); }
.thumbs a { display: block; cursor: zoom-in; }

/* Image pop-up (lightbox) */
.lightbox {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0;
  border: 0; background: transparent; color: #fff; overflow: hidden;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(10, 12, 18, .88); }
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: calc(100vw - 140px); }
.lightbox-figure img {
  display: block; max-width: 100%; max-height: calc(100vh - 110px); width: auto; height: auto;
  object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.lightbox figcaption { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: .9rem; color: #d6d9e0; }
.lightbox-count { color: #9aa0b0; font-variant-numeric: tabular-nums; }
.lightbox-original { color: #b9b4ff; }
.lightbox-close, .lightbox-nav {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-close { top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border-radius: 10px; font-size: 36px; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox.is-single .lightbox-nav { display: none; }
@media (max-width: 600px) {
  .lightbox-figure { max-width: calc(100vw - 24px); }
  .lightbox-nav { top: auto; bottom: 16px; transform: none; }
}

.thumb-remove {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: var(--text); color: var(--surface); cursor: pointer; font-size: 14px; line-height: 22px; padding: 0;
}

/* ---------- Ticket list (requester) ---------- */
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
  display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.ticket-row:hover { border-color: var(--primary); text-decoration: none; background: var(--surface-2); }
.ticket-row .badge { margin-bottom: 2px; }
.ticket-row-main, .ticket-row-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ticket-row-side { align-items: flex-end; text-align: right; flex: none; }
.ticket-title { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .ticket-row { flex-direction: column; }
  .ticket-row-side { align-items: flex-start; text-align: left; }
}

.empty { text-align: center; padding: 48px 16px; background: var(--surface-2); border: 1.5px dashed var(--border); border-radius: var(--radius); }
.empty h1, .empty h2 { font-size: 1.3rem; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg-card { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
/* Two sides: the client's side (requester, CC) plain white; the IT side tinted teal and indented */
.msg-ours { margin-left: 40px; }
.msg-ours .msg-card { background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); }
.msg-internal { margin-left: 40px; }
.msg-internal .msg-card { background: var(--warn-soft); border-color: var(--warn-border); }
.msg-head strong { font-size: .95rem; }
.msg-body { font-size: .97rem; line-height: 1.6; }
@media (max-width: 600px) { .msg-ours, .msg-internal { margin-left: 16px; } }
.tag-muted { background: var(--surface-2); color: var(--muted); }
.timeline-tools { display: flex; justify-content: flex-end; margin-bottom: -4px; }
.timeline-tools[hidden] { display: none; }
.timeline.hide-history .event { display: none; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.msg-head time { color: var(--muted); font-size: .82rem; margin-left: auto; }
.msg-body { overflow-wrap: anywhere; }
.event { display: flex; align-items: baseline; gap: 10px; color: var(--muted); font-size: .85rem; padding-left: 12px; }
.event-text { flex: 1; min-width: 0; }
.event time { margin-left: auto; font-size: .82rem; white-space: nowrap; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9d6d8; flex: none; align-self: center; }
.event strong { color: var(--text); }
.event em { font-style: normal; color: var(--text); font-weight: 600; }
.timeline-empty { color: var(--muted); font-size: .9rem; padding-left: 12px; }

.reply-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reply-toolbar h2 { margin: 0; }
.reply-toolbar select { width: auto; max-width: 100%; }
.reply-form.is-internal { background: var(--warn-soft); border-color: var(--warn-border); }

/* ---------- Sidebar properties ---------- */
.props { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: .9rem; }
.props dt { color: var(--muted); }
.props dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.props-compact { margin-top: 12px; }
.person { display: flex; gap: 10px; align-items: center; }
.person div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.person-inline { display: inline-flex; align-items: center; gap: 8px; }
/* Ticket properties: one row above the conversation (agent ticket page) */
.props-bar {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px; align-items: end; padding: 14px 16px;
}
.props-bar.props-1 { grid-template-columns: minmax(0, 1fr) auto; }
.props-bar.props-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.props-bar .field > label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.props-bar .optional { display: none; }
.props-bar select { padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 1100px) {
  .props-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .props-bar .btn { grid-column: 1 / -1; }
}

/* Requester's equipment (ticket sidebar) */
.equipment-list { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; }
.equipment-list > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.equipment-list dt { color: var(--muted); }
.equipment-list dd { margin: 0; overflow-wrap: anywhere; }
.serial { display: block; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

/* Click-to-copy text (e.g. device names and serial numbers) */
.copyable {
  position: relative; display: inline; padding: 1px 4px; margin: -1px -4px; border: 0; border-radius: 4px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: copy; user-select: text;
  overflow-wrap: anywhere;
}
.copyable:hover, .copyable:focus-visible { background: var(--primary-soft); color: var(--primary); }
.copyable.is-copied::after {
  content: attr(data-copied); position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%);
  padding: 1px 7px; border-radius: 4px; background: var(--text); color: var(--surface);
  font-size: .72rem; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.copy-buffer { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }
.equipment > .muted { margin: 8px 0 0; }
.equipment .btn-block[data-open-dialog] { margin-top: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.equipment-updated { margin: 8px 0 0; }
.equipment-notes {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft);
  border: 1px solid var(--warn-border); font-size: .85rem; overflow-wrap: anywhere;
}
.equipment-notes-label { display: block; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.notes-text { overflow-wrap: anywhere; }

/* Licenses: edit rows (stacked in the ticket sidebar, in columns on the full page) */
.license-head { display: none; }
.license-grid { display: flex; flex-direction: column; gap: 6px; }
.license-end, .license-cost { display: flex; flex-direction: column; gap: 4px; }
.license-cost { flex-direction: row; gap: 6px; }
.license-cost input { flex: 1 1 90px; min-width: 0; }
.license-cost select { flex: 0 1 auto; width: auto; }
.license-renew { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); font-weight: 500; cursor: pointer; }
.license-renew input { width: 16px; height: 16px; }
.license-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.license-total { margin: 8px 0 0; font-size: .88rem; }
.license-foot .license-total { margin: 0; }
.licenses-wide .license-head, .licenses-wide .license-grid {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr) minmax(0, 1.6fr); gap: 8px;
}
.licenses-wide .license-head { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-right: 30px; margin-bottom: 6px; }
@media (max-width: 700px) {
  .licenses-wide .license-head { display: none; }
  .licenses-wide .license-grid { display: flex; flex-direction: column; }
}
/* Licenses: read-only list */
.license-list { display: flex; flex-direction: column; gap: 8px; font-size: .88rem; }
.license-list li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.license-list-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.license-list-meta { color: var(--muted); font-size: .8rem; }
.license-list-price { white-space: nowrap; text-align: right; }
/* Licenses page: a license row opens to show who has it */
.license-people > summary { cursor: pointer; }
.license-people ul { margin: 8px 0 2px; padding-left: 4px; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.license-kpis .kpi-value { font-size: 1.5rem; }
/* End dates: orange within 60 days, red within 30 days or past */
.end-warn { color: var(--s-pending-fg); font-weight: 600; }
.end-danger { color: var(--danger); font-weight: 600; }

/* Two-factor authentication pages */
.setup-steps { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; font-size: .92rem; }
.qr { display: block; margin: 10px 0 6px; border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--border); image-rendering: pixelated; }
.secret-key { display: block; margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 6px; font-size: .95rem; letter-spacing: .05em; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.recovery-codes code { display: block; padding: 6px 10px; background: var(--surface-2); border-radius: 6px; font-size: .95rem; text-align: center; }
.continue-btn { margin-top: 8px; }
.profile-2fa { margin-top: 20px; }

/* Stock (Equipment → In stock) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--body); font-size: .86rem; font-weight: 500; }
.chip:hover { text-decoration: none; border-color: var(--primary); color: var(--text); }
.chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip[aria-current="page"] .count { background: rgba(255,255,255,.16); border-color: transparent; color: inherit; }
.condition-new { background: var(--s-open-bg); color: var(--s-open-fg); }
.condition-used { background: var(--s-closed-bg); color: var(--s-closed-fg); }
.condition-repair { background: var(--s-pending-bg); color: var(--s-pending-fg); }
.condition-broken { background: var(--danger-soft); color: var(--danger); }
.device-history { display: flex; flex-direction: column; gap: 10px; font-size: .86rem; }
.device-history li { display: flex; gap: 8px; }
.invoices .label { font-weight: 600; font-size: .9rem; }
.invoice-list { display: flex; flex-direction: column; gap: 6px; }
.invoice-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.invoice-list a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.invoice-icon { font-size: .65rem; font-weight: 700; padding: 2px 5px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); }
.field .invoice-remove { margin-left: auto; font-size: .82rem; color: var(--muted); }
.invoices input[type=file] { font: inherit; font-size: .86rem; color: var(--muted); max-width: 100%; }
.invoices input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; margin-right: 10px; cursor: pointer; }
.invoices input[type=file]::file-selector-button:hover { background: var(--surface-2); }
.placement { border: 0; padding: 0; margin: 0; }
.placement legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.placement label { font-size: .88rem; }
/* A device just assigned from stock: glows for a few seconds on the employee's page */
.just-added { border-radius: 10px; animation: just-added 4s ease-out; }
@keyframes just-added {
  0%, 40% { background: var(--primary-soft); box-shadow: 0 0 0 6px var(--primary-soft); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) { .just-added { animation: none; outline: 2px solid var(--primary); outline-offset: 4px; } }
.shortcut-card { margin-top: 20px; }
.shortcut-card h2 { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
/* "↩ Return to stock" / "Details →" next to a device */
.device-btn { font-size: .78rem; font-weight: 500; margin-left: 10px; white-space: nowrap; }
.device-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.device-actions .device-btn { margin: 0; }
.equip-item .device-actions { margin-top: 0; }
.equipment-list .device-btn { display: inline-block; margin: 2px 0 0; }
/* A button for a feature that isn't built yet: greyed out, "coming soon" on hover or focus */
.soon { position: relative; display: inline-flex; }
.soon > .btn { opacity: .5; cursor: not-allowed; }
.soon > .btn:hover { background: var(--surface); }
.soon-tip { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 30;
  padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--on-ink); font-size: .82rem; font-weight: 600;
  white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; }
.soon:hover .soon-tip, .soon:focus-within .soon-tip { opacity: 1; visibility: visible; }

/* Small drop-down menu (e.g. Export CSV) */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; z-index: 20; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--pop-shadow);
}
.menu-panel a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: .92rem; }
.menu-panel a:hover { background: var(--mist); text-decoration: none; }

/* Email log on the ticket page */
.email-log summary { list-style: none; cursor: pointer; }
.email-log summary::-webkit-details-marker { display: none; }
.email-log summary h2 { margin: 0; }
.email-log[open] summary { margin-bottom: 10px; }
.email-log-list { display: flex; flex-direction: column; gap: 8px; font-size: .84rem; }
.email-log-list li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.email-log-list li:last-child { border-bottom: 0; }
.email-log-list .badge { align-self: flex-start; }
.email-log-to { overflow-wrap: anywhere; }
.email-sent { background: var(--s-open-bg); color: var(--s-open-fg); }
.email-failed, .email-suppressed { background: var(--danger-soft); color: var(--danger); }
.email-rate_limited, .email-combined { background: var(--s-closed-bg); color: var(--s-closed-fg); }

/* Equipment change log */
.change-log { max-height: 900px; overflow-y: auto; }
.change-group { padding: 10px 0; border-bottom: 1px solid var(--border); }
.change-group:last-child { border-bottom: 0; }
.change-head { display: flex; align-items: center; gap: 8px; font-size: .88rem; flex-wrap: wrap; }
.change-head time { color: var(--muted); font-size: .78rem; margin-left: auto; }
.change-group ul { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.change-group li { display: flex; gap: 8px; font-size: .84rem; line-height: 1.4; overflow-wrap: anywhere; }
.change-icon {
  flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: .72rem; font-weight: 700; margin-top: 1px;
}
.change-added .change-icon { background: var(--s-open-bg); color: var(--s-open-fg); }
.change-removed .change-icon { background: var(--danger-soft); color: var(--danger); }
.change-changed .change-icon { background: var(--s-new-bg); color: var(--s-new-fg); }

/* Team member permission boxes */
.wide-form { max-width: 720px; }
.perm-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
.perm-box legend { font-weight: 700; padding: 0 6px; display: flex; gap: 10px; align-items: center; }
.perm-state { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--s-open-bg); color: var(--s-open-fg); }
.perm-state:empty { display: none; }
.perm-state.is-custom { background: var(--s-pending-bg); color: var(--s-pending-fg); }
.perm-group { margin-top: 16px; }
.perm-group h3 { margin: 0 0 6px; }
.perm-group > .help { margin: 6px 0 0; }
.perm-box > .help:last-child { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.perm-item span { min-width: 0; overflow-wrap: anywhere; }
.perm-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.perm-item input { margin-top: 2px; flex: none; }
.perm-item span { display: flex; flex-direction: column; }
.perm-item .help { font-weight: 400; }
.perm-item.is-locked { cursor: not-allowed; opacity: .65; }
.perm-box + .perm-box { margin-top: 4px; }
.equip-pair { display: flex; flex-direction: column; gap: 6px; }
.equipment-form-wide .equip-pair.with-warranty { grid-template-columns: 3fr 2fr 1.7fr; align-items: start; }
/* Warranty date box: the status tag sits inside the box (next to the calendar
   icon), so rows keep the same spacing with or without a tag. */
.warranty-box { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.warranty-box .badge { align-self: flex-start; }
.warranty-box.is-expired input { border-color: var(--danger); }
.warranty-box.is-soon input { border-color: var(--warn-border); }
@media (min-width: 1100px) {
  .warranty-box .badge {
    position: absolute; top: 50%; right: 34px; transform: translateY(-50%); pointer-events: none;
  }
}
.warranty-line { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.warranty-expired { color: var(--danger); }
/* Full-page equipment form: name and serial side by side */
.equipment-form-wide fieldset { border: 0; padding: 0; margin: 0; }
.equipment-form-wide legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.equipment-form-wide .equip-pair { display: grid; grid-template-columns: 3fr 2fr; gap: 8px; }
.equipment-form-wide .equip-item-list { margin-bottom: 8px; }
@media (max-width: 600px) {
  .equipment-form-wide .equip-pair, .equipment-form-wide .equip-pair.with-warranty { grid-template-columns: 1fr; }
}
.equipment-table td { vertical-align: top; }
.equip-cell-gap { margin-top: 6px; }
/* Radio choices (e.g. equipment sharing) */
.field div:has(> div > label > input[type=radio]) { display: flex; flex-direction: column; gap: 6px; }
.field label:has(> input[type=radio]) { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
input[type=radio] { margin-top: 3px; accent-color: var(--primary); }
.equip-item-list { display: flex; flex-direction: column; gap: 10px; }
.equip-item { position: relative; display: flex; flex-direction: column; gap: 6px; padding-right: 30px; }
.equip-item[hidden] { display: none; }
.equip-remove {
  position: absolute; top: 6px; right: 0; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 0;
}
.equip-remove:hover { color: var(--danger); border-color: var(--danger); }
.equip-delete { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.equip-add { align-self: flex-start; }
/* "+ Add" next to a device group's title (Laptop / Computer [+ Add]) */
.equip-items > legend { display: flex; align-items: center; gap: 10px; }
.equip-items > legend .group-add { padding: 2px 10px; font-size: .78rem; }
.equip-items > .equip-item-list > .muted { margin: 0; }
/* "+ Add" device popup (the same form as "Add to stock") */
.modal { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 2px 4px rgba(15, 38, 48, .08), 0 24px 60px -16px rgba(15, 38, 48, .45); }
.modal::backdrop { background: rgba(11, 26, 32, .55); }
.modal > form { margin: 0; border: 0; box-shadow: none; }
/* A big popup (the equipment editor on a ticket): title bar stays put, the content scrolls */
.modal-wide { width: min(1000px, calc(100vw - 32px)); height: calc(100vh - 48px); background: var(--bg); }
.modal-wide[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; margin-right: auto; font-size: 1.1rem; }
.modal-head form { margin: 0; }
.modal-body { overflow-y: auto; padding: 16px 20px 20px; }
/* With JavaScript: "×" removes a row, "+ Add" adds one. Without: tick "Remove". */
.js .equip-delete { display: none; }
:root:not(.js) .equip-remove, :root:not(.js) .equip-add { display: none; }

.rating-buttons { display: flex; gap: 8px; }
.rating-buttons .btn { flex: 1; }
.tips ul { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

.mini-list { display: flex; flex-direction: column; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap; }
.mini-list li:last-child { border-bottom: 0; }
.mini-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- KPIs & charts ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpis-secondary { margin-bottom: 20px; }

/* Dashboard: which company the stats are for */
.scope-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; }
.scope-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.scope-bar label { font-weight: 600; }
.scope-bar select { width: auto; min-width: 220px; }
.go-tickets { margin-left: auto; }
@media (max-width: 600px) { .go-tickets { width: 100%; } }
.btn-lg { padding: 12px 26px; font-size: 1.05rem; border-radius: 10px; }
/* Dashboard: per-company comparison table */
.company-table { padding-bottom: 8px; }
.table-flat { border: 0; border-radius: 0; margin: 0 -20px; width: calc(100% + 40px); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.kpi { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: var(--text); }
a.kpi:hover { border-color: var(--primary); text-decoration: none; }
.kpi-label { color: var(--muted); font-size: .84rem; font-weight: 600; }
.kpi-value { font-family: var(--f-mono); font-size: 1.65rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-sub { color: var(--muted); font-size: .76rem; }
.kpi-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.kpi-danger .kpi-value { color: var(--danger); }
.kpis-secondary .kpi { background: var(--surface-2); }
.kpis-secondary .kpi-value { font-size: 1.3rem; }

.chart { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
.chart-wrap { position: relative; }
.chart-summary { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.chart-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-baseline { stroke-dasharray: none; }
.chart-axis { fill: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--primary); transition: opacity .12s; }
.chart-bar-zero { fill: var(--border); }
.chart-hit { fill: transparent; }
.chart-col { cursor: default; }
.chart-wrap:hover .chart-bar { opacity: .45; }
.chart-wrap .chart-col:hover .chart-bar { opacity: 1; }
.chart-col:hover .chart-hit { fill: var(--primary-soft); opacity: .5; }
.chart-day { fill: var(--text); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-day.is-weekend { fill: var(--muted); font-weight: 400; }
.chart-month { fill: var(--muted); font-size: 11px; }
.chart-day.is-today { fill: var(--primary); }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .14); font-size: .8rem; white-space: nowrap; color: var(--muted); }
.chart-tip strong { display: block; color: var(--text); font-size: .95rem; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 2fr 32px; gap: 10px; align-items: center; font-size: .88rem; }
.bars-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 99px; }

/* ---------- Tables & filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { flex: 0 1 auto; width: auto; }
.company-picker select { font-weight: 600; border-color: var(--primary); }
/* Checkbox lists (e.g. choosing a company's support agents) */
.field div:has(> div > label > input[type=checkbox]) { display: flex; flex-direction: column; gap: 6px; }
.field label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .8rem; letter-spacing: .02em; color: var(--body); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.cell-title { min-width: 260px; }
.cell-title a, .cell-title .cell-link { display: block; font-weight: 600; color: var(--text); text-align: left; }
.cell-title a .muted { font-weight: 400; margin-right: 2px; }
.cell-title .cell-link:hover { color: var(--primary-ink); text-decoration: underline; }
.row-new { background: color-mix(in srgb, var(--s-new-bg) 35%, var(--surface)); }
.row-new .cell-title a::after { content: "NEW"; margin-left: 6px; font-size: .64rem; font-weight: 700; color: var(--s-new-fg); background: var(--s-new-bg); padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
/* Buttons in the last table column. (No flex on the <td> itself: that breaks the table's row lines.) */
td.actions { text-align: right; white-space: nowrap; }
.actions > * { display: inline-block; vertical-align: middle; }
.actions > * + * { margin-left: 6px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

/* ---------- Auth pages ---------- */
.auth-page { background-color: var(--mist);
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px; }
.auth-page .container { min-height: calc(100vh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 440px; padding: 32px; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 38, 48, .06), 0 8px 24px -8px rgba(15, 38, 48, .12); }
.auth-brand { margin-bottom: 20px; text-align: center; }
.auth-brand h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: .88rem; }

@media (max-width: 700px) {
  h1 { font-size: 1.5rem; }
}

/* ---------- Company switcher (your team: the company you're working in) ---------- */
.switcher { position: relative; }
.switcher > summary { list-style: none; }
.switcher > summary::-webkit-details-marker { display: none; }
.switcher-button { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 0 12px; min-height: 44px; width: 100%;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-weight: 600; color: var(--text); }
.switcher-button:hover, .switcher[open] .switcher-button { border-color: var(--primary); background: var(--surface); }
.switcher[open] .switcher-button { box-shadow: var(--focus); }
.switcher-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-caret { color: var(--muted); font-size: .8rem; }
.switcher-panel { position: absolute; left: 0; top: calc(100% + 8px); z-index: 50; width: 280px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--pop-shadow); }
.switcher-title { margin: 2px 6px 8px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.switcher-search { width: 100%; margin-bottom: 6px; }
.switcher-panel form { margin: 0; }
.switcher-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.switcher-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.switcher-item:hover { background: var(--surface-2); }
.switcher-item.is-current { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.switcher-check { margin-left: auto; color: var(--primary-ink); }
.switcher-all { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; padding-top: 10px; }
.switcher-links { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.switcher-links a { padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: .9rem; }
.switcher-links a:hover { background: var(--surface-2); text-decoration: none; }
.company-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dot-0 { background: #3e7cb1; } .dot-1 { background: #0a7a69; } .dot-2 { background: #d9912b; } .dot-3 { background: #c2463a; }
.dot-4 { background: #2b9fb3; } .dot-5 { background: #7a5bb5; } .dot-6 { background: #c25a8a; } .dot-7 { background: #6f9a2e; }
.dot-all { background: conic-gradient(#3e7cb1 0 25%, #0a7a69 0 50%, #d9912b 0 75%, #c2463a 0); }
/* "×" at the end of a table row (Users: delete an account) */
.row-delete { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.row-delete:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.row-delete:disabled { opacity: .35; cursor: not-allowed; }
/* Licenses: the "Edit" / "+ New license" popup */
.modal-medium { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 20px 24px; }
.license-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.license-editor-head h2 { margin: 0; }
.price-period { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(110px, auto); gap: 6px; }
.license-rows td { vertical-align: middle; }
.license-rows input[type=date] { min-width: 140px; }
td.center, th.center { text-align: center; }
.people-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.people-pick > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; }
.people-search { width: 100%; }
.license-edit-page { max-width: 900px; }
.license-rows .price-period { grid-template-columns: minmax(96px, 1fr) minmax(118px, auto); }
.license-rows input[type=number] { min-width: 96px; }
/* Next to "Licenses" on the equipment editor: pick from the list first */
.license-hint { font-size: .85rem; font-weight: 700; color: var(--text); margin-left: 6px; }
/* Ticket attachments that aren't images: download chips (and their preview before sending) */
.thumbs:empty, .file-chips:empty { display: none; }
.file-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; max-width: 320px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.file-chip:hover { border-color: var(--primary); text-decoration: none; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-ext { font-size: .65rem; font-weight: 700; padding: 2px 5px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.file-ext-docx { background: #dbeafe; color: #1d4ed8; } .file-ext-xlsx, .file-ext-csv { background: #dcfce7; color: #15803d; }
.file-ext-pptx { background: #ffedd5; color: #c2410c; }
.thumb-file { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 6px;
  white-space: pre-line; text-align: center; font-size: .7rem; font-weight: 600; overflow: hidden; word-break: break-all;
  background: var(--surface-2); color: var(--muted); }

/* Ticket CC + merging duplicates */
.cc { margin-top: 14px; }
.cc h3 { margin-bottom: 6px; }
.cc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cc-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cc-list li > span { min-width: 0; overflow-wrap: anywhere; }
.cc-add { display: flex; gap: 6px; }
.cc-add .suggest { flex: 1; min-width: 0; }
.tag-merged { background: var(--surface-2, var(--primary-soft)); color: var(--muted, var(--primary)); }
.msg-title { font-weight: 600; margin: 0 0 4px; }
.merge-table td:first-child, .merge-table td:nth-child(2), .merge-table th:first-child, .merge-table th:nth-child(2) { width: 56px; text-align: center; }
.merge-current { background: var(--primary-soft); }
.card > .cc:first-child { margin-top: 0; }

/* Type-ahead suggestions (CC) */
.suggest { position: relative; }
.suggest input { width: 100%; }
.suggest-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); max-height: 280px; overflow-y: auto; }
.suggest-list li { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 6px; cursor: pointer;
  overflow-wrap: anywhere; }
.suggest-list li strong { font-weight: 600; }
.suggest-list li.is-active { background: var(--primary-soft); }
.suggest-list li[hidden] { display: none; }
.name-help { margin-top: -8px; } /* sits right under the Name / Surname boxes */

/* Reply box: Reply | Internal note tabs */
.reply-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.reply-tabs[hidden] { display: none; }
.reply-tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.reply-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.reply-form.is-internal .reply-tabs button[aria-selected="true"] { color: var(--s-pending-fg); }
.reply-form.is-internal .only-reply { display: none; }
.reply-to { margin: 0; font-size: .9rem; }
.dropzone-compact { padding: 10px 14px; }

/* Private internal notes: "Visible to" (only while Internal note is on) */
.note-for { display: none; margin: 0; }
.reply-form.is-internal .note-for { display: block; }
.note-for-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; padding: 4px 8px;
  border: 1px solid var(--warn-border, var(--border)); border-radius: 8px; background: var(--surface); }
.note-for-label { font-weight: 600; font-size: .9rem; }
.note-for .help { margin-top: 4px; }
.person-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: .85rem; font-weight: 600; }
.person-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; border-radius: 50%; }
.person-chip button:hover { background: var(--surface); }
.note-add { flex: 1; min-width: 160px; }
.note-add[hidden] { display: none; }
.note-add input { border: 0; padding: 4px; background: transparent; box-shadow: none; }
.note-add input:focus { outline: none; }
.note-for-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; margin: 6px 0; }
.note-for-list[hidden] { display: none; }
.note-for-list label { display: flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }
[data-no-js-toggle][hidden] { display: none; }
.reply-form .inline-field { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; } .reply-form .inline-field label { margin: 0; }

/* Ticket sidebar: Details card (status, priority, category, assignee; saves on change) */
.details-card .section-head { margin-bottom: 10px; }
.details-card h2 { margin: 0; }
.details-form { display: flex; flex-direction: column; gap: 8px; }
.details-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 10px; }
.details-row label { color: var(--muted); font-size: .88rem; font-weight: 500; margin: 0; }
.details-row select { padding-top: 6px; padding-bottom: 6px; }
.js .autosave-submit { display: none; }
.autosave-submit { align-self: flex-end; }
.details-list { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px 10px; margin: 0; font-size: .9rem; }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; overflow-wrap: anywhere; }
.details-times { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.save-state { color: var(--muted); }
.save-state[data-kind="ok"] { color: var(--s-open-fg, var(--primary)); }
.save-state[data-kind="error"] { color: var(--danger); }

/* Folded sidebar sections (Equipment) */
.fold { margin-top: 14px; }
.fold > summary { list-style: none; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h3 { margin: 0; }
.fold > summary h3::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.fold[open] > summary h3::before { transform: rotate(90deg); }
.fold[open] > summary { margin-bottom: 8px; }
.email-log summary h2::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.email-log[open] summary h2::before { transform: rotate(90deg); }
.cc h2 { margin-bottom: 6px; }
form.filters.is-searching input[type=search] { background-image: none; opacity: .75; } /* live search running */
.suggest-floating { position: fixed; z-index: 1000; right: auto; top: 0; left: 0; }
/* Equipment page: the top Save sits on the header's bottom edge, right above the sidebar */
.page-head-save { align-items: flex-end; margin-bottom: 12px; }
.page-head-save .head-actions .btn { padding-top: 7px; padding-bottom: 7px; }

/* ==========================================================================
   Knowledge base (knowledge/): your team's list, article page and editor,
   and the employees' "Help articles".
   ========================================================================== */
.eyebrow { display: block; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary-ink); margin-bottom: 4px; }
.kb-label { display: block; font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.kb-section { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 18px 0 8px; }
.kb-results > .kb-section:first-child { margin-top: 4px; }
.flash-warning { border-color: var(--warn-border); background: var(--warn-soft); color: var(--s-pending-fg); }

/* Who sees it: company name / Team-only / Draft / Archived */
.kb-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-family: var(--f-mono);
  font-size: .76rem; font-weight: 500; white-space: nowrap; }
.pill-company { background: var(--primary-soft); color: var(--primary-ink); }
.pill-team { background: var(--ink); color: var(--on-ink); }
.pill-draft { background: var(--s-pending-bg); color: var(--s-pending-fg); }
.pill-archived { background: var(--s-closed-bg); color: var(--s-closed-fg); }
.kb-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }

/* Pinned cards and the list */
.kb-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.kb-pin { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.kb-pin:hover { border-color: var(--primary); text-decoration: none; }
.kb-pin b { font-size: 1rem; font-weight: 600; line-height: 1.35; }
.kb-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kb-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--border-soft); }
.kb-row:last-child { border-bottom: 0; }
.kb-row:hover { background: var(--surface-2); }
.kb-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; color: var(--text); }
.kb-row-main:hover { text-decoration: none; }
.kb-row-main:hover .kb-row-title { text-decoration: underline; }
.kb-row-title { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
.kb-row-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kb-row-side form { margin: 0; }

/* The article text (also inside the editor) */
.kb-body { font-size: 1rem; line-height: 1.65; color: var(--body); overflow-wrap: anywhere; }
.kb-body > * + * { margin-top: .7em; }
.kb-body p { margin: 0; }
.kb-body h2, .kb-body h3 { font-family: var(--f-display); color: var(--text); text-transform: none; letter-spacing: 0;
  margin: 1em 0 0; }
.kb-body h2 { font-size: 1.15rem; }
.kb-body h3 { font-size: 1rem; }
.kb-body > h2:first-child, .kb-body > h3:first-child { margin-top: 0; }
.kb-body ul { list-style: disc; padding-left: 1.5em; }
.kb-body ol { list-style: decimal; padding-left: 1.5em; }
.kb-body li { margin: 4px 0; }
.kb-body a { text-decoration: underline; }
.kb-body code { font-family: var(--f-mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 1px 6px; border-radius: 5px; }
.kb-body pre { font-family: var(--f-mono); font-size: .86em; background: var(--surface-2); padding: 12px; border-radius: 8px;
  overflow-x: auto; white-space: pre-wrap; }
.kb-body blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
/* Images: Small / Medium sit on the left (default) or right with the text wrapping beside them,
   or centered on their own line; Full width never wraps. Phones: always full width above the text. */
.kb-figure { margin: 1em 0; }
.kb-figure img { display: block; margin: 0; border-radius: 8px; border: 1px solid var(--border); }
.kb-figure.kb-size-s img { max-width: min(280px, 100%); }
.kb-figure.kb-size-m img { max-width: min(480px, 100%); }
.kb-figure.kb-size-f img { width: 100%; }
.kb-figure:is(.kb-size-s, .kb-size-m):not(.kb-align-c, .kb-align-r) { float: left; clear: left; margin: .3em 1.4em .8em 0; }
.kb-figure.kb-align-r:is(.kb-size-s, .kb-size-m) { float: right; clear: right; margin: .3em 0 .8em 1.4em; }
.kb-figure.kb-size-s:not(.kb-align-c) { max-width: 40%; }
.kb-figure.kb-size-m:not(.kb-align-c) { max-width: 55%; }
.kb-figure.kb-align-c { text-align: center; }
.kb-figure.kb-align-c img { margin: 0 auto; }
.kb-figure figcaption { margin-top: 6px; font-size: .86rem; font-style: italic; color: var(--muted); }
.kb-body::after, .kb-editor .ql-editor::after { content: ""; display: block; clear: both; }
.kb-body :is(ul, ol) { display: flow-root; } /* beside an image: list numbers never slide under it */
/* A narrow article (phone, small window, editor beside the sidebar): no wrapping, the image goes full width */
.kb-body { container-type: inline-size; }
@container (max-width: 560px) {
  .kb-figure.kb-figure { float: none !important; max-width: 100% !important; margin: 1em 0 !important; }
  .kb-figure img { width: 100%; max-width: 100% !important; }
}
.kb-notice { margin-bottom: 16px; }
.kb-about { grid-template-columns: 96px minmax(0, 1fr); }

/* New / edit article */
.kb-visibility { border: 0; padding: 0; margin: 0; min-width: 0; }
.kb-visibility legend { font-weight: 600; font-size: .9rem; color: var(--text); padding: 0; margin-bottom: 6px; }
.kb-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); cursor: pointer; }
.kb-opt:has(input:checked) { border-color: var(--primary); box-shadow: var(--focus); }
.kb-opt strong { display: block; font-size: .95rem; color: var(--text); }
.kb-opt input { flex: none; }
.kb-team-note { min-height: 42px; display: flex; align-items: center; }
[data-kb-company][hidden], [data-kb-team-note][hidden], .kb-editor-wrap[hidden], .kb-image-bar[hidden],
[data-kb-image-error][hidden], .kb-form textarea[hidden] { display: none; }
.kb-editor-wrap { position: relative; }
.kb-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border); border-bottom: 0;
  border-radius: 8px 8px 0 0; background: var(--surface-2); }
.kb-toolbar button { min-height: 32px; min-width: 32px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent;
  font: inherit; font-size: .86rem; color: var(--body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.kb-toolbar button:hover { background: var(--mist); color: var(--text); }
.kb-toolbar button.ql-active { background: var(--ink); color: var(--on-ink); }
.kb-toolbar-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--border); }
.kb-body .ql-align-center { text-align: center; }
.kb-body .ql-align-right { text-align: right; }
.kb-body li.ql-align-center, .kb-body li.ql-align-right { list-style-position: inside; }
.kb-toolbar .kb-toolbar-image { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.kb-editor.ql-container { border: 1px solid var(--border); border-radius: 0 0 8px 8px; background: var(--surface);
  font: inherit; height: auto; }
.kb-editor .ql-editor { min-height: 320px; max-height: none; padding: 14px 16px; font-size: 1rem; line-height: 1.65;
  color: var(--body); overflow: visible; }
.kb-editor .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; left: 16px; right: 16px; }
.kb-editor-wrap:focus-within .kb-editor.ql-container { border-color: var(--primary); box-shadow: var(--focus); }
.kb-editor .kb-figure { cursor: pointer; }
.kb-editor .kb-figure.is-selected img { outline: 3px solid var(--primary); outline-offset: 2px; }
.kb-image-bar { position: absolute; z-index: 5; display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  max-width: calc(100% - 16px); padding: 6px; border-radius: 10px; background: #0f2630; box-shadow: var(--pop-shadow); }
.kb-image-bar button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #dde7e8;
  font: inherit; font-size: .82rem; cursor: pointer; }
.kb-image-bar button:hover { background: #1e3c48; }
.kb-image-bar button[aria-pressed="true"] { background: #fff; color: #0f2630; font-weight: 600; }
.kb-image-bar input { width: 200px; min-height: 30px; padding: 4px 8px; font-size: .84rem; }
.kb-image-bar-sep { width: 1px; height: 18px; background: #3a5560; }
.kb-upload-state { margin: 6px 0 0; color: var(--muted); min-height: 1em; }
.kb-upload-state:empty { display: none; }
.kb-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px 16px;
  border: 2px dashed #9fc9be; border-radius: 10px; background: var(--surface-2); color: var(--primary); }
.kb-drop span { color: var(--text); }
.kb-drop .help { color: var(--muted); }
.kb-drop.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
:root[data-theme="dark"] .kb-drop { border-color: var(--border); }
.kb-tips p { margin: 0 0 10px; }

/* Popups: copy to another company, archive, add an image */
.kb-dialog { width: min(520px, calc(100vw - 32px)); }
.kb-dialog-body { padding: 22px 24px; }
.kb-dialog-body h2 { margin: 0; font-size: 1.2rem; }
.kb-dialog-body p { margin: 0; }
.kb-dialog-actions { justify-content: flex-end; }
.kb-checks { display: flex; flex-direction: column; gap: 6px; }
.kb-check { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border-soft);
  border-radius: 8px; font-weight: 500; cursor: pointer; }
.kb-check.is-disabled { color: var(--muted); cursor: not-allowed; }
.kb-check-plain { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }

/* Help articles (a company's people) */
.kb-reader { max-width: 960px; }
.kb-search { align-items: center; gap: 10px; padding: 0 6px 0 16px; min-height: 52px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); }
.kb-search:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.kb-search input[type=search] { border: 0; box-shadow: none; background: transparent; font-size: 1.02rem; padding-left: 0; }
.kb-search input[type=search]:focus { box-shadow: none; }
.kb-feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.kb-stuck-q { font-weight: 600; color: var(--text); }
.kb-editor .ql-editor > * + * { margin-top: .7em; }
.kb-editor .ql-editor h2, .kb-editor .ql-editor h3 { margin-top: 1em; }

/* Device Location: the company's locations, or "+ Add new location…" and its text box (app.js) */
.location-field input[name=location][hidden] { display: none; }

/* ==========================================================================
   HR forms (tickets/hr.py): New employee / Leaver on Raise a ticket, the HR
   details on the ticket, Manage → HR forms.
   ========================================================================== */
.js [data-no-js-only] { display: none; }
[data-hr-find][hidden], [data-hr-person][hidden], [data-hr-manual][hidden], [data-hr-manual-link][hidden],
[data-hr-has][hidden], [data-hr-options][hidden] { display: none; }

/* Normal request | New employee | Leaver (also New employee | Leaver on Manage → HR forms) */
.hr-switch { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; max-width: 560px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.hr-switch a { flex: 1 1 140px; min-height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; color: var(--body); font-weight: 500; }
.hr-switch a:hover { text-decoration: none; background: var(--mist); color: var(--text); }
.hr-switch a[aria-current="page"] { background: var(--ink); color: var(--on-ink); font-weight: 600; }

.hr-layout { grid-template-columns: minmax(0, 1fr) 340px; }
.hr-steps { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hr-step { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; }
.hr-step-head { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.12rem; }
.hr-num { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--primary-soft); color: var(--primary-ink); font: 500 .82rem var(--f-mono); }
.hr-date input { max-width: 280px; }

/* Leaver: the person picked */
.hr-person { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px;
  border: 1.5px solid var(--primary); border-radius: 12px; background: var(--primary-soft); }
.hr-person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hr-person-main strong { font-size: 1.02rem; overflow-wrap: anywhere; }

/* Yes / No questions */
.hr-questions { display: flex; flex-direction: column; }
.hr-q { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.hr-questions .hr-q:first-child { padding-top: 0; }
.hr-questions .hr-q:last-child { border-bottom: 0; padding-bottom: 0; }
.hr-q > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hr-q-label { font-weight: 600; color: var(--text); }
.hr-q select { width: 300px; max-width: 100%; }
.hr-q-custom { border-top: 1px solid var(--border-soft); border-bottom: 0; }
.yes-no { display: inline-flex; flex: none; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.yes-no label { position: relative; cursor: pointer; }
.yes-no input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.yes-no span { display: flex; align-items: center; justify-content: center; width: 72px; min-height: 40px;
  background: var(--surface); color: var(--body); font-weight: 500; }
.yes-no label + label span { border-left: 1px solid var(--border); }
.yes-no input:checked + span { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.yes-no input:focus-visible + span { box-shadow: var(--focus); }

/* New employee: What do they need? */
.hr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.hr-tile { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 500; }
.hr-tile input { width: 20px; height: 20px; margin: 0; flex: none; }
.hr-tile:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* Right-hand boxes */
.hr-box { display: flex; flex-direction: column; gap: 10px; }
.hr-box .kb-label { margin: 0; }
.hr-box-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: 1rem; }
.hr-items li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border-soft); }
.hr-items li:last-child { border-bottom: 0; padding-bottom: 0; }
.hr-items b { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
[data-hr-has] { display: flex; flex-direction: column; gap: 16px; }
.hr-rail-note { padding: 0 4px; }
.hr-summary { display: flex; flex-direction: column; margin: 0; }
.hr-summary dt { font-size: .82rem; color: var(--muted); padding-top: 10px; }
.hr-summary dd { margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); color: var(--text); font-weight: 500; }
.hr-summary dd:last-child { border-bottom: 0; padding-bottom: 0; }
.hr-next { list-style: decimal; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; color: var(--text); }

/* On the ticket */
.hr-details { border: 1.5px solid var(--primary); background: var(--primary-soft); }
.hr-details-label { color: var(--primary-ink); }
.hr-dl { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.hr-dl dt { color: var(--muted); }
.hr-dl dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.yn-pill { display: inline-flex; padding: 1px 9px; border-radius: 6px; font-size: .84rem; font-weight: 600;
  background: var(--s-closed-bg); color: var(--s-closed-fg); }
.yn-pill.is-yes { background: var(--surface); color: var(--primary-ink); }
.hr-pill { background: var(--ink); color: var(--on-ink); }
.hr-check { display: flex; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; color: var(--text); }
.hr-check input { margin: 0; flex: none; }
.hr-box .save-state:empty { display: none; }

/* Manage → HR forms */
.hr-manage-lead { max-width: 760px; }
.hr-fields { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
.hr-field { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); }
.hr-field:last-child { border-bottom: 0; }
.hr-field.is-standard { background: var(--surface-2); }
.hr-field-name { flex: 1 1 220px; font-weight: 600; color: var(--text); }
.hr-field-type { font-family: var(--f-mono); font-size: .76rem; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--body); max-width: 100%; overflow-wrap: anywhere; }
.hr-field-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
/* "What do they need?" on Manage → HR forms: locked standard tiles, then the company's own */
.hr-needs { flex: 1 1 100%; display: grid; gap: 10px; }
.hr-need-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); }
.hr-need { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap;
  padding: 7px 12px; border-bottom: 1px solid var(--border-soft); }
.hr-need:last-child { border-bottom: 0; }
.hr-need-name { color: var(--text); overflow-wrap: anywhere; }
.hr-need.is-locked .hr-need-name { color: var(--body); }
.hr-need.is-hidden .hr-need-name { color: var(--muted, var(--body)); text-decoration: line-through; }
.hr-need-name .small { margin-left: 6px; }
.hr-need-edit, .hr-need-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; flex: 1 1 100%; }
.hr-need-edit input[type=text], .hr-need-add input[type=text] { flex: 1 1 200px; min-width: 0; max-width: 360px; }
.hr-required {display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; cursor: pointer; margin-right: 6px; }
.hr-add { border: 1.5px solid var(--primary); max-width: 900px; }
.hr-add h2 { margin: 0; }
.hr-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hr-access { display: flex; align-items: center; gap: 8px; margin: 0; }
.hr-access-tick { display: inline-flex; padding: 4px; cursor: pointer; }
.hr-tick { padding: 12px; border: 1.5px solid var(--primary); border-radius: 10px; background: var(--primary-soft); }
.hr-tick label { display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
/* Users → Edit: the two HR edit ticks, spaced like the rest of the form (.form-stack's gap) */
.hr-ticks { display: flex; flex-direction: column; gap: 14px; }
.hr-ticks[hidden] { display: none; }

@media (max-width: 900px) {
  .hr-layout { grid-template-columns: 1fr; }
  .hr-dl { grid-template-columns: 1fr; gap: 2px; }
  .hr-dl dd { margin-bottom: 8px; }
  .hr-step { padding: 18px; }
}

/* ==========================================================================
   Dashboard and Home (tickets/dashboard.py, static/js/dashboard.js)
   Fixed "Right now" rows, then movable boxes in each person's order, world clocks,
   and the Edit view (drag ⠿ / hide ×, hidden-boxes tray).
   ========================================================================== */
:root { --leave-bg: #f1ecf8; --leave-fg: #5b3a8e; --tint-teal: #f3faf8; --tint-amber: #fffaf2; --tint-red: #fff8f7; }
:root[data-theme="dark"] { --leave-bg: #2a2140; --leave-fg: #c9b5f2; --tint-teal: #12302d; --tint-amber: #2a2213; --tint-red: #2e1a18; }

.dash { display: flex; flex-direction: column; gap: 28px; }
.dash [hidden] { display: none !important; }
:root:not(.js) .js-only, .js .no-js-only { display: none !important; }
.dash-eyebrow { font-family: var(--f-mono); font-size: .74rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); }
.dash-sub, .dash-note { font-size: .82rem; color: var(--muted); margin: 0; }
.dash-label { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Header: date + company, greeting, one line, buttons */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-hello { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dash-hello h1 { margin: 0; font-size: 1.9rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dash-hello p { margin: 0; color: var(--body); }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-actions .btn svg { flex: none; }
.dash-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius);
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); color: var(--text); }
.dash-banner > svg { color: var(--primary); flex: none; }
.dash-banner > span:first-of-type { flex: 1 1 240px; }
.dash-save-state { font-size: .82rem; color: var(--muted); }
.dash-save-state[data-kind="error"] { color: var(--danger); font-weight: 600; }

/* Section labels ("Right now", "Activity" ...) */
.dash-section { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-lock { display: none; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.is-editing .dash-lock { display: inline-flex; }
.dash-fixed { display: flex; flex-direction: column; gap: 12px; }

/* Icon squares */
.dash-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
  flex: none; background: var(--primary-soft); color: var(--primary-ink); }
.dash-ic-amber { background: var(--s-pending-bg); color: var(--s-pending-fg); }
.dash-ic-blue { background: var(--s-new-bg); color: var(--s-new-fg); }
.dash-ic-red { background: var(--danger-soft); color: var(--danger); }
.dash-ic-grey { background: var(--s-closed-bg); color: var(--s-closed-fg); }

/* KPI tiles and the 30-day strip */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dash-kpi { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; min-width: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
a.dash-kpi:hover { border-color: var(--primary); text-decoration: none; }
.dash-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dash-kpi-label { font-size: .86rem; font-weight: 500; color: var(--body); }
.dash-kpi-value { font-family: var(--f-display); font-size: 2.1rem; font-weight: 600; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.dash-kpi-sub { font-size: .8rem; color: var(--muted); }
.dash-kpi.is-alert { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--tint-red); }
.dash-kpi.is-alert .dash-kpi-value { color: var(--danger); }
.dash-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.dash-strip > div { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; min-width: 0;
  box-shadow: 1px 0 var(--border-soft), 0 1px var(--border-soft); }
.dash-strip b { font-family: var(--f-display); font-size: 1.4rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* The movable boxes: one flowing row-wrap, each box has a width class */
.dash-boxes { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.dash-boxes > .dash-section { flex: 1 0 100%; margin-top: 12px; margin-bottom: -4px; }
.dash-boxes > .dash-section:first-child { margin-top: 0; }
.dash-w-full { flex: 1 1 100%; min-width: 0; }
.dash-w-wide { flex: 2 1 520px; min-width: 0; }
.dash-w-half { flex: 1 1 340px; min-width: 0; }
.dash-w-third { flex: 1 1 300px; min-width: 0; }

/* Cards: head (icon, title, meta right) / body / footer link */
.card.dash-card { padding: 0; display: flex; flex-direction: column; border-radius: 14px; min-width: 0; }
.dash-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft);
  min-height: 60px; }
.dash-card-head h2 { margin: 0; font-size: 1rem; min-width: 0; }
.dash-card-head .count { margin-left: 0; }
.dash-meta { margin-left: auto; font-size: .8rem; color: var(--muted); text-align: right; }
.dash-card-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; flex: 1; min-width: 0; }
.dash-card-list { padding-top: 4px; padding-bottom: 4px; }
.dash-card-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid var(--border-soft);
  font-size: .88rem; font-weight: 600; }
.dash-empty { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .86rem; color: var(--body); }
.dash-card-list .dash-empty { margin: 12px 0; }
.dash-empty-pad { margin: 16px 20px; }
.company-table .table-flat { margin: 0; width: 100%; border-radius: 0 0 14px 14px; }
.dash-card .chart-wrap { margin-top: -4px; }

/* Rows: tickets, people, licences, laptops */
.dash-list { display: flex; flex-direction: column; }
.dash-list > li + li { border-top: 1px solid var(--border-soft); }
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; color: var(--text); }
.dash-row:hover { text-decoration: none; }
.dash-row:hover .dash-row-title { color: var(--primary-ink); text-decoration: underline; }
.dash-row-ticket { grid-template-columns: 44px minmax(0, 1fr) auto; }
.dash-row-no { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }
.dash-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dash-row-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row.is-done { opacity: .55; }
/* Same font as the ticket status badges (.badge: New, Open, Pending…) */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-family: var(--f-body);
  font-size: .8rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill-join, .pill-ok { background: var(--s-open-bg); color: var(--s-open-fg); }
.pill-leave { background: var(--leave-bg); color: var(--leave-fg); }
.pill-red { background: var(--danger-soft); color: var(--danger); }
.pill-amber { background: var(--s-pending-bg); color: var(--s-pending-fg); }

/* Unresolved by category */
.dash-cats { display: flex; flex-direction: column; gap: 10px; }
.dash-cats li { display: grid; grid-template-columns: minmax(0, 1fr) 32px; grid-template-areas: "label n" "bar n"; gap: 5px 12px; align-items: center; }
.dash-cat-label { grid-area: label; font-size: .88rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-cats b { grid-area: n; text-align: right; font-family: var(--f-mono); font-size: .85rem; font-weight: 500; }
.dash-cats progress { grid-area: bar; height: 6px; }

/* Big numbers in a bordered 3-column strip (Licences, Laptops) */
.dash-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; }
.dash-num { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-width: 0; color: var(--body); }
.dash-num + .dash-num { border-left: 1px solid var(--border-soft); }
.dash-num:hover { background: var(--surface-2); text-decoration: none; }
.dash-num b { font-family: var(--f-display); font-size: 1.85rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--text);
  font-variant-numeric: tabular-nums; }
.dash-num span { font-size: .78rem; font-weight: 500; line-height: 1.3; }
.dash-num-teal { background: var(--tint-teal); }
.dash-num-teal b { color: var(--primary-ink); }
.dash-num-amber { background: var(--tint-amber); }
.dash-num-amber b { color: var(--s-pending-fg); }
.dash-num-red { background: var(--tint-red); }
.dash-num-red b { color: var(--danger); }
.dash-meter { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 28%, var(--surface)); }
.dash-meter::-webkit-progress-bar { background: color-mix(in srgb, var(--primary) 28%, var(--surface)); border-radius: 999px; }
.dash-meter::-webkit-progress-value { background: var(--ink); border-radius: 999px; }
.dash-meter::-moz-progress-bar { background: var(--ink); border-radius: 999px; }
.dash-meter-foot { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; color: var(--muted); margin-top: -4px; }

/* Boxes with their own heading outside a card (My requests, World clocks) */
.dash-block { display: flex; flex-direction: column; gap: 12px; }
.dash-block-head { position: relative; display: flex; align-items: center; gap: 6px; min-height: 32px; }
.dash-head-link { margin-left: auto; font-size: .86rem; font-weight: 600; }
.dash-tabs { margin: 0; padding: 14px 16px 0; }
.dash-request { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 20px; color: var(--text); }
.dash-request:hover { background: var(--surface-2); text-decoration: none; }
.dash-request-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dash-requests > li + li { border-top-color: var(--border-soft); }

/* World clocks */
.dash-info { display: inline-flex; }  /* the tip is placed under the whole heading row (fits on phones) */
.dash-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--muted); cursor: help; }
.dash-info-btn:hover, .dash-info-btn:focus-visible { background: var(--primary-soft); color: var(--primary-ink); }
.dash-tip { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: min(300px, 100%); padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: var(--on-ink); font-size: .84rem; line-height: 1.4; box-shadow: var(--pop-shadow);
  opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; }
.dash-info:hover .dash-tip, .dash-info-btn:focus-visible + .dash-tip { opacity: 1; visibility: visible; }
.clocks { display: flex; flex-wrap: wrap; gap: 10px; }
.clock { position: relative; flex: 0 0 calc((100% - 56px - 50px) / 5); min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.clock-city { font-size: .84rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock-time { font-family: var(--f-display); font-size: 1.65rem; font-weight: 600; line-height: 1.05; letter-spacing: -.01em;
  color: var(--text); font-variant-numeric: tabular-nums; }
.clock-sub { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.clock-day { font-family: var(--f-mono); font-size: .68rem; padding: 1px 6px; border-radius: 5px; background: var(--s-new-bg); color: var(--s-new-fg); }
.clock.is-mine { border-color: var(--primary); background: var(--tint-teal); }
.clock-add { flex: 0 0 56px; display: flex; align-items: center; justify-content: center; min-height: 82px; padding: 0;
  border: 1.5px dashed var(--border); border-radius: 12px; background: transparent; color: var(--primary-ink); cursor: pointer; }
.clock-add:hover { border-color: var(--primary); background: var(--tint-teal); }
.clock-remove { display: none; position: absolute; top: -12px; right: -12px; width: 40px; height: 40px; padding: 0; border: 0;
  background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.clock-remove span { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); }
.is-editing .clock:not(.is-mine) { border-style: dashed; }
.is-editing .clock-remove { display: flex; }

/* "Add a clock" popup */
.clock-dialog { width: min(420px, calc(100vw - 32px)); }
.clock-form { display: flex; flex-direction: column; }
.clock-dialog-head { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 12px; border-bottom: 1px solid var(--border-soft); }
.clock-dialog-head h2 { margin: 0; }
.clock-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1.5px solid var(--primary); border-radius: 10px; color: var(--muted); }
.clock-search input { border: 0; box-shadow: none; padding-left: 0; padding-right: 0; background: transparent; font-size: 1rem; }
.clock-search input:focus { box-shadow: none; }
.clock-options { display: flex; flex-direction: column; padding: 6px; min-height: 56px; max-height: 300px; overflow-y: auto; }
.clock-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.clock-option:hover, .clock-option[aria-selected="true"] { background: var(--primary-soft); }
.clock-option b { font-weight: 600; color: var(--text); }
.clock-option i { grid-column: 1; font-style: normal; font-size: .8rem; color: var(--muted); }
.clock-option em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-family: var(--f-mono); font-size: .84rem; color: var(--text); }
.clock-options .dash-note { padding: 10px 12px; }
.clock-note { margin: 0; padding: 0 18px 10px; font-size: .8rem; color: var(--muted); }
.clock-label-field { display: flex; flex-direction: column; gap: 6px; padding: 4px 18px 16px; }
.clock-label-field > span { font-size: .86rem; font-weight: 600; color: var(--text); }
.clock-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; }

/* Edit view: handles and ×, dashed outlines, the hidden-boxes tray */
.dash-tools { display: none; align-items: center; gap: 6px; margin-left: 8px; flex: none; }
.dash-card-head .dash-tools:first-child, .dash-block-head .dash-tools { margin-left: auto; }
.dash-meta + .dash-tools, .dash-head-link + .dash-tools { margin-left: 8px; }
.dash-card-head h2 + .dash-tools, .dash-card-head .count + .dash-tools, .dash-info + .dash-tools { margin-left: auto; }
.is-editing .dash-tools { display: inline-flex; }
.dash-tool { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--body); cursor: pointer; }
.dash-move { cursor: grab; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; }  /* phones: press and hold (dashboard.js) */
.dash-move:hover { border-color: var(--primary); color: var(--primary-ink); }
.dash-hide:hover { border-color: var(--danger); color: var(--danger); }
.is-editing [data-box] { outline: 2px dashed color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 3px; border-radius: 14px; }
/* The held box follows the pointer (dashboard.js sets its transform); the page under it stays clickable for the drop */
.is-editing [data-box].is-dragging { position: relative; z-index: 30; pointer-events: none; outline-style: solid; outline-color: var(--primary);
  box-shadow: 0 22px 48px -14px rgba(15, 38, 48, .4); will-change: transform; }
:root[data-theme="dark"] .is-editing [data-box].is-dragging { box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .7); }

.is-dragging-page, .is-dragging-page * { cursor: grabbing !important; user-select: none; }
.is-editing .dash-row, .is-editing .dash-num, .is-editing .dash-request { pointer-events: none; }
.dash-tray-wrap { display: flex; flex-direction: column; gap: 12px; }
.dash-tray { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; border: 1.5px dashed var(--border); border-radius: 12px; background: var(--surface); }
.dash-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer; }
.dash-chip:hover { border-color: var(--primary); color: var(--primary-ink); }

/* Phones: one column, KPI tiles 2 per row, clocks scroll sideways */
@media (max-width: 700px) {
  .dash { gap: 22px; }
  .dash-hello h1 { font-size: 1.5rem; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1 1 auto; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-kpi { padding: 14px; gap: 8px; }
  .dash-kpi-value { font-size: 1.7rem; }
  .dash-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-strip > div { padding: 12px 14px; }
  .dash-w-wide, .dash-w-half, .dash-w-third { flex-basis: 100%; }
  .dash-card-head { padding: 12px 16px; flex-wrap: wrap; }
  .dash-card-body { padding: 14px 16px; }
  .dash-card-foot { padding: 12px 16px; }
  .dash-meta { flex-basis: 100%; order: 5; margin-left: 40px; text-align: left; }
  .dash-num { padding: 10px; }
  .dash-num b { font-size: 1.5rem; }
  .dash-num span { font-size: .72rem; }
  .dash-request { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 16px; }
  .dash-request-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .clocks { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding: 12px 12px 4px 2px; margin: -12px -16px 0 -2px;
    scrollbar-width: none; }
  .clocks::-webkit-scrollbar { display: none; }
  .clock { flex: 0 0 136px; scroll-snap-align: start; }
  .clock-add { flex: 0 0 52px; min-height: 76px; }
  .dash-tool { width: 40px; height: 40px; }
}

/* Narrow cards: the meta drops under the title instead of squeezing it; "Coming up" rows show their whole line */
.dash-card-head { flex-wrap: wrap; row-gap: 4px; }
.dash-card-head h2 { white-space: nowrap; }
.dash-row:not(.dash-row-ticket) .dash-row-sub { white-space: normal; }
.is-editing .dash-block[data-box] { outline-offset: 7px; }
.is-editing .dash-block.is-dragging { background: var(--bg); }
/* Dragging: the dashed slot where the held box will land, and the press-and-hold cue on phones */
.dash-boxes { position: relative; }
.dash-placeholder { position: absolute; z-index: 1; pointer-events: none; border: 2px dashed color-mix(in srgb, var(--primary) 55%, transparent);
  border-radius: 14px; background: color-mix(in srgb, var(--primary) 6%, transparent); }
.dash-placeholder.is-placed { transition: left .2s cubic-bezier(.2, .8, .2, 1), top .2s cubic-bezier(.2, .8, .2, 1), width .2s, height .2s; }
.dash-move.is-holding { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-soft); transform: scale(1.12); transition: transform .3s; }
@media (prefers-reduced-motion: reduce) { .dash-placeholder.is-placed, .dash-move.is-holding { transition: none; } }

/* Licenses → Not in use: the people list in "Give to someone" */
.give-note { margin: 0; }
.give-people { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.give-people li + li { border-top: 1px solid var(--border-soft); }
.give-people label { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 10px 12px; cursor: pointer; }
.give-people label:hover, .give-people label:has(input:checked) { background: var(--primary-soft); }
.give-people li.muted { padding: 10px 12px; }
.give-actions { justify-content: flex-end; }
.unused-notice { margin-bottom: 12px; }
/* Dashboard / Home Licences box: licences of people who left */
.dash-unused { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: var(--tint-red); border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); color: var(--danger); font-size: .86rem; }
.dash-unused:hover { text-decoration: none; border-color: var(--danger); }
.dash-unused b { font-weight: 700; }
.dash-unused span:last-child { font-weight: 600; white-space: nowrap; }
.cell-title .unused-who a { display: inline; font-weight: 500; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Licences page (accounts/licenses.html): tabs, a summary bar, one row per licence that opens
   to list everyone who has it ---------- */
.lic { display: flex; flex-direction: column; gap: 18px; }
.lic-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lic-head h1 { margin: 2px 0 0; }
.lic-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lic-tabs, .pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.lic-tabs a, .pill-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--body); white-space: nowrap; }
.lic-tabs a:hover, .pill-tabs a:hover { border-color: var(--primary); text-decoration: none; color: var(--text); }
.lic-tabs b, .pill-tabs b { font-family: var(--f-mono); font-weight: 500; font-size: .74rem; padding: 0 7px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--muted); }
.lic-tabs a[aria-current="page"], .pill-tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.lic-tabs a[aria-current="page"] b, .pill-tabs a[aria-current="page"] b { background: var(--primary); border-color: var(--primary); color: var(--on-ink); }
.lic-search { flex: 1 1 240px; margin: 0; }
.lic-bar { display: flex; align-items: center; gap: 6px 14px; padding: 14px 18px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); flex-wrap: wrap; }
.lic-bar b { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.lic-bar span { flex: 1 1 260px; }
.lic-bar a { font-weight: 600; }
.lic-bar-red { background: var(--tint-red); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.lic-bar-red b { color: var(--danger); }
.lic-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; }
.lic-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lic-table th { text-align: left; font-family: var(--f-mono); font-size: .7rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.lic-table td { padding: 12px 16px; border-top: 1px solid var(--border-soft); vertical-align: middle; color: var(--text); }
.lic-table thead + tbody > tr:first-child > td, .lic-table thead + tbody > tr:first-child > td { border-top: 0; }
.lic-table small { display: block; color: var(--muted); font-size: .78rem; font-family: var(--f-body); }
.lic-table .mono { font-family: var(--f-mono); white-space: nowrap; }
.lic-table .num { text-align: right; }
.lic-table .act { text-align: right; white-space: nowrap; }
.lic-table .act > * { display: inline-block; vertical-align: middle; margin: 0; }
.lic-table .act > * + * { margin-left: 6px; }
.lic-name { font-weight: 600; }
.unused-who a { font-weight: 500; }
.r-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-family: var(--f-mono); font-size: .74rem; white-space: nowrap; }
.r-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.r-ok { background: var(--s-open-bg); color: var(--s-open-fg); }
.r-red { background: var(--danger-soft); color: var(--danger); }
.r-amber { background: var(--s-pending-bg); color: var(--s-pending-fg); }
.r-grey { background: var(--s-closed-bg); color: var(--s-closed-fg); }
/* The licence name opens its list of people */
.lic-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px; margin: -6px -8px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lic-toggle:hover { background: var(--surface-2); }
.lic-toggle:hover .lic-name { color: var(--primary-ink); }
.lic-chevron { flex: none; color: var(--muted); transition: transform .15s; }
.lic-toggle[aria-expanded="true"] .lic-chevron { transform: rotate(90deg); color: var(--primary-ink); }
.lic-group:has(.lic-toggle[aria-expanded="true"]) > tr:first-child > td { background: var(--surface-2); }
.js .lic-people:not(.is-open) { display: none; }
:root:not(.js) .lic-chevron { display: none; }
.lic-table .lic-people-cell { padding: 0 16px 14px 40px; border-top: 0; background: var(--surface-2); }
.lic-people-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.lic-people-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, auto) minmax(150px, auto); gap: 4px 20px; align-items: center;
  padding: 10px 14px; }
.lic-people-list li + li { border-top: 1px solid var(--border-soft); }
.lic-person { min-width: 0; }
.lic-person a { font-weight: 600; }
.lic-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lic-person-price { text-align: right; }
.lic-person-price small { display: inline; }
.lic-person-price.is-same { color: var(--muted); }
.lic-person-end { text-align: right; }
@media (prefers-reduced-motion: reduce) { .lic-chevron { transition: none; } }
@media (max-width: 700px) {
  .lic-tabs, .pill-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .lic-tabs::-webkit-scrollbar, .pill-tabs::-webkit-scrollbar { display: none; }
  .lic-bar b { font-size: 1.35rem; }
  .lic-table .lic-people-cell { padding: 0 10px 12px; }
  .lic-people-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .lic-person { grid-column: 1 / -1; }
  .lic-person-price { text-align: left; }
}
/* Licences on phones: each licence becomes a small card (name, then who / price / renewal / per year) */
@media (max-width: 700px) {
  .lic-card { overflow: visible; }
  .lic-table, .lic-table tbody, .lic-table tr, .lic-table td { display: block; }
  .lic-table thead { display: none; }
  .lic-table tbody > tr:not(.lic-people) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center;
    padding: 14px 16px; border-top: 1px solid var(--border-soft); }
  .lic-table tbody:first-of-type > tr:first-child { border-top: 0; }
  .lic-table td { padding: 0; border: 0; }
  .lic-table tbody > tr > td:first-child { grid-column: 1 / -1; }
  .lic-table td.act { grid-column: 1 / -1; text-align: left; }
  .lic-table .lic-people-cell { padding: 0 12px 12px; }
  .lic-toggle { margin: -6px -8px; }
}
@media (max-width: 700px) { .lic-group:has(.lic-toggle[aria-expanded="true"]) > tr:first-child { background: var(--surface-2); } .lic-group:has(.lic-toggle[aria-expanded="true"]) > tr:first-child > td { background: transparent; } }
/* Licences page: the regular font everywhere (like before), numbers lined up with tabular figures */
.lic-tabs b, .pill-tabs b, .lic-table th, .lic-table .mono, .lic-table .r-pill, .lic-people-list .r-pill, .lic-person-price { font-family: var(--f-body); }
.lic-table th { font-size: .8rem; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--body); }
.lic-table .mono, .lic-person-price, .lic-bar b { font-variant-numeric: tabular-nums; }

.lic-tabs b, .pill-tabs b { font-size: .76rem; font-weight: 600; }
.lic-bar b { font-family: var(--f-body); font-weight: 700; }
.lic .lic-name { font-weight: 700; }
.lic .dash-eyebrow { font-family: var(--f-body); font-weight: 600; letter-spacing: .04em; }
/* Licences: four numbers in one bordered strip (like the Laptops box numbers), 2 x 2 on phones */
.lic-nums, .num-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; }
.lic-num, .num-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; min-width: 0; color: var(--body); }
.lic-num + .lic-num, .num-tile + .num-tile { border-left: 1px solid var(--border-soft); }
.lic-num b, .num-tile b { font-family: var(--f-display); font-size: 1.85rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lic-num span, .num-tile span { font-size: .84rem; font-weight: 500; }
a.lic-num:hover, a.num-tile:hover { background: var(--surface-2); text-decoration: none; }
.lic-num-red { background: var(--tint-red); }
.lic-num-red b, .lic-num-red span { color: var(--danger); }
a.lic-num-red:hover { background: var(--danger-soft); }
@media (max-width: 700px) {
  .lic-nums, .num-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lic-num, .num-tile { padding: 12px 14px; }
  .lic-num b, .num-tile b { font-size: 1.4rem; }
  .lic-num:nth-child(3), .num-tile:nth-child(3) { border-left: 0; }
  .lic-num:nth-child(n+3), .num-tile:nth-child(n+3) { border-top: 1px solid var(--border-soft); }
}

/* ---------- Shared list-page pieces (first used on Equipment) ----------
   .pill-tabs: round tabs with counts (same as the Licences tabs); inside a .filters bar they sit on
   one line with the search box and dropdowns. .num-tiles / .num-tile: the Licences number strip.
   .cell-none: a faint dash for an empty table cell. .table-zebra: light striping, roomier rows.
   .badge-person: a person's name as a pill (link), with a small icon. */
.filters .pill-tabs { flex: 0 0 auto; }
.filters:has(.pill-tabs) { align-items: center; gap: 10px; }
.cell-none { color: var(--muted); opacity: .45; }
.table-zebra td { padding-top: 15px; padding-bottom: 15px; }
.table-zebra tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.table-zebra tbody tr:hover { background: var(--surface-2); }
.badge.badge-icon::before { content: none; }
.badge-person { max-width: 200px; text-decoration: none; }
.badge-person:hover { text-decoration: none; filter: brightness(.97); }
.badge-person svg { flex: none; }
.badge-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tag-unfilled { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.cell-title.is-unfilled a { font-weight: 500; color: var(--body); }
.cell-title .cell-sub { display: block; }
.num-tiles { margin-bottom: 16px; }
@media (max-width: 700px) {
  .filters .pill-tabs { flex: 1 1 100%; }
}
/* One badge style site-wide: every label/pill (KB who-sees-it pills, Home box pills, licence renewal pills,
   tags like "CC" / "Not filled in yet", HR field types, clock day) uses the ticket badge font (.badge:
   New, Open, Pending, Normal…). Colours and shapes stay per kind. .badge-sm / .badge-lg keep their sizes. */
.pill, .r-pill, .tag, .hr-field-type, .clock-day { font-family: var(--f-body); font-size: .8rem; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
/* Users → Edit: what someone may do, read-only, with a link to change it on the company's People & access */
.access-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.access-summary-title { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.access-summary-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }

.modal-medium.modal-narrow { width: min(560px, calc(100vw - 32px)); }  /* e.g. + Give access to someone */

/* ---------- Platform settings (System health, Reserved subdomains, Email) ---------- */
/* Check rows: icon square, name + one-line detail, status badge */
.health-list { padding-top: 4px; padding-bottom: 4px; }
.health-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; }
.health-row-plain { grid-template-columns: minmax(0, 1fr) auto; }
.health-text b { display: block; color: var(--text); font-weight: 600; }
.health-value { font-family: var(--f-mono); font-size: .86rem; color: var(--body); }
/* A row of fields with their button at the bottom (Reserve a name, Sending) */
.settings-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.settings-row > .field { flex: 1 1 220px; }
.settings-row > .settings-form { flex: 1 1 320px; }
.input-suffix { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.input-suffix:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.input-suffix input { border: 0; border-radius: 0; flex: 1; min-width: 0; }
.input-suffix input:focus { box-shadow: none; }
.input-suffix span { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border-left: 1px solid var(--border);
  font-family: var(--f-mono); font-size: .86rem; color: var(--muted); white-space: nowrap; }
.has-error .input-suffix { border-color: var(--danger); }
/* Reserved names as chips; yours have a remove button, the built-in ones are locked */
.reserved-chips { margin-bottom: 0; }
.reserved-chips .chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-mono); color: var(--text); }
.reserved-chips .chip:hover { border-color: var(--border); }
.reserved-chips .chip:has(form) { padding-right: 4px; }
.reserved-chips .chip.is-locked { background: var(--surface-2); color: var(--body); }
.reserved-chips form { margin: 0; display: inline-flex; }
.chip-remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.chip-remove svg { width: 14px; height: 14px; }
.chip-remove:hover { background: var(--danger-soft); color: var(--danger); }
.reserved-group h3 { margin: 4px 0 8px; }
