.tk-container { max-width: 820px; margin: 0 auto; padding: 2.6rem 1.5rem 4rem; }

/* ---------- Stats strip ---------- */
.tk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 1.8rem; }
.tk-stat {
  padding: 16px 18px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--glass-border);
}
.tk-stat-num { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 850; line-height: 1; margin-bottom: 4px; }
.tk-stat-label { font-size: .76rem; color: var(--text-muted); font-weight: 600; }
.tk-stat.open .tk-stat-num { color: var(--amber); }
.tk-stat.answered .tk-stat-num { color: var(--green); }

/* ---------- Head ---------- */
.tk-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 1.6rem; flex-wrap: wrap; }
.tk-list-head h1 { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 850; letter-spacing: -0.02em; margin-bottom: 6px; }
.tk-list-head p { color: var(--text-muted); font-size: .87rem; max-width: 440px; }

/* ---------- Ticket cards ---------- */
.tk-card-list { display: flex; flex-direction: column; gap: 10px; }
.tk-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; width: 100%; text-align: left;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, transform .15s; font-family: inherit; color: var(--text);
}
.tk-card:hover { border-color: var(--blue-light); transform: translateY(-1px); }
.tk-card-icon {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.06); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--text-dim);
}
.tk-card-icon svg { width: 19px; height: 19px; }
.tk-card-main { flex: 1; min-width: 0; }
.tk-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tk-card-subject { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-card-sub { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-card-sub .dot { opacity: .5; }
.tk-card-arrow { color: var(--text-muted); flex-shrink: 0; }
.tk-card-arrow svg { width: 18px; height: 18px; }

.tk-status-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px;
  font-size: .68rem; font-weight: 700; flex-shrink: 0; white-space: nowrap;
}
.tk-status-pill.open { background: rgba(234, 179, 8, .15); color: var(--amber); }
.tk-status-pill.answered { background: rgba(16, 185, 129, .15); color: var(--green); }
.tk-status-pill.closed { background: rgba(113, 113, 122, .18); color: var(--text-dim); }

.tk-priority-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tk-priority-dot.low { background: var(--text-muted); }
.tk-priority-dot.normal { background: var(--cyan); }
.tk-priority-dot.high { background: #f87171; }

/* ---------- Detail / thread ---------- */
.tk-back-link {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: .84rem; font-weight: 600; font-family: inherit; padding: 0; margin-bottom: 1.4rem;
  transition: color .15s;
}
.tk-back-link:hover { color: var(--text); }
.tk-back-link svg { width: 15px; height: 15px; }

.tk-detail-head { padding-bottom: 1.2rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--glass-border); }
.tk-detail-head-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tk-ticket-num { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.tk-detail-head h1 { font-family: 'Outfit', sans-serif; font-size: 1.35rem; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.tk-detail-meta { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tk-thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 1.6rem; }
.tkt-message {
  border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--glass-border);
  border-left: 3px solid var(--glass-border); padding: 14px 16px;
}
.tkt-message.is-admin { border-left-color: var(--green); }
.tkt-message.is-user { border-left-color: var(--blue-light); }
.tkt-message-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tkt-message-author { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: .85rem; }
.tkt-message-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: .64rem; font-weight: 750; color: #fff; background: var(--grad-cyan);
}
.tkt-message.is-admin .tkt-message-avatar { background: var(--green); color: #06110c; }
.tkt-message-badge-admin {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 20px;
  background: rgba(16, 185, 129, .15); color: var(--green); font-size: .63rem; font-weight: 700;
}
.tkt-message-date { font-size: .74rem; color: var(--text-muted); white-space: nowrap; }
.tkt-message-body { font-size: .89rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--text-dim); }

.tk-closed-banner {
  margin-bottom: 1.4rem; padding: 12px 16px; border-radius: var(--radius-sm);
  background: rgba(113, 113, 122, .12); border: 1px solid var(--glass-border);
  color: var(--text-dim); font-size: .85rem; display: flex; align-items: center; gap: 10px;
}
.tk-closed-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

.tk-reply-form { display: flex; flex-direction: column; gap: 10px; }
.tk-reply-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ---------- Empty state ---------- */
.tk-list-empty {
  padding: 3.2rem 1.5rem; text-align: center; color: var(--text-muted); font-size: .87rem; line-height: 1.6;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
}
.tk-list-empty svg { width: 30px; height: 30px; margin-bottom: 10px; color: var(--text-muted); }

/* ---------- New-ticket modal ---------- */
.tk-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.tk-modal-overlay.show { opacity: 1; pointer-events: auto; }
.tk-modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--bg2);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 26px;
  transform: translateY(14px) scale(.98); transition: transform .2s ease;
}
.tk-modal-overlay.show .tk-modal { transform: translateY(0) scale(1); }
.tk-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tk-modal-head h2 { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 800; }
.tk-modal-close {
  width: 32px; height: 32px; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-dim); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.tk-modal-close:hover { color: var(--text); }
.tk-modal-close svg { width: 15px; height: 15px; }

.tk-form-row { margin-bottom: 16px; }
.tk-form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tk-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tk-cat-chip {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--glass-border); cursor: pointer; font-size: .84rem;
  font-weight: 600; color: var(--text-dim); transition: all .15s;
}
.tk-cat-chip svg { width: 16px; height: 16px; flex-shrink: 0; }
.tk-cat-chip:hover { border-color: var(--text-muted); }
.tk-cat-chip.active { border-color: var(--blue-light); background: rgba(255,255,255,.08); color: var(--text); }

.tk-attach-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px dashed var(--glass-border); color: var(--text-muted); font-size: .8rem; cursor: pointer;
}
.tk-attach-row:hover { border-color: var(--text-muted); color: var(--text-dim); }
.tk-attach-row svg { width: 15px; height: 15px; flex-shrink: 0; }

.tk-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

@media (max-width: 600px) {
  .tk-container { padding: 1.8rem 1rem 3rem; }
  .tk-stats { grid-template-columns: 1fr 1fr 1fr; }
  .tk-list-head { flex-direction: column; align-items: stretch; }
  .tk-list-head .btn { width: 100%; justify-content: center; }
  .tk-card { flex-wrap: wrap; }
  .tk-form-row-split, .tk-cat-grid { grid-template-columns: 1fr; }
  .tk-modal { padding: 20px; }
}
