
/* ============================================================
   My Tickets (user-facing support inbox)
   Loaded after base.css + app.css. Reuses existing tokens and
   mirrors the admin-surface components (.pill, .badge,
   .status-pill, .empty-state, .modal-*, .btn, .link-btn, etc.).
   ============================================================ */

/* ----- two-pane layout ----- */
.mt-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 75vh;
  gap: 0;
}
.mt-side {
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mt-main {
  padding: 26px 34px 60px;
  min-width: 0;
}

/* ----- sidebar head ----- */
.mt-side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 4px;
}
.mt-side-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

/* ----- search ----- */
.mt-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color .15s, box-shadow .15s;
}
.mt-search::placeholder { color: var(--text-faint); }
.mt-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ----- tabs ----- */
.mt-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
}
.mt-tab {
  flex: 1;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mt-tab:hover { color: var(--text); }
.mt-tab.active {
  background: var(--bg-raised);
  color: var(--text-heading);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}

/* ----- ticket list ----- */
#mt-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}
.mt-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
}
.mt-item:hover { background: var(--bg-panel); }
.mt-item.active {
  background: var(--accent-soft);
  border-color: var(--border);
}
.mt-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ----- empty / loading state ----- */
.mt-empty {
  padding: 28px 16px;
  font-size: 14px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
}
.mt-empty a {
  color: var(--accent);
  text-decoration: none;
}
.mt-empty a:hover { text-decoration: underline; }

.mt-more { margin: 12px auto 0; display: block; }

/* ----- status pills (align with .status-pill language) ----- */
.mt-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.mt-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .9;
}
.mt-pill.is-open           { color: #60a5fa; border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.10); }
.mt-pill.is-in_progress    { color: #a78bfa; border-color: rgba(167,139,250,.35); background: rgba(167,139,250,.10); }
.mt-pill.is-waiting_on_customer { color: #f59e0b; border-color: rgba(245,158,11,.4);  background: rgba(245,158,11,.10); }
.mt-pill.is-resolved       { color: var(--success); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.mt-pill.is-closed         { color: var(--text-faint); border-color: var(--border); background: var(--bg-panel); }
.mt-pill.is-closed::before { background: var(--text-faint); }

/* ----- main pane placeholder ----- */
.mt-placeholder {
  text-align: center;
  padding: 90px 20px;
  color: var(--text-muted);
}
.mt-placeholder i {
  font-size: 36px;
  color: var(--text-faint);
  margin-bottom: 16px;
  display: block;
}
.mt-placeholder p { margin: 0; font-size: 14px; }

/* ----- detail header ----- */
.mt-back {
  display: none;
  margin-bottom: 16px;
}
.mt-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.mt-num {
  font-size: 12px;
  color: var(--text-faint);
  font-family: 'SFMono-Regular', Consolas, monospace;
  letter-spacing: 0.02em;
}
.mt-head h1 {
  margin: 4px 0 10px;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-heading);
  letter-spacing: -0.01em;
  word-break: break-word;
  line-height: 1.3;
}
.mt-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
.mt-meta .sep { color: var(--text-faint); }

/* ----- banners ----- */
.mt-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.35);
  color: var(--text);
}
.mt-banner i { color: #f59e0b; }
.mt-banner.is-info {
  background: var(--bg-panel);
  border-color: var(--border);
}
.mt-banner.is-info i { color: var(--text-muted); }

/* ----- conversation thread ----- */
.mt-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.mt-msg {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  max-width: 88%;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.mt-msg.is-you {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: rgba(99,102,241,.35);
}
.mt-msg.is-support {
  align-self: flex-start;
}
.mt-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.mt-msg-head b {
  color: var(--text-heading);
  font-weight: 500;
}
.mt-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* ----- reply composer ----- */
.mt-reply {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.mt-reply label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.mt-reply textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.mt-reply textarea::placeholder { color: var(--text-faint); }
.mt-reply textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.mt-reply-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ----- responsive ----- */
@media (max-width: 800px) {
  .mt-layout { grid-template-columns: 1fr; }
  .mt-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .mt-main { padding: 18px 16px 52px; }
  .mt-layout.has-selection .mt-side { display: none; }
  .mt-layout:not(.has-selection) .mt-main { display: none; }
  .mt-back { display: inline-flex; }
  .mt-msg { max-width: 100%; }
  .mt-head h1 { font-size: 19px; }
}