/**
 * M2 — View ticket (rebuilt chat layout)
 */

body.m2-page-ticket .main-page-contents.m2-support-page-canvas {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.m2-page-ticket .m2-ca-page__shell {
  background: #fff;
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(11, 22, 34, 0.06);
  overflow: hidden;
}

body.m2-page-ticket .m2-ca-page__head {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(72, 192, 216, 0.08) 0%, transparent 55%),
    #fff;
}

body.m2-page-ticket .m2-ca-page__head-title {
  color: var(--m2-ca-ink, #0b1622);
}

body.m2-page-ticket .m2-ca-page__head-title i {
  color: var(--m2-ca-cyan-deep, #0891b2);
}

body.m2-page-ticket .m2-ca-page__head-sub {
  color: var(--m2-ca-muted, #5a6975) !important;
}

body.m2-page-ticket .m2-ca-page__body {
  padding: 0;
}

/* ── Invalid ticket ── */
.m2-view-ticket-error {
  padding: 1.35rem 1.35rem 1.65rem;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(72, 192, 216, 0.1) 0%, transparent 58%),
    linear-gradient(180deg, rgba(248, 251, 253, 0.95) 0%, #fff 100%);
}

.m2-view-ticket-error__panel {
  position: relative;
  overflow: hidden;
  border: 1px dashed rgba(72, 192, 216, 0.28);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 36px rgba(11, 22, 34, 0.06);
}

.m2-view-ticket-error__glow {
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background: radial-gradient(80% 100% at 50% 0%, rgba(72, 192, 216, 0.14) 0%, transparent 100%);
  pointer-events: none;
}

.m2-view-ticket-error__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.85rem;
}

.m2-view-ticket-error__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(72, 192, 216, 0.22) 0%, transparent 55%),
    linear-gradient(135deg, #05141f 0%, #0a2744 55%, #0f3580 120%);
  color: #6dd4ef;
  font-size: 1.55rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(5, 20, 31, 0.18);
}

.m2-view-ticket-error__icon-badge {
  position: absolute;
  inset-inline-end: -0.35rem;
  bottom: -0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
  color: #fff;
  font-size: 0.62rem;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

.m2-view-ticket-error__title {
  margin: 0 0 0.55rem;
  font-family: 'Cairo', 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--m2-ca-ink, #0b1622);
}

.m2-view-ticket-error__text {
  margin: 0 0 1.35rem;
  max-width: 420px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--m2-ca-muted, #5a6975);
}

.m2-view-ticket-error__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  width: 100%;
}

.m2-view-ticket-error__actions .m2-ticket-btn {
  min-width: 10.5rem;
}

/* ── Hero toolbar ── */
.m2-vt-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  background:
    radial-gradient(100% 120% at 0% 0%, rgba(72, 192, 216, 0.06) 0%, transparent 50%),
    rgba(248, 251, 253, 0.85);
}

.m2-vt-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.1));
  background: #fff;
  color: var(--m2-ca-muted, #5a6975);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.m2-vt-hero__back:hover {
  color: var(--m2-ca-cyan-deep, #0891b2);
  border-color: rgba(72, 192, 216, 0.35);
  background: rgba(72, 192, 216, 0.06);
  text-decoration: none;
}

.m2-vt-hero__main {
  min-width: 0;
}

.m2-vt-hero__id-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.m2-vt-hero__tid {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(72, 192, 216, 0.12);
  color: var(--m2-ca-cyan-deep, #0891b2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.m2-vt-hero__subject {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
  color: var(--m2-ca-ink, #0b1622);
  word-break: break-word;
}

.m2-vt-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.m2-vt-hero__close:hover {
  color: #b42318 !important;
  border-color: rgba(180, 35, 24, 0.25) !important;
  background: rgba(180, 35, 24, 0.06) !important;
}

/* ── Status chips ── */
.m2-vt-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}

.m2-vt-chip--sm {
  font-size: 0.68rem;
  padding: 0.14rem 0.45rem;
}

.m2-vt-chip--open {
  background: rgba(85, 200, 232, 0.16);
  color: #0e7490;
  border-color: rgba(85, 200, 232, 0.35);
}

.m2-vt-chip--closed {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.28);
}

.m2-vt-chip--urgent {
  background: rgba(220, 53, 69, 0.1);
  color: #b42318;
  border-color: rgba(220, 53, 69, 0.25);
}

.m2-vt-chip--medium {
  background: rgba(255, 193, 7, 0.14);
  color: #856404;
  border-color: rgba(255, 193, 7, 0.35);
}

.m2-vt-chip--low {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.35);
}

