:root {
  --ink: #1a1c20;
  --muted: #5a6675;
  --brand: #0d6b75;
  --brand-dark: #0a4d55;
  --accent: #f2b53f;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.72);
  --line: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

.helpdesk-body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(13, 107, 117, 0.12), transparent 55%),
    radial-gradient(
      circle at 15% 20%,
      rgba(242, 181, 63, 0.18),
      transparent 40%
    ),
    linear-gradient(135deg, #f7f9fb 0%, #eef2f6 100%);
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 24px 24px;
  flex: 1 0 auto;
}

.letter-pad::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 10px solid #111a7a;
  pointer-events: none;
}

.letter-pad-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(17, 26, 122, 0.12);
  margin-bottom: 18px;
}

.letter-pad-brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.letter-pad-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  flex: 0 0 auto;
}

.letter-pad-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a4d55;
}

.letter-pad-title {
  font-family: "Spectral", serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: #7b0b2b;
  margin-top: 2px;
}

.letter-pad-subtitle {
  font-size: 14px;
  color: #4b5563;
  margin-top: 4px;
}

.letter-pad-ref {
  min-width: 210px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbfc, #eef5f7);
  display: grid;
  gap: 10px;
}

.letter-pad-ref span,
.letter-pad-meta-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 4px;
}

.letter-pad-ref strong,
.letter-pad-meta-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  word-break: break-word;
}

.letter-pad-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.letter-pad-meta-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.letter-pad-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.letter-pad-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a4d55;
  margin-bottom: 10px;
}

.letter-pad-message {
  font-size: 15px;
  line-height: 1.75;
  color: #111827;
  white-space: normal;
}

.letter-pad-list {
  margin: 0;
  padding-left: 18px;
}

.letter-pad-list li + li {
  margin-top: 6px;
}

.letter-pad-link {
  margin-top: 10px;
  word-break: break-word;
}

.letter-pad-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 2px solid rgba(17, 26, 122, 0.12);
  font-size: 14px;
}

.letter-pad-signature {
  min-width: 220px;
  text-align: center;
  padding-top: 44px;
  border-top: 1px solid rgba(15, 23, 42, 0.35);
  color: #374151;
}

.letter-pad-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.print-all-actions {
  display: flex;
  justify-content: flex-end;
  margin: 16px 0 8px;
}

.print-page > .row > .col-12 > h3 {
  display: none !important;
}

body {
  background: #ffffff !important;
  color: #000 !important;
}

.print-page,
.container.print-page {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.letter-pad {
  max-width: 100% !important;
  margin: 0 0 18px 0 !important;
  padding: 22px 22px 20px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
  page-break-after: always;
}

.letter-pad::before {
  border-top-width: 8px;
}

.letter-pad-title {
  font-size: 24px;
}

.letter-pad-footer {
  page-break-inside: avoid;
}

.letter-pad-ref,
.letter-pad-meta-item,
.letter-pad-section,
.letter-pad-footer {
  break-inside: avoid;
}

.letter-pad-link a {
  color: #000 !important;
  text-decoration: none !important;
  display: block;
  height: 8px;

  @media (max-width: 992px) {
    .panel-grid {
      grid-template-columns: 1fr;
    }

    .report-hero,
    .report-stats {
      grid-template-columns: 1fr;
    }
  }
  background: #111a7a;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) minmax(
      120px,
      200px
    );
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  padding: 12px 20px 10px;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  width: clamp(90px, 12vw, 150px);
  height: clamp(90px, 12vw, 150px);
  object-fit: contain;
}

.brand-text {
  font-family: "Spectral", serif;
  text-align: center;
}

.brand-title {
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #7b0b2b;
}

.brand-lines {
  font-size: clamp(12px, 1.2vw, 15px);
  color: #1f2937;
  line-height: 1.45;
}

.brand-lines strong {
  display: block;
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: 0.6px;
  color: #1b3e8a;
  margin: 4px 0 2px;
}

