@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap");
:root {
  --brand: #087f78;
  --brand-deep: #075f5b;
  --brand-soft: #e7f6f4;
  --accent: #e8ba12;
  --ink: #182321;
  --muted: #71807d;
  --bg: #f4f7f6;
  --panel: #fff;
  --line: #e5ebe9;
  --purple: #7356b8;
  --amber: #bd7a0b;
  --coral: #d34f55;
  --sidebar: 248px;
  --shadow: 0 10px 32px rgba(28, 55, 51, 0.06);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px "DM Sans",
    "Segoe UI",
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: #073f3c;
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 8px 0 30px rgba(0, 36, 33, 0.08);
}
.brand {
  height: 104px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand img {
  display: block;
  width: 172px;
  height: 44px;
  object-fit: cover;
  object-position: center 48%;
  border-radius: 7px;
}
.brand-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a8ceca;
  margin: 3px 0 0 5px;
}
.nav {
  padding: 22px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}
.nav-section {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6fa39e;
  padding: 15px 13px 7px;
}
.nav-item {
  min-height: 44px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #c9dddb;
  padding: 0 12px;
  font-weight: 500;
  transition: 0.18s;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(90deg, #0b8f86, #0a756f);
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.12);
}
.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 18px;
}
.nav-item small {
  margin-left: auto;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #76aaa5;
}
.nav-counter { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: #e45b4d; color: #fff; font-size: 9px; font-weight: 900; }
.nav-item.active small {
  color: #cce8e5;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding: 17px;
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  align-items: center;
  gap: 9px;
}
.avatar,
.mini-avatar,
.member-avatar,
.timeline-avatar {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #16a39a, #e1b821);
  color: #fff;
  font-weight: 700;
}
.avatar {
  width: 36px;
  height: 36px;
}
.sidebar-foot strong {
  font-size: 12px;
  display: block;
}
.sidebar-foot span {
  font-size: 10px;
  color: #88b2ae;
}
.sidebar-foot form {
  margin: 0;
}
.sidebar-foot button {
  border: 0;
  background: transparent;
  color: #9dc2be;
  cursor: pointer;
  font-size: 20px;
}
.app-shell {
  margin-left: var(--sidebar);
  min-height: 100vh;
}
.topbar {
  height: 68px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.breadcrumb {
  color: #85918f;
  font-size: 12px;
}
.breadcrumb strong {
  color: #344440;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #60716e;
  font-size: 12px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25ad73;
  box-shadow: 0 0 0 4px #e2f6ed;
}
.mini-avatar {
  width: 32px;
  height: 32px;
  margin-left: 9px;
}
.menu-button {
  display: none;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}
.content {
  max-width: 1460px;
  margin: 0 auto;
  padding: 34px 34px 60px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.page-head h1,
.ticket-title h1 {
  font-size: 29px;
  letter-spacing: -0.035em;
  margin: 5px 0 4px;
}
.page-head p,
.ticket-title p {
  margin: 0;
  color: var(--muted);
}
.eyebrow {
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.button {
  border: 1px solid transparent;
  border-radius: 9px;
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s;
}
.button:hover {
  transform: translateY(-1px);
}
.button.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 16px rgba(8, 127, 120, 0.18);
}
.button.primary:hover {
  background: var(--brand-deep);
}
.button.secondary {
  background: #eef3f1;
  color: #3e5551;
  border-color: #dfe7e4;
}
.button.ghost {
  background: #fff;
  border-color: var(--line);
  color: #536460;
}
.button.tiny {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}
.full {
  width: 100%;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.metric {
  min-height: 132px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.metric:after {
  content: "";
  position: absolute;
  inset: auto -32px -40px auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.045;
}
.metric span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.metric strong {
  display: block;
  font-size: 32px;
  letter-spacing: -0.04em;
  margin: 8px 0 2px;
}
.metric small {
  color: #93a09e;
  font-size: 10px;
}
.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}
.metric.teal {
  color: var(--brand);
}
.metric.teal .metric-icon {
  background: var(--brand-soft);
}
.metric.purple {
  color: var(--purple);
}
.metric.purple .metric-icon {
  background: #f0ecfb;
}
.metric.amber {
  color: var(--amber);
}
.metric.amber .metric-icon {
  background: #fff4df;
}
.metric.coral {
  color: var(--coral);
}
.metric.coral .metric-icon {
  background: #feebec;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 21px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-head h2,
.sticky-card h2 {
  font-size: 18px;
  margin: 4px 0 0;
}
.text-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
}
.table-wrap {
  overflow: auto;
  margin: 0 -21px -21px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th {
  text-align: left;
  background: #f8faf9;
  color: #87938f;
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 11px 16px;
  border-block: 1px solid var(--line);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1ef;
  vertical-align: middle;
  font-size: 12px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fbfdfc;
}
td strong {
  display: block;
  font-size: 12px;
}
td small {
  display: block;
  color: #929e9b;
  margin-top: 3px;
}
.ticket-number {
  color: var(--brand);
  font-weight: 700;
}
.status,
.priority {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}
.status.open {
  background: #e5f5f4;
  color: #087f78;
}
.status.in_progress {
  background: #efebfb;
  color: #6a4dac;
}
.status.waiting_customer {
  background: #fff3dc;
  color: #a46a07;
}
.status.resolved {
  background: #e3f5ec;
  color: #168157;
}
.status.closed {
  background: #edf1ef;
  color: #667572;
}
.priority.low {
  background: #eef5f1;
  color: #56816e;
}
.priority.medium {
  background: #fff4dd;
  color: #9e680e;
}
.priority.high {
  background: #ffede4;
  color: #b85a2c;
}
.priority.urgent {
  background: #fee9eb;
  color: #c53f4b;
}
.empty {
  text-align: center !important;
  padding: 55px !important;
  color: var(--muted);
}
.empty strong,
.empty span {
  display: block;
  margin-top: 7px;
}
.empty-icon {
  font-size: 28px;
  color: #aab7b3;
}
.filters-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px auto;
  gap: 10px;
  margin-bottom: 20px;
}
.search-box {
  position: relative;
}
.search-box span {
  position: absolute;
  left: 12px;
  top: 8px;
  font-size: 20px;
  color: #84928f;
}
.search-box input,
.filters-bar select {
  width: 100%;
  height: 41px;
  border: 1px solid #dce5e2;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}
.search-box input {
  padding-left: 38px;
}
.field-label {
  font-size: 11px;
  font-weight: 600;
  color: #52635f;
  display: block;
  margin: 0 0 15px;
}
.field-label em {
  color: #d34f55;
  font-style: normal;
}
.field {
  width: 100%;
  border: 1px solid #d9e3e0;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  margin-top: 7px;
  outline: none;
  transition: 0.18s;
}
.field:focus {
  border-color: #52aaa5;
  box-shadow: 0 0 0 3px rgba(8, 127, 120, 0.1);
}
textarea.field {
  resize: vertical;
  line-height: 1.55;
}
.form-layout {
  max-width: 910px;
}
.form-card {
  margin-bottom: 16px;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 8px;
}
.form-card .panel-head > div {
  display: flex;
  align-items: center;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.full-row {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.ticket-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.title-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}
.description {
  white-space: pre-wrap;
  line-height: 1.7;
  margin-top: 12px;
  background: #f8faf9;
  border-radius: 10px;
  padding: 16px;
  color: #3e4e4b;
}
.timeline-panel {
  margin-top: 18px;
}
.count-badge {
  background: #f1f5f3;
  color: #70807d;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 10px;
}
.timeline {
  margin: 8px 0 20px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  padding: 15px 0;
  border-bottom: 1px solid #edf1ef;
}
.timeline-avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
}
.timeline-body {
  background: #f8faf9;
  border-radius: 10px;
  padding: 12px;
}
.timeline-item.public .timeline-body {
  background: #edf9f7;
  border: 1px solid #d4efeb;
}
.timeline-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: #899693;
  flex-wrap: wrap;
}
.timeline-meta strong {
  color: #33433f;
  font-size: 11px;
}
.visibility {
  margin-left: auto;
  background: #fff;
  border-radius: 12px;
  padding: 3px 7px;
}
.message-text {
  white-space: pre-wrap;
  line-height: 1.55;
  margin-top: 7px;
  color: #384844;
}
.reply-box {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.compact-select {
  width: auto;
  min-width: 160px;
  margin: 0;
}
.sticky-card {
  position: sticky;
  top: 88px;
}
.ticket-facts {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 12px;
}
.ticket-facts div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 10px;
}
.ticket-facts span {
  color: var(--muted);
}
.ticket-facts strong {
  text-align: right;
}
.team-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.member-row {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.member-row:last-child {
  border-bottom: 0;
}
.member-row.disabled {
  opacity: 0.55;
}
.member-avatar {
  width: 39px;
  height: 39px;
}
.member-info strong {
  display: block;
}
.member-info span {
  color: var(--muted);
  font-size: 10px;
}
.member-info small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.member-state {
  font-size: 9px;
  border-radius: 15px;
  padding: 4px 7px;
  background: #edf1ef;
  color: #71807d;
}
.member-state.active {
  background: #e1f4eb;
  color: #128057;
}
.alert {
  border-radius: 9px;
  padding: 11px 13px;
  margin-bottom: 16px;
  font-size: 12px;
}
.alert.success {
  background: #e3f5ec;
  color: #13734f;
}
.alert.danger {
  background: #fee9eb;
  color: #ad3340;
}
.alert.warning {
  background: #fff4dd;
  color: #8b5e0d;
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}
.customer-filter {
  grid-template-columns: minmax(260px, 1fr) auto;
}
.customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.customer-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  transition: 0.18s;
}
.customer-card:hover {
  border-color: #9acbc6;
  box-shadow: 0 9px 24px rgba(22, 78, 71, 0.08);
  transform: translateY(-1px);
}
.company-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), #d9ae14);
  color: #fff;
  font-weight: 700;
}
.company-avatar.large {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 18px;
}
.customer-main > span,
.customer-main > small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.customer-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.customer-stats {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}
.customer-stats b {
  color: var(--ink);
}
.card-arrow {
  color: var(--brand);
  font-size: 18px;
}
.customer-empty {
  grid-column: 1/-1;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}
.customer-empty strong,
.customer-empty span {
  display: block;
  margin: 7px 0;
}
.customer-empty .button {
  margin-top: 12px;
}
.customer-hero {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.customer-hero h1 {
  margin: 5px 0 2px;
  font-size: 28px;
}
.customer-hero p {
  margin: 0;
  color: var(--muted);
}
.customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}
.customer-section {
  margin-top: 18px;
}
.unit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.unit-card {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 10px;
  align-items: center;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.unit-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
}
.unit-card strong,
.unit-card span,
.unit-card small {
  display: block;
}
.unit-card span,
.unit-card small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.inline-empty {
  color: var(--muted);
  font-size: 11px;
}
.inline-form {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 13px;
}
.inline-form summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
}
.inline-form form {
  margin-top: 16px;
}
.contact-row {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.contact-row:last-child {
  border: 0;
}
.contact-row strong,
.contact-row span {
  display: block;
}
.contact-row span {
  color: var(--muted);
  font-size: 10px;
}
.contact-links {
  text-align: right;
}
.company-notes {
  margin-top: 16px;
  background: #f8faf9;
  border-radius: 9px;
  padding: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  font-size: 11px;
}
.company-address {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.company-address strong,
.company-address span {
  display: block;
}
.company-address span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.lookup-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 9px;
  align-items: end;
}
.lookup-row .field {
  margin-top: 7px;
}
.lookup-status {
  display: block;
  min-height: 18px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}
.lookup-status.loading {
  color: var(--amber);
}
.lookup-status.success {
  color: #13734f;
}
.lookup-status.error {
  color: #ad3340;
}
.mini-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.mini-ticket:last-child {
  border: 0;
}
.mini-ticket strong,
.mini-ticket span {
  display: block;
}
.mini-ticket > div span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.soon-card {
  min-height: 540px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 35px;
  box-shadow: var(--shadow);
}
.soon-card h1 {
  font-size: 28px;
  margin: 8px 0;
}
.soon-card p {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 20px;
}
.soon-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 27px;
  margin-bottom: 14px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(430px, 46%) 1fr;
  background: #fff;
}
.login-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #063f3c, #087c74);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 60px;
}
.login-brand-inner {
  max-width: 520px;
  position: relative;
  z-index: 2;
}
.login-brand img {
  width: 270px;
  height: 80px;
  object-fit: cover;
  object-position: center 48%;
  border-radius: 10px;
  margin-bottom: 34px;
}
.product-tag {
  display: block;
  color: #ffe071;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.login-brand h1 {
  font-size: 37px;
  line-height: 1.15;
  letter-spacing: -0.045em;
  margin: 12px 0 16px;
}
.login-brand p {
  color: #c1dedb;
  line-height: 1.65;
  font-size: 15px;
  margin-bottom: 30px;
}
.login-feature {
  margin: 12px 0;
  color: #d8ecea;
  font-size: 12px;
}
.login-feature span {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffe071;
  margin-right: 8px;
}
.brand-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(230, 188, 21, 0.12);
  right: -260px;
  bottom: -270px;
}
.login-side {
  display: grid;
  place-items: center;
  padding: 35px;
}
.login-card {
  width: min(410px, 100%);
}
.login-card h2 {
  font-size: 28px;
  letter-spacing: -0.035em;
  margin: 8px 0;
}
.login-card > .muted {
  margin: 0 0 24px;
}
.login-help {
  display: block;
  text-align: center;
  color: #8c9996;
  margin-top: 18px;
}
.mobile-logo {
  display: none;
}
.muted {
  color: var(--muted);
}
.mobile-overlay {
  display: none;
}
@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filters-bar {
    grid-template-columns: 1fr 1fr;
  }
  .search-box {
    grid-column: 1/-1;
  }
  .ticket-layout {
    grid-template-columns: 1fr;
  }
  .sticky-card {
    position: static;
  }
  .team-layout {
    grid-template-columns: 1fr;
  }
  .customer-layout {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 42px;
  }
  .login-brand h1 {
    font-size: 32px;
  }
}
@media (max-width: 780px) {
  :root {
    --sidebar: 250px;
  }
  .sidebar {
    transform: translateX(-102%);
    transition: 0.22s;
  }
  .app-shell {
    margin-left: 0;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 27, 25, 0.45);
    z-index: 25;
  }
  .menu-button {
    display: block;
  }
  .topbar {
    padding: 0 18px;
  }
  .content {
    padding: 24px 17px 45px;
  }
  .online-label {
    display: none;
  }
  .page-head,
  .ticket-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .customer-grid,
  .unit-grid {
    grid-template-columns: 1fr;
  }
  .customer-hero {
    grid-template-columns: 54px 1fr;
  }
  .customer-hero-actions {
    grid-column: 1/-1;
  }
  .company-avatar.large {
    width: 54px;
    height: 54px;
  }
  .customer-ticket {
    grid-column: 1/-1;
    width: max-content;
  }
  .contact-row {
    grid-template-columns: 39px 1fr;
  }
  .contact-links {
    grid-column: 2;
    text-align: left;
  }
  .full-row {
    grid-column: auto;
  }
  table:has(td.empty) {
    min-width: 100%;
  }
  table:has(td.empty) thead {
    display: none;
  }
  table:has(td.empty) tbody,
  table:has(td.empty) tr,
  table:has(td.empty) td {
    display: block;
    width: 100%;
  }
  .login-page {
    grid-template-columns: 1fr;
    background: linear-gradient(145deg, #063f3c, #087c74);
    padding: 20px;
  }
  .login-brand {
    display: none;
  }
  .login-side {
    padding: 0;
  }
  .login-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 25px 70px rgba(0, 25, 22, 0.3);
  }
  .mobile-logo {
    display: block;
  }
  .mobile-logo img {
    width: 190px;
    height: 55px;
    object-fit: cover;
    object-position: center 48%;
    border-radius: 8px;
    margin-bottom: 22px;
  }
}
@media (max-width: 520px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .filters-bar {
    grid-template-columns: 1fr;
  }
  .search-box {
    grid-column: auto;
  }
  .form-actions,
  .reply-actions {
    flex-direction: column-reverse;
  }
  .form-actions .button,
  .reply-actions .button,
  .compact-select {
    width: 100%;
  }
  .lookup-row {
    grid-template-columns: 1fr;
  }
  .member-row {
    grid-template-columns: 39px 1fr;
  }
  .member-state,
  .member-row form {
    grid-column: 2;
  }
  .sidebar-foot {
    padding-bottom: calc(17px + env(safe-area-inset-bottom));
  }
}
.sla-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.sla-badge.ok, .sla-badge.completed { background: #e9f8f3; color: #087f5b; }
.sla-badge.warning { background: #fff4d6; color: #9a6700; }
.sla-badge.breached { background: #ffebe9; color: #c4382a; }
.sla-badge.untracked { background: #eef1f5; color: #667085; }
.sla-summary {
  margin: -8px 0 22px;
  padding: 14px 18px;
  border: 1px solid #dfe5ea;
  border-left: 4px solid #1d9a88;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #667085;
  font-size: 13px;
}
.sla-summary > div { display: flex; align-items: center; gap: 10px; }
.sla-summary strong { color: #25313c; }
.sla-summary.warning { border-left-color: #e0a100; }
.sla-summary.breached { border-left-color: #d94a3a; }
.sla-summary.completed { border-left-color: #16845f; }
@media (max-width: 640px) {
  .sla-summary, .sla-summary > div { align-items: flex-start; flex-direction: column; }
}
.view-actions, .quick-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view-actions .active { border-color: #159489; color: #087f78; background: #eaf8f6; }
.filters-bar.advanced { grid-template-columns: minmax(260px, 1.8fr) repeat(6, minmax(140px, 1fr)) auto auto; }
.ticket-quick-actions { margin: 0 0 22px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.ticket-quick-actions > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.quick-buttons form { margin: 0; }
.success-action { color: #087f5b; border-color: #a8dcc9; background: #effaf6; }
.worklog-form { display: flex; align-items: flex-end; gap: 12px; }
.worklog-form .field-label:first-of-type { width: 130px; }
.worklog-form .grow { flex: 1; }
.time-total { background: #eaf8f6; color: #087f78; padding: 7px 11px; border-radius: 9px; font-weight: 800; }
.worklog-list { margin-top: 15px; border-top: 1px solid #e9edf0; }
.worklog-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid #eef1f3; font-size: 12px; }
.worklog-list span { color: #74808b; text-align: right; }
.board-filters { padding: 14px; margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.board-filters select { min-width: 190px; }
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 12px; }
.kanban-column { min-width: 260px; background: #f1f4f6; border: 1px solid #e2e7ea; border-radius: 14px; overflow: hidden; }
.kanban-column > header { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-bottom: 1px solid #dfe5e8; }
.kanban-column > header > strong { background: #fff; color: #68747e; border-radius: 999px; padding: 3px 8px; font-size: 12px; }
.kanban-stack { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.kanban-card { display: block; padding: 14px; color: inherit; background: #fff; border: 1px solid #e3e8eb; border-radius: 11px; box-shadow: 0 2px 6px rgba(28,45,55,.04); transition: transform .15s ease, box-shadow .15s ease; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 7px 18px rgba(28,45,55,.09); }
.kanban-card-top, .kanban-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kanban-card h3 { margin: 12px 0 5px; font-size: 14px; line-height: 1.4; }
.kanban-card p { margin: 0 0 13px; color: #77838d; font-size: 12px; }
.kanban-card-meta { font-size: 11px; color: #66727d; }
.kanban-empty { padding: 22px 10px; color: #8a949c; text-align: center; font-size: 12px; }
@media (max-width: 1050px) {
  .filters-bar.advanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-bar.advanced .search-box { grid-column: 1 / -1; }
  .ticket-quick-actions { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) {
  .view-actions { width: 100%; }
  .view-actions .button { flex: 1; justify-content: center; }
  .filters-bar.advanced { grid-template-columns: 1fr; }
  .filters-bar.advanced .search-box { grid-column: auto; }
  .worklog-form { align-items: stretch; flex-direction: column; }
  .worklog-form .field-label:first-of-type { width: auto; }
  .worklog-list > div { flex-direction: column; }
  .worklog-list span { text-align: left; }
}
.notification-button { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #dfe5e8; border-radius: 10px; color: #50606b; background: #fff; font-size: 19px; }
.notification-button:hover, .notification-button.active { color: #087f78; border-color: #9bd7d1; background: #eefaf8; }
.notification-button > span { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; background: #dc493a; color: #fff; font-size: 9px; font-weight: 900; }
.notification-list { overflow: hidden; }
.notification-row { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 17px 20px; border-bottom: 1px solid #edf0f2; }
.notification-row:last-child { border-bottom: 0; }
.notification-row.unread { background: #f2fbfa; }
.notification-mark { width: 7px; height: 7px; border-radius: 999px; background: #cbd2d7; }
.notification-row.unread .notification-mark { background: #0c978b; box-shadow: 0 0 0 4px #dff5f2; }
.notification-row p { margin: 4px 0; color: #5f6b75; }
.notification-row span { color: #929ba3; font-size: 11px; }
.attachment-form { display: flex; align-items: stretch; gap: 12px; }
.attachment-drop { position: relative; flex: 1; padding: 15px 18px; border: 1px dashed #b9c9ce; border-radius: 11px; background: #f8fbfb; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.attachment-drop:hover { border-color: #45aaa1; background: #f0faf8; }
.attachment-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attachment-drop strong { color: #087f78; }
.attachment-drop span { color: #7b8790; font-size: 11px; }
.attachment-list { margin-top: 14px; display: grid; gap: 8px; }
.attachment-list a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #e4e9ec; border-radius: 10px; color: inherit; }
.attachment-list a:hover { border-color: #a9d9d4; background: #f4fbfa; }
.attachment-list a > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.attachment-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-list span { color: #7b8790; font-size: 11px; }
.attachment-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #e7f7f4; color: #087f78 !important; font-size: 18px !important; }
@media (max-width: 640px) {
  .notification-row { grid-template-columns: 8px 1fr; }
  .notification-row form { grid-column: 2; }
  .attachment-form { flex-direction: column; }
}
.client-sidebar { background: linear-gradient(180deg, #063f42 0%, #07585a 100%); }
.client-login-brand { background: linear-gradient(145deg, #064d50, #087f78); }
.client-staff-link { display: block; margin-top: 18px; text-align: center; color: #66747e; font-size: 12px; }
.client-staff-link:hover { color: #087f78; }
.client-metrics { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 16px; margin-bottom: 22px; }
.client-ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.client-attachment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.client-attachment-form small { color: #849099; }
@media (max-width: 900px) {
  .client-ticket-layout { grid-template-columns: 1fr; }
  .client-metrics { grid-template-columns: 1fr; }
}

/* Caixa de entrada ZapResponder */
.chat-page-head { margin-bottom: 16px; }
.chat-page-actions { display: flex; align-items: center; gap: 8px; }
.chat-live-status { display: inline-flex; align-items: center; gap: 6px; color: #63757c; font-size: 10px; font-weight: 800; }
.chat-live-status i { width: 7px; height: 7px; border-radius: 50%; background: #1eb980; box-shadow: 0 0 0 4px rgba(30,185,128,.12); }
.chat-live-status.connecting i { background: #d49b2e; box-shadow: 0 0 0 4px rgba(212,155,46,.14); animation: livePulse 1.4s ease-in-out infinite; }
.chat-live-status.offline { color: #a75a52; }
.chat-live-status.offline i { background: #d05c52; box-shadow: 0 0 0 4px rgba(208,92,82,.12); }
.live-update-button { border-color: #8bd3c9; background: #e2f6f2; color: #087f78; animation: livePulse 1.6s ease-in-out infinite; }
.live-update-button[hidden] { display: none; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 5px rgba(13,148,136,.10); } }
.chat-shell { min-height: 640px; height: calc(100vh - 190px); display: grid; grid-template-columns: 350px minmax(0, 1fr); overflow: hidden; border: 1px solid #dde5e8; border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(26, 54, 63, .07); }
.chat-list-panel { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid #e3e9eb; background: #fbfcfc; }
.chat-search { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid #e8edef; }
.chat-search .field { min-width: 0; }
.chat-search-clear { width: 34px; height: 34px; display: grid; place-items: center; align-self: center; flex: 0 0 auto; border-radius: 9px; color: #77868d; font-size: 20px; line-height: 1; }
.chat-search-clear:hover { background: #edf4f3; color: #087f78; }
.chat-filters { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid #e8edef; }
.chat-filters a { padding: 7px 9px; border-radius: 8px; color: #72808a; font-size: 11px; font-weight: 800; }
.chat-filters a:hover, .chat-filters a.active { background: #e5f5f3; color: #087f78; }
.chat-scope-filters { overflow-x: auto; padding-bottom: 4px; border-bottom: 0; }
.chat-scope-filters a { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap; }
.chat-scope-filters b { display: inline-grid; min-width: 18px; height: 18px; place-items: center; padding: 0 5px; border-radius: 999px; background: #edf2f3; color: #62727a; font-size: 9px; }
.chat-scope-filters a.active b { background: #087f78; color: #fff; }
.chat-status-filters { overflow-x: auto; }
.chat-status-filters a { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; white-space: nowrap; }
.chat-status-filters b { min-width: 17px; height: 17px; display: inline-grid; place-items: center; padding: 0 4px; border-radius: 999px; background: #edf2f3; color: #72808a; font-size: 8px; }
.chat-status-filters a.active b { background: rgba(8,127,120,.12); color: #087f78; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-list-item { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; gap: 11px; align-items: center; padding: 14px; border-bottom: 1px solid #edf1f2; color: inherit; }
.chat-list-item:hover { background: #f1f8f7; }
.chat-list-item.active { background: #e7f6f4; box-shadow: inset 3px 0 #0b8d83; }
.chat-list-item.unread:not(.active) { background: #f0faf8; }
.chat-list-item.unread .chat-summary strong { font-weight: 900; }
.chat-unread-count { min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: #0d9488; color: #fff; font-size: 9px; font-weight: 900; }
.chat-list-meta { min-width: 38px; align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 7px; padding: 2px 0; }
.chat-list-meta time { color: #87949a; font-size: 8px; font-weight: 700; white-space: nowrap; }
.chat-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #0d9488, #086e69); color: #fff; font-weight: 900; }
.chat-avatar.large { width: 46px; height: 46px; }
.chat-summary { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-summary strong, .chat-summary small, .chat-summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-summary strong { color: #26363d; font-size: 13px; }
.chat-summary small { color: #7f8b93; font-size: 10px; }
.chat-summary > span { color: #68757e; font-size: 11px; }
.chat-summary b { margin-top: 2px; color: #087f78; font-size: 9px; font-weight: 800; }
.chat-summary b.unassigned { color: #a56c20; }
.chat-state { width: 7px; height: 7px; border-radius: 50%; background: #aab4ba; }
.chat-state.open { background: #14a38f; box-shadow: 0 0 0 4px #dff5f1; }
.chat-empty-list { padding: 35px 20px; color: #89949b; text-align: center; font-size: 12px; }
.chat-conversation-panel { min-width: 0; display: flex; flex-direction: column; background: linear-gradient(rgba(244, 248, 248, .94), rgba(244, 248, 248, .94)), radial-gradient(circle at 10px 10px, #cee0dd 1px, transparent 1px); background-size: auto, 20px 20px; }
.chat-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 13px 18px; border-bottom: 1px solid #dfe6e8; background: rgba(255,255,255,.96); }
.chat-contact { min-width: 210px; display: flex; align-items: center; gap: 12px; flex: 1 1 220px; }
.chat-contact > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-contact strong, .chat-contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact span { color: #75828b; font-size: 11px; }
.chat-contact em { color: #087f78; font-size: 10px; font-style: normal; font-weight: 800; }
.chat-header-actions { max-width: 100%; display: flex; align-items: center; justify-content: flex-end; flex: 1 1 440px; gap: 7px; flex-wrap: wrap; }
.chat-header-actions .button { padding: 8px 10px; font-size: 10px; white-space: nowrap; }
.chat-header-actions details { position: relative; }
.chat-header-actions summary { list-style: none; cursor: pointer; }
.chat-header-actions summary::-webkit-details-marker { display: none; }
.chat-name-form { position: absolute; z-index: 4; top: 44px; right: 0; width: 280px; display: flex; gap: 8px; padding: 12px; border: 1px solid #dce4e7; border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(28, 51, 59, .16); }
.chat-transfer-form { position: absolute; z-index: 4; top: 44px; right: 0; width: 310px; display: flex; gap: 8px; padding: 12px; border: 1px solid #dce4e7; border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(28, 51, 59, .16); }
.owner-badge { padding: 8px 11px; border-radius: 9px; background: #ddf5ef; color: #087f78; font-size: 11px; font-weight: 900; }
.danger-outline { color: #b94336; border-color: #e7b8b2; background: #fff8f7; }
.danger-outline:hover { background: #fbeae8; }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble { display: flex; }
.chat-bubble.outbound { justify-content: flex-end; }
.chat-bubble > div { max-width: min(72%, 680px); padding: 10px 12px 7px; border: 1px solid #dce5e7; border-radius: 5px 14px 14px 14px; background: #fff; box-shadow: 0 2px 6px rgba(36, 59, 66, .05); }
.chat-bubble.outbound > div { border-color: #bfe4df; border-radius: 14px 5px 14px 14px; background: #dff5f1; }
.chat-bubble.failed > div { border-color: #efb6b3; background: #fff0ef; }
.chat-bubble p { margin: 0; color: #293a41; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble footer { margin-top: 5px; color: #839097; font-size: 9px; text-align: right; }
.delivery-status { display: inline-flex; align-items: center; gap: 3px; margin-left: 7px; font-weight: 800; }
.delivery-status.sent { color: #087f78; }
.delivery-status.pending { color: #b27913; }
.delivery-status.failed { color: #c63f3a; cursor: help; }
.chat-bubble a { display: inline-block; margin-top: 6px; color: #087f78; font-size: 11px; font-weight: 800; }
.chat-bubble .chat-media-image { display: block; margin: 0 0 7px; }
.chat-media-image img { display: block; width: min(360px, 100%); max-height: 320px; object-fit: cover; border-radius: 10px; background: #eef3f4; }
.chat-media-audio { display: block; width: min(340px, 100%); margin: 3px 0 7px; }
.chat-media-video { display: block; width: min(380px, 100%); max-height: 340px; margin-bottom: 7px; border-radius: 10px; background: #172126; }
.chat-bubble .chat-file-card { display: flex; align-items: center; gap: 10px; min-width: min(300px, 100%); margin: 2px 0 7px; padding: 10px; border: 1px solid #d5e2e4; border-radius: 10px; background: rgba(255,255,255,.72); text-decoration: none; }
.chat-file-card > span { display: grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #e1f3f0; font-size: 17px; }
.chat-file-card div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-file-card strong { overflow: hidden; color: #263940; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-card small { color: #7a898f; font-size: 9px; font-weight: 600; }
.message-type { display: inline-block; margin-bottom: 5px; padding: 3px 7px; border-radius: 999px; background: #edf3f4; color: #64737c; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.chat-no-messages, .chat-placeholder { margin: auto; color: #829097; text-align: center; }
.chat-placeholder { display: grid; place-items: center; }
.chat-placeholder > span { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; background: #dff2ef; color: #087f78; font-size: 28px; }
.chat-placeholder h2 { margin: 0 0 6px; color: #3e5058; }
.chat-placeholder p { margin: 0; }
.chat-composer-wrap { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: end; border-top: 1px solid #dce5e7; background: rgba(255,255,255,.97); }
.chat-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px; padding: 13px 16px 13px 8px; }
.chat-composer-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.chat-composer-field small { padding-left: 3px; color: #87939a; font-size: 9px; }
.chat-composer textarea { resize: none; }
.chat-media-menu { align-self: center; padding-left: 16px; }
.chat-media-menu > summary { list-style: none; white-space: nowrap; }
.chat-media-menu > summary::-webkit-details-marker { display: none; }
.chat-media-form { position: absolute; z-index: 8; left: 16px; bottom: calc(100% - 4px); display: grid; width: min(390px, calc(100% - 32px)); gap: 10px; padding: 16px; border: 1px solid #d5e1e3; border-radius: 14px; background: #fff; box-shadow: 0 16px 42px rgba(29,55,62,.2); }
.chat-media-form small { color: #718087; font-size: 10px; }
.chat-media-form .button { justify-self: end; }
.chat-closed-banner { padding: 18px; border-top: 1px solid #dce5e7; background: #fff; color: #78858d; text-align: center; font-weight: 800; }
@media (max-width: 1050px) {
  .chat-shell { grid-template-columns: 300px minmax(0,1fr); }
  .chat-header { align-items: flex-start; flex-direction: column; }
  .chat-header-actions { width: 100%; }
}
@media (max-width: 780px) {
  .chat-shell { height: auto; min-height: 0; grid-template-columns: 1fr; overflow: visible; }
  .chat-list-panel { max-height: 360px; border-right: 0; border-bottom: 1px solid #dfe6e8; }
  .chat-conversation-panel { min-height: 620px; }
  .chat-bubble > div { max-width: 88%; }
  .chat-composer-wrap { grid-template-columns: 1fr; }
  .chat-media-menu { padding: 10px 12px 0; }
  .chat-composer { padding: 9px 12px 12px; }
  .chat-header-actions { flex-wrap: wrap; }
}

/* Rolagem consistente e controles compactos */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.timeline, .chat-messages, .chat-list, .attachment-list, .worklog-list, .notification-list, .table-wrap { scrollbar-width: auto; scrollbar-color: #9db9b6 #edf3f3; }
.timeline::-webkit-scrollbar, .chat-messages::-webkit-scrollbar, .chat-list::-webkit-scrollbar, .attachment-list::-webkit-scrollbar, .worklog-list::-webkit-scrollbar, .notification-list::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.timeline::-webkit-scrollbar-track, .chat-messages::-webkit-scrollbar-track, .chat-list::-webkit-scrollbar-track, .attachment-list::-webkit-scrollbar-track, .worklog-list::-webkit-scrollbar-track, .notification-list::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: #edf3f3; border-radius: 999px; }
.timeline::-webkit-scrollbar-thumb, .chat-messages::-webkit-scrollbar-thumb, .chat-list::-webkit-scrollbar-thumb, .attachment-list::-webkit-scrollbar-thumb, .worklog-list::-webkit-scrollbar-thumb, .notification-list::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { border: 2px solid #edf3f3; border-radius: 999px; background: #8ba9a6; }
.timeline { max-height: clamp(300px, 50vh, 540px); margin-bottom: 14px; padding-right: 8px; overflow-y: scroll; overscroll-behavior: contain; scrollbar-gutter: stable; }
.timeline-item { padding: 11px 0; }
.timeline-body { padding: 10px 12px; }
.worklog-list { max-height: 260px; padding-right: 5px; overflow-y: auto; scrollbar-gutter: stable; }
.attachment-list.scrollable-list, .attachment-list { max-height: 310px; padding-right: 5px; overflow-y: auto; scrollbar-gutter: stable; }
.notification-list { max-height: calc(100dvh - 220px); overflow-y: auto; scrollbar-gutter: stable; }
.table-wrap { max-height: min(66dvh, 720px); overflow: auto; scrollbar-gutter: stable; }
.table-wrap thead th { position: sticky; z-index: 2; top: 0; background: #f7faf9; box-shadow: 0 1px #e4e9e7; }

.compact-attachment-form { display: flex; align-items: center; gap: 7px; }
.compact-file-picker { position: relative; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 4px 8px; border: 1px solid #dbe5e6; border-radius: 9px; background: #f8fbfb; cursor: pointer; transition: .18s ease; }
.compact-file-picker:hover { border-color: #8fcfc8; background: #f1faf9; }
.compact-file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.compact-file-icon { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: #e3f5f2; color: #087f78; }
.compact-file-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.compact-file-copy { min-width: 0; display: flex; align-items: center; gap: 6px; }
.compact-file-copy strong { color: #31444a; font-size: 11px; }
.compact-file-copy small { max-width: 180px; overflow: hidden; color: #7b8a90; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.compact-file-picker.has-file { border-color: #6fc2ba; background: #eefaf8; }
.compact-upload-button { min-height: 36px; padding: 0 12px; }

.chat-shell { height: clamp(480px, calc(100dvh - 225px), 800px); min-height: 0; }
.chat-list-panel, .chat-conversation-panel { min-height: 0; overflow: hidden; }
.chat-list { min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chat-header { flex: 0 0 auto; }
.chat-messages { min-height: 0; padding: 16px 18px; overflow-y: scroll; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chat-day-divider { position: sticky; z-index: 2; top: 0; display: flex; justify-content: center; padding: 3px 0 7px; }
.chat-day-divider span { padding: 4px 10px; border: 1px solid #dfe7e8; border-radius: 999px; background: rgba(255,255,255,.94); color: #728087; font-size: 9px; font-weight: 800; box-shadow: 0 2px 6px rgba(38,61,67,.06); }
.chat-bubble > div { max-width: min(66%, 540px); padding: 8px 10px 6px; }
.chat-bubble footer { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.chat-bubble footer > span:first-child { margin-right: auto; }
.chat-media-image img { width: min(225px, 100%); max-height: 215px; object-fit: contain; border-radius: 9px; background: #f7f9f9; }
.chat-bubble > div:has(.chat-media-audio) { width: min(300px, 62vw); }
.chat-bubble > div:has(.chat-media-audio) .message-type { display: none; }
.chat-media-audio { display: block; width: 100%; min-width: 0; height: 42px; margin: 2px 0 5px; }
.chat-media-video { width: min(245px, 100%); max-height: 225px; margin-bottom: 5px; }
.chat-bubble .chat-file-card { min-width: min(240px, 100%); max-width: 290px; padding: 8px; }
.chat-composer-wrap { grid-template-columns: auto minmax(0,1fr); align-items: center; padding: 8px 10px; }
.chat-media-inline { display: flex; align-items: center; }
.chat-tool-button, .chat-send-button { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 11px; cursor: pointer; transition: .18s ease; }
.chat-tool-button { position: relative; background: transparent; color: #7b878e; }
.chat-tool-button:hover, .chat-tool-button.uploading { background: #e8f5f3; color: #087f78; }
.chat-tool-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chat-tool-button svg, .chat-send-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-composer { width: 100%; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 0; }
.chat-composer-field { padding: 7px 10px; border: 1px solid #dfe6e8; border-radius: 12px; background: #f8fafb; }
.chat-composer .field { min-height: 34px; padding: 4px 2px; border: 0; background: transparent; box-shadow: none; }
.chat-composer-field small { font-size: 8px; }
.chat-send-button { align-self: center; background: #087f78; color: #fff; box-shadow: 0 5px 14px rgba(8,127,120,.22); }
.chat-send-button:hover { transform: translateY(-1px); background: #076c67; }
.chat-send-button:disabled { cursor: wait; opacity: .72; transform: none; }
.chat-send-button.loading, .chat-tool-button.uploading { cursor: wait; opacity: .72; }
.button-spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: button-spin .7s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }

@media (max-width: 780px) {
  .chat-shell { height: auto; max-height: none; overflow: hidden; }
  .chat-list-panel { min-height: 240px; max-height: 310px; }
  .chat-conversation-panel { height: 68dvh; min-height: 500px; max-height: 680px; overflow: hidden; }
  .chat-messages { padding: 12px; }
  .chat-bubble > div { max-width: 88%; }
  .chat-composer-wrap { grid-template-columns: auto minmax(0,1fr); padding: 7px; }
  .chat-composer { padding: 0; }
  .compact-attachment-form { flex-wrap: wrap; }
  .compact-file-picker { max-width: calc(100% - 80px); }
  .timeline { max-height: 430px; }
}

/* Versão 2: filtros, cronômetro, contas e tema */
.theme-toggle { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); cursor: pointer; font-size: 17px; }
.ticket-filter-panel { display: grid; gap: 14px; padding: 4px 0 17px; border-bottom: 1px solid var(--line); }
.filter-search-row { display: grid; grid-template-columns: minmax(260px,1fr) auto auto; gap: 9px; }
.filter-search { min-width: 0; }
.status-filter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); cursor: pointer; font-weight: 700; font-size: 11px; }
.filter-chip:hover { border-color: #8ebdb8; color: var(--brand); }
.filter-chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); box-shadow: 0 4px 14px rgba(8,127,120,.12); }
.advanced-filter-box { border: 1px solid var(--line); border-radius: 12px; background: #f9fbfa; }
.advanced-filter-box summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; color: var(--ink); font-weight: 700; }
.advanced-filter-box summary span { color: var(--muted); font-size: 10px; font-weight: 500; }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(5,minmax(130px,1fr)); gap: 10px; padding: 0 14px 14px; }
.advanced-filter-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.advanced-filter-grid select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); }
.filter-result-meta { display: flex; gap: 5px; padding: 13px 2px 9px; color: var(--muted); font-size: 11px; }
.filter-result-meta strong { color: var(--ink); }
.status.queued { background: #e7f2ff; color: #28659b; }
.status.queued i { background: #3987c5; }
.status.paused { background: #f0ecff; color: #6650a5; }
.status.paused i { background: #7a63bc; }
.status.waiting_third_party { background: #fff0db; color: #996119; }
.status.waiting_third_party i { background: #d98a21; }
.timer-actions > div:first-child { display: grid; gap: 3px; }
.live-timer { color: var(--brand); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.timer-pause { border: 1px solid #d8ca87; background: #fff9da; color: #715a00; }
.success-action { border: 1px solid #70b98a; background: #eaf8ef; color: #21713e; }
.status-action-dialog { width: min(520px,calc(100vw - 28px)); padding: 0; border: 0; border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: 0 25px 90px rgba(0,0,0,.28); }
.status-action-dialog::backdrop { background: rgba(5,24,22,.58); backdrop-filter: blur(3px); }
.status-action-dialog form { padding: 22px; }
.status-action-dialog p { color: var(--muted); }
.dialog-head,.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { margin: 3px 0 0; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--bg); color: var(--muted); cursor: pointer; font-size: 22px; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
.readonly-field { min-height: 43px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.work-session-row.running { border-left: 3px solid var(--brand); padding-left: 10px; }
.company-combobox { position: relative; }
.company-picker-results { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; right: 0; max-height: 280px; padding: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 16px 40px rgba(23,52,48,.15); }
.company-picker-results button { width: 100%; display: grid; gap: 2px; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.company-picker-results button:hover { background: var(--brand-soft); }
.company-picker-results button span { color: var(--muted); font-size: 10px; }
.company-picker-results p { padding: 12px; color: var(--muted); text-align: center; }
.live-search-hint { color: var(--muted); font-size: 10px; }
.customer-filter { align-items: center; }
.customer-hero-actions { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.danger-zone { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-button { border: 1px solid #e4a2a6; background: #fff0f1; color: #ae343c; }
.edit-form-card,.account-form { width: min(760px,100%); margin: 0 auto; padding: 24px; }
.account-form-wrap { min-height: calc(100dvh - 150px); display: grid; place-items: center; }
.account-form { width: min(480px,100%); }
.account-form h1 { margin-bottom: 6px; }
.account-form > p { color: var(--muted); }
.toggle-field { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--ink); font-weight: 700; }
.member-info small { color: var(--muted); font-size: 9px; }
.simple-login { display: grid; grid-template-columns: 1fr; }
.simple-login .login-side { width: 100%; }
.recovery-logo { width: 170px; margin: 0 auto 18px; }
.login-row { display: flex; justify-content: flex-end; margin: -4px 0 4px; }
.login-row a,.login-back-link { color: var(--brand); font-size: 11px; font-weight: 700; }
.login-back-link { display: block; margin-top: 18px; text-align: center; }

[data-theme="dark"] { color-scheme: dark; --brand:#39bdb2; --brand-deep:#88ddd5; --brand-soft:#153c3a; --ink:#e8f0ef; --muted:#9eafad; --bg:#0f1717; --panel:#172222; --line:#2b3a39; --shadow:0 12px 36px rgba(0,0,0,.22); }
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .sidebar { background:#081c1b; }
[data-theme="dark"] .topbar { background:rgba(23,34,34,.96); }
[data-theme="dark"] .topbar,[data-theme="dark"] .panel,[data-theme="dark"] .login-card,[data-theme="dark"] .chat-list-panel,[data-theme="dark"] .chat-conversation-panel { border-color:var(--line); }
[data-theme="dark"] .login-card,[data-theme="dark"] .soon-card { background:var(--panel); border-color:var(--line); color:var(--ink); }
[data-theme="dark"] .field,[data-theme="dark"] select,[data-theme="dark"] textarea,[data-theme="dark"] .search-box,[data-theme="dark"] .chat-composer-field { border-color:var(--line); background:#111b1b; color:var(--ink); }
[data-theme="dark"] .field::placeholder,[data-theme="dark"] input::placeholder,[data-theme="dark"] textarea::placeholder { color:#71817f; }
[data-theme="dark"] .advanced-filter-box,[data-theme="dark"] .compact-file-picker,[data-theme="dark"] .readonly-field,[data-theme="dark"] .dialog-close { background:#111b1b; border-color:var(--line); }
[data-theme="dark"] .advanced-filter-grid select,[data-theme="dark"] .filter-chip,[data-theme="dark"] .theme-toggle,[data-theme="dark"] .company-picker-results { background:var(--panel); border-color:var(--line); color:var(--ink); }
[data-theme="dark"] .table-wrap thead th { background:#14201f; box-shadow:0 1px var(--line); }
[data-theme="dark"] table tr,[data-theme="dark"] .member-row,[data-theme="dark"] .contact-row,[data-theme="dark"] .worklog-list>div,[data-theme="dark"] .timeline-item { border-color:var(--line); }
[data-theme="dark"] tbody tr:hover,[data-theme="dark"] .customer-card:hover,[data-theme="dark"] .company-picker-results button:hover { background:#19302e; }
[data-theme="dark"] .customer-card,[data-theme="dark"] .unit-card,[data-theme="dark"] .timeline-body,[data-theme="dark"] .attachment-list a,[data-theme="dark"] .mini-ticket { background:#14201f; border-color:var(--line); color:var(--ink); }
[data-theme="dark"] .chat-messages { background:#101a1a; }
[data-theme="dark"] .chat-bubble.inbound>div { background:#203130; color:var(--ink); }
[data-theme="dark"] .chat-bubble.outbound>div { background:#14544f; color:#f2fffd; }
[data-theme="dark"] .login-side { background:var(--bg); }
[data-theme="dark"] .login-brand { background:#082b29; }
[data-theme="dark"] .danger-button { background:#3d2022; border-color:#6c363a; color:#ffadb2; }
[data-theme="dark"] .timer-pause { background:#3a3217; border-color:#695b25; color:#f4d66a; }
[data-theme="dark"] .success-action { background:#173b27; border-color:#2d6b45; color:#87dfaa; }
[data-theme="dark"] .timeline,[data-theme="dark"] .chat-messages,[data-theme="dark"] .chat-list,[data-theme="dark"] .attachment-list,[data-theme="dark"] .worklog-list,[data-theme="dark"] .notification-list,[data-theme="dark"] .table-wrap { scrollbar-color:#486562 #152321; }

/* Superfícies e textos neutros não podem herdar os brancos fixos do tema claro. */
[data-theme="dark"] .breadcrumb,
[data-theme="dark"] .topbar-actions,
[data-theme="dark"] .field-label,
[data-theme="dark"] .description,
[data-theme="dark"] .message-text,
[data-theme="dark"] .timeline-meta strong,
[data-theme="dark"] .sla-summary,
[data-theme="dark"] .sla-summary strong,
[data-theme="dark"] .kanban-card p,
[data-theme="dark"] .kanban-card-meta,
[data-theme="dark"] .notification-row p,
[data-theme="dark"] .attachment-drop span,
[data-theme="dark"] .attachment-list span,
[data-theme="dark"] .compact-file-copy strong,
[data-theme="dark"] .compact-file-copy small { color:var(--muted); }
[data-theme="dark"] .breadcrumb strong,
[data-theme="dark"] .description,
[data-theme="dark"] .message-text,
[data-theme="dark"] .timeline-meta strong,
[data-theme="dark"] .sla-summary strong,
[data-theme="dark"] .compact-file-copy strong { color:var(--ink); }
[data-theme="dark"] .button.secondary,
[data-theme="dark"] .button.ghost,
[data-theme="dark"] .notification-button { background:#14201f; border-color:var(--line); color:var(--ink); }
[data-theme="dark"] .button.secondary:hover,
[data-theme="dark"] .button.ghost:hover,
[data-theme="dark"] .notification-button:hover,
[data-theme="dark"] .notification-button.active { background:#1b302e; border-color:#3d6965; color:var(--brand); }
[data-theme="dark"] .notification-button>span { border-color:var(--panel); }
[data-theme="dark"] .search-box input,
[data-theme="dark"] .filters-bar select { background:#111b1b; border-color:var(--line); color:var(--ink); }
[data-theme="dark"] th,
[data-theme="dark"] td,
[data-theme="dark"] .reply-box,
[data-theme="dark"] .ticket-facts,
[data-theme="dark"] .worklog-list { border-color:var(--line); }
[data-theme="dark"] .description,
[data-theme="dark"] .count-badge,
[data-theme="dark"] .timeline-body,
[data-theme="dark"] .visibility,
[data-theme="dark"] .attachment-drop,
[data-theme="dark"] .compact-file-picker,
[data-theme="dark"] .sla-summary { background:#14201f; border-color:var(--line); }
[data-theme="dark"] .timeline-item.public .timeline-body,
[data-theme="dark"] .notification-row.unread,
[data-theme="dark"] .attachment-drop:hover,
[data-theme="dark"] .attachment-list a:hover,
[data-theme="dark"] .compact-file-picker:hover,
[data-theme="dark"] .compact-file-picker.has-file { background:#17312f; border-color:#35635e; }
[data-theme="dark"] .notification-row,
[data-theme="dark"] .attachment-list a { border-color:var(--line); }
[data-theme="dark"] .notification-row.unread .notification-mark { box-shadow:0 0 0 4px #19403c; }
[data-theme="dark"] .attachment-icon,
[data-theme="dark"] .compact-file-icon { background:#183936; color:var(--brand)!important; }
[data-theme="dark"] .kanban-column { background:#111b1b; border-color:var(--line); }
[data-theme="dark"] .kanban-column>header { border-color:var(--line); }
[data-theme="dark"] .kanban-column>header>strong,
[data-theme="dark"] .kanban-card { background:#1a2727; border-color:#314240; color:var(--ink); }
[data-theme="dark"] .kanban-card:hover { box-shadow:0 7px 18px rgba(0,0,0,.24); }

/* Chat: cabeçalho, lista, mensagens e compositor usam a mesma paleta escura. */
[data-theme="dark"] .chat-shell { background:var(--panel); border-color:var(--line); box-shadow:0 8px 28px rgba(0,0,0,.22); }
[data-theme="dark"] .chat-list-panel { background:#131e1e; }
[data-theme="dark"] .chat-conversation-panel { background:#101a1a; }
[data-theme="dark"] .chat-search,
[data-theme="dark"] .chat-filters,
[data-theme="dark"] .chat-list-item,
[data-theme="dark"] .chat-header,
[data-theme="dark"] .chat-composer-wrap,
[data-theme="dark"] .chat-closed-banner { border-color:var(--line); }
[data-theme="dark"] .chat-search-clear,
[data-theme="dark"] .chat-filters a,
[data-theme="dark"] .chat-list-meta time,
[data-theme="dark"] .chat-summary small,
[data-theme="dark"] .chat-summary>span,
[data-theme="dark"] .chat-contact span,
[data-theme="dark"] .chat-bubble footer,
[data-theme="dark"] .chat-no-messages,
[data-theme="dark"] .chat-placeholder,
[data-theme="dark"] .chat-composer-field small,
[data-theme="dark"] .chat-media-form small,
[data-theme="dark"] .chat-closed-banner { color:var(--muted); }
[data-theme="dark"] .chat-summary strong,
[data-theme="dark"] .chat-contact strong,
[data-theme="dark"] .chat-placeholder h2,
[data-theme="dark"] .chat-bubble p,
[data-theme="dark"] .chat-file-card strong { color:var(--ink); }
[data-theme="dark"] .chat-search-clear:hover,
[data-theme="dark"] .chat-filters a:hover,
[data-theme="dark"] .chat-filters a.active,
[data-theme="dark"] .chat-tool-button:hover,
[data-theme="dark"] .chat-tool-button.uploading { background:#1b3b38; color:var(--brand); }
[data-theme="dark"] .chat-scope-filters b,
[data-theme="dark"] .chat-status-filters b,
[data-theme="dark"] .message-type { background:#253332; color:#b2c0be; }
[data-theme="dark"] .chat-scope-filters a.active b { background:var(--brand); color:#071817; }
[data-theme="dark"] .chat-status-filters a.active b { background:#1d4541; color:var(--brand); }
[data-theme="dark"] .chat-list-item:hover { background:#182c2a; }
[data-theme="dark"] .chat-list-item.active { background:#1a3936; box-shadow:inset 3px 0 var(--brand); }
[data-theme="dark"] .chat-list-item.unread:not(.active) { background:#172d2b; }
[data-theme="dark"] .chat-state.open { box-shadow:0 0 0 4px #183b37; }
[data-theme="dark"] .chat-header,
[data-theme="dark"] .chat-composer-wrap,
[data-theme="dark"] .chat-media-form,
[data-theme="dark"] .chat-name-form,
[data-theme="dark"] .chat-transfer-form,
[data-theme="dark"] .chat-closed-banner { background:#172222; border-color:var(--line); color:var(--ink); }
[data-theme="dark"] .owner-badge { background:#183f3b; color:var(--brand); }
[data-theme="dark"] .danger-outline { background:#392020; border-color:#75403d; color:#ffaaa3; }
[data-theme="dark"] .danger-outline:hover { background:#482725; }
[data-theme="dark"] .chat-day-divider span { background:#23302f; border-color:#3a4a48; color:#c0ccca; box-shadow:0 2px 6px rgba(0,0,0,.2); }
[data-theme="dark"] .chat-bubble>div { border-color:#3a4a48; }
[data-theme="dark"] .chat-bubble.inbound>div { background:#203130; }
[data-theme="dark"] .chat-bubble.outbound>div { background:#14544f; border-color:#28736d; }
[data-theme="dark"] .chat-bubble.failed>div { background:#3b2323; border-color:#7b4240; }
[data-theme="dark"] .chat-bubble .chat-file-card { background:rgba(8,20,19,.46); border-color:#3b514f; }
[data-theme="dark"] .chat-file-card>span { background:#1a4541; }
[data-theme="dark"] .chat-file-card small { color:var(--muted); }
[data-theme="dark"] .chat-media-image img { background:#111b1b; }
[data-theme="dark"] .chat-placeholder>span { background:#183b38; color:var(--brand); }
[data-theme="dark"] .chat-composer-field { background:#101919; }
[data-theme="dark"] .chat-tool-button { color:#9aabaa; }

[data-theme="dark"] .timeline::-webkit-scrollbar-track,
[data-theme="dark"] .chat-messages::-webkit-scrollbar-track,
[data-theme="dark"] .chat-list::-webkit-scrollbar-track,
[data-theme="dark"] .attachment-list::-webkit-scrollbar-track,
[data-theme="dark"] .worklog-list::-webkit-scrollbar-track,
[data-theme="dark"] .notification-list::-webkit-scrollbar-track,
[data-theme="dark"] .table-wrap::-webkit-scrollbar-track { background:#152321; }
[data-theme="dark"] .timeline::-webkit-scrollbar-thumb,
[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb,
[data-theme="dark"] .chat-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .attachment-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .worklog-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .notification-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb { border-color:#152321; background:#486562; }

@media (max-width: 1000px) { .advanced-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 680px) { .filter-search-row { grid-template-columns: 1fr 1fr; }.filter-search { grid-column:1/-1; }.advanced-filter-grid { grid-template-columns:1fr; }.customer-hero-actions { width:100%; margin-left:0; flex-wrap:wrap; justify-content:flex-start; }.timer-actions { align-items:flex-start; }.quick-buttons { justify-content:flex-start; }.theme-toggle { width:34px; height:34px; } }
