/* =====================================================================
   Vision Infra · IT Service Desk
   Palette: deep navy, corporate blue, light blue, white.
   One accent colour; status colours used only for meaning.
   ===================================================================== */
:root {
  --navy-950: #071a33;
  --navy-900: #0b2545;
  --navy-800: #13315c;
  --navy-700: #1b3f73;
  --blue-600: #1d5fc4;
  --blue-500: #2f74d6;
  --blue-300: #8ec5ff;
  --blue-100: #e4eefb;
  --blue-50:  #f3f7fc;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-hover: #f1f6fd;
  --border: #dfe7f1;
  --border-strong: #c9d6e6;
  --text: #13233a;
  --text-2: #4a5c74;
  --muted: #74859b;
  --primary: var(--blue-600);
  --primary-hover: #174fa6;
  --primary-soft: var(--blue-100);
  --primary-text: #1550ad;
  --focus: rgba(29, 95, 196, .35);
  --primary-border: #cddff6;
  --heading: var(--navy-900);

  --ok: #157a52;      --ok-soft: #e3f4ec;
  --warn: #a15c07;    --warn-soft: #fdf1dc;
  --danger: #b42318;  --danger-soft: #fdeceb;
  --info: #1d5fc4;    --info-soft: #e4eefb;
  --neutral: #55657a; --neutral-soft: #edf1f6;
  --internal: #7a5b00; --internal-soft: #fff7d9; --internal-border: #f0dc94;

  --sidebar-bg: var(--navy-900);
  --sidebar-text: #c3d3ea;
  --sidebar-muted: #7f97b8;
  --sidebar-active: rgba(142, 197, 255, .14);

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06);
  --shadow: 0 1px 3px rgba(11, 37, 69, .06), 0 6px 20px -8px rgba(11, 37, 69, .14);
  --shadow-lg: 0 24px 60px -20px rgba(7, 26, 51, .45);
  --font: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --chart-1: #1d5fc4; --chart-2: #8ec5ff; --chart-3: #13315c; --chart-grid: #e6edf6;
}


*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { color-scheme: light; }
html[data-mode="dark"] { color-scheme: dark; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px; text-align: center; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: #fff; overflow: hidden;
  display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); flex: none;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { color: #fff; font-weight: 600; font-size: 14.5px; line-height: 1.15; }
.brand-sub { color: var(--sidebar-muted); font-size: 11.5px; letter-spacing: .02em; }
.nav-section { margin: 14px 8px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--sidebar-muted); }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text);
  font-size: 13.5px; text-decoration: none; margin-bottom: 1px; transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 2px 0 0 var(--blue-300); }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; font-size: 11px; background: rgba(142,197,255,.18); color: #dbeaff;
  padding: 1px 7px; border-radius: 10px; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 2px; font-size: 11.5px; color: var(--sidebar-muted);
  border-top: 1px solid rgba(255,255,255,.07); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { padding-left: 36px; background: var(--surface-2); border-color: transparent; height: 38px; }
.search input:focus { background: var(--surface); border-color: var(--border-strong); }
.search > svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 30; max-height: 420px; overflow: auto;
}
.search-results .group-label { font-size: 11px; color: var(--muted); padding: 8px 10px 4px; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600; }
.search-results a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--surface-hover); text-decoration: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.dot-count { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center;
  border: 2px solid var(--surface); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; background: none; color: inherit; font: inherit; }
.user-chip:hover { background: var(--surface-hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text);
  display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who b { font-weight: 600; font-size: 13px; display: block; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }
.menu { position: absolute; right: 24px; top: 58px; width: 240px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.menu button, .menu a { width: 100%; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 0;
  background: none; color: var(--text); border-radius: 7px; cursor: pointer; font: inherit; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface-hover); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .meta { padding: 8px 10px 10px; font-size: 12px; color: var(--muted); }

.content { padding: 28px 32px 56px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.card-body { padding: 16px 20px 20px; }
.card-body.flush { padding: 8px 0 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* KPI strip: one card, divided cells — calmer than a wall of tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.kpi { padding: 16px 20px 15px; border-right: 1px solid var(--border); position: relative; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi a.kpi-link { position: absolute; inset: 0; }
.kpi:has(a.kpi-link:hover) { background: var(--surface-hover); }
.kpi .label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi.alert .value { color: var(--danger); }
.kpi.warn .value { color: var(--warn); }
.kpi .foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.section-label .pill { text-transform: none; letter-spacing: 0; }

/* ---------------------------------------------------------------- forms */
label.field { display: block; }
.field > span.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time],
input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; height: 38px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374859b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.fieldset-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.form-section + .form-section { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 22px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 13px;
  color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 11px; cursor: pointer; background: var(--surface);
  font-size: 12.5px; line-height: 1.35; transition: border-color .12s, background .12s; }
.choice b { display: block; font-size: 13px; margin-bottom: 2px; }
.choice span { color: var(--muted); }
.choice:hover { border-color: var(--primary); }
.choice.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; white-space: nowrap; line-height: 1.6; background: var(--neutral-soft); color: var(--neutral); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.prio i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.prio.P1 i { background: #d92d20; } .prio.P2 i { background: #ef8a17; } .prio.P3 i { background: #2f74d6; } .prio.P4 i { background: #98a6b8; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-2); }
.pill.demo { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
.tag-internal { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--internal); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-hover); }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; }
.t-id { font-family: var(--mono); font-size: 12.5px; color: var(--primary-text); font-weight: 600; white-space: nowrap; }
.t-subject { font-weight: 500; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.t-sub2 { font-size: 12px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar select, .toolbar input { height: 34px; width: auto; min-width: 140px; font-size: 13px; }
.toolbar .search-inline { position: relative; min-width: 240px; flex: 1; max-width: 340px; }
.toolbar .search-inline input { width: 100%; padding-left: 32px; }
.toolbar .search-inline svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 13px 12px 11px; font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--primary-text); border-bottom-color: var(--primary); font-weight: 600; }
.tabs .n { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); padding: 0 6px; border-radius: 8px; margin-left: 5px; color: var(--muted); }

/* ---------------------------------------------------------------- ticket detail */
.ticket-title { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ticket-title h1 { font-size: 21px; }
.meta-line { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.prose { white-space: pre-wrap; word-wrap: break-word; color: var(--text); }
.kv { display: grid; grid-template-columns: 116px 1fr; gap: 9px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.erp-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-top: 16px; }
.erp-box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }

/* conversation: chat bubbles */
.chat { padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, var(--surface-2), var(--surface) 140px); }
.chat-empty { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text-2); font-size: 13px; }
.chat-empty svg { width: 18px; height: 18px; color: var(--primary); flex: none; }
.chat-empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 1px; }
.chat-day { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.chat-day span { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }

.chat-activity { list-style: none; margin: 0 auto; padding: 0; width: min(560px, 100%); display: flex; flex-direction: column; gap: 2px; }
.chat-activity li { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.chat-activity li:hover { background: var(--surface-hover); }
.chat-activity .act-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-50); border: 1px solid var(--border); color: var(--primary); flex: none; }
.chat-activity .act-ic svg { width: 12px; height: 12px; }
.chat-activity .act-txt { flex: 1; min-width: 0; line-height: 1.5; }
.chat-activity .act-txt b { color: var(--text); font-weight: 600; }
.chat-activity .act-txt .badge { font-size: 11.5px; padding: 0 8px; vertical-align: 1px; }
.chat-activity .act-why { color: var(--muted); font-style: italic; }
.chat-activity time { color: var(--muted); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chat-activity li.act-more { display: block; padding: 0; }
.chat-activity li.act-more:hover { background: none; }
.chat-activity summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin: 0 0 2px 0;
  font-size: 12px; color: var(--primary-text); border-radius: 999px; font-weight: 500; }
.chat-activity summary::-webkit-details-marker { display: none; }
.chat-activity summary:hover { background: var(--primary-soft); }
.chat-activity summary svg { width: 13px; height: 13px; }
.chat-activity details[open] summary { color: var(--muted); }
.chat-activity.inner { width: 100%; margin-bottom: 2px; }

.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; }
.msg.right { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { flex: none; margin-bottom: 18px; }
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msg.right .msg-col { align-items: flex-end; }
.msg-meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; margin: 0 4px 4px; flex-wrap: wrap; }
.msg-meta b { font-weight: 600; color: var(--text); }
.who-role { font-size: 11px; color: var(--muted); background: var(--neutral-soft); padding: 1px 7px; border-radius: 999px; }
.bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); max-width: 100%; }
.msg.left .bubble { border-bottom-left-radius: 5px; }
.msg.right .bubble { border-bottom-right-radius: 5px; }
/* Who wrote it, at a glance: employee = baby orange, IT = baby green (internal notes keep their dashed style) */
.msg.req .bubble { background: #FFEBD9; border-color: #F9CDA5; color: #3B2A1C; }
.msg.it .bubble { background: #E2F5E7; border-color: #B3E0C0; color: #183424; }
html[data-mode="dark"] .msg.req .bubble { background: rgba(251, 146, 60, .16); border-color: rgba(251, 146, 60, .38); color: var(--text); }
html[data-mode="dark"] .msg.it .bubble { background: rgba(74, 222, 128, .13); border-color: rgba(74, 222, 128, .34); color: var(--text); }
.msg.internal .bubble { background: var(--internal-soft); border: 1px dashed var(--internal-border); }
.msg time { font-size: 11px; color: var(--muted); margin: 4px 6px 0; }

/* history: vertical timeline */
.hist { list-style: none; margin: 0; padding: 16px 22px 20px; }
.hist-day { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.hist-day:not(:first-child) { margin-top: 18px; }
.hist-item { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding-bottom: 16px; }
.hist-item::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.hist-item:last-child::before, .hist-item:has(+ .hist-day)::before { display: none; }
.hist-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--primary); z-index: 1; }
.hist-dot svg { width: 14px; height: 14px; }
.hist-item.internal .hist-dot { color: var(--internal); border-color: var(--internal-border); background: var(--internal-soft); }
.hist-body { padding-top: 4px; min-width: 0; }
.hist-title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.hist-change { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 13px; }
.hist-old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.hist-arrow { color: var(--muted); }
.hist-reason { margin-top: 6px; padding: 6px 10px; background: var(--surface-2); border-left: 3px solid var(--border-strong); border-radius: 0 6px 6px 0; font-size: 13px; color: var(--text-2); font-style: italic; }
.hist-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* reply box */
.composer { border-top: 1px solid var(--border); padding: 16px 22px 20px; }
.composer.closed-note { display: flex; gap: 8px; align-items: center; background: var(--surface-2); }
.composer.closed-note svg { width: 15px; height: 15px; }
.compose-modes { display: flex; gap: 6px; margin-bottom: 10px; }
.compose-modes button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; line-height: 1.2; }
.compose-modes button svg { width: 14px; height: 14px; }
.compose-modes button:hover { border-color: var(--border-strong); color: var(--text); }
.compose-modes button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.compose-modes button[data-v="internal"].on { background: var(--internal); border-color: var(--internal); }
.compose-box { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.compose-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.compose-box textarea { border: 0 !important; box-shadow: none !important; outline: none; resize: vertical; min-height: 84px; padding: 12px 14px; background: transparent; width: 100%; font-size: 14px; }
.composer.internal-mode .compose-box { background: var(--internal-soft); border-color: var(--internal-border); }
.composer.internal-mode .compose-box:focus-within { box-shadow: 0 0 0 3px rgba(240, 220, 148, .55); }
.composer-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px 14px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.composer.internal-mode .composer-foot { border-top-color: var(--internal-border); }
.composer-foot .small svg { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 720px) { .composer-foot .hide-sm { display: none; } .msg { max-width: 94%; } .chat, .hist, .composer { padding-left: 14px; padding-right: 14px; } }

.sla-bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 10px 0 8px; }
.sla-bar > div { height: 100%; background: var(--ok); border-radius: 6px; transition: width .3s; }
.sla-bar.at_risk > div { background: var(--warn); }
.sla-bar.breached > div { background: var(--danger); }
.sla-bar.paused > div { background: var(--neutral); }
.sla-state { display: flex; justify-content: space-between; align-items: baseline; }
.sla-state .big { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.attach { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 13px; }
.attach + .attach { border-top: 1px dashed var(--border); }
.attach .ic { width: 30px; height: 30px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex: none; }
.attach .ic svg { width: 15px; height: 15px; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--border-strong); }
.stars button.on, .stars button:hover { color: #f2a516; }
.stars svg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- side lists, notices */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 20px; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.list a.item { display: block; color: var(--text); }
.list a.item:hover { text-decoration: none; color: var(--primary-text); }
.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: 8px; background: var(--info-soft); color: var(--text); font-size: 13px; }
.notice svg { width: 18px; height: 18px; color: var(--info); flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-soft); } .notice.warn svg { color: var(--warn); }
.notice.danger { background: var(--danger-soft); } .notice.danger svg { color: var(--danger); }
.notice b { display: block; margin-bottom: 2px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--border-strong); margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-hover) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 6px; height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .btn .spin { animation: none; } }