.brand-side {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-hero-image {
  width: clamp(140px, 18vw, 220px);
  max-width: 100%;
  height: clamp(90px, 12vw, 140px);
  object-fit: contain;
  background: #ffffff;
  border-radius: 10px;
  border: none;
  display: block;
}

.brand-tag {
  font-size: 20px;
  font-weight: 700;
  color: #1b3e8a;
}

.brand-note {
  font-size: 14px;
  color: #4b5563;
}

.alert-banner {
  margin: 24px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-banner.success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.panel {
  margin-top: 28px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 100%;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.panel-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
}

.panel-subtitle {
  color: var(--muted);
  margin-bottom: 20px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.form-control {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 15px;
}

.form-control:focus {
  border-color: rgba(13, 107, 117, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(13, 107, 117, 0.15);
}

.btn.btn-primary {
  background: linear-gradient(120deg, var(--brand) 0%, #0f8a97 100%);
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 600;
}

.btn.btn-danger {
  border-radius: 12px;
}

.btn.btn-success {
  border-radius: 12px;
}

.panel-visual {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.visual-card {
  background: linear-gradient(
    140deg,
    rgba(13, 107, 117, 0.08),
    rgba(242, 181, 63, 0.12)
  );
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(13, 107, 117, 0.15);
}

.visual-image {
  width: 100%;
  border-radius: 16px;
  background: #fff;
}

.visual-caption h3 {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
}

.visual-caption p {
  color: var(--muted);
}

.info-card {
  background: #f7f8fb;
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

.info-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.info-card ul {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
}

.table-card {
  padding: 20px;
}

.report-shell {
  padding-top: 10px;
  padding-bottom: 12px;
  width: 100%;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 20px;
  align-items: start;
  margin-top: 10px;
}

.report-hero-copy,
.report-user-card,
.stat-card,
.report-table-header {
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.report-hero-copy {
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.report-hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -70px -80px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(13, 107, 117, 0.16),
    transparent 68%
  );
}

.report-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 107, 117, 0.1);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-title {
  margin: 16px 0 10px;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 700;
}

.report-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.6;
}

.report-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.report-pills span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(13, 107, 117, 0.08);
  color: #114a52;
  font-size: 13px;
  font-weight: 600;
}

.report-user-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  background: linear-gradient(
    180deg,
    rgba(13, 107, 117, 0.08),
    rgba(255, 255, 255, 0.92)
  );
}

.report-user-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-user-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.stat-card {
  padding: 20px 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 32px;
  line-height: 1;
  color: var(--brand-dark);
}

.table-card {
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
}

.report-table-header {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(245, 248, 251, 0.96)
  );
  padding: 14px 18px 12px;
}

.report-table-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.report-table-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.report-table-header > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  margin-top: 10px;
}

.state-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #415160;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.state-dot--closed {
  background: #dc3545;
}

.state-dot--pending {
  background: #0d6efd;
}

.state-dot--replied {
  background: #198754;
}

.report-table {
  margin: 0 !important;
}

.report-table_wrapper,
.dataTables_wrapper {
  width: 100%;
}

.dt-container {
  width: 100%;
}

.report-table_wrapper .dt-layout-row,
.dt-container .dt-layout-row,
.dataTables_wrapper .dt-layout-row {
  margin: 0;
  padding: 12px 18px;
  gap: 12px 16px;
  align-items: center;
}

.report-table_wrapper .dt-layout-start,
.report-table_wrapper .dt-layout-end,
.dt-container .dt-layout-start,
.dt-container .dt-layout-end,
.dataTables_wrapper .dt-layout-start,
.dataTables_wrapper .dt-layout-end {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.report-table_wrapper .dt-info,
.dt-container .dt-info,
.dataTables_wrapper .dt-info {
  padding: 0 18px 14px;
  margin: 0;
}

.report-table_wrapper .dt-paging,
.dt-container .dt-paging,
.dataTables_wrapper .dt-paging {
  padding: 0 18px 14px;
}

.report-table_wrapper .dt-search,
.report-table_wrapper .dt-length,
.dt-container .dt-search,
.dt-container .dt-length,
.dataTables_wrapper .dt-search,
.dataTables_wrapper .dt-length {
  margin: 0;
}

.report-table_wrapper .dt-search label,
.report-table_wrapper .dt-length label,
.dt-container .dt-search label,
.dt-container .dt-length label,
.dataTables_wrapper .dt-search label,
.dataTables_wrapper .dt-length label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.dt-container .dt-layout-end {
  justify-content: flex-end;
}

.dt-container .dt-layout-row:last-child {
  padding-top: 6px;
  padding-bottom: 12px;
}

.report-table thead th {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #415160;
  background: #f4f7fa;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.report-table tbody td {
  vertical-align: middle;
}

.req-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(13, 107, 117, 0.12);
  color: var(--brand-dark);
  font-weight: 700;
}

