:root {
  --color-inverse: #ffffff;
  --color-text: #202022;
  --color-selected: #e6e6e6;
  --color-muted: #77777d;
  --color-canvas: #f5f5f5;
  --color-faint: #96969c;
  --color-slate-soft: #eeeef0;
  --color-subtle: #f8f8f8;
  --color-teal: #269b91;
  --color-line: #e8e8e8;
  --color-surface: #ffffff;
  --color-border: #d4d4d4;
  --color-blue: #0c3cb9;
  --color-blue-bright: #508af2;
  --color-blue-soft: #e5f1ff;
  --color-blue-text: #2c65a8;
  --color-amber: #886613;
  --color-amber-soft: #fff0c4;
  --color-purple: #7942b4;
  --color-purple-soft: #f0e6f9;
  --color-green: #137a48;
  --color-green-soft: #ddf6e5;
  --color-red: #c43c3c;
  --color-reply: #f0f5fc;
  --color-closed: #8d8d93;
  --radius-6: 6px;
  --radius-8: 8px;
  --radius-10: 10px;
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-99: 99px;
  --shadow-pop: 0 8px 28px rgba(32, 32, 34, 0.12);
  --font: "Roboto", "Segoe UI", sans-serif;
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  background: var(--color-canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
a { color: inherit; text-decoration: none; }
img { display: block; }

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  display: block;
}
.icon-14 { width: 14px; height: 14px; }
.icon-12 { width: 12px; height: 12px; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }
.icon-22 { width: 22px; height: 22px; }

.app {
  height: 100vh;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--color-canvas);
}
body[data-mode="public"] .app,
body[data-mode="login"] .app,
body[data-mode="change-password"] .app,
body[data-mode="forgot"] .app,
body[data-mode="reset-password"] .app { display: none; }
body:not([data-mode="public"]) .public { display: none; }
body:not([data-mode="login"]) #login { display: none; }
body:not([data-mode="change-password"]) #change-password { display: none; }
body:not([data-mode="forgot"]) #forgot-password { display: none; }
body:not([data-mode="reset-password"]) #reset-password { display: none; }

.sidebar {
  width: 248px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 16px 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--color-canvas);
}
.sidebar-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.sidebar-head .brand { flex: 1; min-width: 0; }
.sidebar-toggle,
.sidebar-close,
.sidebar-backdrop { display: none; }
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-foot { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.brand {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-text);
}
.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--color-text);
  color: var(--color-inverse);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
}
.brand-mark.is-logo {
  background: transparent;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand strong {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand .icon-14 { color: var(--color-muted); flex-shrink: 0; }
.rail {
  display: none;
}
.rail-brand, .avatar {
  display: grid;
  place-items: center;
  border-radius: var(--radius-99);
  color: var(--color-inverse);
  font-weight: 500;
  letter-spacing: 0;
}
.rail-brand {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-8);
  background: var(--color-text);
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
}
.rail-nav, .rail-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.rail-nav { gap: 12px; }
.rail-spacer { flex: 1; }
.rail-btn, .icon-btn {
  border: 0;
  background: transparent;
  color: var(--color-text);
  display: grid;
  place-items: center;
  padding: 0;
}
.rail-btn {
  width: 36px;
  height: 40px;
  border-radius: var(--radius-8);
}
.rail-foot .rail-btn { height: 36px; }
.rail-btn:hover, .icon-btn:hover, .nav-link:hover, .text-btn:hover { background: rgba(32, 32, 34, 0.04); }
.rail-btn.is-active { background: var(--color-selected); }
body[data-rail="admin"] .rail-btn[data-rail="admin"],
body[data-rail="inbox"] .rail-btn[data-rail="inbox"],
body[data-rail="reports"] .rail-btn[data-rail="reports"],
body[data-rail="client"] .rail-btn[data-rail="client"] { background: var(--color-selected); }
body[data-nav="client"] .rail-btn[data-rail="building"],
body[data-nav="client"] .rail-btn[data-rail="admin"] { display: none; }

.avatar { font-size: 12px; line-height: 16px; flex: 0 0 auto; }
.avatar-32 { width: 32px; height: 32px; flex-basis: 32px; }
.avatar-28 { width: 28px; height: 28px; flex-basis: 28px; font-size: 10.5px; line-height: 14px; }
.avatar-sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 10.5px; }
.bg-teal { background: var(--color-teal); }
.bg-purple { background: var(--color-purple); }
.bg-blue { background: var(--color-blue-bright); }
.bg-red { background: var(--color-red); }
.bg-ink { background: var(--color-text); }
.bg-green { background: var(--color-green); }