.m2-vt-chip--open i {
  font-size: 0.45rem;
}

/* ── Notices ── */
.m2-vt-alert {
  padding: 0.75rem 1.35rem 0;
}

.m2-vt-alert .alert {
  margin-bottom: 0;
}

.m2-vt-notice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.85rem 1.35rem 0;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.m2-vt-notice--closed {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: #856404;
}

.m2-vt-notice--closed i {
  flex-shrink: 0;
}

/* ── Layout ── */
.m2-vt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0;
  align-items: start;
}

.m2-vt-main {
  grid-column: 1;
  min-width: 0;
  padding: 1rem 1.35rem 1.35rem;
  border-inline-end: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
}

.m2-vt-aside {
  grid-column: 2;
  padding: 1rem 1rem 1.35rem;
  position: sticky;
  top: 1rem;
}

/* ── Thread (chat) ── */
.m2-vt-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.m2-vt-msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 100%;
}

.m2-vt-msg--staff {
  flex-direction: row;
}

.m2-vt-msg--client {
  flex-direction: row-reverse;
}

.m2-vt-msg__avatar {
  flex: 0 0 2.35rem;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(11, 22, 34, 0.08);
}

.m2-vt-msg--staff .m2-vt-msg__avatar {
  background: linear-gradient(135deg, #05141f 0%, #0a2744 70%, #0f3580 120%);
  color: #6dd4ef;
}

.m2-vt-msg--client .m2-vt-msg__avatar {
  background: rgba(72, 192, 216, 0.14);
  color: var(--m2-ca-cyan-deep, #0891b2);
  border: 1px solid rgba(72, 192, 216, 0.25);
}

.m2-vt-msg__bubble {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(100%, 720px);
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(11, 22, 34, 0.04);
}

.m2-vt-msg--staff .m2-vt-msg__bubble {
  border-color: rgba(72, 192, 216, 0.28);
  background: rgba(72, 192, 216, 0.04);
}

.m2-vt-msg--client .m2-vt-msg__bubble {
  margin-inline-start: auto;
}

.m2-vt-msg__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  background: rgba(11, 22, 34, 0.025);
}

.m2-vt-msg__who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.m2-vt-msg__name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--m2-ca-ink, #0b1622);
}

.m2-vt-msg__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
}