.report-table .btn {
  min-width: 84px;
}

.table-empty-state {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.ticket-state--closed {
  background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
  border: none;
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
}

.ticket-state--pending {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  border: none;
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
}

.ticket-state--replied {
  background: linear-gradient(135deg, #198754 0%, #157347 100%);
  border: none;
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
}

.ticket-state--closed:hover,
.ticket-state--pending:hover,
.ticket-state--replied:hover {
  color: #ffffff;
  filter: brightness(0.96);
}

.reply-modal-dialog {
  max-width: min(1160px, calc(100vw - 1.5rem));
}

.reply-modal-dialog.modal-dialog-scrollable {
  height: calc(100vh - 1.5rem);
}

.reply-modal-dialog.modal-dialog-scrollable .modal-content {
  height: 100%;
  max-height: 100%;
}

.reply-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.reply-modal-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.reply-modal-body {
  padding: 20px 22px 18px;
  background: linear-gradient(
    180deg,
    rgba(247, 249, 251, 0.92),
    rgba(255, 255, 255, 0.98)
  );
  overflow-y: auto;
}

.reply-modal-dialog.modal-dialog-scrollable .reply-modal-body {
  max-height: calc(100vh - 180px);
}

.reply-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 18px;
}

.reply-summary-card,
.reply-form-card,
.reply-request-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.reply-summary-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reply-summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reply-summary-label {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.reply-request-id {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(13, 107, 117, 0.12);
  color: var(--brand-dark);
  font-weight: 700;
}

.reply-summary-block {
  display: grid;
  gap: 10px;
}

.reply-summary-row {
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.reply-summary-key {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reply-summary-value {
  display: block;
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}

.reply-summary-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 107, 117, 0.12);
  color: var(--brand-dark);
  font-weight: 700;
}

.reply-request-card {
  padding: 16px;
}

.reply-request-card h5,
.reply-section-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.reply-request-content {
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
}

.reply-form-card {
  padding: 18px;
}

.reply-section-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
}

.reply-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.reply-form-card .field {
  margin-bottom: 14px;
}

.reply-form-card label {
  margin-bottom: 8px;
  font-weight: 600;
}

.reply-form-card .form-control {
  border-radius: 14px;
}

.reply-author {
  margin: 10px 0 0;
  text-align: right;
  color: var(--brand-dark);
}

.modal-footer {
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-footer .btn-light {
  border-radius: 12px;
}

@media (max-width: 992px) {
  .reply-panel-grid {
    grid-template-columns: 1fr;
  }

  .reply-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .reply-modal-body,
  .reply-modal-header,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .reply-summary-card,
  .reply-form-card,
  .reply-request-card {
    border-radius: 16px;
  }

  .reply-modal-dialog.modal-dialog-scrollable {
    height: calc(100vh - 0.75rem);
  }

  .reply-modal-dialog.modal-dialog-scrollable .reply-modal-body {
    max-height: calc(100vh - 160px);
  }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.site-footer {
  margin-top: auto;
  padding: 8px 0 6px;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.helpdesk-body > main.shell {
  flex: 1 0 auto;
}

.footer-inner {
  text-align: center;
  color: #4b5563;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.footer-brand {
  font-weight: 700;
  color: #1b3e8a;
}

.footer-copy {
  font-size: 13px;
  color: #6b7280;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 6px 10px;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 10px;
  border: 1px solid var(--line);
}

.print-page {
  padding-top: 24px;
}

@media (max-width: 992px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .report-hero,
  .report-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .header-logo {
    justify-content: center;
  }

  .brand-text {
    text-align: center;
  }

  .brand-side {
    display: none;
  }

  .brand-hero-image {
    display: none;
  }
}

@media (max-width: 600px) {
  .panel {
    padding: 20px;
  }

  .panel-title {
    font-size: 24px;
  }

  .report-hero-copy,
  .report-user-card,
  .stat-card,
  .report-table-header {
    padding: 18px;
    border-radius: 18px;
  }

  .report-title {
    font-size: 24px;
  }

  .report-user-name {
    font-size: 20px;
  }

  .stat-card strong {
    font-size: 26px;
  }

  .table-card {
    padding: 0;
  }

  .report-table-header {
    padding: 14px 14px 12px;
  }

  .table-card {
    margin-top: 0;
  }

  .report-table_wrapper .dt-layout-row,
  .dt-container .dt-layout-row,
  .dataTables_wrapper .dt-layout-row {
    padding: 6px 14px 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .report-table_wrapper .dt-layout-start,
  .report-table_wrapper .dt-layout-end,
  .dt-container .dt-layout-start,
  .dt-container .dt-layout-end,
  .dataTables_wrapper .dt-layout-start,
  .dataTables_wrapper .dt-layout-end {
    width: 100%;
    justify-content: flex-start;
  }

  .report-table_wrapper .dt-search,
  .report-table_wrapper .dt-length,
  .dt-container .dt-search,
  .dt-container .dt-length,
  .dataTables_wrapper .dt-search,
  .dataTables_wrapper .dt-length {
    width: 100%;
  }

  .report-table_wrapper .dt-length,
  .dt-container .dt-length,
  .dataTables_wrapper .dt-length {
    display: none !important;
  }

  .report-table_wrapper .dt-search label,
  .report-table_wrapper .dt-length label,
  .dt-container .dt-search label,
  .dt-container .dt-length label,
  .dataTables_wrapper .dt-search label,
  .dataTables_wrapper .dt-length label {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    justify-content: flex-start;
  }

  .report-table_wrapper .dt-search,
  .dt-container .dt-search,
  .dataTables_wrapper .dt-search {
    display: block !important;
  }

  .report-table_wrapper .dt-search label,
  .dt-container .dt-search label,
  .dataTables_wrapper .dt-search label {
    width: 100%;
  }

  .report-table_wrapper .dt-search span,
  .dt-container .dt-search span,
  .dataTables_wrapper .dt-search span {
    display: block;
    margin-bottom: 6px;
  }

  .report-table_wrapper .dt-search input,
  .dt-container .dt-search input,
  .dataTables_wrapper .dt-search input,
  .report-table_wrapper .dt-length select,
  .dt-container .dt-length select,
  .dataTables_wrapper .dt-length select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .report-table_wrapper .dt-info,
  .dt-container .dt-info,
  .dataTables_wrapper .dt-info,
  .report-table_wrapper .dt-paging,
  .dt-container .dt-paging,
  .dataTables_wrapper .dt-paging {
    padding-left: 14px;
    padding-right: 14px;
    text-align: center;
    width: 100%;
  }

  .report-table_wrapper .dt-info,
  .dt-container .dt-info,
  .dataTables_wrapper .dt-info {
    display: block !important;
  }

  .report-table_wrapper .dt-paging,
  .dt-container .dt-paging,
  .dataTables_wrapper .dt-paging {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .report-table_wrapper .dt-info,
  .dt-container .dt-info,
  .dataTables_wrapper .dt-info {
    padding-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
  }

  .report-table_wrapper .dt-paging .dt-paging-button,
  .dt-container .dt-paging .dt-paging-button,
  .dataTables_wrapper .dt-paging .dt-paging-button {
    min-width: 36px;
    padding: 6px 10px;
  }

  .table-wrap {
    overflow-x: auto;
    display: block;
  }

  .report-table {
    min-width: 760px;
  }

  .report-table thead th,
  .report-table tbody td {
    white-space: nowrap;
    padding: 10px 12px;
  }

  .report-table .btn {
    min-width: 72px;
    padding: 8px 12px;
    border-radius: 12px;
  }

  .ticket-state--closed,
  .ticket-state--pending,
  .ticket-state--replied {
    padding: 10px 12px;
  }
}

/* Letter-pad style for print page */
.letter-pad {
  max-width: 900px;
  margin: 24px auto;
  padding: 28px 30px 26px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  color: #111827;
  position: relative;
  overflow: hidden;
}

.letter-pad::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 10px solid #111a7a;
  pointer-events: none;
}

.letter-pad-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(17, 26, 122, 0.12);
  margin-bottom: 18px;
}

.letter-pad-brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.letter-pad-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  flex: 0 0 auto;
}

.letter-pad-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a4d55;
}

.letter-pad-title {
  font-family: "Spectral", serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: #7b0b2b;
  margin-top: 2px;
}

.letter-pad-subtitle {
  font-size: 14px;
  color: #4b5563;
  margin-top: 4px;
}

.letter-pad-ref {
  min-width: 220px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbfc, #eef5f7);
  display: grid;
  gap: 10px;
}

.letter-pad-ref span,
.letter-pad-meta-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 4px;
}

.letter-pad-ref strong,
.letter-pad-meta-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  word-break: break-word;
}