.workspace { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 24px 8px 48px;
}
.identity {
  width: 204px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: var(--radius-8);
}
.identity strong { font-size: 22px; line-height: 28px; font-weight: 700; }
.identity:hover { background: transparent; }
.search {
  width: 420px;
  max-width: 42vw;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-slate-soft);
  border-radius: var(--radius-8);
  padding: 0 12px;
  color: var(--color-faint);
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  min-width: 0;
  color: var(--color-text);
}
.search input::placeholder { color: var(--color-faint); }
.grow { flex: 1; }
.top-tools { display: flex; align-items: center; gap: 16px; }
.user-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: var(--radius-99);
  color: var(--color-muted);
}
.user-menu:hover { background: var(--color-subtle); }
.icon-btn { width: 28px; height: 28px; border-radius: var(--radius-8); position: relative; }
.bell-dot {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--color-red);
  display: none;
}

.frame { flex: 1; min-height: 0; display: flex; }
.sidenav {
  width: 100%;
  flex: none;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 0;
}
body[data-nav="admin"] .sidenav[data-nav="admin"],
body[data-nav="inbox"] .sidenav[data-nav="inbox"],
body[data-nav="reports"] .sidenav[data-nav="reports"],
body[data-nav="client"] .sidenav[data-nav="client"] { display: flex; }

.nav-title {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}
.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
  height: 30px;
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-align: left;
}
.nav-label .grow { height: 1px; }
.nav-label .chev { transition: transform 0.15s ease; }
.nav-section.is-collapsed .chev { transform: rotate(-90deg); }
.nav-section.is-collapsed .nav-links { display: none; }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  height: 36px;
  border-radius: var(--radius-8);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--color-muted);
  font-weight: 400;
  border: 0;
  background: transparent;
  width: 100%;
  max-width: 100%;
  text-align: left;
  font: inherit;
  overflow: hidden;
  box-sizing: border-box;
}
.nav-link > span:not(.count) {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 20px;
}
.nav-link .count {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-muted);
}
.nav-link.is-active {
  background: var(--color-selected);
  color: var(--color-text);
  font-weight: 500;
}
body:not([data-role="client"]) #nav-manage-users,
body:not([data-role="client"]) #nav-manage-depts { display: none !important; }
.nav-divider { height: 1px; background: var(--color-line); margin: 4px 0; }
.profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
  min-height: 52px;
}
.profile .who { display: flex; flex-direction: column; min-width: 0; }
.profile .who strong { font-size: 14px; font-weight: 500; line-height: 20px; }
.profile .who span { font-size: 12px; line-height: 16px; color: var(--color-muted); }
.client-foot {
  display: none;
}
.client-foot strong {
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.client-foot span {
  font-size: 12px;
  color: var(--color-muted);
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 0 24px 8px;
  display: flex;
  overflow: hidden;
}
.panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--color-surface);
  border-radius: var(--radius-16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.view { display: none; flex-direction: column; min-height: 0; flex: 1; }
.view.is-active { display: flex; }
.panel-head {
  height: auto;
  min-height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 20px;
}
.panel-head h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-body { flex: 1; overflow: auto; padding: 24px; }
.panel-body.tight { padding-top: 8px; }

.page-intro {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.page-intro h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
}
.page-intro p, .muted { color: var(--color-muted); margin: 0; }
.faint { color: var(--color-faint); }
.caption { font-size: 12px; line-height: 16px; color: var(--color-muted); }
.strong { font-weight: 500; color: var(--color-text); }
.semibold { font-weight: 600; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--radius-6);
  background: var(--color-subtle);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}
.btn {
  height: 36px;
  border-radius: var(--radius-8);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  font-weight: 500;
}
.btn-primary { background: var(--color-text); color: var(--color-inverse); }
.btn-primary:hover { background: #111113; }
.btn-secondary { background: var(--color-surface); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-subtle); }
.btn-ghost { color: var(--color-text); }
.btn-block { width: 100%; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.metric {
  height: 122px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-12);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--color-surface);
}
.metric .label { color: var(--color-muted); }
.metric .value { font-size: 32px; line-height: 40px; font-weight: 500; }
.metric .detail { font-size: 12px; line-height: 16px; color: var(--color-muted); }