.m2-vt-msg__date {
  font-size: 0.72rem;
  color: var(--m2-ca-muted, #5a6975);
  white-space: nowrap;
}

.m2-vt-msg__body {
  padding: 0.85rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--m2-ca-ink, #0b1622);
}

.m2-vt-msg__body.message > :last-child {
  margin-bottom: 0;
}

.m2-vt-msg__ip {
  margin: 0.75rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  font-size: 0.72rem;
  color: var(--m2-ca-muted, #5a6975);
}

.m2-vt-msg__rating {
  margin-top: 0.65rem;
}

.m2-vt-msg__attachments {
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  background: rgba(11, 22, 34, 0.02);
}

.m2-vt-msg__attachments-title {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  color: var(--m2-ca-ink, #0b1622);
}

.m2-vt-msg__attachments-removed {
  font-size: 0.72rem;
  color: var(--m2-ca-muted, #5a6975);
}

.m2-vt-msg__attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m2-vt-msg__attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  border-radius: 10px;
  background: #fff;
  color: var(--m2-ca-cyan-deep, #0891b2);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.m2-vt-msg__attachment:hover {
  border-color: rgba(72, 192, 216, 0.45);
  background: rgba(72, 192, 216, 0.06);
  text-decoration: none;
}

.m2-vt-msg__attachment figure,
.m2-vt-msg__attachment .caption {
  margin: 0;
}

.m2-vt-msg__attachment .caption {
  font-size: 0.75rem;
  font-weight: 600;
  word-break: break-all;
}

/* ── Reply form ── */
.m2-vt-reply {
  margin-top: 1.15rem;
}

.m2-vt-reply .m2-ticket-form-shell {
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 20px rgba(11, 22, 34, 0.05);
}

.m2-vt-reply .m2-ticket-form-head--compact {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1.15rem;
  grid-template-columns: unset;
  grid-template-areas: unset;
}

.m2-vt-reply .m2-ticket-form-head--compact .m2-ticket-form-head__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}

.m2-vt-reply .m2-ticket-form-head--compact .m2-ticket-form-head__body {
  flex: 1 1 auto;
  min-width: 0;
}

/* Reply form RTL (main thread stays LTR) */
[dir="rtl"] .m2-vt-reply,
html[dir="rtl"] .m2-vt-reply,
body[dir="rtl"] .m2-vt-reply {
  direction: rtl;
}

[dir="rtl"] .m2-vt-reply .m2-ticket-form-head--compact,
html[dir="rtl"] .m2-vt-reply .m2-ticket-form-head--compact,
body[dir="rtl"] .m2-vt-reply .m2-ticket-form-head--compact {
  direction: rtl;
}

[dir="rtl"] .m2-vt-reply .m2-ticket-form-head__title,
html[dir="rtl"] .m2-vt-reply .m2-ticket-form-head__title,
body[dir="rtl"] .m2-vt-reply .m2-ticket-form-head__title,
[dir="rtl"] .m2-vt-reply .m2-ticket-form-head__sub,
html[dir="rtl"] .m2-vt-reply .m2-ticket-form-head__sub,
body[dir="rtl"] .m2-vt-reply .m2-ticket-form-head__sub {
  text-align: right;
}

[dir="rtl"] .m2-vt-reply .m2-ticket-form-section,
html[dir="rtl"] .m2-vt-reply .m2-ticket-form-section,
body[dir="rtl"] .m2-vt-reply .m2-ticket-form-section,
[dir="rtl"] .m2-vt-reply .m2-ticket-form-section__title,
html[dir="rtl"] .m2-vt-reply .m2-ticket-form-section__title,
body[dir="rtl"] .m2-vt-reply .m2-ticket-form-section__title,
[dir="rtl"] .m2-vt-reply .m2-ticket-label,
html[dir="rtl"] .m2-vt-reply .m2-ticket-label,
body[dir="rtl"] .m2-vt-reply .m2-ticket-label,
[dir="rtl"] .m2-vt-reply .m2-ticket-attach__hint,
html[dir="rtl"] .m2-vt-reply .m2-ticket-attach__hint,
body[dir="rtl"] .m2-vt-reply .m2-ticket-attach__hint {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .m2-vt-reply .m2-ticket-form-footer,
html[dir="rtl"] .m2-vt-reply .m2-ticket-form-footer,
body[dir="rtl"] .m2-vt-reply .m2-ticket-form-footer {
  direction: ltr;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ── Aside meta ── */
.m2-vt-aside__card {
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(11, 22, 34, 0.04);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.m2-vt-aside__title {
  margin: 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--m2-ca-ink, #0b1622);
  border-bottom: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  background: rgba(248, 251, 253, 0.9);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.m2-vt-aside__title i {
  color: var(--m2-ca-cyan-deep, #0891b2);
  flex: 0 0 auto;
}

.m2-vt-meta-list {
  margin: 0;
  padding: 0.35rem 0;
}

.m2-vt-meta-list__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px dashed rgba(11, 22, 34, 0.06);
}

.m2-vt-meta-list__row:last-child {
  border-bottom: none;
}

.m2-vt-meta-list dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--m2-ca-muted, #5a6975);
  text-align: start;
  white-space: nowrap;
}

.m2-vt-meta-list dd {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--m2-ca-ink, #0b1622);
  text-align: end;
  word-break: break-word;
}

/* WHMCS sidebar mount — CC only */
.m2-vt-whmcs-sidebar > .nav-elements-box:not([menuitemname="CC Recipients"]),
.m2-vt-whmcs-sidebar [menuitemname="Support"],
.m2-vt-whmcs-sidebar [menuitemname="Ticket Information"] {
  display: none !important;
}

.m2-vt-whmcs-sidebar [menuitemname="CC Recipients"] {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

.m2-vt-whmcs-sidebar [menuitemname="CC Recipients"] .nav-title {
  display: none;
}

.m2-vt-whmcs-sidebar [menuitemname="CC Recipients"] .panel-footer {
  margin: 0 !important;
  margin-inline: 0 !important;
  padding: 0.75rem 0.9rem 0.9rem !important;
  background: transparent !important;
  border: none !important;
  float: none !important;
  clear: none !important;
}

.m2-vt-whmcs-sidebar [menuitemname="CC Recipients"] .panel-footer.mr-8,
.m2-vt-whmcs-sidebar [menuitemname="CC Recipients"] .panel-footer.clearfix {
  margin: 0 !important;
}

.m2-vt-whmcs-sidebar #ccCloneRow,
.m2-vt-whmcs-sidebar .list-group-item.hidden,
.m2-vt-whmcs-sidebar .list-group-item.w-hidden {
  display: none !important;
}

.m2-vt-whmcs-sidebar .ticket-cc-item:not(.w-hidden):not(.hidden) {
  display: block !important;
  padding: 0 0.9rem;
  margin: 0 0 0.45rem;
  border: none;
  background: transparent;
}

.m2-vt-whmcs-sidebar .ticket-cc-email {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  border-radius: 10px;
  background: rgba(248, 251, 253, 0.92);
}

.m2-vt-whmcs-sidebar .ticket-cc-email .email {
  flex: 1 1 auto;
  min-width: 0;
  direction: ltr;
  text-align: start;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--m2-ca-ink, #0b1622);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m2-vt-whmcs-sidebar .ticket-cc-email .pull-right,
.m2-vt-whmcs-sidebar .ticket-cc-email .float-right {
  float: none !important;
  flex: 0 0 auto;
}

.m2-vt-whmcs-sidebar .ticket-cc-email .delete-cc-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  background: rgba(220, 53, 69, 0.08);
  text-decoration: none;
  transition: background 0.15s ease;
}

.m2-vt-whmcs-sidebar .ticket-cc-email .delete-cc-email:hover {
  background: rgba(220, 53, 69, 0.14);
}

.m2-vt-whmcs-sidebar #containerAddCcEmail {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  margin: 0;
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.12));
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.m2-vt-whmcs-sidebar #containerAddCcEmail .input-group-append,
.m2-vt-whmcs-sidebar #containerAddCcEmail .input-group-btn {
  display: flex;
  flex: 0 0 auto;
  margin: 0 !important;
}

.m2-vt-whmcs-sidebar #inputAddCcEmail {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  height: auto;
  min-height: 40px;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 0.78rem;
  direction: ltr;
  text-align: start;
  padding-inline: 0.75rem;
}

.m2-vt-whmcs-sidebar #btnAddCcEmail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0 !important;
  width: auto;
  min-height: 40px;
  height: 100%;
  margin: 0 !important;
  padding: 0 0.95rem;
  border: none !important;
  border-radius: 0 !important;
  background: var(--m2-ca-cyan-deep, #0891b2) !important;
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.m2-vt-whmcs-sidebar #btnAddCcEmail:hover {
  background: #067a96 !important;
}

.m2-vt-whmcs-sidebar #divCcEmailFeedback {
  margin: 0.45rem 0 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
}

.m2-vt-whmcs-sidebar #divCcEmailFeedback:not(.hidden):not(.w-hidden) {
  display: block !important;
}

.m2-vt-aside__card--cc .m2-vt-aside__title--cc {
  border-bottom: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
}

.m2-vt-aside__card--cc .m2-vt-whmcs-sidebar {
  display: block;
}

.m2-vt-aside__links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.m2-vt-aside__link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  background: #fff;
  color: var(--m2-ca-muted, #5a6975);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.m2-vt-aside__link:hover {
  color: var(--m2-ca-cyan-deep, #0891b2);
  border-color: rgba(72, 192, 216, 0.35);
  background: rgba(72, 192, 216, 0.06);
  text-decoration: none;
}

.m2-vt-aside__link i {
  width: 1rem;
  text-align: center;
  color: var(--m2-ca-cyan-deep, #0891b2);
}

/* ── KB (shared file) ── */
body.m2-page-kb .kb-article,
body.m2-page-kb .kbarticles {
  font-size: 0.9rem;
  line-height: 1.6;
}

body.m2-page-kb .kb-article-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--m2-ca-ink, #0b1622);
  margin-bottom: 0.75rem;
}

.m2-kb-suggest-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.m2-kb-suggest-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
}

.m2-kb-suggest-list a {
  color: var(--m2-ca-cyan-deep, #0891b2);
  font-weight: 600;
  text-decoration: none;
}

.m2-kb-suggest-list a:hover {
  text-decoration: underline;
}

/* ── RTL: keep LTR shell, Arabic text only ── */
[dir="rtl"] body.m2-page-ticket .m2-ca-page__head,
html[dir="rtl"] body.m2-page-ticket .m2-ca-page__head,
body[dir="rtl"].m2-page-ticket .m2-ca-page__head {
  direction: rtl;
}

[dir="rtl"] body.m2-page-ticket .m2-ca-page__head > div,
html[dir="rtl"] body.m2-page-ticket .m2-ca-page__head > div,
body[dir="rtl"].m2-page-ticket .m2-ca-page__head > div {
  width: 100%;
  text-align: right;
}

[dir="rtl"] .m2-vt-layout,
html[dir="rtl"] .m2-vt-layout,
body[dir="rtl"] .m2-vt-layout,
[dir="rtl"] .m2-vt-hero,
html[dir="rtl"] .m2-vt-hero,
body[dir="rtl"] .m2-vt-hero,
[dir="rtl"] .m2-vt-thread,
html[dir="rtl"] .m2-vt-thread,
body[dir="rtl"] .m2-vt-thread,
[dir="rtl"] .m2-vt-msg,
html[dir="rtl"] .m2-vt-msg,
body[dir="rtl"] .m2-vt-msg {
  direction: ltr;
}

[dir="rtl"] .m2-vt-aside,
html[dir="rtl"] .m2-vt-aside,
body[dir="rtl"] .m2-vt-aside,
[dir="rtl"] .m2-vt-whmcs-sidebar,
html[dir="rtl"] .m2-vt-whmcs-sidebar,
body[dir="rtl"] .m2-vt-whmcs-sidebar {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .m2-vt-hero__main,
html[dir="rtl"] .m2-vt-hero__main,
body[dir="rtl"] .m2-vt-hero__main,
[dir="rtl"] .m2-vt-hero__back,
html[dir="rtl"] .m2-vt-hero__back,
body[dir="rtl"] .m2-vt-hero__back,
[dir="rtl"] .m2-vt-notice,
html[dir="rtl"] .m2-vt-notice,
body[dir="rtl"] .m2-vt-notice,
[dir="rtl"] .m2-vt-msg__head,
html[dir="rtl"] .m2-vt-msg__head,
body[dir="rtl"] .m2-vt-msg__head,
[dir="rtl"] .m2-vt-msg__body,
html[dir="rtl"] .m2-vt-msg__body,
body[dir="rtl"] .m2-vt-msg__body {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .m2-vt-msg__body.message,
html[dir="rtl"] .m2-vt-msg__body.message,
body[dir="rtl"] .m2-vt-msg__body.message,
[dir="rtl"] .m2-vt-msg__body.message p,
html[dir="rtl"] .m2-vt-msg__body.message p,
body[dir="rtl"] .m2-vt-msg__body.message p,
[dir="rtl"] .m2-vt-msg__body.message li,
html[dir="rtl"] .m2-vt-msg__body.message li,
body[dir="rtl"] .m2-vt-msg__body.message li {
  text-align: right;
}

[dir="rtl"] .m2-vt-msg__ip,
html[dir="rtl"] .m2-vt-msg__ip,
body[dir="rtl"] .m2-vt-msg__ip {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .m2-vt-aside__title,
html[dir="rtl"] .m2-vt-aside__title,
body[dir="rtl"] .m2-vt-aside__title,
[dir="rtl"] .m2-vt-meta-list__row,
html[dir="rtl"] .m2-vt-meta-list__row,
body[dir="rtl"] .m2-vt-meta-list__row,
[dir="rtl"] .m2-vt-aside__link,
html[dir="rtl"] .m2-vt-aside__link,
body[dir="rtl"] .m2-vt-aside__link {
  direction: rtl;
}

[dir="rtl"] .m2-vt-aside__title,
html[dir="rtl"] .m2-vt-aside__title,
body[dir="rtl"] .m2-vt-aside__title {
  justify-content: flex-start;
}

[dir="rtl"] .m2-vt-meta-list dt,
html[dir="rtl"] .m2-vt-meta-list dt,
body[dir="rtl"] .m2-vt-meta-list dt {
  text-align: start;
}

[dir="rtl"] .m2-vt-meta-list dd,
html[dir="rtl"] .m2-vt-meta-list dd,
body[dir="rtl"] .m2-vt-meta-list dd {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  text-align: end;
}

[dir="rtl"] .m2-vt-whmcs-sidebar #containerAddCcEmail,
html[dir="rtl"] .m2-vt-whmcs-sidebar #containerAddCcEmail,
body[dir="rtl"] .m2-vt-whmcs-sidebar #containerAddCcEmail {
  direction: rtl;
}

[dir="rtl"] .m2-vt-whmcs-sidebar #inputAddCcEmail,
html[dir="rtl"] .m2-vt-whmcs-sidebar #inputAddCcEmail,
body[dir="rtl"] .m2-vt-whmcs-sidebar #inputAddCcEmail {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .m2-vt-whmcs-sidebar #inputAddCcEmail:not(:placeholder-shown),
html[dir="rtl"] .m2-vt-whmcs-sidebar #inputAddCcEmail:not(:placeholder-shown),
body[dir="rtl"] .m2-vt-whmcs-sidebar #inputAddCcEmail:not(:placeholder-shown) {
  direction: ltr;
  text-align: left;
}

[dir="rtl"] .m2-vt-aside__link,
html[dir="rtl"] .m2-vt-aside__link,
body[dir="rtl"] .m2-vt-aside__link {
  justify-content: flex-start;
}

[dir="rtl"] .m2-vt-hero__subject,
html[dir="rtl"] .m2-vt-hero__subject,
body[dir="rtl"] .m2-vt-hero__subject {
  text-align: right;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .m2-vt-layout {
    grid-template-columns: 1fr;
  }

  .m2-vt-main {
    border-inline-end: none;
    border-bottom: 1px solid var(--m2-ca-border, rgba(11, 22, 34, 0.08));
  }

  .m2-vt-aside {
    position: static;
    padding-top: 0.75rem;
  }

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

  .m2-vt-hero__back {
    justify-self: start;
  }

  .m2-vt-hero__actions {
    justify-content: stretch;
  }

  .m2-vt-hero__actions .m2-ticket-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 767.98px) {
  .m2-vt-hero,
  .m2-vt-main,
  .m2-vt-aside,
  body.m2-page-ticket .m2-ca-page__head {
    padding-inline: 1rem;
  }

  .m2-vt-notice {
    margin-inline: 1rem;
  }

  .m2-vt-msg--client,
  .m2-vt-msg--staff {
    flex-direction: row;
  }

  .m2-vt-msg__bubble {
    max-width: 100%;
  }
}