.letter-pad-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.letter-pad-meta-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.letter-pad-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.letter-pad-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a4d55;
  margin-bottom: 10px;
}

.letter-pad-message {
  font-size: 15px;
  line-height: 1.75;
  color: #111827;
  white-space: normal;
}

.letter-pad-list {
  margin: 0;
  padding-left: 18px;
}

.letter-pad-list li + li {
  margin-top: 6px;
}

.letter-pad-link {
  margin-top: 10px;
  word-break: break-word;
}

.letter-pad-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 2px solid rgba(17, 26, 122, 0.12);
  font-size: 14px;
}

.letter-pad-signature {
  min-width: 220px;
  text-align: center;
  padding-top: 44px;
  border-top: 1px solid rgba(15, 23, 42, 0.35);
  color: #374151;
}

@media (max-width: 600px) {
  .letter-pad-header,
  .letter-pad-footer,
  .letter-pad-meta-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .letter-pad-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .letter-pad-ref,
  .letter-pad-signature {
    min-width: 0;
  }
}

@media print {
  .site-header,
  .site-footer,
  .no-print,
  .print-page > .row > .col-12 > h3 {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000 !important;
  }

  .shell,
  .container,
  .container.print-page,
  .report-shell {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .letter-pad {
    max-width: 100% !important;
    margin: 0 0 18px 0 !important;
    padding: 22px 22px 20px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    page-break-after: always;
  }

  .letter-pad::before {
    border-top-width: 8px;
  }

  .letter-pad-title {
    font-size: 24px;
  }

  .letter-pad-footer {
    page-break-inside: avoid;
  }

  .letter-pad-ref,
  .letter-pad-meta-item,
  .letter-pad-section,
  .letter-pad-footer {
    break-inside: avoid;
  }

  .letter-pad-link a {
    color: #000 !important;
    text-decoration: none !important;
  }

  .letter-pad-actions,
  .print-all-actions {
    display: none !important;
  }

  img {
    max-width: 100% !important;
    height: auto !important;
  }
}

@media print {
  /* Hide interactive UI elements */
  .no-print,
  .panel-toolbar,
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    display: none !important;
  }

  /* Page background and typography for printing */
  body {
    background: #ffffff !important;
    color: #000 !important;
  }

  /* Make print container full width */
  .shell,
  .container,
  .container.print-page,
  .report-shell {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 12px !important;
  }

  /* Center the header and simplify for print */
  .container.print-page .nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .container.print-page .nav .nav-item {
    display: inline-block !important;
    vertical-align: middle !important;
  }

  .container.print-page .nav img {
    display: block !important;
    margin: 0 auto !important;
    max-width: 140px !important;
    height: auto !important;
  }

  .brand-text,
  .brand-lines {
    text-align: center !important;
  }

  .brand-side {
    display: none !important;
  }

  /* Table layout suitable for printing */
  table.display,
  table.display thead,
  table.display tbody {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  table.display thead th,
  table.display tbody td {
    border: 1px solid #ddd !important;
    padding: 8px !important;
    vertical-align: top !important;
    background: transparent !important;
    color: #000 !important;
  }

  .report-table thead th {
    background: #f4f7fa !important;
  }

  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Remove visual chrome for print */
  .panel,
  .panel-grid,
  .report-hero,
  .reply-summary-card,
  .reply-form-card {
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
  }
}