.split { display: grid; grid-template-columns: minmax(0, 1.93fr) minmax(280px, 1fr); gap: 16px; margin-bottom: 20px; }
.card {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-12);
  background: var(--color-surface);
  padding: 20px;
}
.card-head, .row-between {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head { margin-bottom: 8px; }
.card-head h3, .block-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}
.linkish {
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 16px;
  padding: 0;
}
.linkish:hover { color: var(--color-text); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0 12px; font-size: 12px; color: var(--color-muted); }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.swatch.received, .bar.received { background: var(--color-blue); }
.swatch.resolved, .bar.resolved { background: var(--color-blue-bright); }
.swatch.handling { background: var(--color-blue-bright); }
.swatch.response { background: #8d8d93; }

.chart { display: grid; grid-template-columns: 28px 1fr; height: 205px; }
.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 16px;
  padding-bottom: 22px;
}
.chart-plot { position: relative; display: flex; align-items: flex-end; min-width: 0; overflow-x: auto; }
.chart-grid {
  position: absolute;
  inset: 0 0 22px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.chart-grid i { display: block; height: 1px; background: var(--color-line); }
.chart-bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  width: 100%;
  min-width: 0;
  height: 100%;
  gap: 4px;
}
.day { display: flex; flex-direction: column; align-items: center; height: 100%; flex: 1 1 0; min-width: 36px; max-width: 72px; }
.pair { display: flex; align-items: flex-end; gap: 3px; flex: 1; min-height: 0; width: 100%; justify-content: center; }
.bar { width: clamp(8px, 40%, 18px); border-radius: 2px 2px 0 0; display: block; min-height: 2px; }
.day span { height: 22px; font-size: 12px; line-height: 22px; color: var(--color-muted); }

.stat-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.stat-row { display: grid; grid-template-columns: 84px 1fr 28px; align-items: center; gap: 12px; height: 28px; }
.track { height: 6px; background: var(--color-slate-soft); border-radius: var(--radius-99); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: inherit; }
.fill-open { background: var(--color-blue); width: 100%; }
.fill-pending, .fill-pending-c { background: var(--color-amber); width: 39.1%; }
.fill-pending-t { background: var(--color-teal); width: 39.1%; }
.fill-hold { background: var(--color-purple); width: 19.6%; }
.fill-solved { background: var(--color-green); width: 67.4%; }
.fill-closed { background: var(--color-closed); width: 52.2%; }
.stat-row b { font-weight: 500; text-align: right; }

.work-row, .kv, .attention, .activity-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 38px;
  min-width: 0;
}
.work-row { border: 0; background: transparent; width: 100%; text-align: left; padding: 0; border-radius: 8px; }
.work-row:hover { background: var(--color-subtle); }
.work-row .name { font-weight: 500; flex: 0 1 92px; min-width: 0; }
.work-row .meta { color: var(--color-muted); flex: 0 1 90px; min-width: 0; }
.kv { min-height: 28px; }
.kv span { color: var(--color-muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.field-search, .select, .text-input, .area {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-8);
  height: 40px;
}
.field-search {
  width: 280px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--color-faint);
}
.field-search input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  color: var(--color-text);
}
.text-input, .select, .area { padding: 0 12px; color: var(--color-text); }
.text-input, .area { background: var(--color-surface); }
.area { height: auto; min-height: 96px; padding: 12px; resize: vertical; display: block; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23202022' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  width: auto;
}
.date-pill { width: 164px; }
.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
table.data th {
  text-align: left;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-muted);
  background: #f6f6f7;
  height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}
