/* OneCase app: navy side menu, soft blue-gray page, white cards, navy table headers.
   Colors are tokens; the brand hue lives in --sb-bg / --head-bg / --accent. */
:root {
  color-scheme: light;
  --bg: #EDF0F5;
  --surface: #FFFFFF;
  --surface-2: #F5F7FA;
  --surface-3: #E9EDF3;
  --ink: #14233B;
  --ink-2: #44526A;
  --ink-3: #59667C;
  --line: #DCE2EB;
  --line-strong: #C5CEDB;
  --sb-bg: #12284B;
  --sb-bg-2: #0D1F3D;
  --sb-ink: #E8EEF8;
  --sb-ink-2: #A7B6CD;
  --sb-line: rgba(232, 238, 248, 0.12);
  --sb-hover: rgba(232, 238, 248, 0.07);
  --sb-active: rgba(232, 238, 248, 0.14);
  --hl: #F5B83D;
  --head-bg: #1A3460;
  --head-ink: #F3F6FB;
  --accent: #2A62D6;
  --accent-hover: #2152BB;
  --accent-ink: #1D4FB8;
  --accent-soft: #E6EDFC;
  --ok: #1D7349;
  --ok-soft: #E0F2E8;
  --warn: #8A5300;
  --warn-soft: #FCEFD6;
  --bad: #B42318;
  --bad-soft: #FDE8E6;
  --violet: #5A37BD;
  --violet-soft: #EDE8FB;
  --info: #1D4FB8;
  --info-soft: #E6EDFC;
  --note-bg: #FFF8E5;
  --note-line: #E2C36F;
  --note-ink: #6A4B00;
  --demo-bg: #FFF3D1;
  --demo-line: #EFD48A;
  --demo-ink: #4A3500;
  --btn-bg: #2A62D6;
  --btn-bg-hover: #2152BB;
  --btn-ink: #FFFFFF;
  /* department colors, assigned in creation order */
  --d0: #2A62D6; --d1: #0E9384; --d2: #D9730D; --d3: #C4327A;
  --d4: #6941C6; --d5: #3E8E41; --d6: #A15C38; --d7: #4B5B73;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 18px 40px -18px rgba(15, 27, 45, 0.30);
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.05), 0 6px 18px -12px rgba(15, 27, 45, 0.22);
  --font-body: "IBM Plex Sans Hebrew", "IBM Plex Sans", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --font-latin: "IBM Plex Sans", "IBM Plex Sans Hebrew", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --sb-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1524; --surface: #142033; --surface-2: #192740; --surface-3: #1F2E48;
    --ink: #E6ECF5; --ink-2: #AEBBCD; --ink-3: #8F9CB1;
    --line: #263552; --line-strong: #344766;
    --sb-bg: #0A1221; --sb-bg-2: #070D19; --sb-ink: #E6ECF5; --sb-ink-2: #9EADC4;
    --head-bg: #22385F; --head-ink: #EEF3FA;
    --accent: #7DA6FF; --accent-hover: #9BBBFF; --accent-ink: #A9C4FF; --accent-soft: #1A2D52;
    --ok: #5CC490; --ok-soft: #12301F; --warn: #EDB65C; --warn-soft: #33270F; --bad: #F3897F; --bad-soft: #3A1A18;
    --violet: #B9A5FF; --violet-soft: #271F4A; --info: #A9C4FF; --info-soft: #1A2D52;
    --note-bg: #2A220E; --note-line: #6A5623; --note-ink: #EBCF89;
    --demo-bg: #2E250F; --demo-line: #5C4A1C; --demo-ink: #F1DCA2;
    --btn-bg: #7DA6FF; --btn-bg-hover: #9BBBFF; --btn-ink: #08101D;
    --d0: #6E9BFF; --d1: #2EC4B0; --d2: #F2994A; --d3: #E879B0;
    --d4: #A98BFA; --d5: #6CC070; --d6: #D29A72; --d7: #9AA9BF;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.55; }
