:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111111;
  --muted: #6b7280;
  --faint: #9ca3af;
  --accent: #e8573a;
  --accent-dark: #d4451e;
  --blue: #3a87c8;
  --green: #22c55e;
  --purple: #7c3aed;
  --amber: #f59e0b;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #e8863a;
  box-shadow: 0 0 0 3px rgba(232, 134, 58, 0.12);
}

label {
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.app-main {
  min-width: 0;
  padding: 22px 28px 48px;
}

.mobile-brand {
  display: none;
  margin-bottom: 16px;
}

.brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.login-brand strong {
  display: block;
  font-size: 15px;
}

.brand small,
.login-brand small,
.sidebar-user small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
}

.side-nav {
  display: grid;
  gap: 7px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px;
  border-radius: 9px;
  color: #374151;
  font-weight: 700;
}

.side-nav a.active,
.side-nav a:hover {
  background: #fef2f2;
  color: var(--accent);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: currentColor;
}

.sidebar-user {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.avatar-large {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-size: 14px;
}

.avatar-small {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.page-header,
.ticket-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header h1,
.ticket-hero h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.page-header h2,
.panel h2,
.side-panel h2,
.hero-panel h2 {
  margin: 0;
  font-size: 16px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #9ca3af;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.header-actions,
.button-row,
.composer-foot,
.channel-row,
.message-send-row,
.ticket-title-line,
.meta-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-actions-empty {
  min-width: 1px;
}

.btn {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-secondary {
  background: #fff;
  color: #374151;
  border-color: var(--line);
}

.btn-secondary:hover,
.btn-ghost:hover,
.btn-outline:hover {
  background: var(--surface-soft);
}

.btn-outline {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.inbox-button {
  position: relative;
}

.btn-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.btn-small {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 12px;
}

.full {
  width: 100%;
}

.flash {
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.flash-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.flash-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.flash-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.notice-details {
  margin: 8px 0 0 18px;
  padding: 0;
}

.panel,
.hero-panel,
.side-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.panel,
.side-panel {
  padding: 16px;
}

.soft-panel {
  background: #fcfcfd;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-head.tight {
  margin-bottom: 10px;
}

.panel-head a {
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-title-group h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
}

.dashboard-title-group > span {
  display: block;
  margin-top: 7px;
  color: #4b5563;
  font-weight: 700;
}

.dashboard-tools {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-search {
  width: min(360px, 38vw);
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dashboard-search input {
  min-height: 34px;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.dashboard-tools form {
  margin: 0;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(142px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-summary-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.dashboard-summary-card::after {
  display: none;
}

.dashboard-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-summary-card strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 29px;
  line-height: 1;
}

.dashboard-summary-card p {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.summary-open::after {
  background: var(--amber);
}

.summary-progress::after {
  background: var(--blue);
}

.summary-pending::after {
  background: var(--purple);
}

.summary-closed::after {
  background: var(--green);
}

.summary-overdue::after {
  background: var(--danger);
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(318px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.dashboard-side-stack {
  display: grid;
  gap: 16px;
}

.dashboard-ticket-table {
  min-width: 0;
  min-width: 920px;
  table-layout: auto;
  font-size: 12px;
}

.dashboard-ticket-table th,
.dashboard-ticket-table td {
  padding-left: 10px;
  padding-right: 10px;
  overflow-wrap: normal;
}

.dashboard-ticket-table th:nth-child(1),
.dashboard-ticket-table td:nth-child(1) {
  width: 10%;
}

.dashboard-ticket-table th:nth-child(2),
.dashboard-ticket-table td:nth-child(2) {
  width: 22%;
}

.dashboard-ticket-table th:nth-child(3),
.dashboard-ticket-table td:nth-child(3) {
  width: 10%;
}

.dashboard-ticket-table th:nth-child(4),
.dashboard-ticket-table td:nth-child(4) {
  width: 12%;
}

.dashboard-ticket-table th:nth-child(5),
.dashboard-ticket-table td:nth-child(5) {
  width: 9%;
}

.dashboard-ticket-table th:nth-child(6),
.dashboard-ticket-table td:nth-child(6) {
  width: 10%;
}

.dashboard-ticket-table th:nth-child(7),
.dashboard-ticket-table td:nth-child(7) {
  width: 9%;
}

.dashboard-ticket-table th:nth-child(8),
.dashboard-ticket-table td:nth-child(8) {
  width: 18%;
}

.dashboard-ticket-table td:first-child strong,
.dashboard-ticket-table td:nth-child(5),
.dashboard-ticket-table td:nth-child(7) {
  white-space: nowrap;
}

.dashboard-ticket-row:focus {
  outline: 2px solid rgba(232, 87, 58, 0.35);
  outline-offset: -2px;
}

.communication-list {
  display: grid;
  gap: 9px;
}

.communication-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.communication-item strong,
.communication-item small {
  display: block;
}

.communication-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.comm-ready {
  background: #dcfce7;
  color: #166534;
}

.comm-testing {
  background: #fffbeb;
  color: #92400e;
}

.comm-warning {
  background: #fee2e2;
  color: #991b1b;
}

.comm-muted {
  background: #f3f4f6;
  color: #4b5563;
}

.dashboard-new-ticket-modal {
  width: min(760px, calc(100vw - 28px));
}

.new-ticket-form input.is-invalid,
.new-ticket-form select.is-invalid,
.new-ticket-form textarea.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.11);
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  font-size: 34px;
}

.summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-accent {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  opacity: 0.18;
}

.summary-accent.open {
  background: var(--amber);
}

.summary-accent.progress {
  background: var(--blue);
}

.summary-accent.pending {
  background: var(--purple);
}

.summary-accent.closed {
  background: var(--green);
}

.summary-accent.overdue {
  background: var(--danger);
}

.dashboard-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 16px;
}

.tickets-grid {
  align-items: start;
}

.unmatched-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.unmatched-detail-grid {
  align-items: start;
}

.message-preview {
  max-width: 360px;
  white-space: pre-line;
}

.unmatched-table tbody tr {
  cursor: default;
}

.review-status-new {
  background: #fef2f2;
  color: #991b1b;
}

.review-status-reviewed {
  background: #f0fdf4;
  color: #166534;
}

.review-status-ignored {
  background: #f3f4f6;
  color: #4b5563;
}

.unmatched-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.unmatched-detail-list div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.unmatched-detail-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.unmatched-detail-list dd {
  margin: 4px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.unmatched-message-body {
  margin: 0 0 14px;
}

.unmatched-message-body pre {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.45;
}

.media-indicator {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-bar input {
  min-width: 250px;
}

.ticket-list.compact {
  display: grid;
  gap: 8px;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.ticket-row:hover,
.task-card:hover,
.file-row:hover {
  border-color: var(--line-strong);
  background: #fffdfb;
}

.ticket-row strong,
.ticket-row span,
.ticket-row small,
.task-card strong,
.task-card span,
.task-card small {
  display: block;
}

.ticket-row small,
.task-card small,
.file-row small {
  color: var(--muted);
  font-size: 12px;
}

.ticket-row-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.ticket-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 9px 14px;
  text-align: left;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: #fef9f5;
}

.data-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.badge,
.meta-pill,
.count-pill,
.dept-pill,
.ticket-number-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.dept-pill,
.ticket-number-pill {
  border-radius: 6px;
}

.dept-pill {
  background: var(--blue);
  color: #fff;
}

.ticket-number-pill {
  background: #dbeafe;
  color: #1d4ed8;
}

.meta-pill,
.count-pill {
  background: var(--surface-soft);
  color: #374151;
}

.count-pill.danger {
  background: #fef2f2;
  color: #991b1b;
}

.status-open {
  background: #fef3c7;
  color: #92400e;
}

.status-progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pending {
  background: #ede9fe;
  color: #5b21b6;
}

.status-closed {
  background: #dcfce7;
  color: #166534;
}

.status-blocked,
.priority-urgent {
  background: #fee2e2;
  color: #991b1b;
}

.priority-low {
  background: #f3f4f6;
  color: #4b5563;
}

.priority-medium {
  background: #eff6ff;
  color: #1d4ed8;
}

.priority-high {
  background: #fffbeb;
  color: #92400e;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-button-align {
  display: flex;
  align-items: end;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f3f4f6;
}

.login-shell {
  width: min(440px, calc(100vw - 32px));
}

.login-panel {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14);
}

.login-panel h1 {
  margin: 24px 0 8px;
  font-size: 30px;
}

.login-foot {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.crumbs a {
  color: var(--accent);
  font-weight: 800;
}

.ticket-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.ticket-hero .hero-panel {
  padding: 14px 16px;
}

.ticket-status-panel {
  min-height: 0;
}

.ticket-status-panel p,
.homeowner-card p {
  color: var(--muted);
}

.ticket-status-panel > p:not(.eyebrow) {
  margin: 0;
  line-height: 1.45;
}

.homeowner-card p {
  margin: 2px 0 0;
  line-height: 1.35;
}

.ticket-status-panel h1 {
  margin: 8px 0 4px;
  font-size: 20px;
}

.person-line {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 8px;
}

.homeowner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.homeowner-edit-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.homeowner-feedback {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fef2f2;
  color: #991b1b;
  font-size: 12px;
  line-height: 1.4;
}

.homeowner-feedback ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.homeowner-identity {
  min-width: 0;
  flex: 1;
}

.homeowner-edit-fields,
.homeowner-edit-field {
  display: none;
}

.homeowner-edit-fields {
  gap: 8px;
}

.homeowner-card.is-editing .homeowner-readonly {
  display: none;
}

.homeowner-card.is-editing .homeowner-edit-fields {
  display: grid;
}

.homeowner-card.is-editing .homeowner-edit-field {
  display: block;
  margin-top: 6px;
}

.person-line h2 {
  font-size: 17px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.contact-grid div {
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid #f0f2f5;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.contact-grid small,
.detail-list dt {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-grid strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.stage-bar {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}

.stage-bar span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stage-bar span:first-child {
  border-radius: 7px 0 0 7px;
}

.stage-bar span:last-child {
  border-radius: 0 7px 7px 0;
}

.stage-bar span + span {
  border-left: 0;
}

.stage-bar .done {
  background: #f0fdf4;
  color: #166534;
}

.stage-bar .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.progress-block {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.progress-block > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--green);
}

.progress-preview {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 900;
}

.meta-strip {
  color: var(--muted);
}

.meta-strip span {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 12px;
}

.meta-strip.small span {
  padding: 0;
  background: transparent;
}

.ticket-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
}

.workspace-main {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.tab span,
.subtabs span {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-pane {
  display: none;
  padding: 18px;
  background: #f7f7f8;
}

.tab-pane.active {
  display: block;
}

.subtabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 2px solid var(--line);
  margin-bottom: 16px;
}

.subtabs button {
  flex: 1 0 180px;
  padding: 11px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.subtabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.discussion-pane {
  display: none;
}

.discussion-pane.active {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: max(420px, calc(100vh - 360px));
  overflow: hidden;
}

.composer,
.customer-composer,
.installer-composer,
.thread-header,
.comment-card,
.issue-section,
.task-card,
.file-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.composer,
.customer-composer,
.installer-composer {
  display: grid;
  gap: 10px;
  padding: 13px;
  margin-bottom: 14px;
}

.discussion-pane .composer,
.discussion-pane .customer-composer,
.discussion-pane .installer-composer {
  flex: 0 0 auto;
  margin: 12px 0 0;
}

.composer-head,
.message-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.composer-head small,
.message-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.composer-foot {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.feed {
  display: grid;
  gap: 9px;
}

.discussion-pane .feed,
.discussion-pane .bubble-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  align-content: start;
}

.comment-card {
  padding: 13px;
}

.comment-card.internal {
  border-left: 3px solid var(--amber);
  background: #fffdf5;
}

.comment-card p {
  margin: 8px 0 0 39px;
  color: #1f2937;
  line-height: 1.6;
  white-space: pre-line;
}

.thread-header {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
}

.thread-header small {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.installer-thread-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.bubble-feed {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.discussion-pane .bubble-feed {
  margin-bottom: 0;
}

.bubble-row {
  display: flex;
  flex-direction: column;
}

.bubble-row.outgoing {
  align-items: flex-end;
}

.bubble-row.incoming {
  align-items: flex-start;
}

.bubble-label,
.bubble-meta {
  color: var(--muted);
  font-size: 11px;
  display: flex;
  gap: 7px;
}

.bubble {
  max-width: min(620px, 78%);
  padding: 10px 13px;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-line;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  max-width: min(680px, 100%);
}

.bubble-row.outgoing .message-attachments {
  justify-content: flex-end;
}

.message-attachment-thumb {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.message-attachment-thumb img {
  display: block;
  width: 132px;
  height: 96px;
  object-fit: cover;
}

.message-attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.message-attachment-file span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.message-attachment-file strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.bubble.out {
  border-bottom-right-radius: 4px;
  background: var(--accent);
  color: #fff;
}

.bubble.out.channel-whatsapp {
  background: #16a34a;
}

.bubble.out.channel-email {
  background: var(--blue);
  border-radius: 10px;
}

.bubble.in {
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  background: #fff;
}

.channel-row {
  align-items: center;
}

.channel-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.channel-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 11px;
  cursor: pointer;
  font-weight: 900;
}

.channel-btn.active,
.channel-btn:hover {
  background: #fef2f2;
  color: var(--accent);
  border-color: #fecaca;
}

.channel-btn.is-disabled,
.channel-btn:disabled {
  background: #f8fafc;
  color: #94a3b8;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.composer-feedback {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.composer-feedback-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.composer-feedback-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.composer-feedback-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.message-send-row {
  align-items: flex-end;
  flex-wrap: nowrap;
}

.message-send-row textarea {
  min-height: 46px;
}

.send-dot {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.send-dot:disabled {
  cursor: wait;
  opacity: 0.7;
}

.issue-section {
  overflow: hidden;
  margin-bottom: 12px;
}

.issue-section-head {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
}

.issue-section-head span {
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.issue-table-wrap {
  overflow-x: auto;
}

.issue-table {
  min-width: 680px;
}

.issue-table td:nth-child(2) {
  min-width: 150px;
}

.owner-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.inline-form {
  display: grid;
  gap: 6px;
}

.inline-form select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
}

.inline-form .btn {
  width: 100%;
}

.task-columns,
.files-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.45fr);
  gap: 14px;
  align-items: start;
}

.task-list {
  display: grid;
  gap: 9px;
}

.task-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
}

.task-card.mini {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  color: var(--text);
}

.task-card.is-overdue {
  border-color: #fecaca;
  background: #fff7f7;
}

.task-card.is-done {
  opacity: 0.7;
}

.task-card.is-done strong {
  text-decoration: line-through;
}

.task-check,
.task-toggle {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.task-toggle {
  cursor: pointer;
  color: #166534;
  font-weight: 900;
}

.task-title-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.task-body p {
  margin: 6px 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.text-danger {
  color: var(--danger) !important;
  font-weight: 900;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
}

.activity-feed {
  display: grid;
}

.activity-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--blue);
}

.activity-item p {
  margin: 3px 0;
  color: #374151;
}

.activity-item small {
  color: var(--muted);
}

.ticket-sidebar {
  display: grid;
  gap: 12px;
}

.detail-list,
.financial-summary {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div,
.financial-summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f2f5;
}

.detail-list div:last-child,
.financial-summary div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.financial-summary .is-total {
  padding-top: 2px;
  border-bottom: 0;
  color: var(--text);
}

.detail-list dd,
.financial-summary dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
}

.financial-card .panel-head {
  align-items: start;
}

.financial-edit-actions {
  display: flex;
  gap: 6px;
}

.financial-edit-field {
  display: none;
}

.financial-card.is-editing .financial-readonly {
  display: none;
}

.financial-card.is-editing .financial-edit-field {
  display: block;
}

.financial-card.is-editing .payment-status-picker {
  position: relative;
  display: inline-grid;
  justify-items: end;
}

.financial-summary .financial-edit-field input,
.financial-payment-row .financial-edit-field,
.inline-order-form select,
.linked-order-actions select {
  width: 100%;
}

.financial-summary .financial-edit-field input {
  min-height: 32px;
  padding: 6px 8px;
  text-align: right;
}

.financial-summary .is-total .financial-edit-field {
  color: var(--text);
}

.job-calculator {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.job-calculator-head,
.job-calculator-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-calculator-head h3 {
  margin: 0;
  font-size: 15px;
}

.job-calculator-profit-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.job-calculator-profit-chip.is-negative {
  background: #fee2e2;
  color: #991b1b;
}

.job-calculator-items {
  display: grid;
  gap: 8px;
}

.job-calculator-items-head strong {
  color: #374151;
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.job-calculator-item-list {
  display: grid;
  gap: 8px;
}

.job-calculator-item {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) 126px 90px minmax(150px, 1fr) 92px 32px;
  gap: 8px;
  align-items: end;
}

.job-calculator-item label {
  margin: 0;
}

.job-calculator-base-field.is-hidden {
  display: none;
}

.job-calculator-line-total {
  min-width: 84px;
  padding: 2px 0 6px;
  color: #374151;
  text-align: right;
  white-space: nowrap;
}

.job-calculator-line-total small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.job-calculator-line-total strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 900;
}

.job-calculator-remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.job-calculator-remove:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.job-calculator-totals,
.calculator-readout {
  display: grid;
  gap: 8px;
}

.job-calculator-totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.job-calculator-total,
.calculator-readout div {
  padding: 9px 10px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: var(--surface-soft);
}

.job-calculator-total span,
.calculator-readout dt {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.job-calculator-total strong,
.calculator-readout dd {
  display: block;
  margin: 4px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.job-calculator-total.is-negative strong,
.calculator-readout dd.is-negative {
  color: #b91c1c;
}

.job-calculator-readonly {
  margin-top: 12px;
}

.job-calculator-edit {
  margin-top: 12px;
}

.job-calculator-edit .job-calculator {
  padding: 10px;
}

.financial-card .job-calculator-item,
.financial-card .job-calculator-totals {
  grid-template-columns: 1fr;
}

.financial-card .job-calculator-line-total {
  text-align: left;
}

.financial-card .job-calculator-remove {
  width: 100%;
}

.modal-box.job-calculator-modal-box {
  width: min(920px, calc(100vw - 28px));
}

.sidebar-section-title {
  margin: 12px 0 7px;
  color: #374151;
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-schedule {
  margin-top: 12px;
}

.payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #f0f2f5;
}

.payment-row:first-of-type {
  border-top: 0;
}

.payment-main {
  min-width: 0;
}

.payment-main strong {
  display: block;
  font-size: 13px;
}

.payment-main strong span,
.payment-main small {
  color: var(--muted);
  font-weight: 700;
}

.payment-main small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
}

.payment-status,
.order-status {
  border: 0;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

button.payment-status {
  cursor: pointer;
}

button.payment-status:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.payment-status-received,
.order-status.is-received {
  background: #dcfce7;
  color: #166534;
}

.payment-status-pending,
.order-status.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.payment-status-not_due,
.order-status.is-work {
  background: #eff6ff;
  color: #1d4ed8;
}

.payment-status-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.order-status.is-danger {
  background: #fee2e2;
  color: #991b1b;
}

.milestone-edit-grid {
  grid-column: 1 / -1;
  margin-top: 6px;
}

.financial-card.is-editing .milestone-edit-grid {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 6px;
}

.milestone-edit-grid label {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.milestone-edit-grid input {
  min-height: 30px;
  padding: 5px 7px;
}

.milestone-edit-grid span {
  grid-column: 1 / -1;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.payment-status-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 118px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.payment-status-menu-option {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 7px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.payment-status-menu-option:hover,
.payment-status-menu-option:focus-visible {
  background: #f3f4f6;
  outline: 0;
}

.remaining-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
}

.remaining-balance span {
  color: #d1d5db;
  font-size: 12px;
  font-weight: 800;
}

.remaining-balance strong {
  font-size: 16px;
}

.sidebar-task-list,
.linked-list {
  display: grid;
  gap: 8px;
}

.sidebar-task,
.linked-list > div,
.linked-list > form {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px;
  text-align: left;
}

.sidebar-task {
  cursor: pointer;
}

.sidebar-task.is-overdue {
  border-color: #fecaca;
  background: #fff7f7;
}

.sidebar-task span,
.linked-list span:not(.order-status) {
  color: var(--muted);
  font-size: 12px;
}

.orders-panel .sidebar-section-title:first-of-type {
  margin-top: 0;
}

.linked-list.compact {
  gap: 6px;
}

.linked-list.compact .linked-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 8px;
}

.linked-list.compact .order-update-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.linked-order-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.linked-installer-summary,
.linked-installer-fields {
  grid-column: 1 / -1;
}

.linked-installer-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.linked-installer-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.linked-installer-fields input {
  min-height: 30px;
  padding: 5px 8px;
}

.linked-order-actions select,
.inline-order-form select {
  min-height: 30px;
  padding: 5px 8px;
}

.linked-row strong {
  display: block;
  font-size: 12.5px;
}

.linked-row span:not(.order-status) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-compact {
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.issue-order-cell {
  display: grid;
  min-width: 110px;
  gap: 6px;
}

.issue-order-cell strong {
  font-size: 12px;
}

.inline-order-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.empty-state,
.empty-inline {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.modal-head {
  border-bottom: 1px solid #f0f0f0;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.modal-close:hover {
  background: #eef2f7;
  color: var(--text);
}

.send-update-form {
  display: grid;
  gap: 11px;
  padding: 16px 20px 18px;
}

.modal-foot {
  padding: 13px 0 0;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f0;
}

.modal-alert {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-weight: 700;
}

.modal-alert ul {
  margin: 8px 0 0 18px;
  padding: 0;
  font-weight: 600;
}

.modal-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.modal-alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.channel-toggle-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.channel-toggle-group legend {
  grid-column: 1 / -1;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 2px;
}

.channel-toggle {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 78px;
  padding: 11px 12px 11px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.channel-toggle input {
  position: absolute;
  left: 11px;
  top: 13px;
  width: 16px;
  height: 16px;
}

.channel-toggle span {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.channel-toggle .channel-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.channel-warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.channel-toggle small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.channel-toggle.has-channel-warning {
  border-color: #fecaca;
}

.channel-toggle.has-channel-warning:has(input:checked) {
  border-color: #f87171;
  background: #fffafa;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.1);
}

.channel-toggle:has(input:checked) {
  border-color: var(--accent);
  background: #fff7f5;
  box-shadow: 0 0 0 3px rgba(232, 87, 58, 0.08);
}

.channel-toggle.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.provider-note {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1340px) {
  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-side-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .unmatched-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ticket-workspace,
  .dashboard-grid,
  .dashboard-workspace,
  .content-grid,
  .task-columns,
  .files-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-search {
    width: min(100%, 420px);
  }

  .ticket-sidebar {
    order: -1;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .mobile-brand {
    display: block;
  }

  .app-main {
    padding: 16px;
  }

  .dashboard-topbar {
    display: grid;
  }

  .dashboard-tools {
    justify-content: stretch;
  }

  .dashboard-side-stack {
    grid-template-columns: 1fr;
  }

  .dashboard-search,
  .dashboard-tools form,
  .dashboard-tools .btn {
    width: 100%;
  }

  .ticket-hero {
    grid-template-columns: 1fr;
  }

  .ticket-status-panel {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .form-grid.two,
  .form-grid.three,
  .form-grid.four,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .job-calculator-item {
    grid-template-columns: 1fr 1fr;
  }

  .job-calculator-item label:first-child {
    grid-column: 1 / -1;
  }

  .job-calculator-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unmatched-summary-grid,
  .unmatched-detail-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-header,
  .ticket-topbar {
    display: grid;
  }

  .header-actions,
  .filter-bar,
  .button-row {
    width: 100%;
  }

  .header-actions > *,
  .filter-bar input,
  .filter-bar select,
  .filter-bar button,
  .button-row > * {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-title-group h1 {
    font-size: 26px;
  }

  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }

  .communication-item {
    display: grid;
  }

  .bubble {
    max-width: 94%;
  }

  .inline-form {
    display: grid;
  }

  .channel-toggle-group {
    grid-template-columns: 1fr;
  }

  .job-calculator-item,
  .job-calculator-totals {
    grid-template-columns: 1fr;
  }

  .job-calculator-line-total {
    text-align: left;
  }

  .job-calculator-remove {
    width: 100%;
  }

  .modal-foot {
    display: grid;
  }
}

@media (min-width: 561px) {
  .dashboard-new-ticket-modal .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-new-ticket-modal .modal-foot {
    display: flex;
  }
}

@media (max-width: 560px) {
  .dashboard-new-ticket-modal .form-grid.two {
    grid-template-columns: 1fr;
  }
}