table.data td {
  height: 64px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-line);
  vertical-align: middle;
}
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #fafafa; }
table.data tbody tr.is-selected { background: #f4f4f5; }
table.data tbody tr.dt-empty { cursor: default; }
table.data tbody tr.dt-empty:hover { background: transparent; }
table.data tbody tr.dt-empty td {
  height: auto;
  text-align: center;
  color: var(--color-muted);
  padding: 28px 12px;
}
/* Ticket lists follow the DataTables Tailwind skin. Other .data tables are unchanged. */
.table-wrap:has(.dt-container) {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.dt-container { width: 100%; }
.dt-container table.data thead tr:first-child th {
  height: auto;
  padding: 14px 12px;
  background: #f3f4f6;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
}
.dt-container table.data thead tr:first-child th.dt-orderable-none { cursor: default; }
.dt-container table.data thead tr:first-child .dt-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.dt-container table.data .dt-column-order {
  position: relative;
  width: 12px;
  height: 20px;
  flex: none;
}
.dt-container table.data thead tr:first-child th.dt-orderable-asc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-ordering-asc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-orderable-desc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-ordering-desc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-orderable-asc .dt-column-order::after,
.dt-container table.data thead tr:first-child th.dt-ordering-asc .dt-column-order::after,
.dt-container table.data thead tr:first-child th.dt-orderable-desc .dt-column-order::after,
.dt-container table.data thead tr:first-child th.dt-ordering-desc .dt-column-order::after {
  position: absolute;
  left: 0;
  line-height: 9px;
  font-size: 9px;
  opacity: 0.15;
}
.dt-container table.data thead tr:first-child th.dt-orderable-asc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-ordering-asc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-orderable-desc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-ordering-desc .dt-column-order::before {
  content: "▲";
  bottom: 50%;
}
.dt-container table.data thead tr:first-child th.dt-orderable-asc .dt-column-order::after,
.dt-container table.data thead tr:first-child th.dt-ordering-asc .dt-column-order::after,
.dt-container table.data thead tr:first-child th.dt-orderable-desc .dt-column-order::after,
.dt-container table.data thead tr:first-child th.dt-ordering-desc .dt-column-order::after {
  content: "▼";
  top: 50%;
}
.dt-container table.data thead tr:first-child th.dt-ordering-asc .dt-column-order::before,
.dt-container table.data thead tr:first-child th.dt-ordering-desc .dt-column-order::after { opacity: 0.6; }
.dt-container table.data thead tr:first-child th.dt-orderable-asc:hover,
.dt-container table.data thead tr:first-child th.dt-orderable-desc:hover {
  outline: 2px solid rgba(0, 0, 0, 0.05);
  outline-offset: -2px;
}
.dt-container table.data td {
  height: auto;
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.dt-container table.data tbody tr:nth-child(even) { background: #f9fafb; }
.dt-container table.data tbody tr:hover { background: #f3f4f6; }
.dt-container table.data tbody tr.is-selected { background: #eef2ff; }
.dt-container table.data tbody tr.dt-empty,
.dt-container table.data tbody tr.dt-empty:nth-child(even) { background: transparent; }
.dt-container table.data thead tr.col-filters th {
  height: auto;
  padding: 8px;
  background: #fff;
  color: var(--color-muted);
  font-weight: 400;
  border-bottom: 1px solid #e5e7eb;
  cursor: default;
}
.dt-container table.data thead tr.col-filters .text-input,
.dt-container table.data thead tr.col-filters .select {
  display: block;
  width: 0;
  min-width: 100%;
  max-width: 100%;
  height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
  font-size: 12px;
  box-shadow: none;
}
.dt-container table.data thead tr.col-filters .text-input:focus,
.dt-container table.data thead tr.col-filters .select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
#ticket-pages { gap: 0; }
#ticket-pages .page-btn {
  min-width: 36px;
  height: 36px;
  margin-left: -1px;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 500;
}
#ticket-pages .page-btn:first-child { margin-left: 0; border-radius: 8px 0 0 8px; }
#ticket-pages .page-btn:last-child { border-radius: 0 8px 8px 0; }
#ticket-pages .page-btn.is-active {
  background: #f3f4f6;
  font-weight: 600;
  z-index: 1;
}
#ticket-pages .page-btn:hover:not(:disabled):not(.is-active) {
  border-color: #d1d5db;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  z-index: 1;
}
#ticket-pages .page-btn:disabled {
  color: #d1d5db;
  opacity: 1;
  background: #fff;
}
.person { display: flex; align-items: center; gap: 10px; }
.person .sub, .subject .sub { display: block; font-size: 12px; line-height: 16px; color: var(--color-muted); font-weight: 400; }
.subject strong { font-weight: 500; }
.origin-public {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: var(--radius-99);
  background: var(--color-purple-soft);
  color: var(--color-purple);
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  vertical-align: 1px;
}
.pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--color-muted);
  font-size: 12px;
}
.pages { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.page-btn {
  min-width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--color-text);
}
.page-btn.is-active { background: var(--color-selected); }
.page-btn:disabled { color: var(--color-faint); }

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  height: 22px;
  max-width: 100%;
  padding-block: 0;
  padding-inline: 0.55em 0.85em;
  border-radius: var(--radius-99);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}
.status .icon-12 {
  flex: none;
}
.thread-tags .status {
  height: 26px;
  gap: 0.4em;
  padding-inline: 0.7em 1em;
}
.status.open, .status.invited { background: var(--color-blue-soft); color: var(--color-blue-text); }
.status.pending, .status.pending_c { background: var(--color-amber-soft); color: var(--color-amber); }
.status.pending_t { background: var(--color-blue-soft); color: var(--color-blue-text); }
.status.hold { background: var(--color-purple-soft); color: var(--color-purple); }
.status.solved, .status.active { background: var(--color-green-soft); color: var(--color-green); }
.status.closed { background: var(--color-slate-soft); color: var(--color-muted); }
.priority { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.priority.best-effort { color: var(--color-blue-text); }
.priority.important { color: var(--color-amber); }
.priority.urgent { color: #c45c12; }
.priority.critical { color: var(--color-red); }
.priority b { font-weight: 400; color: var(--color-text); }
.icon-hit {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--color-muted);
  display: grid;
  place-items: center;
}
.icon-hit:hover { background: var(--color-subtle); color: var(--color-text); }

.menu, .popover {
  position: absolute;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  min-width: 220px;
}
.menu button, .palette button, .note-list button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-line);
}
.menu-head strong { font-weight: 600; }
.menu-head small { color: var(--color-muted); font-size: 12px; line-height: 16px; }
.menu button { flex-direction: row; align-items: center; gap: 8px; }
.menu button:hover, .palette button:hover, .note-list button:hover { background: var(--color-subtle); }
.palette { width: min(420px, calc(100vw - 24px)); padding: 8px; max-width: calc(100vw - 24px); }
.palette .hint { font-size: 12px; color: var(--color-muted); padding: 4px 10px 8px; }
.note-list { width: min(320px, calc(100vw - 24px)); }
.note-list button small { color: var(--color-muted); }