a { color: var(--accent-ink); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.h3 { font-size: 16px; font-weight: 600; }
.h4 { font-size: 14px; font-weight: 600; margin-top: 18px; }
p { margin: 0 0 .6em; }
small, .small { font-size: 13px; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-size: .95em; }
.break { word-break: break-all; }
.bad { color: var(--bad); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-solid { background: var(--btn-bg); color: var(--btn-ink); box-shadow: 0 1px 2px rgba(15, 27, 45, .12); }
.btn-solid:hover:not(:disabled) { background: var(--btn-bg-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-3); background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 10px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; cursor: pointer; text-decoration: underline; }
.icon-btn { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.input::placeholder { color: var(--ink-3); opacity: .85; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { min-height: 32px; padding: 4px 8px; font-size: 13px; width: auto; }
.input-lg { min-height: 46px; font-size: 16px; }
textarea.input { resize: vertical; min-height: 84px; }
select.input { padding-inline-end: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.field-error { font-size: 13px; color: var(--bad); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.form { display: block; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form > .input { flex: 1 1 auto; width: auto; min-width: 0; }
.inline-form > .btn { flex: none; }
.wrap-row { flex-wrap: wrap; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 14px; font: inherit; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--head-bg); color: var(--head-ink); font-weight: 600; }
.seg-sm button { padding: 5px 12px; font-size: 13px; }
.field .seg { align-self: flex-start; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* boxes, chips */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.box { border-radius: 10px; padding: 12px 14px; margin: 12px 0; border: 1px solid; }
.box p:last-child { margin-bottom: 0; }
.box-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); }
.box-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--ink); }
.box-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ink); }
.box-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 1.6; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-neutral { background: var(--surface-3); color: var(--ink-2); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.avatar { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--head-bg); color: var(--head-ink); font-size: 13px; font-weight: 700; }
.avatar-ext { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.spinner { display: flex; align-items: center; gap: 10px; color: var(--ink-3); padding: 24px 0; justify-content: center; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.empty-title { font-weight: 600; color: var(--ink-2); }

/* department color tag */
.dept { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); min-width: 0; white-space: nowrap; }
.dept-sq { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--dc, var(--ink-3)); }
.dept-sq.ext { background: transparent; border: 2.5px solid var(--dc, var(--ink-3)); }
.dc0 { --dc: var(--d0); } .dc1 { --dc: var(--d1); } .dc2 { --dc: var(--d2); } .dc3 { --dc: var(--d3); }
.dc4 { --dc: var(--d4); } .dc5 { --dc: var(--d5); } .dc6 { --dc: var(--d6); } .dc7 { --dc: var(--d7); }
.ext-tag { font-size: 11.5px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 5px; }

/* ===== app shell: side menu + content ===== */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to left, var(--sb-bg-2) var(--sb-w), var(--bg) var(--sb-w)); }
.sb { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, var(--sb-bg), var(--sb-bg-2)); color: var(--sb-ink); padding: 18px 14px 14px; z-index: 40; }
.sb :focus-visible { outline-color: var(--hl); }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; border-bottom: 1px solid var(--sb-line); margin-bottom: 8px; color: var(--sb-ink); text-decoration: none; }
.sb-logo { flex: none; display: block; color: #FFFFFF; --logo-check: var(--sb-bg); }
.logo-body { fill: currentColor; }
.logo-check { fill: none; stroke: var(--logo-check); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand .sb-logo { color: var(--head-bg); --logo-check: #FFFFFF; }
.sb-brand-text { min-width: 0; }
.sb-name { display: block; font-family: var(--font-latin); font-weight: 700; font-size: 18px; line-height: 1.2; }
.sb-company { display: block; font-size: 12.5px; color: var(--sb-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-label { margin: 14px 10px 6px; font-size: 12px; font-weight: 600; color: var(--sb-ink-2); letter-spacing: .02em; }
.sb-link { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--sb-ink); text-decoration: none; font-weight: 500; }
.sb-link .ico { color: var(--sb-ink-2); }
.sb-link:hover { background: var(--sb-hover); }
.sb-link.on { background: var(--sb-active); font-weight: 600; }
.sb-link.on .ico { color: var(--sb-ink); }
.sb-link.on::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 4px; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--hl); }
.sb-text { flex: 1; min-width: 0; }
.sb-count { min-width: 24px; padding: 0 7px; border-radius: 999px; background: rgba(232, 238, 248, .16); color: var(--sb-ink); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.sb-count.hot, .bell-count { background: #E5484D; color: #fff; }
.sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--sb-line); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px; }
.sb-user .avatar { background: var(--hl); color: #3A2A00; }
.sb-user-text { min-width: 0; flex: 1; }
.user-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-role { display: block; font-size: 12.5px; color: var(--sb-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-out { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--sb-line); background: transparent; color: var(--sb-ink); font: inherit; font-size: 14px; cursor: pointer; }
.sb-out:hover { background: var(--sb-hover); }
.sb-backdrop { display: none; }
.content { min-width: 0; display: flex; flex-direction: column; }
.main { width: 100%; max-width: 1380px; padding: 22px 28px 64px; }

/* mobile top bar (only on small screens) */
.mbar { display: none; }
.mbar-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--sb-ink); cursor: pointer; position: relative; text-decoration: none; }
.mbar-btn:hover { background: var(--sb-hover); }
.mbar-brand { display: flex; align-items: center; gap: 8px; color: var(--sb-ink); text-decoration: none; font-family: var(--font-latin); font-weight: 700; font-size: 17px; flex: 1; }
.mbell-count { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* demo bar */
.demo-bar { background: var(--demo-bg); color: var(--demo-ink); border-bottom: 1px solid var(--demo-line); font-size: 13.5px; }
.demo-bar-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 48px; padding: 6px 28px; max-width: 1380px; }
.demo-tag { background: var(--hl); color: #3A2A00; font-weight: 700; border-radius: 6px; padding: 1px 8px; }
.demo-note { flex: 1 1 260px; }
.persona { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.persona .input { min-width: 230px; }
.demo-bar .btn-ghost { background: transparent; color: var(--demo-ink); border-color: color-mix(in srgb, var(--demo-ink) 35%, transparent); }

/* page header */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-sub { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--ink-3); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }

/* demo guide */
.guide { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.guide-steps { margin: 6px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; counter-reset: step; }
.guide-steps li { position: relative; padding: 10px 12px 10px 12px; padding-inline-start: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; counter-increment: step; }
.guide-steps li::before { content: counter(step); position: absolute; inset-inline-start: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--head-bg); color: var(--head-ink); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }

/* ===== tickets list ===== */
.list-card { padding: 0; overflow: hidden; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px 10px; }
.tabs { display: flex; gap: 3px; background: var(--surface-3); padding: 3px; border-radius: 11px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 5px; border-radius: 10px; background: var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: center; }
.tabs button.on .count { background: var(--accent-soft); color: var(--accent-ink); }
.search { display: flex; gap: 8px; flex: 1 1 320px; margin: 0; }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box .ico { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-inline-start: 38px; }
.filter { flex: 0 1 220px; }
.filter .input { min-width: 170px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 12px; padding-inline-start: 12px; padding-inline-end: 6px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pill:hover { border-color: var(--ink-3); }
.pill .n { min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink); font-size: 12.5px; font-weight: 700; text-align: center; line-height: 20px; }
.pill-bad .n { background: var(--bad-soft); color: var(--bad); }
.pill-warn .n { background: var(--warn-soft); color: var(--warn); }
.pill-violet .n { background: var(--violet-soft); color: var(--violet); }
.pill-info .n { background: var(--info-soft); color: var(--info); }
.pill[aria-pressed="true"] { background: var(--head-bg); border-color: var(--head-bg); color: var(--head-ink); }
.pill[aria-pressed="true"] .n { background: rgba(255, 255, 255, .2); color: var(--head-ink); }
.search-note { margin: 0; padding: 0 16px 12px; color: var(--ink-2); font-weight: 500; }
.list-foot { margin: 0; padding: 10px 16px 14px; color: var(--ink-3); font-size: 13px; }
.list-card > .empty { margin: 4px 16px 16px; }
.list-card > .box { margin: 4px 16px 16px; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { text-align: start; padding: 9px 12px; vertical-align: top; }
.table thead th { background: var(--head-bg); color: var(--head-ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.table thead th:first-child { border-start-start-radius: 10px; }
.table thead th:last-child { border-start-end-radius: 10px; }
.table td { border-bottom: 1px solid var(--line); }
.table tbody tr:nth-child(even) td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .input { min-width: 140px; }
.list-card .table thead th:first-child, .list-card .table thead th:last-child { border-radius: 0; }
.tickets td { padding-top: 11px; padding-bottom: 11px; }
.tickets .sub { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.ticket-row { cursor: pointer; }
.ticket-row:hover td { background: var(--accent-soft) !important; }
.ticket-row td:first-child { border-inline-start: 3px solid transparent; }
.ticket-row.is-late td:first-child { border-inline-start-color: var(--bad); }
.ticket-row.is-closed td { color: var(--ink-2); }
.c-ticket { width: 30%; min-width: 240px; }
.t-link { display: block; color: var(--ink); text-decoration: none; font-weight: 600; }
.t-link:hover .t-name { text-decoration: underline; }
.t-num { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink-3); }
.t-name { overflow-wrap: anywhere; margin-inline-start: 6px; }
.ship { display: inline-flex; align-items: center; gap: 4px; }
.ship b { font-weight: 600; }
.ship b, .c-ship .mono { white-space: nowrap; }
.c-ship { min-width: 140px; }
.copy { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: pointer; }
.copy:hover { background: var(--surface-3); color: var(--ink); }
.state { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; }
.c-state { min-width: 150px; }
.c-activity, .c-opened { white-space: nowrap; }

/* ===== ticket page ===== */
.t-head { padding: 0; overflow: hidden; }
.t-band { height: 5px; background: var(--info); }
.st-in_progress .t-band { background: var(--violet); }
.st-waiting .t-band { background: var(--hl); }
.st-closed .t-band { background: var(--ok); }
.is-late .t-band { background: var(--bad); }
.t-head-in { padding: 18px 20px 20px; }
.t-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.num-lg { font-size: 15px; color: var(--ink-3); }
.t-title { font-size: 23px; margin-bottom: 16px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; margin: 0; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.meta-grid > div { min-width: 0; }
.meta-grid dt { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.meta-grid dd { margin: 0; font-weight: 500; }
.meta-grid .span-2 { grid-column: span 2; }
.closed-box { margin-bottom: 0; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.timeline-col > .h3 { margin: 4px 0 12px; }
.side-col { position: sticky; top: 16px; }
.side-card { padding: 16px; }
.side-card > .h3 { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.side-card .field { margin-bottom: 10px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-meta { font-size: 12px; color: var(--ink-3); }
.mini-dl { margin: 0; font-size: 14px; }
.mini-dl div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.mini-dl div:last-child { border-bottom: 0; }
.mini-dl dt { color: var(--ink-3); }
.mini-dl dd { margin: 0; text-align: end; }
.timeline { list-style: none; margin: 0 0 16px; padding: 0; position: relative; }
.ev { margin-bottom: 10px; }
.ev-msg { display: flex; gap: 10px; }
.ev-msg .ev-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 14px; box-shadow: var(--shadow-sm); }
.ev-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; font-size: 14px; }
.ev-head time, .ev-label { color: var(--ink-3); font-size: 12.5px; }
.ev-kind { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 0 6px; margin-bottom: 4px; }
.ev-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.ev-sub { font-size: 13px; color: var(--ink-3); margin: 4px 0 0; }
.ev-note .ev-body { background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 12px; padding: 10px 14px; color: var(--ink); margin-inline-start: 44px; }
.note-tag { font-size: 12px; font-weight: 700; color: var(--note-ink); width: 100%; }
.ev-sys { display: flex; gap: 10px; align-items: baseline; padding: 2px 12px; padding-inline-start: 56px; font-size: 13.5px; color: var(--ink-2); }
.ev-sys p { margin: 0; }
.ev-sys-internal { color: var(--note-ink); }
.sys-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); margin-top: 6px; }
.ev-meta { color: var(--ink-3); font-size: 12px; }
.ev-closed .ev-body { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: 12px; padding: 10px 14px; margin-inline-start: 44px; }
.ev-reopen .ev-body { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: 12px; padding: 10px 14px; margin-inline-start: 44px; }
.files { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { display: block; width: 120px; height: 90px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { display: grid; place-items: center; height: 100%; font-size: 11px; padding: 4px; text-align: center; color: var(--ink-3); }
.file-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); text-decoration: none; color: var(--ink); font-size: 13px; width: fit-content; }
.composer { padding: 14px; }
.composer .seg { margin-bottom: 10px; }
.composer-internal { background: var(--note-bg); border-color: var(--note-line); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.pending-files { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.pending-files li { display: flex; align-items: center; gap: 6px; }

/* ===== new ticket ===== */
.form-grid { max-width: 920px; }
.form-card { padding: 20px; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-head .h3 { margin: 0; }
.step-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--head-bg); color: var(--head-ink); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.shipment-found p { margin-bottom: 2px; }
.history-box { margin: 10px 0 14px; font-size: 14px; }
.history-box summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.import-map { margin-top: 14px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }
.inline-card { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dept-list li { align-items: center; }

/* ===== reports ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; padding-inline-start: 20px; box-shadow: var(--shadow-sm); overflow: hidden; }
.tile::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--tone, var(--head-bg)); }
.tone-blue { --tone: var(--d0); } .tone-green { --tone: var(--ok); } .tone-violet { --tone: var(--violet); }
.tone-teal { --tone: var(--d1); } .tone-amber { --tone: var(--hl); } .tone-red { --tone: var(--bad); }
.tile-label { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.tile-value { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 0; }
.tile-note { font-size: 12.5px; color: var(--ink-2); margin: 4px 0 0; }
.num-table td.n { font-variant-numeric: tabular-nums; }
.mt { margin-top: 18px; }
a[href^="tel:"] { white-space: nowrap; }

/* ===== notifications ===== */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 6px; font: inherit; color: var(--ink); cursor: pointer; }
.notif:hover { border-color: var(--line-strong); }
.notif.unread { border-inline-start: 4px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); font-weight: 600; }
.notif-time { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* ===== sign-in pages ===== */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(180deg, var(--sb-bg) 0, var(--sb-bg-2) 300px, var(--bg) 300px); }
.narrow { width: 100%; max-width: 440px; }
.auth { box-shadow: var(--shadow); padding: 24px; }
.auth h1 { font-size: 23px; margin-top: 16px; }
.auth-links { margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.auth-links p { margin: 4px 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-family: var(--font-latin); font-weight: 700; font-size: 18px; }

/* ===== modal & toasts ===== */
.modal-back { position: fixed; inset: 0; background: rgba(10, 17, 30, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-body { padding: 18px; }
.toasts { position: fixed; bottom: 16px; inset-inline-end: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--head-bg); color: var(--head-ink); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; max-width: 360px; }
.toast-bad { background: var(--bad); color: #fff; }

/* ===== responsive ===== */
@media (max-width: 1100px) {
  .c-opened { display: none; }
  .t-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  .shell { display: block; background: var(--bg); }
  .sb { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); height: auto; transform: translateX(100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: var(--shadow); }
  .shell.nav-open .sb { transform: none; visibility: visible; transition: transform .2s ease; }
  .sb-link.on::before { inset-inline-start: -14px; }
  .shell.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 17, 30, .5); z-index: 39; border: 0; padding: 0; }
  .mbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 30; min-height: 56px; padding: 6px 10px; background: var(--sb-bg); color: var(--sb-ink); }
  .main { padding: 16px 14px 56px; }
  .demo-bar-in { padding: 6px 14px; }
  .t-grid { grid-template-columns: 1fr; }
  .side-col { position: static; order: -1; }
  .two-col { grid-template-columns: 1fr; }
  .three { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .sb, .shell.nav-open .sb { transition: none; } }
@media (max-width: 760px) {
  .tickets thead { display: none; }
  .tickets, .tickets tbody { display: block; }
  .tickets tr.ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tickets tr.ticket-row.is-late { box-shadow: inset -3px 0 0 var(--bad); }
  .tickets tr.ticket-row:nth-child(even) { background: var(--surface-2); }
  .tickets td { display: block; padding: 0; border: 0 !important; background: none !important; min-width: 0; width: auto; }
  .tickets .c-ticket { grid-column: 1 / -1; }
  .tickets .c-ship { grid-column: 1; }
  .tickets .c-state { grid-column: 2; grid-row: 2 / span 2; min-width: 0; }
  .tickets .c-state .state { flex-direction: column; align-items: flex-end; }
  .tickets .c-owner { grid-column: 1; }
  .tickets .c-activity { grid-column: 1 / -1; white-space: normal; }
  .tickets .c-activity .sub { display: inline; margin-inline-start: 8px; }
  .tickets .c-opened { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .two, .three { grid-template-columns: 1fr; }
  .list-head { padding: 12px; }
  .pills { padding: 0 12px 12px; }
  .search { flex-basis: 100%; }
  .filter { flex: 1 1 100%; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .meta-grid .span-2 { grid-column: span 2; }
  .demo-note, .persona > span { display: none; }
  .demo-bar-in { flex-wrap: nowrap; gap: 8px; min-height: 52px; }
  .persona { flex: 1; min-width: 0; }
  .persona .input { min-width: 0; width: 100%; }
  .demo-bar .btn { padding: 4px 10px; }
  .guide-steps { grid-template-columns: 1fr; }
  .ev-note .ev-body, .ev-closed .ev-body, .ev-reopen .ev-body { margin-inline-start: 0; }
  .ev-sys { padding-inline-start: 12px; }
}