/* ---------------------------------------------------------------- welcome / hero (employee dashboard) */
.hero { background: var(--navy-900); color: #dbe7f7; border-radius: 12px; padding: 26px 28px; display: grid;
  grid-template-columns: 1fr auto; gap: 20px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(142,197,255,.18), transparent 70%); pointer-events: none; }
.hero h1 { color: #fff; font-size: 22px; }
.hero p { color: #a9bfdc; margin-top: 4px; }
.hero .search { max-width: 520px; margin-top: 16px; }
.hero .search input { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.12); height: 42px; }
.hero .search input::placeholder { color: #a9bfdc; }
.hero .search input:focus { background: rgba(255,255,255,.12); border-color: var(--blue-300); }
.hero .btn.primary { background: #fff; color: var(--navy-900); border-color: #fff; height: 42px; }
.hero .btn.primary:hover { background: var(--blue-100); }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--chart-grid); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 3px; display: inline-block; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 36px; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 0; }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--chart-1); border-radius: 4px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-tip { position: fixed; pointer-events: none; background: var(--navy-950); color: #fff; font-size: 12px; padding: 6px 9px;
  border-radius: 6px; z-index: 80; box-shadow: var(--shadow); white-space: nowrap; }

/* ---------------------------------------------------------------- KB */
.kb-article h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
.kb-card { display: block; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: border-color .12s, box-shadow .12s; }
.kb-card:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow); }
.kb-card h3 { margin-bottom: 4px; }
.suggest { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.suggest a { display: block; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text); font-size: 13px; }
.suggest a:first-of-type { border-top: 0; }
.suggest a:hover { background: var(--surface-hover); text-decoration: none; }

/* ---------------------------------------------------------------- modal, toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7, 26, 51, .45); display: grid; place-items: center; z-index: 60;
  padding: 20px; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide { max-width: 620px; }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-body { padding: 16px 22px; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { min-width: 280px; max-width: 420px; background: var(--navy-950); color: #fff; padding: 12px 14px; border-radius: 9px;
  box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: start; font-size: 13px; animation: rise .18s ease-out; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #6fdcaa; } .toast.err svg { color: #ff9d94; } .toast.info svg { color: var(--blue-300); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, 1fr); }
.login-art { background: var(--navy-900); color: #c7d7ee; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(142,197,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(142,197,255,.06) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%); }
.login-art > * { position: relative; }
.login-art h1 { color: #fff; font-size: 34px; line-height: 1.2; margin: auto 0 16px; max-width: 460px; letter-spacing: -.02em; }
.login-art p.lead { color: #9fb6d6; font-size: 15px; max-width: 440px; }
.login-points { display: grid; gap: 14px; margin-top: 34px; max-width: 440px; }
.login-points div { display: flex; gap: 12px; font-size: 13.5px; }
.login-points svg { width: 18px; height: 18px; color: var(--blue-300); flex: none; margin-top: 2px; }
.login-art .foot { margin-top: auto; padding-top: 40px; font-size: 12px; color: #6f89ad; }
.login-form { display: grid; place-items: center; padding: 40px; background: var(--surface); overflow-y: auto; }
.login-form form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 22px; margin-bottom: 6px; }
.demo-box { margin-top: 26px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; font-size: 12.5px; }
.demo-box .accts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.demo-box button { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 6px 8px; font: inherit;
  font-size: 12px; cursor: pointer; text-align: left; color: var(--text); }
.demo-box button:hover { border-color: var(--primary); }
.demo-box button span { display: block; color: var(--muted); font-size: 11px; }

.confirm-hero { text-align: center; padding: 42px 24px 30px; }
.confirm-hero .ok-ring { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid;
  place-items: center; margin: 0 auto 16px; }
.confirm-hero .ok-ring svg { width: 28px; height: 28px; }
.confirm-hero .num { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--primary-text); margin: 8px 0 4px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .grid-main-side { grid-template-columns: minmax(0, 1fr) 300px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid; }
  .grid-main-side, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  #row1 { grid-template-columns: minmax(0, 1fr) !important; }
  .content { padding: 20px 16px 48px; }
  .topbar { padding: 0 12px; }
  .user-chip .who { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .kpi { border-bottom: 1px solid var(--border); }
  .hero { grid-template-columns: 1fr; }
  .toolbar .search-inline { max-width: none; }
  table.data .hide-sm { display: none; }
}
@media print {
  .sidebar, .topbar, .composer, .btn { display: none !important; }
  .shell { display: block; }
}

.queue-line { display: flex; gap: 18px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; }
.queue-line a { color: var(--text-2); }
.queue-line b { color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .queue-line { display: none; } }

/* Default icon size (zero specificity so component rules override) */
:where(svg[aria-hidden="true"]) { width: 18px; height: 18px; flex: none; }
.toolbar > svg { width: 16px; height: 16px; color: var(--muted); }
/* search inputs: keep room for the leading icon over the generic input rule */
.search input[type=search], .toolbar .search-inline input[type=search] { padding-left: 36px; }
.toolbar .search-inline input[type=search] { padding-left: 32px; }
table.data td.hide-sm { white-space: nowrap; }
@media (max-width: 640px) { .t-subject { max-width: 150px; } }

/* ---------------------------------------------------------------- company title (topbar + login) */
.company-title { font-size: 19px; font-weight: 700; color: var(--heading); letter-spacing: -.01em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.topbar .search { margin-left: auto; max-width: 360px; }
.topbar-right { margin-left: 8px; }
@media (max-width: 1180px) { .company-title { font-size: 16px; } .topbar .search { max-width: 260px; } }
@media (max-width: 760px) { .topbar .search { display: none; } .company-title { flex: 1; font-size: 15px; } }

.login-company { margin-bottom: 30px; }
.login-company .logo { width: 52px; height: 52px; border-radius: 12px; background: var(--navy-900); display: grid;
  place-items: center; margin-bottom: 18px; }
.login-company h1 { font-size: 30px; line-height: 1.2; color: var(--navy-900); letter-spacing: -.02em; }
.login-company .tag { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--primary-text);
  background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }
.login-art .company-big { color: #fff; font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em;
  margin: auto 0 14px; max-width: 520px; }

/* ---------------------------------------------------------------- row ⋮ menu */
td.row-menu { width: 44px; text-align: right; padding-right: 10px !important; }
.kebab { width: 32px; height: 32px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; }
.kebab:hover, .kebab[aria-expanded=true] { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.kebab svg { width: 18px; height: 18px; }
.pop-menu { position: fixed; z-index: 70; width: 280px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; max-height: 360px; overflow: auto; }
.pop-menu .pm-head { padding: 8px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); }
.pop-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none;
  border-radius: 7px; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.pop-menu button:hover, .pop-menu button:focus-visible { background: var(--surface-hover); outline: none; }
.pop-menu button .grow { flex: 1; min-width: 0; }
.pop-menu button .grow b { display: block; font-weight: 600; font-size: 13px; }
.pop-menu button .grow span { font-size: 11.5px; color: var(--muted); }
.pop-menu button .tick { width: 16px; color: var(--primary); }
.pop-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.pop-menu .load { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* notifications: assignee chip */
.assignee-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-2);
  background: var(--blue-50); border: 1px solid var(--border); padding: 2px 9px 2px 3px; border-radius: 999px; }
.assignee-chip .avatar { width: 20px; height: 20px; font-size: 9.5px; }
.assignee-chip.none { padding-left: 9px; color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.assignee-chip svg { width: 13px; height: 13px; }

/* admin ticket list: fit 9 columns without horizontal scrolling */
table.compact-admin .t-subject { max-width: 250px; }
table.compact-admin th, table.compact-admin td { padding-left: 11px; padding-right: 11px; }
table.compact-admin .t-sub2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
@media (max-width: 1700px) { table.data .hide-md { display: none; } }
/* the big company title already sits on the left panel on wide screens */
@media (min-width: 981px) { .login-company h1, .login-company .tag { display: none; } .login-company { margin-bottom: 18px; } .login-company .logo-full img { height: 140px; } }

/* employee ID tag next to names */
.name-id { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.emp-id { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .02em;
  color: var(--primary-text); background: var(--primary-soft); border: 1px solid var(--border); padding: 0 6px; border-radius: 5px; white-space: nowrap; }
.msg-meta .emp-id { margin-left: -2px; }

/* ---------------------------------------------------------------- how-to guide */
.kbd { display: inline-block; font-family: var(--mono); font-size: 11.5px; padding: 0 6px; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--text); line-height: 1.6; }
.guide-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 20px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--primary-soft), var(--surface) 75%); border: 1px solid var(--border); color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); }
.guide-banner:hover { border-color: var(--primary); text-decoration: none; }
.guide-banner .grow { flex: 1; min-width: 0; }
.guide-banner b { display: block; font-size: 15px; }
.guide-banner .grow > span { color: var(--text-2); font-size: 13px; }
.g-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.g-ic svg { width: 19px; height: 19px; }
.g-hero { display: flex; align-items: center; gap: 18px; padding: 24px 26px; border-radius: 14px; margin-bottom: 22px; color: #fff;
  background: linear-gradient(120deg, var(--hero-1, var(--navy-900)), var(--hero-2, var(--blue-600))); box-shadow: var(--shadow); flex-wrap: wrap; }
.g-hero > div { flex: 1; min-width: 240px; }
.g-hero h1 { color: #fff; font-size: 22px; }
.g-hero p { margin: 6px 0 0; color: rgba(255,255,255,.82); }
.g-hero .btn.primary { background: #fff; color: var(--primary-text); border-color: #fff; }
.g-hero-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.g-hero-ic svg { width: 26px; height: 26px; }
.g-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; }
.g-toc { position: sticky; top: 88px; padding: 10px; display: flex; flex-direction: column; gap: 1px; }
.g-toc-title { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 8px; }
.g-toc a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.g-toc a:hover { background: var(--surface-hover); color: var(--text); }
.g-toc .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.g-sec { scroll-margin-top: 90px; }
.g-sec-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px 0; }
.g-sec-head .g-ic { width: 34px; height: 34px; background: var(--primary-soft); color: var(--primary); }
.g-sec-head h2 { font-size: 16.5px; }
.g-sec-body { padding: 12px 22px 20px 68px; color: var(--text-2); line-height: 1.65; }
.g-sec-body p { margin: 0 0 10px; }
.g-sec-body b { color: var(--text); }
.g-steps { margin: 0 0 10px; padding: 0; list-style: none; counter-reset: g; }
.g-steps li { counter-increment: g; position: relative; padding: 4px 0 8px 36px; }
.g-steps li::before { content: counter(g); position: absolute; left: 0; top: 3px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--primary); color: #fff; }
.g-steps li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.g-tip { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 4px; }
.g-tip svg { width: 15px; height: 15px; color: var(--primary); flex: none; margin-top: 3px; }
.g-status { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 8px 0 0; align-items: center; }
.g-status dd { margin: 0; }
.g-list { margin: 0; padding-left: 20px; }
.g-list li { margin-bottom: 4px; }
@media (max-width: 900px) { .g-layout { grid-template-columns: 1fr; } .g-toc { display: none; } .g-sec-body { padding-left: 22px; } .g-status { grid-template-columns: 1fr; gap: 4px; } .g-status dd { margin-bottom: 8px; } }