.panel:has(> #view-ticket.is-active) { max-width: 1144px; }
#view-ticket .panel-head { height: auto; min-height: 56px; padding: 12px 24px; flex-wrap: wrap; }
#ticket-id, .subject .sub { overflow-wrap: anywhere; }
#view-ticket .panel-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; position: relative; }
.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.thread-col { min-width: 0; min-height: 0; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.ticket-side-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 25;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(32, 32, 34, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#view-ticket.ticket-info-open .ticket-side-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
#thread { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.thread-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 28px; }
.day-label { margin: 0; text-align: center; color: var(--color-muted); font-size: 12px; line-height: 16px; }
.msg { display: flex; gap: 10px; align-items: flex-start; align-self: flex-start; max-width: min(100%, 560px); min-width: 0; }
.msg .avatar { flex: 0 0 28px; width: 28px; height: 28px; min-width: 28px; }
.msg.reply { align-self: flex-end; flex-direction: row-reverse; }
.msg-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.msg.reply .msg-body { align-items: flex-end; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; line-height: 16px; }
.msg.reply .msg-meta { justify-content: flex-end; }
.bubble {
  background: var(--color-subtle);
  border-radius: var(--radius-12);
  padding: 12px 16px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.bubble.reply { background: var(--color-reply); }
.bubble p { margin: 0; }
.file-chip {
  margin-top: 10px;
  height: 40px;
  background: var(--color-surface);
  border-radius: var(--radius-6);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  width: max-content;
  max-width: 100%;
  font-size: 12px;
  line-height: 16px;
  overflow-wrap: anywhere;
}
.event { margin: 0; text-align: center; color: var(--color-muted); font-size: 12px; line-height: 16px; }
.note {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--color-amber-soft);
  color: var(--color-amber);
  border-radius: var(--radius-8);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 16px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.composer {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-12);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
}
.composer.is-locked {
  background: var(--color-subtle);
  min-height: 0;
}
.composer.is-locked .composer-top,
.composer.is-locked .composer-rule,
.composer.is-locked .reply-box,
.composer.is-locked .composer-files,
.composer.is-locked .composer-bar { display: none; }
.composer-locked-note {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-muted);
}
.composer-locked-note a { color: var(--color-text); font-weight: 600; }
.composer-top, .composer-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.composer-top { font-size: 12px; line-height: 16px; color: var(--color-muted); }
.composer-top #reply-to { color: var(--color-text); flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.composer-top .select { height: 28px; width: 140px; margin-left: auto; font-size: 14px; flex: none; }
.composer-rule { height: 1px; background: var(--color-line); }
.reply-box {
  flex: 1;
  min-height: 20px;
  outline: none;
  color: var(--color-text);
}
.reply-box:empty:before { content: attr(data-placeholder); color: var(--color-faint); }
.composer-bar {
  color: var(--color-muted);
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.composer-format { display: flex; align-items: center; gap: 14px; flex: none; }
.composer-count {
  font-size: 12px;
  line-height: 16px;
  color: var(--color-muted);
  flex: none;
}
.composer-count.is-full { color: var(--color-red); }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.composer-bar .icon-hit { width: 16px; height: 16px; border-radius: 0; }
.composer-bar .select {
  height: 36px;
  width: auto;
  min-width: 132px;
  max-width: 180px;
  flex: 1 1 auto;
}
.composer-bar .btn { flex: none; white-space: nowrap; }
.side-card {
  border-left: 1px solid var(--color-line);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface);
}
#view-ticket .side-card {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(332px, 92vw);
  transform: translateX(105%);
  transition: transform 0.2s ease;
  box-shadow: none;
}
#view-ticket.ticket-info-open .side-card {
  transform: translateX(0);
  box-shadow: var(--shadow-pop);
}
.side-card-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-line);
}
.side-card-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}
.side-card-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.side-block { display: flex; flex-direction: column; gap: 12px; }
.side-block + .side-block { border-top: 1px solid var(--color-line); padding-top: 12px; }
.side-card .person strong { font-weight: 600; }
.prop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  min-width: 0;
}
.prop > span { width: 94px; flex: none; color: var(--color-muted); }
.prop .select { flex: 1; width: 0; min-width: 0; height: 30px; }
.prop b { font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.prop.prop-people {
  align-items: flex-start;
  padding-top: 2px;
}
.prop.prop-people .chip-row {
  flex: 1;
  min-width: 0;
}
.prop.prop-people .caption {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.contact { display: flex; gap: 10px; align-items: center; min-height: 22px; min-width: 0; color: var(--color-text); font-size: 14px; }
.contact span { color: var(--color-text); min-width: 0; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline > div { display: flex; gap: 10px; align-items: center; }
.tl-label { display: block; font-size: 12px; line-height: 16px; color: var(--color-muted); font-weight: 400; }
.tl-value { display: block; font-size: 14px; line-height: 20px; color: var(--color-muted); }
.timeline .is-done .tl-value,
.timeline .is-done .icon { color: var(--color-green); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-36 { width: 36px; height: 36px; flex-basis: 36px; font-size: 13.5px; line-height: 18px; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.editor { display: flex; flex-direction: column; gap: 14px; }
.dept-layout, .users-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) 320px; gap: 16px; align-items: start; }
.dept-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  border-radius: var(--radius-12);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.dept-card.is-active { background: #f7f7f8; }
.dept-card .top, .chips { display: flex; align-items: center; gap: 8px; }
.dept-card .top strong { font-weight: 600; }
.dept-card .top em { font-style: normal; color: var(--color-muted); }
.chips { color: var(--color-muted); font-size: 12px; }
.toggle {
  width: 36px;
  height: 20px;
  border-radius: 99px;
  border: 0;
  background: #d0d0d4;
  padding: 2px;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.toggle i {
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: white;
  display: block;
  transition: transform 0.15s ease;
}
.toggle.is-on { background: var(--color-text); }
.toggle.is-on i { transform: translateX(16px); }
.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 6px 0;
}
.check input { margin-top: 3px; accent-color: var(--color-text); }
.help-note { font-size: 12px; color: var(--color-muted); line-height: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 500; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 4px;
  border-radius: 8px;
  background: var(--color-subtle);
}
.person-chip button { border: 0; background: transparent; color: var(--color-muted); display: grid; place-items: center; }

.banner {
  margin-top: 16px;
  background: var(--color-reply);
  border-radius: var(--radius-12);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.banner .copy { flex: 1 1 180px; min-width: 0; }
.banner strong { display: block; }
.drop {
  border: 1px solid var(--color-border);
  background: var(--color-subtle);
  border-radius: var(--radius-8);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text);
  text-align: center;
  padding: 12px;
}
.drop.drag { border-color: var(--color-text); background: var(--color-slate-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.composer-tools { display: flex; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--color-line); margin-bottom: 8px; }
.rich {
  width: 100%;
  min-height: 120px;
  border: 0;
  resize: vertical;
  outline: none;
  padding: 0;
}
.rich:empty:before { content: attr(data-placeholder); color: var(--color-faint); }
.field .composer-count { display: block; margin-top: 8px; text-align: right; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.login-card,
form.card,
dialog > form,
.composer { position: relative; }
.form-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--color-surface) 78%, transparent);
  border-radius: inherit;
}
.form-loader svg { display: block; width: 60px; height: 60px; }
.tips { display: flex; flex-direction: column; gap: 12px; }
.tip { display: flex; gap: 10px; }
.num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--color-subtle);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: none;
}
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }

.public { min-height: 100vh; background: var(--color-canvas); display: flex; flex-direction: column; }
.public-bar {
  min-height: 72px;
  height: auto;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 48px;
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.public-brand strong {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.vdiv { width: 1px; height: 24px; background: var(--color-line); }
.public-main { width: min(1120px, calc(100% - 80px)); margin: 0 auto; padding: 24px 0 32px; flex: 1; }
.public-intro { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; min-height: 80px; margin-bottom: 24px; }
.public-intro h2 { margin: 0 0 6px; font-size: 32px; line-height: 40px; font-weight: 500; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-99);
  background: var(--color-green-soft);
  color: var(--color-green);
}
.public-grid { display: grid; grid-template-columns: minmax(0, 744fr) minmax(280px, 352fr); gap: 24px; align-items: start; }
.public-foot {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(1120px, calc(100% - 80px));
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 12px;
}
.priority-picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.priority-picks button {
  height: 40px;
  border-radius: var(--radius-8);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.priority-picks button.is-on { background: var(--color-slate-soft); border-color: var(--color-text); }
.icon-tile {
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-10);
  display: grid;
  place-items: center;
}
.steps { display: flex; flex-direction: column; gap: 12px; }
.steps strong { display: block; font-weight: 500; }
.file-list { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.file-list .file-chip { margin-top: 0; color: inherit; text-decoration: none; cursor: pointer; }
.file-preview {
  display: block;
  width: max-content;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
}
.file-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16, 16, 18, 0.78);
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
}
.file-preview-modal[hidden] { display: none; }
body.file-preview-open { overflow: hidden; }
.file-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  min-height: 40px;
  flex-shrink: 0;
}
.file-preview-bar strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-preview-bar .icon-btn { color: #fff; }
.file-preview-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.file-preview-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-preview-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: var(--color-surface);
}
.file-preview-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #fff;
}
.file-preview img {
  display: block;
  max-width: min(100%, 320px);
  max-height: 240px;
  object-fit: contain;
}
.side-card .file-preview img { max-height: 140px; }
.composer-files { display: flex; flex-wrap: wrap; gap: 8px; }
.composer-files[hidden] { display: none; }
.composer-files .file-chip { margin-top: 0; }
.composer-files .file-chip img { width: 24px; height: 24px; object-fit: cover; border-radius: 4px; }
.composer-files .file-chip button {
  border: 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.attach-row {
  height: 54px;
  border: 1px solid var(--color-border);
  background: var(--color-subtle);
  border-radius: var(--radius-8);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  width: 100%;
  text-align: left;
}
.success {
  border: 1px solid var(--color-green);
  background: var(--color-green-soft);
  color: var(--color-green);
  border-radius: var(--radius-12);
  padding: 16px;
}
.form-error {
  border: 1px solid var(--color-red);
  background: #fdecec;
  color: var(--color-red);
  border-radius: var(--radius-12);
  padding: 16px;
  white-space: pre-line;
  margin-bottom: 14px;
}
dialog {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-12);
  padding: 20px;
  width: min(440px, calc(100% - 32px));
  box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(32, 32, 34, 0.28); }
