/* support.css — internal support center. Scoped under .sup-* */

.sup-root {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg-app); min-height: 0;
  overflow: auto;
}
.sup-header {
  flex-shrink: 0;
  padding: 22px 28px 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-row);
}
.sup-title-row {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.sup-title { font-size: 22px; font-weight: 800; color: var(--ink-strong); margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.sup-title-icon { font-size: 20px; }
.sup-meta { font-size: 12.5px; color: var(--ink-muted); }

/* 8 tabs can overflow narrow viewports — let the bar scroll
   horizontally instead of wrapping into a ragged second row.
   Scrollbar is hidden; the active tab is scrolled into view by the
   browser on focus. */
.sup-tabs {
  display: flex; gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;            /* Firefox */
  -webkit-overflow-scrolling: touch;
}
.sup-tabs::-webkit-scrollbar { display: none; }   /* Chrome/Safari */
.sup-tab {
  padding: 10px 16px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--ink-muted);
  background: transparent;
  border: none; border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;              /* don't wrap a label mid-word */
  flex-shrink: 0;
  transition: color .12s, border-color .12s;
}
.sup-tab:hover { color: var(--ink-strong); }
.sup-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.sup-empty { padding: 40px 28px; text-align: center; color: var(--ink-muted); font-size: 13px; }

/* ── Tickets tab ──────────────────────────────────────────────── */
.sup-tickets { padding: 14px 28px 28px; display: flex; flex-direction: column; gap: 14px; }

.sup-tickets-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.sup-search {
  flex: 0 1 360px;
  padding: 7px 12px; font: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: white;
  transition: border-color .12s, box-shadow .12s;
}
.sup-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.sup-tickets-toolbar select {
  font: inherit; font-size: 13px; color: var(--ink-strong);
  padding: 6px 10px;
  background: white;
  border: 1px solid var(--border); border-radius: var(--r-md);
  min-height: 32px;
}
.sup-toolbar-count {
  font-size: 12px; color: var(--ink-muted); font-weight: 500;
  padding: 4px 10px; background: var(--bg-subtle); border-radius: 999px;
}

.sup-ticket-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 18px;
  align-items: start;
}
.sup-ticket-grid.is-full { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1200px) { .sup-ticket-grid { grid-template-columns: 1fr; } }

.sup-ticket-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ── Task-table-style group cards (mirrors .epic-group / .t) ─── */
.sup-group {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  --sup-group-color: var(--brand);
}
.sup-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 8px;
  border-left: 6px solid var(--sup-group-color);
  background: white;
  cursor: pointer; user-select: none;
}
.sup-group-chev {
  width: 16px; height: 16px;
  color: var(--sup-group-color);
  transition: transform .15s ease;
  flex: none;
}
.sup-group.is-collapsed .sup-group-chev { transform: rotate(-90deg); }
.sup-group-title {
  font-weight: 700; font-size: 14px;
  color: var(--sup-group-color);
  letter-spacing: -0.01em;
}
.sup-group-count {
  font-size: 12px; color: var(--ink-muted); font-weight: 500;
  padding: 1px 8px; border-radius: 999px;
  background: var(--bg-subtle);
}
.sup-group-table-wrap { overflow-x: auto; }