/* =====================================================================
   Colour themes (html[data-accent]) and dark mode (html[data-mode=dark])
   Chosen with the palette button in the top bar; applied by js/theme-init.js before paint.
   ===================================================================== */
html[data-accent="teal"] {
  --navy-950: #052427; --navy-900: #08363a; --navy-800: #0d4a4f; --navy-700: #125e63;
  --blue-600: #0f8a85; --blue-500: #18a29c; --blue-300: #7fdcd5; --blue-100: #def4f2; --blue-50: #f1faf9;
  --primary-hover: #0b706c; --primary-text: #0b6f6b; --focus: rgba(15, 138, 133, .32); --primary-border: #bfe6e2;
  --info: #0f8a85; --info-soft: #def4f2; --sidebar-text: #bfe0de; --sidebar-muted: #79a9a6; --sidebar-active: rgba(127, 220, 213, .14);
  --bg: #f3f8f8; --surface-hover: #eef7f6; --chart-1: #0f8a85; --chart-2: #7fdcd5; --chart-3: #0d4a4f;
}
html[data-accent="indigo"] {
  --navy-950: #120f33; --navy-900: #1e1a4d; --navy-800: #2b2566; --navy-700: #39317f;
  --blue-600: #5a48d6; --blue-500: #6e5ee6; --blue-300: #bdb3ff; --blue-100: #ebe8fd; --blue-50: #f6f5ff;
  --primary-hover: #4836bd; --primary-text: #4a38c2; --focus: rgba(90, 72, 214, .32); --primary-border: #d6d0fa;
  --info: #5a48d6; --info-soft: #ebe8fd; --sidebar-text: #d0cbf2; --sidebar-muted: #8f88c4; --sidebar-active: rgba(189, 179, 255, .15);
  --bg: #f6f6fc; --surface-hover: #f2f0fd; --chart-1: #5a48d6; --chart-2: #bdb3ff; --chart-3: #2b2566;
}
html[data-accent="emerald"] {
  --navy-950: #072014; --navy-900: #0d3321; --navy-800: #13472e; --navy-700: #1a5c3c;
  --blue-600: #178a4c; --blue-500: #1fa35c; --blue-300: #8fdcae; --blue-100: #e1f4e8; --blue-50: #f2faf5;
  --primary-hover: #12703d; --primary-text: #126f3d; --focus: rgba(23, 138, 76, .32); --primary-border: #c3e8d1;
  --info: #178a4c; --info-soft: #e1f4e8; --sidebar-text: #c3e2cf; --sidebar-muted: #7fa98f; --sidebar-active: rgba(143, 220, 174, .14);
  --bg: #f4f8f5; --surface-hover: #eef7f1; --chart-1: #178a4c; --chart-2: #8fdcae; --chart-3: #13472e;
}
html[data-accent="crimson"] {
  --navy-950: #26070e; --navy-900: #3b0d18; --navy-800: #521524; --navy-700: #6a1d30;
  --blue-600: #c02a46; --blue-500: #d63f5b; --blue-300: #f5a3b3; --blue-100: #fbe6ea; --blue-50: #fdf4f6;
  --primary-hover: #a1213a; --primary-text: #a5233c; --focus: rgba(192, 42, 70, .30); --primary-border: #f3ccd4;
  --info: #c02a46; --info-soft: #fbe6ea; --sidebar-text: #ecc7cf; --sidebar-muted: #b4818c; --sidebar-active: rgba(245, 163, 179, .14);
  --bg: #faf5f6; --surface-hover: #fcf0f2; --chart-1: #c02a46; --chart-2: #f5a3b3; --chart-3: #521524;
}
html[data-accent="amber"] {
  --navy-950: #241205; --navy-900: #3a1e08; --navy-800: #51290c; --navy-700: #6a3611;
  --blue-600: #c4610f; --blue-500: #dc7419; --blue-300: #f8c18c; --blue-100: #fcecdc; --blue-50: #fef7f0;
  --primary-hover: #a5510b; --primary-text: #9e4f0b; --focus: rgba(196, 97, 15, .30); --primary-border: #f5d6b8;
  --info: #c4610f; --info-soft: #fcecdc; --sidebar-text: #ecd2bb; --sidebar-muted: #b3906f; --sidebar-active: rgba(248, 193, 140, .14);
  --bg: #faf7f3; --surface-hover: #fcf3ea; --chart-1: #c4610f; --chart-2: #f8c18c; --chart-3: #51290c;
}
html[data-accent="slate"] {
  --navy-950: #0d121a; --navy-900: #161d29; --navy-800: #222b3a; --navy-700: #2f3a4c;
  --blue-600: #4b5b72; --blue-500: #5f7089; --blue-300: #b7c3d4; --blue-100: #e8ecf2; --blue-50: #f5f7fa;
  --primary-hover: #3b4859; --primary-text: #3d4b5f; --focus: rgba(75, 91, 114, .32); --primary-border: #d3dae4;
  --info: #4b5b72; --info-soft: #e8ecf2; --sidebar-text: #c9d1dc; --sidebar-muted: #8591a3; --sidebar-active: rgba(183, 195, 212, .14);
  --bg: #f5f6f8; --surface-hover: #f0f2f5; --chart-1: #4b5b72; --chart-2: #b7c3d4; --chart-3: #222b3a;
}