dialog h3 { margin: 0 0 8px; font-size: 16px; }
dialog p { margin: 0 0 16px; color: var(--color-muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--color-text);
  color: white;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--color-muted);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sort-btn { margin-left: auto; }

.auth-screen,
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--color-canvas);
}
.login-card {
  width: min(440px, 100%);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-16);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand strong { font-size: 22px; line-height: 28px; }
.login-logo {
  display: block;
  max-height: 40px;
  max-width: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.login-notice {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.login-example {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
  font-size: 12px;
  line-height: 18px;
  word-break: break-all;
  color: var(--color-text);
}
#login-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#login-fields[hidden] { display: none !important; }
.login-card h1 { margin: 4px 0 0; font-size: 24px; font-weight: 500; line-height: 32px; }
.login-card .muted { margin: 0; }
.login-error { margin: 0; color: var(--color-red); font-size: 13px; }
.login-success { margin: 0; color: var(--color-green); font-size: 13px; }
.login-card .field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login-card .field-head label { font-weight: 400; }
.forgot-link {
  flex: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
}
.forgot-link:hover { color: var(--color-blue-text); }
.auth-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.auth-back:hover { color: var(--color-text); }
.auth-resend {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}
.auth-resend .forgot-link { font-size: inherit; }
.code-input {
  letter-spacing: 0.28em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
.login-card .btn-primary { align-self: flex-start; }
.recaptcha-slot { min-height: 78px; }

.password-field .password-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.password-field .text-input { flex: 1; min-width: 0; }
.password-toggle {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 0;
  cursor: pointer;
}
.password-toggle:hover { color: var(--color-text); }
.login-password-wrap { position: relative; display: block; width: 100%; }
.login-password-wrap .text-input { width: 100%; padding-right: 40px; }
.login-password-wrap .password-eye {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
}
.password-policy {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.password-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.password-strength-seg {
  height: 4px;
  border-radius: 999px;
  background: var(--color-line);
}
.password-strength-seg.is-on { background: var(--color-red); }
.password-strength[data-score="2"] .password-strength-seg.is-on { background: #e67e22; }
.password-strength[data-score="3"] .password-strength-seg.is-on { background: #f1c40f; }
.password-strength[data-score="4"] .password-strength-seg.is-on { background: var(--color-green, #16a34a); }
.password-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.password-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--color-muted);
}
.password-rule.is-met { color: var(--color-text); }
.password-rule svg { flex: none; }
.password-rule:not(.is-met) svg { color: var(--color-muted); }
.password-rule.is-met svg { color: var(--color-green, #16a34a); }
.change-password-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.change-password-actions .btn-primary { align-self: auto; }

body.chat-only { height: 100vh; height: 100dvh; overflow: hidden; background: var(--color-canvas); }
.chat-shell { height: 100%; padding: 16px; display: flex; min-height: 0; min-width: 0; }
.chat-shell .panel { flex: 1; min-width: 0; min-height: 0; max-width: 1144px; margin: 0 auto; }
.chat-shell .panel-head { height: auto; min-height: 56px; padding: 12px 24px; flex-wrap: wrap; }
.chat-shell .panel-head h1 { white-space: normal; overflow-wrap: anywhere; }
.chat-shell .panel-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.chat-shell .thread-col { min-width: 0; min-height: 0; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat-shell #thread { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.public-unlock { max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.chat-shell .composer { flex: none; }
.chat-shell .msg { max-width: min(100%, 560px); }
.chat-shell .bubble, .chat-shell .note, .chat-shell .file-chip, .chat-shell .file-preview { max-width: 100%; overflow-wrap: anywhere; }
.chat-shell .file-preview img { max-width: 100%; height: auto; }
.chat-shell .ticket-side-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 25;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(32, 32, 34, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#view-chat.ticket-info-open .ticket-side-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.chat-shell .side-card {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(332px, 92vw);
  border-left: 1px solid var(--color-line);
  background: var(--color-surface);
  transform: translateX(105%);
  transition: transform 0.2s ease;
  box-shadow: none;
}
#view-chat.ticket-info-open .side-card {
  transform: translateX(0);
  box-shadow: var(--shadow-pop);
}
.chat-shell .side-card .prop b { display: inline-flex; align-items: center; min-width: 0; }
.chat-shell .side-card .prop .status,
.chat-shell .side-card .prop .priority { margin: 0; }
.chat-shell .thread-tags { flex-wrap: wrap; }

@media (max-width: 1180px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .split, .dept-layout, .users-layout, .create-layout, .public-grid, .form-grid { grid-template-columns: 1fr; }
  .search { width: min(420px, 42vw); }
}

@media (max-width: 960px) {
  .sidebar-toggle { display: grid; flex: none; }
  .sidebar-close { display: grid; flex: none; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    width: min(280px, 88vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-pop);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(32, 32, 34, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .topbar {
    gap: 12px;
    padding: 8px 16px;
  }
  .search {
    width: auto;
    flex: 1;
    max-width: none;
    min-width: 0;
  }
  .top-tools { gap: 10px; }
  .role-tag { display: none; }
  .stage { padding: 0 12px 8px; }
  .panel-body { padding: 16px; }
  .panel-head { padding: 8px 16px; }
  .page-intro { flex-direction: column; gap: 8px; }
  .page-intro h2 { font-size: 20px; line-height: 28px; }
  .metrics { grid-template-columns: 1fr; }
  .field-search { width: 100%; flex: 1 1 200px; }
  .toolbar .select { flex: 1 1 140px; min-width: 0; }
  .sort-btn { margin-left: 0; }
  .date-pill { width: 100%; max-width: 220px; }
  .public-bar { padding: 12px 16px; }
  .public-main,
  .public-foot { width: min(1120px, calc(100% - 32px)); }
  .public-brand strong { max-width: min(220px, 46vw); }
  .public-intro h2 { font-size: 24px; line-height: 32px; }
  .msg { max-width: 100%; }
  table.data { min-width: 640px; }
}

@media (max-width: 640px) {
  .chat-shell { padding: 0; }
  .chat-shell .panel { border-radius: 0; max-width: none; }
  .chat-shell .panel-head { padding: 12px 16px; }
  .chat-shell .thread-col { padding: 16px; }
  .composer { padding: 12px; min-height: 0; }
  .composer-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .composer-format { width: 100%; }
  .composer-actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }
  .composer-bar .select {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
    width: 100%;
  }
  .composer-bar .btn {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }
  .composer-top {
    flex-direction: column;
    align-items: stretch;
  }
  .composer-top .select {
    margin-left: 0;
    width: 100%;
  }
  .panel { border-radius: var(--radius-12); }
  .stage { padding: 0 8px 8px; }
  .topbar { padding: 8px 12px; }
  .filters { gap: 6px; }
  .dept-card { padding: 12px; }
  .dept-card .chips { flex-wrap: wrap; }
  .editor .field,
  .form-grid .field { min-width: 0; }
  .toolbar .select,
  .toolbar .btn { flex: 1 1 100%; width: 100%; }
  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-actions .btn { width: 100%; justify-content: center; }
  .banner { align-items: flex-start; }
  .banner .btn { flex: 1 1 auto; }
  .pages { margin-left: 0; width: 100%; }
  .public-bar { padding: 12px; gap: 10px; }
  .public-intro { flex-direction: column; align-items: flex-start; }
  .public-intro h2 { font-size: 22px; line-height: 28px; }
  .priority-picks { grid-template-columns: 1fr; }
  .work-row .name,
  .work-row .meta { flex: 1 1 100%; width: auto; }
  .stat-row { grid-template-columns: 72px 1fr 28px; gap: 8px; }
  .prop { flex-direction: column; align-items: stretch; }
  .prop > span { width: auto; }
  .prop .select { width: 100%; }
  table.data { min-width: 520px; }
  .day { min-width: 28px; }
  .bar { width: clamp(6px, 36%, 14px); }
}