.sup-t {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.sup-t thead th {
  background: #fafbfc;
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  user-select: none;
  white-space: nowrap;
}
.sup-t thead th.sup-th-name {
  border-left: 6px solid var(--sup-group-color);
  padding-left: 14px;
}
.sup-t thead th.sup-th-center { text-align: center; }
.sup-t thead th.sup-th-actions { text-align: right; }

.sup-t tbody td {
  border-bottom: 1px solid var(--border-row);
  padding: 8px 10px;
  vertical-align: middle;
  background: white;
  transition: background .08s;
}
.sup-t tbody tr:last-child td { border-bottom: none; }
.sup-t tbody tr.sup-tr { cursor: pointer; }
.sup-t tbody tr.sup-tr:hover td { background: #fbfcfe; }
.sup-t tbody tr.sup-tr.is-selected td { background: rgba(0,115,234,.05); }

.sup-t tbody td.sup-td-name {
  border-left: 6px solid var(--sup-group-color);
  padding-left: 14px;
  color: var(--ink-strong);
  font-weight: 600;
  min-width: 220px;
}
.sup-td-name-wrap { display: flex; align-items: center; gap: 8px; }
.sup-td-name-text { word-break: break-word; }
.sup-td-id {
  font-family: ui-monospace, monospace;
  font-size: 10.5px; color: var(--ink-faint);
  margin-top: 2px; font-weight: 500;
}
.sup-td-cell { color: var(--ink-body); }
.sup-td-center { text-align: center; }
.sup-td-meta { color: var(--ink-muted); font-size: 12px; white-space: nowrap; }
.sup-td-customer { font-weight: 600; color: var(--ink-strong); }
.sup-td-customer-sub { font-size: 11.5px; color: var(--ink-muted); }
.sup-faint { color: var(--ink-faint); font-size: 12px; }

.sup-credits-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 22px; padding: 0 8px;
  border-radius: var(--r-sm);
  background: var(--bg-subtle); font-size: 12px; font-weight: 700;
  color: var(--ink-body);
}
.sup-inline-select,
.sup-inline-input {
  font: inherit; font-size: 13px; color: var(--ink-strong);
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  width: 100%;
  transition: border-color .12s, background .12s;
}
.sup-inline-select:hover, .sup-inline-input:hover { background: var(--bg-subtle); }
.sup-inline-select:focus, .sup-inline-input:focus {
  outline: none; background: white;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.sup-inline-num { text-align: center; max-width: 100px; }

.sup-status, .sup-prio {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}
.sup-status-open                { background: rgba(87,155,252,.15);  color: #1f5db8; }
.sup-status-in_progress         { background: rgba(253,171,61,.18);  color: #b66f00; }
.sup-status-waiting_on_customer { background: rgba(162,93,220,.16);  color: #6e2bd9; }
.sup-status-resolved            { background: rgba(0,200,117,.16);   color: #00853d; }
.sup-status-closed              { background: rgba(154,160,174,.20); color: #4b5266; }

.sup-prio-low    { background: rgba(87,155,252,.15);  color: #1f5db8; }
.sup-prio-normal { background: var(--bg-subtle);      color: var(--ink-muted); }
.sup-prio-high   { background: rgba(226,68,92,.14);   color: #b41f37; }
.sup-prio-urgent { background: rgba(226,68,92,.20);   color: #8a1024; }

.sup-detail-empty {
  background: var(--bg-surface);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 80px 24px; text-align: center;
  color: var(--ink-muted); font-size: 13.5px;
}
.sup-detail {
  background: var(--bg-surface);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 220px);
  overflow: hidden;
}
.sup-detail-head {
  padding: 14px 16px 14px 14px;
  border-bottom: 1px solid var(--border-row);
  border-left: 6px solid var(--brand);
  display: flex; gap: 14px; justify-content: space-between; align-items: flex-start;
  background: white;
}
.sup-detail-head h3 { margin: 4px 0 6px; font-size: 17px; font-weight: 800; word-break: break-word; }
.sup-detail-id   { font-family: ui-monospace, monospace; font-size: 11px; color: var(--ink-faint); }
.sup-detail-cust { font-size: 12px; color: var(--ink-muted); display: flex; gap: 6px; flex-wrap: wrap; }
.sup-detail-cust b { color: var(--ink-strong); }

.sup-detail-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-row);
  background: var(--bg-app);
  font-size: 12px; color: var(--ink-muted);
}
.sup-detail-controls label { display: inline-flex; align-items: center; gap: 6px; }
.sup-detail-controls select {
  font: inherit; font-size: 12.5px; padding: 4px 8px;
  border: 1px solid var(--border-soft); border-radius: 6px; background: white;
}
.sup-detail-tag {
  margin-left: auto;
  background: var(--bg-subtle); padding: 4px 10px; border-radius: 999px;
  font-weight: 600; color: var(--ink-strong);
}

.sup-detail-body {
  padding: 14px 18px;
  font-size: 14px; color: var(--ink-strong);
  white-space: pre-wrap; word-break: break-word;
  border-bottom: 1px solid var(--border-row);
}
.sup-attachments {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-row);
}
.sup-att-image img {
  max-width: 220px; max-height: 160px;
  border-radius: 8px; border: 1px solid var(--border-soft);
}
.sup-att-video {
  max-width: 320px; max-height: 200px;
  border-radius: 8px; background: black;
}
.sup-att-file {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px;
  background: var(--bg-subtle); border: 1px solid var(--border-soft);
  font-size: 13px; color: var(--ink-strong); text-decoration: none;
}

.sup-thread {
  flex: 1; overflow-y: auto;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.sup-thread-empty { color: var(--ink-muted); font-style: italic; padding: 24px 0; text-align: center; }
.sup-comment {
  max-width: 80%;
  padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5;
}
.sup-comment.is-customer { align-self: flex-start; background: var(--bg-subtle); border: 1px solid var(--border-row); }
.sup-comment.is-agent    { align-self: flex-end;   background: var(--brand-soft, rgba(108,43,217,.08)); border: 1px solid rgba(108,43,217,.25); }
.sup-comment-meta { font-size: 11px; color: var(--ink-faint); margin-bottom: 4px; font-weight: 600; }
.sup-comment-body { white-space: pre-wrap; word-break: break-word; color: var(--ink-strong); }

.sup-reply {
  border-top: 1px solid var(--border-row);
  padding: 12px 18px; background: var(--bg-app);
}
.sup-reply textarea {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 14px;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: white;
  min-height: 70px; resize: vertical;
}
.sup-reply-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 8px;
}

/* ── Customers tab ───────────────────────────────────────────── */
.sup-customers { padding: 14px 28px 28px; display: flex; flex-direction: column; gap: 14px; }

.sup-cust-cap   { font-size: 11px; color: var(--ink-faint); margin-left: 4px; }
.sup-cust-mini {
  margin-left: 8px;
  font: inherit; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  border: 1px solid var(--border); background: white;
  cursor: pointer; color: var(--ink-muted);
}
.sup-cust-mini:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

.sup-cust-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sup-cust-del { color: #c0223a; border-color: #f5c0cc; }
.sup-cust-del:hover { background: #fff0f3; }

.sup-pill {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.sup-pill-active    { background: rgba(0,200,117,.14);  color: #00853d; }
.sup-pill-suspended { background: rgba(228,68,92,.12);  color: #b41f37; }

/* ── Settings tab (plans + types) ────────────────────────────── */
.sup-settings { padding: 18px 28px 28px; display: flex; flex-direction: column; gap: 18px; }
.sup-t-settings tbody td.sup-td-name { min-width: 200px; }
.sup-t-settings .sup-inline-input { padding: 6px 10px; }

/* ── Project pill on ticket rows + linked-task pill ─────────── */
.sup-proj-pill {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  letter-spacing: .01em;
}
.sup-task-pill {
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: #efe6ff; color: #6e2bd9;
  letter-spacing: .01em;
}

/* ── Escalate panel inside a ticket detail ──────────────────── */
.sup-escalate-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px;
  background: linear-gradient(0deg, rgba(0,115,234,.04), rgba(0,115,234,.04)),
              var(--bg-surface);
  border-bottom: 1px solid var(--border-row);
  font-size: 13px; color: var(--ink-body);
}
.sup-escalate-label { font-weight: 600; color: var(--ink-strong); }
.sup-escalate-code  { font-family: ui-monospace, monospace; font-size: 11.5px;
                      background: var(--bg-subtle); padding: 2px 8px; border-radius: 6px;
                      color: var(--ink-body); }
.sup-escalate-name  { color: var(--ink-muted); }
.sup-mini-status {
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-subtle); color: var(--ink-body);
  text-transform: uppercase; letter-spacing: .04em;
}

.sup-escalate-form {
  padding: 14px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-row);
  display: flex; flex-direction: column; gap: 10px;
}
.sup-escalate-head {
  display: flex; justify-content: space-between; align-items: center;
}
.sup-escalate-head h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-strong); }
.sup-escalate-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.sup-escalate-form label,
.sup-escalate-full {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--ink-muted);
}
.sup-escalate-form select,
.sup-escalate-form input[type="text"],
.sup-escalate-form textarea {
  font: inherit; font-size: 13px; color: var(--ink-strong);
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: white;
  resize: vertical;
}
.sup-escalate-form select:focus,
.sup-escalate-form input[type="text"]:focus,
.sup-escalate-form textarea:focus { outline: none; border-color: var(--brand); }
.sup-escalate-assignees {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 4px;
}
.sup-escalate-assignees-head { font-size: 12px; color: var(--ink-muted); }
.sup-escalate-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sup-assignee-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-body);
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: white; cursor: pointer;
  user-select: none;
}
.sup-assignee-chip input { display: none; }
.sup-assignee-chip span {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 11px;
}
.sup-assignee-chip.is-on {
  background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark);
}
.sup-escalate-foot { display: flex; justify-content: flex-end; }
.sup-escalate-error {
  font-size: 12.5px; color: var(--status-blocked);
  background: #ffeef1; padding: 6px 10px; border-radius: 6px;
}

/* ── Linked-projects section inside CustomerEditor ──────────── */
.sup-cust-projects {
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border-row); padding-top: 10px;
}
.sup-cust-projects-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--ink-strong);
}
.sup-cust-projects-hint { font-weight: 400; color: var(--ink-muted); font-size: 11.5px; }
.sup-cust-projects-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 150px; overflow-y: auto;
  padding: 4px 0;
}
.sup-cust-projects-empty { font-size: 12px; color: var(--ink-muted); padding: 8px; }
.sup-cust-project-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-body);
  padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: white; cursor: pointer;
  user-select: none;
}
.sup-cust-project-chip input { display: none; }
.sup-cust-project-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.sup-cust-project-chip.is-on {
  background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark);
}