/* dark mode works with every colour theme: surfaces go dark, the accent brightens */
html[data-mode="dark"] {
  --bg: #0b111c; --surface: #121a28; --surface-2: #172133; --surface-hover: #1b273b;
  --border: #243249; --border-strong: #31435f;
  --text: #e5ecf6; --text-2: #b0bdd0; --muted: #8393ab; --heading: #f1f5fb;
  --primary: var(--blue-500); --primary-hover: var(--blue-600);
  --primary-soft: color-mix(in srgb, var(--blue-500) 20%, transparent);
  --primary-border: color-mix(in srgb, var(--blue-500) 38%, transparent);
  --primary-text: var(--blue-300);
  --focus: color-mix(in srgb, var(--blue-500) 45%, transparent);
  --info: var(--blue-300); --info-soft: color-mix(in srgb, var(--blue-500) 20%, transparent);
  --ok: #5fd39c;     --ok-soft: rgba(52, 168, 112, .16);
  --warn: #f2b25c;   --warn-soft: rgba(224, 146, 40, .16);
  --danger: #ff8a80; --danger-soft: rgba(229, 72, 60, .16);
  --neutral: #a3b1c5; --neutral-soft: rgba(148, 163, 184, .14);
  --internal: #f0cd6a; --internal-soft: rgba(240, 205, 106, .10); --internal-border: rgba(240, 205, 106, .38);
  --sidebar-bg: #080d16;
  --blue-50: #172133;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --chart-grid: #243249;
}
html[data-mode="dark"] .sidebar { border-right: 1px solid var(--border); }
html[data-mode="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238393ab' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
html[data-mode="dark"] .btn.primary, html[data-mode="dark"] .compose-modes button.on, html[data-mode="dark"] .g-steps li::before { color: #fff; }
html[data-mode="dark"] .hero, html[data-mode="dark"] .login-art { background: var(--navy-950); }
html[data-mode="dark"] .modal-backdrop { background: rgba(0, 0, 0, .6); }
html[data-mode="dark"] .toast { background: #223049; }
html[data-mode="dark"] .g-hero .btn.primary { background: #fff; color: #111; }
html[data-mode="dark"] img { opacity: .94; }

/* theme picker */
.theme-btn svg { width: 19px; height: 19px; }
.theme-menu { width: 300px; padding: 12px; }
.theme-title { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 2px 2px 8px; }
.theme-title:not(:first-child) { margin-top: 14px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.menu .swatch { flex-direction: column; gap: 5px; padding: 8px 4px 6px; border-radius: 9px; align-items: center; border: 1px solid transparent; }
.menu .swatch.on { border-color: var(--primary); background: var(--primary-soft); }
.swatch .sw { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c1) 0 50%, var(--c2) 50% 100%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 1px 3px rgba(0,0,0,.2); }
.swatch .sw svg { width: 15px; height: 15px; }
.swatch .nm { font-size: 11.5px; color: var(--text-2); }
.mode-seg { display: flex; width: 100%; }
.menu .mode-seg button { flex: 1; justify-content: center; padding: 7px 8px; gap: 6px; font-size: 13px; width: auto; }
.mode-seg button svg { width: 14px; height: 14px; }
html[data-mode="dark"] .seg button.on { background: var(--surface-hover); }

/* users & roles: delete */
.btn.icon-only { padding: 0 8px; }
.btn.icon-only svg { width: 15px; height: 15px; }
.btn.del-user { color: var(--muted); }
.btn.del-user:hover { color: var(--danger); background: var(--danger-soft); }
.del-sum { border: 1px solid var(--border); border-left: 3px solid var(--danger); border-radius: 8px; padding: 12px 14px; background: var(--surface-2); font-size: 13.5px; }
.del-sum ul { margin: 6px 0 0; padding-left: 18px; }
.del-sum li { margin: 2px 0; }

/* ---------------------------------------------------------------- simple admin dashboard */
.dash-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dash-tile { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; position: relative; overflow: hidden; transition: border-color .15s, transform .15s; }
.dash-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.dash-tile.warn::before { background: var(--warn); } .dash-tile.danger::before { background: var(--danger); } .dash-tile.ok::before { background: var(--ok); }
.dash-tile:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.dt-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.dash-tile.warn .dt-ic { background: var(--warn-soft); color: var(--warn); }
.dash-tile.danger .dt-ic { background: var(--danger-soft); color: var(--danger); }
.dash-tile.ok .dt-ic { background: var(--ok-soft); color: var(--ok); }
.dt-ic svg { width: 21px; height: 21px; }
.dt-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dt-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.dt-value { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dash-tile.danger .dt-value { color: var(--danger); } .dash-tile.warn .dt-value { color: var(--warn); }
.dt-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.dt-go { color: var(--muted); transform: rotate(180deg); opacity: 0; transition: opacity .15s; }
.dt-go svg { width: 16px; height: 16px; }
.dash-tile:hover .dt-go { opacity: 1; }
.strip { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; padding: 0 4px; font-size: 13px; }
.strip a { color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.strip a:hover { color: var(--primary-text); }
.strip a b { color: var(--text); }
.strip svg { width: 14px; height: 14px; color: var(--muted); }
.card-head h2 svg { width: 17px; height: 17px; vertical-align: -3px; color: var(--warn); margin-right: 4px; }

.att-list, .team-list { list-style: none; margin: 0; padding: 0; }
.att-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.att-item:first-child { border-top: 0; }
.att-item:hover { background: var(--surface-hover); }
.prio-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #98a6b8; }
.prio-dot.P1 { background: #d92d20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .15); } .prio-dot.P2 { background: #ef8a17; } .prio-dot.P3 { background: #2f74d6; }
.att-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
.att-main:hover { text-decoration: none; }
.att-main:hover .att-subj { color: var(--primary-text); }
.att-top { display: flex; gap: 8px; align-items: center; }
.att-top .badge { font-size: 11px; padding: 0 8px; }
.att-subj { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-empty { display: flex; gap: 14px; align-items: center; padding: 28px 22px; color: var(--text-2); }
.att-empty svg { width: 30px; height: 30px; color: var(--ok); flex: none; }
.att-empty b { display: block; color: var(--text); font-size: 15px; }

.team-list li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--border); }
.team-list li:first-child { border-top: 0; }
.team-list li.me { background: var(--primary-soft); }
.team-list .rank { width: 22px; text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; flex: none; }
.tm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; color: var(--text); text-decoration: none; }
.tm-main:hover { text-decoration: none; }
.tm-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.tm-bar { height: 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.tm-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.tm-stats { display: flex; flex-direction: column; align-items: flex-end; font-size: 11.5px; color: var(--muted); line-height: 1.35; min-width: 56px; }
.tm-stats b { font-size: 16px; color: var(--text); }
.tm-star { color: #c88a04; font-weight: 600; }
.week-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.wk-v { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.wk-v small { font-size: 14px; color: #c88a04; }
.wk-l { font-size: 12px; color: var(--muted); }
.mini-trend { margin-top: 14px; }
.mini-trend svg { max-height: 120px; }
.reports { margin-top: 20px; }
.reports > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.reports > summary::-webkit-details-marker { display: none; }
.reports > summary > svg { width: 18px; height: 18px; color: var(--primary); }
.reports > summary .chev { transform: rotate(-90deg); transition: transform .15s; color: var(--muted); }
.reports[open] > summary .chev { transform: rotate(90deg); }
.reports > summary .chev svg { width: 16px; height: 16px; }
.reports[open] > summary { border-bottom: 1px solid var(--border); }
.reports .toolbar { border-bottom: 1px solid var(--border); }
.reports-inner { padding: 4px 20px 20px; }

/* employee quick-help tiles */
.quick-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.quick-tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.quick-tile:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.quick-tile .qt-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.quick-tile .qt-ic svg { width: 19px; height: 19px; }
.quick-tile b { display: block; font-size: 14px; }
.quick-tile span span { font-size: 12px; color: var(--muted); }
@media (max-width: 1200px) { .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .dash-tiles { grid-template-columns: 1fr; } .quick-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .att-item { padding: 12px 14px; } }

/* announcements */
.ann-bar:empty { display: none; }
.ann-bar { display: flex; flex-direction: column; gap: 0; }
.ann { display: flex; align-items: center; gap: 12px; padding: 8px 28px; background: var(--info-soft); color: var(--text); border-bottom: 1px solid var(--border); font-size: 13.5px; }
.ann.warn { background: var(--warn-soft); } .ann.danger { background: var(--danger-soft); }
.ann-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.ann.warn .ann-ic, .ann-ic.warn { background: var(--warn); color: #fff; } .ann.danger .ann-ic, .ann-ic.danger { background: var(--danger); color: #fff; }
.ann-ic svg { width: 15px; height: 15px; }
.ann-txt { flex: 1; min-width: 0; }
.ann-txt span { color: var(--text-2); }
.ann-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; }
.ann-x:hover { background: rgba(0,0,0,.06); color: var(--text); }
.ann-x svg { width: 15px; height: 15px; }
.ann-admin { list-style: none; margin: 0; padding: 0; }
.ann-admin li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border-top: 1px solid var(--border); }
.ann-admin li:first-child { border-top: 0; }
.ann-admin li.ended { opacity: .65; }
.ann-admin .grow { flex: 1; min-width: 0; }
.ann-preview { display: flex; flex-direction: column; gap: 6px; }
.ann-preview .ann { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
#sev .choice { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
#sev .choice svg { width: 18px; height: 18px; color: var(--primary); }
#sev .sev-warning svg { color: var(--warn); } #sev .sev-outage svg { color: var(--danger); }
@media (max-width: 760px) { .ann { padding: 10px 14px; } }

/* ticket progress tracker */
.progress { list-style: none; margin: 0 0 20px; padding: 16px 20px; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.progress li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.progress li:not(:first-child)::before { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.progress li.done::before, .progress li.now::before { background: var(--primary); }
.pg-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; z-index: 1;
  background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); }
.pg-dot svg { width: 15px; height: 15px; }
.progress li.done .pg-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.progress li.now .pg-dot { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.progress li.now:last-child .pg-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.progress li.pulse .pg-dot { animation: pg-pulse 2s infinite; }
@keyframes pg-pulse { 0% { box-shadow: 0 0 0 0 var(--focus); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pg-name { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.progress li.done .pg-name, .progress li.now .pg-name { color: var(--text); }
.pg-when { font-size: 11px; color: var(--muted); min-height: 15px; }
@media (prefers-reduced-motion: reduce) { .progress li.pulse .pg-dot { animation: none; } }
@media (max-width: 600px) { .progress { padding: 12px 8px; } .pg-name { font-size: 11px; } .pg-when { display: none; } }

/* quick replies */
.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px 0; }
.quick-replies .small svg { width: 13px; height: 13px; vertical-align: -2px; color: var(--primary); }
.qr { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.qr:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
@media (max-width: 600px) { .ann-txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; } }

/* ticket list: star, new rows, employee filter */
.star-col { width: 34px; padding-right: 0 !important; }
.star-btn { border: 0; background: none; padding: 4px; border-radius: 6px; cursor: pointer; color: var(--border-strong); display: grid; place-items: center; }
.star-btn svg { width: 17px; height: 17px; }
.star-btn:hover { color: #f2a516; background: var(--surface-hover); }
.star-btn.on { color: #f2a516; }
tr.row-new > td { background: #ecfbf1; }
tr.row-new:hover > td { background: #dff6e7; }
tr.row-new > td:first-child { box-shadow: inset 3px 0 0 #2fa765; }
html[data-mode="dark"] tr.row-new > td { background: rgba(47, 167, 101, .12); }
html[data-mode="dark"] tr.row-new:hover > td { background: rgba(47, 167, 101, .18); }
.new-pill { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: #fff; background: #2fa765; border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }
.toolbar .search-inline.wide { max-width: 420px; min-width: 300px; }
.toolbar .search-inline.emp-filter { max-width: 150px; min-width: 130px; flex: 0 0 140px; }
.req-link { color: var(--text); cursor: pointer; text-decoration: none; }
.req-link:hover { color: var(--primary-text); text-decoration: underline; }
.filter-chip-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--primary-soft);
  border-bottom: 1px solid var(--border); font-size: 13.5px; }
.filter-chip-bar > svg { width: 15px; height: 15px; color: var(--primary); }
.filter-chip-bar .btn { margin-left: auto; }
.ticket-star { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 2px 10px 2px 7px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12.5px; color: var(--muted); }
.ticket-star svg { width: 15px; height: 15px; color: var(--border-strong); }
.ticket-star.on { color: var(--text); border-color: #f2c66b; background: #fff8e6; }
html[data-mode="dark"] .ticket-star.on { background: rgba(242, 165, 22, .14); }
.ticket-star.on svg, .ticket-star:hover svg { color: #f2a516; }
.search-results a > svg { width: 16px; height: 16px; color: var(--muted); flex: none; margin-top: 2px; }

/* raise a ticket: IT department picker */
.desk-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.desk-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--border-strong); border-radius: 12px;
  cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s; }
.desk-opt:hover { border-color: var(--primary); }
.desk-opt:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.desk-opt.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.desk-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); flex: none; border: 1px solid var(--border); }
.desk-opt.on .desk-ic { background: var(--primary); color: #fff; border-color: var(--primary); }
.desk-ic svg { width: 19px; height: 19px; }
.desk-opt b { display: block; font-size: 15px; }
.desk-opt span span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.desk-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 8px;
  border-radius: 6px; background: var(--neutral-soft); color: var(--neutral); white-space: nowrap; }
.desk-badge.it { background: #e4eefb; color: #1550ad; }
.desk-badge.erp { background: #efe9fd; color: #5a3fc0; }
.desk-badge.both { background: #e6f6f4; color: #0b6f6b; }
html[data-mode="dark"] .desk-badge.it { background: rgba(47,116,214,.2); color: #8ec5ff; }
html[data-mode="dark"] .desk-badge.erp { background: rgba(110,94,230,.22); color: #bdb3ff; }
html[data-mode="dark"] .desk-badge.both { background: rgba(24,162,156,.2); color: #7fdcd5; }
@media (max-width: 760px) { .desk-pick { grid-template-columns: 1fr; } }
.desk-switch { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.desk-switch button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow-sm); }
.desk-switch button svg { width: 16px; height: 16px; }
.desk-switch button:hover { border-color: var(--primary); color: var(--text); }
.desk-switch button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.desk-switch .n:empty { display: none; }
.desk-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.desk-card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.desk-card:hover { border-color: var(--primary); }
.desk-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.desk-card.on .desk-ic { background: var(--primary); color: #fff; border-color: var(--primary); }
.dc-txt { flex: 1; min-width: 0; }
.dc-txt b { display: block; font-size: 16px; }
.dc-txt span { font-size: 12.5px; color: var(--muted); }
.dc-open { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.dc-open b { font-size: 20px; color: var(--text); margin-right: 3px; }

/* =====================================================================
   Phone & small-tablet layout
   ===================================================================== */
.bottom-nav, .search-btn, .tb-toggle, .nav-scrim { display: none; }
.tb-more { display: contents; }

@media (max-width: 980px) {
  .nav-scrim { position: fixed; inset: 0; background: rgba(7, 26, 51, .45); z-index: 45; }
  .shell.nav-open .nav-scrim { display: block; }
}

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 14.5px; }
  .content { padding: 16px 12px calc(84px + env(safe-area-inset-bottom)); }
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-head h1 { font-size: 21px; }
  .page-head .sub { font-size: 13px; }
  .page-head > .row { width: 100%; }
  .page-head > .row > .btn, .page-head > .row > a.btn { flex: 1 1 auto; justify-content: center; }
  .crumbs { font-size: 12px; }
  /* bigger tap targets */
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  input[type=text], input[type=email], input[type=password], input[type=search], select, textarea { font-size: 16px; } /* no iOS zoom */
  input[type=text], input[type=email], input[type=password], input[type=search], select { height: 42px; }

  /* top bar: logo title + icons, search opens on demand */
  .topbar { gap: 6px; height: 56px; }
  .company-title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
  .search-btn { display: grid; }
  .theme-btn { display: none; }                 /* theme picker lives in the Menu on phones */
  .shell.search-open .topbar .search { display: block; position: fixed; left: 0; right: 0; top: 56px; max-width: none; margin: 0;
    padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); z-index: 40; }
  .shell.search-open .topbar .search > svg { left: 24px; top: 23px; }
  .shell.search-open .topbar .search-results { top: 62px; left: 8px; right: 8px; max-height: 70vh; }

  /* bottom tab bar */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(11, 37, 69, .08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; position: relative; cursor: pointer; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav .bn-raise svg { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: var(--primary); color: #fff; margin-top: -2px; }
  .bottom-nav .bn-count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; }
  .toasts { bottom: calc(78px + env(safe-area-inset-bottom)) !important; left: 12px; right: 12px; }
  .toast { min-width: 0; max-width: none; }

  /* cards and modals */
  .card-head { padding: 14px 16px 0; }
  .card-body { padding: 14px 16px; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); }
  .modal-foot .btn { flex: 1; justify-content: center; }

  /* toolbars: search boxes on top, everything else behind "Filters" */
  .toolbar { padding: 12px; gap: 8px; }
  .toolbar .search-inline, .toolbar .search-inline.wide { flex: 1 1 100%; min-width: 0; max-width: none; }
  .toolbar .search-inline.emp-filter { flex: 1 1 0; max-width: none; }
  .tb-toggle { display: inline-flex; flex: 0 0 auto; }
  .toolbar .tb-more { display: none; }
  .toolbar.open .tb-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .toolbar.open .tb-more select { width: 100%; min-width: 0; }
  .toolbar select { min-width: 0; flex: 1 1 calc(50% - 8px); }
  .toolbar .spacer { display: none; }
  .tabs { padding: 0 6px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 12px 10px 10px; }

  /* IT / ERP-IT switches */
  .desk-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .desk-switch button { justify-content: center; padding: 9px 6px; font-size: 13px; gap: 5px; }
  .desk-switch button svg { display: none; }
  .desk-cards { gap: 8px; }
  .desk-card { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .desk-card .desk-ic { width: 32px; height: 32px; }
  .dc-txt span { display: none; }
  .dc-open { width: 100%; }

  /* ---- ticket list: each row becomes a card */
  .table-wrap:has(table.tlist), .table-wrap:has(table.ulist) { overflow: visible; }
  table.data.tlist, table.data.tlist tbody { display: block; width: 100%; }
  table.data.tlist thead { display: none; }
  table.data.tlist tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto;
    grid-template-areas: "star id status menu" "star subj subj subj" "star req req prio" "star asg asg asg";
    gap: 4px 8px; padding: 12px 12px 12px 8px; border-bottom: 1px solid var(--border); align-items: center; }
  table.data.tlist td, table.data.tlist td.hide-sm { display: block; padding: 0; border: 0; white-space: normal; background: none !important; box-shadow: none !important; min-width: 0; }
  table.data.tlist td.c-upd { display: none; }
  .tlist .c-star { grid-area: star; align-self: start; }
  .tlist .c-id { grid-area: id; }
  .tlist .c-status { grid-area: status; justify-self: end; }
  .tlist .c-menu { grid-area: menu; width: auto; }
  .tlist .c-subj { grid-area: subj; }
  .tlist .c-subj .t-subject { max-width: none; white-space: normal; font-size: 14.5px; }
  .tlist .c-req { grid-area: req; font-size: 13px; }
  .tlist .c-asg { grid-area: asg; font-size: 13px; }
  .tlist .c-prio { grid-area: prio; justify-self: end; }
  .tlist .c-sla { grid-area: sla; justify-self: end; }
  .tlist td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  .tlist .c-req .t-sub2 { display: none; }
  .tlist .c-req .name-id, .tlist .c-asg .name-id { display: inline-flex; }
  table.data.tlist tr.row-new { background: #ecfbf1; box-shadow: inset 3px 0 0 #2fa765; }
  html[data-mode="dark"] table.data.tlist tr.row-new { background: rgba(47, 167, 101, .12); }
  table.data.tlist tr:has(td[colspan]) { display: block; padding: 0; }
  table.data.tlist tr:has(td[colspan]) td { display: block; }
  .kebab { width: 34px; height: 34px; }

  /* ---- users table: each user becomes a card with all buttons reachable */
  table.data.ulist, table.data.ulist tbody { display: block; width: 100%; }
  table.data.ulist thead { display: none; }
  table.data.ulist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "user status" "roles code" "actions actions";
    gap: 8px; padding: 14px 12px; border-bottom: 1px solid var(--border); }
  table.data.ulist td, table.data.ulist td.hide-sm { display: block; padding: 0; border: 0; min-width: 0; }
  table.data.ulist td.u-dept, table.data.ulist td.u-last { display: none; }
  .ulist .u-user { grid-area: user; } .ulist .u-status { grid-area: status; justify-self: end; }
  .ulist .u-roles { grid-area: roles; } .ulist .u-code { grid-area: code; justify-self: end; font-size: 12.5px; }
  .ulist .u-actions { grid-area: actions; display: flex !important; flex-wrap: wrap; gap: 6px; justify-content: flex-start; white-space: normal !important; }
  .ulist .u-actions .btn { flex: 1 1 auto; justify-content: center; }
  table.data.ulist tr:has(td[colspan]) { display: block; }
  table.data.compact-admin .t-sub2 { max-width: none; }

  /* other tables scroll sideways inside their card instead of breaking the page */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pager { flex-wrap: wrap; gap: 8px; padding: 12px; }

  /* dashboard numbers: two per row */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 14px; }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi .value { font-size: 22px; }
  .section-label { flex-wrap: wrap; }

  /* ticket page */
  .ticket-title { gap: 8px; }
  .ticket-title h1, .page-head h1 { word-break: break-word; }
  #actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #actions .btn { justify-content: center; width: 100%; }
  .meta-line { gap: 8px 14px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .quick-replies { gap: 5px; }

  /* raise a ticket */
  .modal-foot, #tf .modal-foot { flex-wrap: wrap; }
  #tf .modal-foot > span { width: 100%; text-align: center; }
  #tf .modal-foot .row { width: 100%; }
  #tf .modal-foot .row .btn { flex: 1; justify-content: center; }
  .choice-grid { grid-template-columns: 1fr; }
  .dropzone { padding: 18px 12px; }

  /* home */
  .hero { padding: 20px 18px; }
  .hero h1 { font-size: 20px; }
  .hero .btn.primary { width: 100%; justify-content: center; }
  .quick-tile { padding: 12px; gap: 8px; }
}

/* theme picker shortcut inside the phone menu */
.side-theme { display: none; }
@media (max-width: 760px) {
  .side-theme { display: flex; align-items: center; gap: 10px; margin: 6px 12px 0; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1);
    color: var(--sidebar-text); background: none; font: inherit; cursor: pointer; width: calc(100% - 24px); }
  .side-theme svg { width: 18px; height: 18px; }
}
@media (max-width: 760px) {
  .theme-menu { position: fixed; left: 12px !important; right: 12px !important; top: 64px !important; width: auto; }
  .menu { right: 12px; }
}
@media (max-width: 760px) { #tf .modal-foot { position: static; } }
.dev-chip { font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary-text); text-decoration: none; white-space: nowrap; }
.dev-chip:hover { text-decoration: none; background: var(--primary); color: #fff; }
.card.flash { animation: cardFlash 1.6s ease-out 2; } @keyframes cardFlash { 0%,100% { box-shadow: var(--shadow-sm); } 40% { box-shadow: 0 0 0 4px var(--focus); } }
.new-ticket-wrap { max-width: 900px; }

/* ---------- Notifications page ---------- */
.nf-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.nf-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.nf-kinds .chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.nf-kinds .chip:hover { background: var(--surface-hover); }
.nf-kinds .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.nf-day { margin-bottom: 20px; }
.nf-day h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 4px; }
.nf-card { padding: 0; overflow: hidden; }
.nf-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; color: inherit; text-decoration: none;
  border-top: 1px solid var(--border); position: relative; transition: background .15s; }
.nf-item:first-child { border-top: 0; }
.nf-item:hover { background: var(--surface-hover); text-decoration: none; }
.nf-item:hover * { text-decoration: none; }
.nf-item.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.nf-item.unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.nf-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.nf-ic svg { width: 18px; height: 18px; }
.nf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nf-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.nf-tag { font-weight: 650; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; }
.nf-num { font-family: var(--mono); font-weight: 600; color: var(--primary-text); font-size: 12px; }
.nf-time { margin-left: auto; color: var(--muted); white-space: nowrap; }
.nf-title { font-weight: 600; color: var(--text); font-size: 14.5px; line-height: 1.4; }
.nf-item:not(.unread) .nf-title { font-weight: 500; }
.nf-subj { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-subj svg { width: 13px; height: 13px; flex: none; opacity: .7; }
.nf-body { color: var(--text-2); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nf-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.nf-meta:empty { display: none; }
.nf-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.nf-pill b { font-weight: 600; color: var(--text); }
.nf-pill svg { width: 12px; height: 12px; }
.nf-pill .avatar { width: 16px; height: 16px; font-size: 8px; }
.nf-pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.nf-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-top: 6px; }
.tone-primary { background: var(--primary-soft); color: var(--primary-text); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-neutral { background: var(--neutral-soft); color: var(--neutral); }
@media (max-width: 720px) {
  .nf-item { padding: 12px 14px; gap: 11px; }
  .nf-ic { width: 32px; height: 32px; border-radius: 10px; }
  .nf-bar { flex-direction: column; align-items: stretch; }
}

/* ---------- Attachments: tiles + in-app viewer ---------- */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.viewer img, html[data-mode="dark"] .viewer img { opacity: 1; }
.att-tile { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex;
  flex-direction: column; transition: box-shadow .15s, border-color .15s, transform .15s; }
.att-tile:hover { box-shadow: var(--shadow); border-color: var(--primary-border); transform: translateY(-1px); }
.att-prev { all: unset; cursor: pointer; display: block; height: 92px; background: var(--surface-2); position: relative; overflow: hidden; }
.att-prev:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.att-thumb { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.att-thumb svg { width: 30px; height: 30px; }
.att-thumb.pdf { color: #C2410C; }
.att-thumb.pdf::after { content: "PDF"; position: absolute; bottom: 12px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }
.att-thumb.has-img img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
.att-prev .att-eye { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7, 26, 51, .45); color: #fff;
  opacity: 0; transition: opacity .15s; font-size: 12.5px; font-weight: 600; }
.att-prev .att-eye span { display: inline-flex; gap: 6px; align-items: center; }
.att-prev .att-eye svg { width: 16px; height: 16px; }
.att-prev:hover .att-eye, .att-prev:focus-visible .att-eye { opacity: 1; }
.att-info { padding: 8px 10px 4px; min-width: 0; }
.att-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.att-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.att-acts { display: flex; gap: 2px; padding: 2px 6px 6px; }
.att-acts button { all: unset; cursor: pointer; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 0; border-radius: 7px; font-size: 12px; color: var(--text-2); }
.att-acts button:hover { background: var(--surface-hover); color: var(--primary-text); }
.att-acts button.danger:hover { color: var(--danger); background: var(--danger-soft); }
.att-acts svg { width: 14px; height: 14px; }
.att-tile .tag-internal { font-size: 10px; }

body.vw-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 55; background: #0B111C; color: #E6ECF5; display: flex; flex-direction: column;
  animation: vw-in .15s ease-out; }
@keyframes vw-in { from { opacity: 0; } to { opacity: 1; } }
.vw-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .08); flex-wrap: wrap; }
.vw-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 260px; }
.vw-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; flex: none; }
.vw-ic svg { width: 17px; height: 17px; }
.vw-names { min-width: 0; display: flex; flex-direction: column; }
.vw-names b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-names span { font-size: 12px; color: #9AA8BC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vw-group { display: inline-flex; gap: 2px; background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 3px; }
.vw-group[hidden] { display: none; }
.vw-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; color: #E6ECF5; }
.vw-btn:hover { background: rgba(255, 255, 255, .12); }
.vw-btn:focus-visible { outline: 2px solid #7FB2FF; }
.vw-btn svg { width: 17px; height: 17px; }
.vw-btn.primary { background: var(--primary); color: #fff; }
.vw-btn.primary:hover { background: var(--primary-hover); }
.vw-btn.danger:hover { background: rgba(239, 68, 68, .25); color: #FCA5A5; }
.vw-btn[hidden] { display: none; }
.vw-pct { min-width: 46px; justify-content: center; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.vw-main { flex: 1; min-height: 0; position: relative; display: flex; }
.vw-stage { flex: 1; min-width: 0; overflow: auto; display: grid; place-items: center; padding: 16px; }
.vw-imgbox { position: relative; flex: none; }
.vw-imgbox img { position: absolute; left: 50%; top: 50%; transform-origin: center; user-select: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); border-radius: 4px; background: #fff; }
.vw-stage.zoomed { place-items: start; }
.vw-stage.zoomed .vw-imgbox { margin: auto; }
.vw-pdf { width: min(1100px, 100%); height: 100%; border: 0; border-radius: 6px; background: #fff; }
.vw-nav { all: unset; cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); display: grid; place-items: center; z-index: 2; }
.vw-nav:hover { background: rgba(255, 255, 255, .22); }
.vw-nav svg { width: 22px; height: 22px; }
.vw-nav.prev { left: 14px; } .vw-nav.next { right: 14px; }
.vw-nav[hidden] { display: none; }
.vw-loading, .vw-msg { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #C3CEDD; max-width: 420px; }
.vw-msg svg { width: 40px; height: 40px; opacity: .8; }
.vw-msg span { font-size: 13.5px; color: #9AA8BC; }
.vw-loading .spinner { width: 28px; height: 28px; border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; border-radius: 50%;
  animation: vw-spin .8s linear infinite; }
@keyframes vw-spin { to { transform: rotate(360deg); } }
.vw-strip { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; border-top: 1px solid rgba(255, 255, 255, .08); justify-content: center; }
.vw-strip[hidden] { display: none; }
.vw-thumb { all: unset; cursor: pointer; width: 84px; flex: none; display: flex; flex-direction: column; gap: 4px; opacity: .6; }
.vw-thumb:hover, .vw-thumb.on { opacity: 1; }
.vw-thumb-box { height: 54px; border-radius: 7px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; overflow: hidden;
  border: 2px solid transparent; }
.vw-thumb.on .vw-thumb-box { border-color: #7FB2FF; }
.vw-thumb-box svg { width: 20px; height: 20px; }
.vw-thumb-box { position: relative; }
.vw-thumb-box img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
.vw-thumb-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #C3CEDD; }
.vw-print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }
@media (max-width: 720px) {
  .vw-btn span { display: none; }
  .vw-bar { padding: 8px 10px; gap: 8px; }
  .vw-tools { width: 100%; justify-content: space-between; gap: 6px; }
  .vw-btn { padding: 7px 8px; }
  .vw-nav { width: 38px; height: 38px; background: rgba(0, 0, 0, .45); }
  .vw-nav.prev { left: 6px; } .vw-nav.next { right: 6px; }
  .vw-stage { padding: 8px; }
  .att-grid { grid-template-columns: repeat(2, 1fr); }
}
.vw-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 4px 0 24px; }
.vw-page { background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); border-radius: 3px; flex: none; }
.vw-stage:has(.vw-pages) { place-items: start center; }
.vw-stage.zoomed:has(.vw-pages) { place-items: start; }
.vw-stage.zoomed .vw-pages { margin: 0 auto; }

/* ---------- Logo + password help on the sign-in page ---------- */
.login-company .logo-full { display: inline-block; background: #fff; border-radius: 14px; padding: 8px 12px; margin-bottom: 14px; }
.login-company .logo-full img { display: block; height: 118px; width: auto; }
html[data-mode="dark"] .login-company .logo-full { box-shadow: 0 0 0 1px var(--border); }
.login-art .brand-mark { width: 46px; height: 46px; border-radius: 12px; }
.pw-help { margin-top: 22px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.pw-help-head { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.pw-help-head svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--primary); }
.pw-help-head b { color: var(--text); font-weight: 600; }
.pw-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pw-list li { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; background: var(--surface);
  border: 1px solid var(--border); }
.pw-list li + li { margin-top: 6px; }
.pw-list .avatar { width: 32px; height: 32px; font-size: 11.5px; flex: none; }
.pw-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.pw-who b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pw-who a { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--primary-text); text-decoration: none;
  overflow-wrap: anywhere; }
.pw-who a:hover { text-decoration: underline; }
.pw-who a svg { width: 13px; height: 13px; flex: none; opacity: .8; }
@media (max-width: 640px) { .login-company .logo-full img { height: 92px; }  }

/* ---------- Paste button next to the attachment drop zone ---------- */
.drop-row { display: flex; gap: 10px; align-items: stretch; }
.drop-row .dropzone { flex: 1; margin: 0; }
.paste-btn { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 88px; border-style: dashed; }
.paste-btn svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .drop-row { flex-direction: column; } .paste-btn { flex-direction: row; min-height: 40px; } }

/* ---------- Reset filters (ticket list) ---------- */
.reset-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.reset-btn svg { width: 15px; height: 15px; }
.reset-btn .n:empty { display: none; }
.reset-btn .n { background: var(--primary); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.reset-btn.has { color: var(--primary-text); border-color: var(--primary-border); background: var(--primary-soft); }

/* ---------- SLA (IT only): ticket card + report ---------- */
.sla-badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.sla-card .card-head h2 { display: flex; align-items: center; gap: 7px; }
.sla-card .card-head h2 svg { width: 17px; height: 17px; color: var(--primary); }
.sla-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sla-pct { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sla-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.sla-bar i { display: block; height: 100%; border-radius: 999px; }
.sla-bar i.tone-ok { background: var(--ok); } .sla-bar i.tone-warn { background: var(--warn); }
.sla-bar i.tone-danger { background: var(--danger); } .sla-bar i.tone-neutral { background: var(--neutral); }
.sla-kv { margin-top: 14px; }
.sla-kv dd .sla-badge { margin-left: 4px; }
.sla-over { color: var(--danger); font-weight: 600; }
.sla-card a.small { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; }
.sla-card a.small svg { width: 14px; height: 14px; }
.kpi.clickable-kpi { cursor: pointer; }
.kpi .kpi-go { font-size: 11.5px; color: var(--primary-text); display: flex; align-items: center; gap: 3px; margin-top: 3px; white-space: nowrap; font-weight: 600; }
.kpi .kpi-go svg { width: 12px; height: 12px; }
.sla-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sla-row-detail td { background: var(--surface-2); padding: 0 !important; }
.sla-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; padding: 16px 20px; }
.sla-detail h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sla-tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.sla-tl li { position: relative; padding: 0 0 10px 10px; font-size: 12.5px; }
.sla-tl li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--primary); }
.sla-tl li.bad::before { border-color: var(--danger); } .sla-tl li.good::before { border-color: var(--ok); }
.sla-tl b { display: block; font-size: 12.5px; }
.sla-tl span { color: var(--muted); }
.sla-table td { vertical-align: middle; }
.sla-table .mini { width: 90px; }
.sla-expand { all: unset; cursor: pointer; color: var(--text-2); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.sla-expand:hover { background: var(--surface-hover); }
.sla-expand svg { width: 16px; height: 16px; transition: transform .15s; }
.sla-expand[aria-expanded="true"] svg { transform: rotate(90deg); }

/* =================================================================== Task management */
/* which menu / bottom bar shows depends on the area: data-mode="tasks" | "desk" on .shell */
.shell .nav-tasks, .shell .only-tasks, .shell .only-tasks-flex { display: none; }
.shell[data-mode="tasks"] .nav-tasks { display: block; }
.shell[data-mode="tasks"] .nav-desk, .shell[data-mode="tasks"] .only-desk, .shell[data-mode="tasks"] .only-desk-flex { display: none; }
.shell[data-mode="tasks"] .only-tasks { display: inline; }
@media (max-width: 860px) { .shell[data-mode="tasks"] .only-tasks-flex { display: grid; } }
.shell[data-mode="tasks"] .only-desk-block { display: none; }
.nav-tasks a.on, .nav-tasks a[data-mode-go] { }
.mode-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; margin-left: 14px; flex: none; }
.mode-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); text-decoration: none; white-space: nowrap; }
.mode-switch a svg { width: 15px; height: 15px; }
.mode-switch a:hover { color: var(--text); background: var(--surface-hover); }
.mode-switch a.on { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.15)); }
@media (max-width: 1100px) { .mode-switch a span { display: none; } .mode-switch a { padding: 6px 9px; } }

.tk-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tk-pill svg { width: 12px; height: 12px; }
.tk-cat { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tk-bar { display: inline-block; vertical-align: middle; width: 100%; max-width: 140px; height: 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.tk-bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.tk-bar.late i { background: var(--danger); }
.tk-who { display: inline-flex; align-items: center; gap: 7px; }
.tk-who .avatar { width: 24px; height: 24px; font-size: 10px; flex: none; }
.tk-due { display: inline-flex; flex-direction: column; font-size: 12.5px; line-height: 1.3; }
.tk-due b { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tk-due.soon b { color: var(--warn); } .tk-due.late b, .tk-due.late span { color: var(--danger); }
.tk-red { color: var(--danger); font-weight: 700; }
.tk-row-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tk-kpi { text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.tk-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 960px) { .tk-grid { grid-template-columns: 1fr; } }
.card .card-head h2 { display: flex; align-items: center; gap: 7px; }
.card .card-head h2 svg { width: 17px; height: 17px; color: var(--primary); }
.tk-att { list-style: none; margin: 0; padding: 0; }
.tk-att li + li { border-top: 1px solid var(--border); }
.tk-att a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 18px; color: inherit; text-decoration: none; }
.tk-att a:hover { background: var(--surface-hover); }
.tk-att a b { flex: 1; min-width: 160px; font-weight: 600; font-size: 13.5px; }
.tk-att-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tk-att-tag.k-approval { background: var(--warn-soft); color: var(--warn); }
.tk-att-tag.k-extension { background: var(--info-soft); color: var(--info); }
.tk-att-tag.k-overdue { background: var(--danger-soft); color: var(--danger); }
.tk-att-tag.k-quiet { background: var(--neutral-soft); color: var(--neutral); }
.tk-empty { display: flex; align-items: center; gap: 8px; padding: 22px 18px; color: var(--muted); font-size: 13.5px; }
.tk-empty svg { width: 18px; height: 18px; }
.tk-feed { list-style: none; margin: 0; padding: 0; }
.tk-feed li { display: flex; gap: 11px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.tk-feed li:first-child { border-top: 0; }
.tk-feed .avatar { width: 30px; height: 30px; font-size: 11px; flex: none; }
.tk-feed-body, .tk-tl-body { margin: 4px 0; padding: 8px 11px; background: var(--surface-2); border-radius: 8px; white-space: pre-wrap; font-size: 13px; color: var(--text-2); }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tabs button { all: unset; cursor: pointer; padding: 9px 14px; font-weight: 600; font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--primary-text); border-bottom-color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.chips .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chips[hidden] { display: none; }
.tk-board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; padding: 14px; overflow-x: auto; }
.tk-col { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.tk-col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 6px; }
.tk-col-empty { color: var(--muted); text-align: center; padding: 14px; }
.tk-card { display: flex; flex-direction: column; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px;
  color: inherit; text-decoration: none; transition: box-shadow .12s, transform .12s; }
.tk-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tk-card.late { border-left: 3px solid var(--danger); }
.tk-card b { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.tk-card .tk-bar { max-width: none; }
.tk-card-top, .tk-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-card-foot .tk-who span:last-child { font-size: 12px; }
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .tk-layout { grid-template-columns: 1fr; } .tk-layout aside { order: -1; } }
.tk-head { align-items: flex-start; }
.tk-actions { flex-wrap: wrap; justify-content: flex-end; }
.tk-desc { white-space: pre-wrap; line-height: 1.6; }
.tk-prog-big { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.tk-prog-big b { font-size: 30px; font-weight: 750; }
.tk-prog-big span { color: var(--muted); }
aside .tk-bar { max-width: none; height: 9px; }
.tk-stars { color: #F5A524; letter-spacing: 2px; }
.tk-stars span { color: var(--border); }
.tk-slider { display: flex; align-items: center; gap: 12px; }
.tk-slider input { flex: 1; accent-color: var(--primary); }
.tk-slider b { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.tk-tl { list-style: none; margin: 0; padding: 0; }
.tk-tl li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; font-size: 13.5px; }
.tk-tl li:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.tk-tl-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex: none; }
.tk-tl-ic svg { width: 15px; height: 15px; }
.tk-tl li.k-approved .tk-tl-ic, .tk-tl li.k-completed .tk-tl-ic { background: var(--ok-soft); color: var(--ok); }
.tk-tl li.k-returned .tk-tl-ic, .tk-tl li.k-cancelled .tk-tl-ic { background: var(--danger-soft); color: var(--danger); }
.tk-tl li.k-extension_requested .tk-tl-ic, .tk-tl li.k-submitted .tk-tl-ic { background: var(--warn-soft); color: var(--warn); }
.tk-ext { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tk-ext > div:first-of-type { flex: 1; min-width: 220px; }
.tk-rate { display: flex; gap: 4px; }
.tk-rate button { all: unset; cursor: pointer; font-size: 28px; color: var(--border); line-height: 1; }
.tk-rate button.on { color: #F5A524; }
.tk-pick { position: relative; }
.tk-pick-sel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.tk-pick-sel[hidden], .tk-pick-list[hidden], .search-inline[hidden] { display: none; }
.tk-pick-list { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  max-height: 260px; overflow: auto; box-shadow: var(--shadow); }
.tk-pick-list button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; }
.tk-pick-list button:hover { background: var(--surface-hover); }
.notice.warn { background: var(--warn-soft); border-color: transparent; }
.tk-card:hover, .tk-card:hover *, .tk-att a:hover, .tk-att a:hover *, .tk-kpi:hover, .tk-kpi:hover * { text-decoration: none; }
.tk-pick-in[hidden] { display: none; }

/* =================================================================== Sky theme — whole app (IT Service Desk and Task management) */
.shell .main {
  background: #1b2a5c url("/static/assets/tasks-bg.jpg") center / cover fixed no-repeat;
  --tk-glass: rgba(18, 28, 66, .42); --tk-glass-2: rgba(255, 255, 255, .14); --tk-line: rgba(255, 255, 255, .22);
  --tk-ink: #fff; --tk-ink-2: rgba(255, 255, 255, .78);
}
@media (max-width: 900px) { .shell .main { background-image: url("/static/assets/tasks-bg-sm.jpg"); background-attachment: scroll; } }
.shell[data-mode="tasks"] .content { max-width: none; padding: 18px 26px 56px; }
.shell .topbar { background: rgba(14, 22, 52, .55); border-bottom-color: var(--tk-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.shell .topbar .company-title, .shell .topbar .icon-btn, .shell .topbar .menu-btn { color: #fff; }
.shell .topbar .icon-btn:hover { background: rgba(255,255,255,.12); }
.shell .user-chip, .shell .user-chip .who, .shell .user-chip .who * { color: #fff !important; }
.shell .user-chip .who span { opacity: .78; }
.shell .user-chip:hover { background: rgba(255,255,255,.12); }
.shell .topbar .global-search input { background: rgba(255,255,255,.14); border-color: var(--tk-line); color: #fff; }
.shell .topbar .global-search input::placeholder { color: rgba(255,255,255,.7); }
.shell .topbar .global-search svg { color: rgba(255,255,255,.8); }
.shell .mode-switch { background: rgba(255,255,255,.12); border-color: var(--tk-line); }
.shell .mode-switch a { color: rgba(255,255,255,.85); }
.shell .mode-switch a.on { background: #2fc26b; color: #fff; }
/* text that sits straight on the sky */
.shell .content > .page > .page-head h1, .shell .content > .page > .page-head .sub, .shell .content > .page > .page-head .sub b,
.shell .content .crumbs, .shell .content .crumbs a, .shell .content .crumbs span, .tk-sub,
.shell .content > .page > .section-label, .shell .content > .page > h2, .shell .content .nf-day h3 {
  color: #fff !important; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.shell .content > .page > .section-label .pill { background: rgba(255,255,255,.2); color: #fff; }
.shell .tk-hello .sub { color: rgba(255,255,255,.85) !important; }
/* tabs and chips that sit on the sky */
.shell .content > .page > .tabs { border-bottom-color: rgba(255,255,255,.3); }
.shell .content > .page > .tabs button { color: rgba(255,255,255,.8); }
.shell .content > .page > .tabs button.on { color: #fff; border-bottom-color: #fff; }

/* glass building blocks */
.tk-panel, .shell .content .card, .shell .content .kpi, .shell .content .table-card {
  background: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .55); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(8, 16, 48, .18); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tk-panel { margin-bottom: 16px; overflow: hidden; }
html[data-mode="dark"] .tk-panel, html[data-mode="dark"] .shell .content .card, html[data-mode="dark"] .shell .content .kpi {
  background: rgba(16, 22, 38, .86); border-color: rgba(255, 255, 255, .08); }
.tk-glass, .tk-glass-sel { background: var(--tk-glass) !important; border: 1px solid var(--tk-line) !important; color: #fff !important; backdrop-filter: blur(10px); }
.tk-glass:hover { background: rgba(18, 28, 66, .6) !important; }
.tk-glass-sel { height: 38px; border-radius: 10px; padding: 0 12px; width: auto; }
.tk-glass-sel option { color: #111; }
.tk-glass-seg { background: var(--tk-glass); border-color: var(--tk-line); }
.tk-glass-seg button { color: rgba(255,255,255,.85); }
.tk-glass-seg button.on { background: #fff; color: #172554; }
.btn.tk-green { background: #2fc26b; border-color: #2fc26b; color: #fff; font-weight: 700; }
.btn.tk-green:hover { background: #27ad5e; border-color: #27ad5e; }

/* top tabs: Overview · Tasks · Performance · Analytics */
.tk-top { display: flex; gap: 4px; margin: -4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tk-top a { position: relative; color: rgba(255,255,255,.82); text-decoration: none; font-size: 15.5px; font-weight: 600; padding: 8px 14px; border-radius: 10px; white-space: nowrap; }
.tk-top a:hover { color: #fff; background: rgba(255,255,255,.1); }
.tk-top a.on { color: #fff; background: rgba(255,255,255,.18); }
.tk-top-n { position: absolute; top: 0; right: 0; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 6px; }

/* row 1: title · Create · preset · filter box · gear */
.tk-bar1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tk-bar1 h1 { margin: 0 6px 0 0; font-size: 28px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.tk-create { position: relative; display: inline-flex; }
.tk-create > a { border-radius: 10px 0 0 10px; height: 40px; }
.tk-create-more { border-radius: 0 10px 10px 0; border-left: 1px solid rgba(255,255,255,.35) !important; padding: 0 9px; height: 40px; }
.tk-presets { position: relative; }
.tk-presets .btn { height: 40px; font-weight: 600; }
.tk-n { background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.tk-n:empty { display: none; }
.tk-filterbox { flex: 1 1 360px; min-width: 0; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px; border-radius: 10px;
  background: var(--tk-glass); border: 1px solid var(--tk-line); backdrop-filter: blur(10px); cursor: text; }
.tk-filterbox input { flex: 1; min-width: 80px; height: 32px !important; background: transparent !important; border: 0 !important; color: #fff; box-shadow: none !important; padding: 0 6px !important; }
.tk-filterbox input::placeholder { color: rgba(255,255,255,.7); }
.tk-chips { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.tk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 8px; background: rgba(255,255,255,.2);
  color: #fff; font-size: 13px; white-space: nowrap; }
.tk-chip.more { padding-right: 11px; }
.tk-chip button { all: unset; cursor: pointer; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; }
.tk-chip button:hover { background: rgba(255,255,255,.25); }
.tk-chip svg { width: 13px; height: 13px; }
.tk-icon { all: unset; cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: rgba(255,255,255,.9); }
.tk-icon:hover { background: rgba(255,255,255,.16); }
.tk-icon svg { width: 18px; height: 18px; }
.tk-gear { position: relative; margin-left: auto; }
.tk-gear .tk-icon { width: 40px; height: 40px; border-radius: 10px; }
.tk-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 16px 40px rgba(8,16,48,.25); padding: 6px; display: flex; flex-direction: column; }
.tk-menu.right { left: auto; right: 0; }
.tk-menu[hidden] { display: none; }
.tk-menu a, .tk-menu button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.tk-menu a:hover, .tk-menu button:hover { background: var(--surface-hover); }
.tk-menu svg { width: 16px; height: 16px; color: var(--primary); }
.tk-menu-h { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tk-menu-check { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); margin-top: 4px; font-size: 13.5px; }

/* advanced search panel */
.tk-adv { margin-bottom: 14px; }
.tk-adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; padding: 18px 20px;
  background: rgba(255,255,255,.95); border-radius: 14px; box-shadow: 0 16px 40px rgba(8,16,48,.25); }
html[data-mode="dark"] .tk-adv-grid { background: rgba(16,22,38,.95); }
.tk-adv-h { grid-column: 1 / -1; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.tk-adv-h b { display: inline-flex; gap: 7px; align-items: center; font-size: 15px; }
.tk-adv-h svg { width: 17px; height: 17px; color: var(--primary); }
.tk-adv-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.tk-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; }
.tk-checks label { display: inline-flex; gap: 6px; align-items: center; }
.tk-range { display: flex; align-items: center; gap: 8px; }
.tk-range span { color: var(--muted); font-size: 13px; }

/* row 2: view tabs + counters */
.tk-bar2 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.tk-views { display: inline-flex; background: var(--tk-glass); border: 1px solid var(--tk-line); border-radius: 10px; padding: 3px; backdrop-filter: blur(10px); overflow-x: auto; max-width: 100%; }
.tk-views button { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 8px; color: rgba(255,255,255,.85); font-size: 14px; white-space: nowrap; }
.tk-views button:hover { color: #fff; }
.tk-views button.on { background: rgba(255,255,255,.92); color: #172554; font-weight: 600; }
.tk-counters { display: inline-flex; background: var(--tk-glass); border: 1px solid var(--tk-line); border-radius: 10px; padding: 3px; backdrop-filter: blur(10px); }
.tk-count { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; color: #fff; font-size: 14px; white-space: nowrap; }
.tk-count:hover { background: rgba(255,255,255,.12); }
.tk-count b { min-width: 20px; height: 20px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; padding: 0 6px; background: rgba(255,255,255,.25); }
.tk-count.red b { background: #ef4444; }
.tk-count.zero b { background: rgba(255,255,255,.25); }
.tk-count.ghost { color: rgba(255,255,255,.7); }

/* Deadline / Planner columns */
.tk-cols-wrap { position: relative; }
.tk-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px;
  scroll-snap-type: x proximity; scrollbar-width: thin; }
.tk-col2 { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; min-height: 60vh; }
.tk-colh { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: 8px; color: #0b1730; font-weight: 700; font-size: 14.5px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.tk-colh b { font-weight: 500; opacity: .75; }
.tk-colh.c-red { background: #ff5b5b; color: #fff; } .tk-colh.c-orange { background: #ffa53d; }
.tk-colh.c-sky { background: #2fc6f6; } .tk-colh.c-teal { background: #55d0e0; }
.tk-colh.c-blue { background: #2b8cf6; color: #fff; } .tk-colh.c-grey { background: #c7ccd6; } .tk-colh.c-done { background: #a8b0bd; color: #fff; }
.tk-add { all: unset; cursor: pointer; display: grid; place-items: center; height: 34px; border-radius: 8px; color: #fff; background: rgba(255,255,255,.12);
  border: 1px dashed rgba(255,255,255,.45); }
.tk-add:hover { background: rgba(255,255,255,.22); }
.tk-add svg { width: 18px; height: 18px; }
.tk-col2-body { display: flex; flex-direction: column; gap: 8px; border-right: 1px dashed rgba(255,255,255,.35); padding-right: 6px; flex: 1; }
.tk-col2:last-child .tk-col2-body { border-right: 0; }
.tk-col2 .tk-col-empty { color: rgba(255,255,255,.65); text-align: center; padding: 18px 0; font-size: 13px; }
.tk-col2 .tk-card { background: rgba(255,255,255,.96); border-color: transparent; box-shadow: 0 4px 14px rgba(8,16,48,.18); }
html[data-mode="dark"] .tk-col2 .tk-card { background: rgba(16,22,38,.94); }
.tk-scroll { all: unset; cursor: pointer; position: absolute; top: 45%; z-index: 3; width: 42px; height: 72px; display: grid; place-items: center; color: #fff;
  background: rgba(18,28,66,.5); backdrop-filter: blur(8px); }
.tk-scroll.left { left: -26px; border-radius: 0 40px 40px 0; } .tk-scroll.right { right: -26px; border-radius: 40px 0 0 40px; }
.tk-scroll svg { width: 22px; height: 22px; }
.tk-unread { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: #fff; background: #2fc26b; border-radius: 999px; padding: 1px 7px; }
.tk-unread svg { width: 11px; height: 11px; }
.tk-avs { display: inline-flex; }
.tk-avs .avatar { width: 24px; height: 24px; font-size: 9.5px; border: 2px solid var(--surface); margin-left: -6px; }
.tk-avs .avatar:first-child { margin-left: 0; }
.tk-avs .avatar.more { background: var(--surface-2); color: var(--text-2); }
.tk-more { padding: 10px 16px; }

/* Calendar */
.tk-cal { padding: 14px; }
.tk-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tk-cal-head b { font-size: 16px; min-width: 160px; text-align: center; }
.tk-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tk-cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.tk-cal-day { min-height: 104px; border-radius: 8px; background: var(--surface-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.tk-cal-day.out { opacity: .45; }
.tk-cal-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.tk-cal-n { font-size: 12px; font-weight: 700; color: var(--text-2); }
.tk-cal-t { display: block; font-size: 12px; padding: 2px 6px; border-radius: 5px; background: var(--primary-soft); color: var(--primary-text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--primary); }
.tk-cal-t.p-high { border-left-color: var(--danger); } .tk-cal-t.p-medium { border-left-color: var(--warn); }
.tk-cal-t.late { background: var(--danger-soft); color: var(--danger); }
.tk-cal-t.done { opacity: .6; text-decoration: line-through; }
.tk-cal-more { font-size: 11px; color: var(--muted); }
.tk-cal-nodl { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.tk-agenda { display: none; }
.tk-ag-day { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

/* Gantt */
.tk-gantt { padding: 14px; }
.tk-g-scroll { overflow-x: auto; }
.tk-g { min-width: 900px; }
.tk-g-row { display: grid; grid-template-columns: 240px 1fr; align-items: center; min-height: 40px; border-bottom: 1px solid var(--border); }
.tk-g-headrow { min-height: 30px; position: sticky; top: 0; background: inherit; }
.tk-g-name { display: flex; flex-direction: column; padding: 4px 10px 4px 2px; color: var(--text); text-decoration: none; min-width: 0; font-size: 13.5px; font-weight: 600;
  position: sticky; left: 0; background: var(--surface); z-index: 2; }
.tk-g-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-g-name small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.tk-g-track { position: relative; height: 40px; }
.tk-g-headrow .tk-g-track { height: 30px; }
.tk-g-day { position: absolute; top: 7px; font-size: 11px; color: var(--muted); transform: translateX(2px); }
.tk-g-day.we { color: var(--danger); opacity: .7; }
.tk-g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .6; }
.tk-g-bar { position: absolute; top: 9px; height: 22px; border-radius: 6px; background: #8fb7f5; overflow: hidden; text-decoration: none; min-width: 8px; }
.tk-g-bar i { position: absolute; inset: 0 auto 0 0; background: #2b6fd6; }
.tk-g-bar span { position: relative; z-index: 1; color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 22px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.tk-g-bar.s-completed { background: #9be0b8; } .tk-g-bar.s-completed i { background: #1f9d55; }
.tk-g-bar.s-waiting_approval i { background: #e2900f; } .tk-g-bar.s-waiting_approval { background: #f7d29a; }
.tk-g-bar.late { background: #f6a5a5; } .tk-g-bar.late i { background: #d92d20; }
.tk-g-bar.open-end { border-right: 2px dashed rgba(0,0,0,.3); }

/* Performance & Analytics */
.tk-pf-top { display: flex; gap: 26px; align-items: center; padding: 22px 26px; flex-wrap: wrap; }
.tk-pf-top h2 { margin: 0 0 6px; }
.tk-pf-top p { margin: 0 0 12px; max-width: 640px; }
.tk-pf-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.tk-pf-stats b { font-size: 20px; color: var(--text); margin-right: 4px; }
.tk-ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; flex: none; display: grid; place-items: center; align-content: center;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(#2fc26b calc(var(--p) * 1%), var(--surface-2) 0); }
.tk-ring b { font-size: 30px; font-weight: 800; line-height: 1; }
.tk-ring span { font-size: 12px; color: var(--muted); }
.tk-weeks { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; padding: 16px 20px 18px; align-items: end; }
.tk-week { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.tk-wbars { display: flex; gap: 4px; align-items: flex-end; height: 140px; width: 100%; justify-content: center; }
.tk-wbars i { width: 40%; max-width: 22px; border-radius: 5px 5px 0 0; min-height: 2px; }
.tk-wbars .c1, .tk-legend .c1 { background: #2b8cf6; } .tk-wbars .c2, .tk-legend .c2 { background: #2fc26b; }
.tk-legend { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.tk-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.tk-hbars { display: flex; flex-direction: column; gap: 10px; }
.tk-hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; font-size: 13.5px; }
.tk-hbar div { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.tk-hbar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.tk-hbar i.ok { background: var(--ok); } .tk-hbar i.warn { background: var(--warn); } .tk-hbar i.danger { background: var(--danger); }
.tk-hbar i.info { background: var(--info); } .tk-hbar i.neutral { background: var(--neutral); }
.tk-hbar b { text-align: right; }

/* several people picker, privacy */
.tk-multi { position: relative; }
.tk-multi-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); min-height: 40px; }
.tk-multi-box input { flex: 1; min-width: 180px; border: 0 !important; height: 30px !important; box-shadow: none !important; padding: 0 6px !important; background: transparent !important; }
.tk-multi-chips { display: contents; }
.tk-chip.person { background: var(--primary-soft); color: var(--primary-text); padding: 3px 4px 3px 4px; }
.tk-chip.person .avatar { width: 22px; height: 22px; font-size: 9px; }
.tk-chip.person button:hover { background: rgba(0,0,0,.08); }
.tk-multi .tk-pick-list { position: absolute; left: 0; right: 0; z-index: 25; }
.tk-people { display: flex; flex-direction: column; gap: 6px; }
.tk-private { background: rgba(255,255,255,.92); }
.tk-hidden { font-style: italic; color: var(--muted) !important; display: inline-flex; gap: 6px; align-items: center; }
.tk-hidden svg { width: 13px; height: 13px; }
.tk-crumbs { margin-bottom: 8px; }
.tk-head { padding: 18px 20px; }
.shell .content > .page > .tk-head h1, .shell .content .tk-head h1 { color: var(--text) !important; text-shadow: none !important; }
.shell .content > .page > .tk-head .sub, .shell .content .tk-head .sub { color: var(--muted) !important; text-shadow: none !important; }
.shell .content .notice { box-shadow: 0 6px 18px rgba(8,16,48,.15); }
.tk-sub { margin: -4px 0 14px; }

/* ---------- phones & tablets */
@media (max-width: 860px) {
  .shell[data-mode="tasks"] .content { padding: 12px 12px 90px; }
  .tk-bar1 h1 { font-size: 22px; flex: 1 0 100%; }
  .tk-filterbox { flex: 1 0 100%; order: 5; }
  .tk-gear { margin-left: 0; }
  .tk-bar2 { gap: 8px; }
  .tk-views, .tk-counters { width: 100%; }
  .tk-views button { flex: 1; text-align: center; padding: 6px 8px; }
  .tk-count { flex: 1; justify-content: center; padding: 6px 6px; font-size: 13px; }
  .tk-cols { grid-auto-columns: 84vw; }
  .tk-scroll { display: none; }
  .tk-col2 { min-height: 0; }
  .tk-cal-grid { display: none; }
  .tk-agenda { display: block; }
  .tk-g-row { grid-template-columns: 150px 1fr; }
  .tk-hbar { grid-template-columns: 100px 1fr 32px; }
  .tk-weeks { gap: 4px; padding: 12px; }
  .tk-pf-top { padding: 16px; gap: 16px; }
  .tk-ring { width: 104px; height: 104px; }
  .tk-menu { position: fixed; left: 10px !important; right: 10px !important; top: auto; bottom: 74px; min-width: 0; }
  .tk-adv-grid { padding: 14px; }
  .tk-layout { gap: 12px; }
}

/* ---------- advanced search: tidy grid (date ranges get room, no overlap) */
.tk-adv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tk-adv-grid .field { min-width: 0; }
.tk-adv-grid .f-wide { grid-column: span 2; }
.tk-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.tk-range input { width: 100%; min-width: 0; }
.tk-checks { align-content: flex-start; padding-top: 4px; }
@media (max-width: 1200px) { .tk-adv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tk-adv-grid { grid-template-columns: minmax(0, 1fr); } .tk-adv-grid .f-wide { grid-column: auto; } }

/* ---------- task conversation (chat) */
.tk-chat-card { overflow: hidden; }
.tk-chat { max-height: 620px; overflow-y: auto; padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, rgba(240,245,252,.6), rgba(240,245,252,.25)); }
html[data-mode="dark"] .tk-chat { background: transparent; }
.tk-day { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tk-day::before, .tk-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.tk-day span { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.tk-sys { display: flex; justify-content: center; }
.tk-sys span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 92%; text-align: center;
  font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.tk-sys svg { width: 13px; height: 13px; color: var(--primary); flex: none; }
.tk-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; }
.tk-msg .avatar { width: 32px; height: 32px; font-size: 11px; flex: none; margin-bottom: 2px; }
.tk-msg.mine { margin-left: auto; flex-direction: row-reverse; }
.tk-bubble-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tk-msg.mine .tk-bubble-wrap { align-items: flex-end; }
.tk-msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 0 4px; flex-wrap: wrap; }
.tk-msg-head b { font-size: 13px; color: var(--text); }
.tk-role { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary-text); background: var(--primary-soft);
  padding: 1px 7px; border-radius: 999px; }
.tk-bubble { background: #fff; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 10px 14px; box-shadow: 0 2px 8px rgba(8,16,48,.06);
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tk-msg.mine .tk-bubble { background: #E2F5E7; border-color: #B3E0C0; border-radius: 16px 4px 16px 16px; align-items: flex-end; }
html[data-mode="dark"] .tk-bubble { background: var(--surface-2); }
html[data-mode="dark"] .tk-msg.mine .tk-bubble { background: rgba(74, 222, 128, .13); border-color: rgba(74, 222, 128, .34); }
.tk-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; color: var(--text); text-align: left; align-self: stretch; }
.tk-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tk-tag svg { width: 12px; height: 12px; }
.tk-tag.t-progress { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tk-tag.t-done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tk-tag.t-submit, .tk-tag.t-time { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tk-tag.t-back { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tk-compose { border-top: 1px solid var(--border); padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.tk-compose-row { display: flex; gap: 10px; align-items: flex-end; }
.tk-compose-row textarea { flex: 1; min-height: 46px; resize: vertical; }
.tk-compose-row .btn { height: 46px; }
.tk-compose-hint { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-compose-hint svg { width: 12px; height: 12px; }
.tk-compose-hint kbd { font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; background: var(--surface-2); }
@media (max-width: 640px) { .tk-msg { max-width: 94%; } .tk-chat { padding: 12px; max-height: none; } .tk-compose { padding: 12px; } }

/* live-now counters that sit on the sky */
.shell .content .section-label .queue-line a { color: rgba(255,255,255,.85); }
.shell .content .section-label .queue-line b { color: #fff; }

/* overview tiles: coloured top edge so each figure is easy to spot */
.tk-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tk-kpi { border-top: 4px solid var(--primary) !important; }
.tk-kpi .value { font-size: 30px; }
.tk-kpi.t-open { border-top-color: #2f80ed !important; }
.tk-kpi.warn { border-top-color: #f2994a !important; }
.tk-kpi.alert { border-top-color: #eb5757 !important; }
.tk-kpi.t-done { border-top-color: #27ae60 !important; }
.tk-kpi.t-total { border-top-color: #6c5ce7 !important; }
@media (max-width: 1100px) { .tk-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tk-kpis .tk-kpi:first-child { grid-column: span 2; } }

/* ---------- task files */
.tk-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; text-align: left; max-width: 340px; width: 100%; color: var(--text); font: inherit; }
.tk-file:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(8,16,48,.08); }
.tk-file.gone { cursor: default; color: var(--muted); }
.tk-file-thumb { width: 44px; height: 44px; flex: none; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden; color: var(--primary); padding: 0; cursor: pointer; }
.tk-file-thumb.pdf { color: #c0392b; }
.tk-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tk-file-thumb svg { width: 20px; height: 20px; }
.tk-file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tk-file-meta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-file-meta span { font-size: 11.5px; color: var(--muted); }
.tk-file-open { color: var(--primary); display: grid; place-items: center; }
.tk-file-open svg { width: 16px; height: 16px; }
.tk-msg.mine .tk-file { background: rgba(255,255,255,.75); }
.tk-files { display: flex; flex-direction: column; gap: 10px; }
.tk-frow { display: flex; align-items: center; gap: 10px; }
.tk-finfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tk-finfo .linklike { background: none; border: 0; padding: 0; text-align: left; font: inherit; font-weight: 600; font-size: 13px; color: var(--primary-text);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-finfo span { font-size: 11.5px; color: var(--muted); }
.tk-facts { display: flex; gap: 2px; }
.tk-facts .tk-icon { width: 30px; height: 30px; color: var(--text-2); }
.tk-facts .tk-icon:hover { background: var(--surface-2); }
.tk-facts .tk-icon.danger { color: var(--danger); }
.tk-clip { height: 46px; width: 46px; padding: 0; display: grid; place-items: center; }
.tk-export { white-space: nowrap; }
.tk-pending { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-pend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 6px 4px 10px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface-2); }
.tk-pend svg { width: 13px; height: 13px; }
.tk-pend button { border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); padding: 2px; }
.sidebar-copy { text-align: center; letter-spacing: .02em; }
