/* ═══════════════════════════════════════════════════════════
   Support Tickets — shared styles (client + admin)
   Brand: --button-bg: #5bbe58  |  RTL-first
   ═══════════════════════════════════════════════════════════ */

/* ── Layout wrapper ───────────────────────────────────────── */
.tk-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--body-bg);
  color: var(--text-color);
  font-family: inherit;
}

/* ── Section header (on support.php) ─────────────────────── */
.tk-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.tk-section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-color);
}
.tk-section-header i {
  color: var(--button-bg);
  font-size: 1.3rem;
}
.tk-section-badge {
  background: var(--button-bg);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-inline-start: 4px;
  vertical-align: middle;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── New Ticket Form ──────────────────────────────────────── */
.tk-new-form {
  background: var(--pop-bg);
  border-radius: 16px;
  padding: 28px 24px 22px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  border: 1px solid rgba(91,190,88,.18);
  max-width: 640px;
  width: 100%;
}
.tk-new-form h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tk-new-form h3 i { color: var(--button-bg); }

/* ── Status Badge ─────────────────────────────────────────── */
.tk-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
}
.tk-status::before { content: '●'; font-size: .55rem; }
.tk-status.opened   { background: rgba(73,179,255,.15); color: #1a7ec7; border: 1px solid rgba(73,179,255,.35); }
.tk-status.in_action{ background: rgba(255,160,50,.15);  color: #b96500; border: 1px solid rgba(255,160,50,.35); }
.tk-status.closed   { background: rgba(120,120,120,.12); color: var(--text-color); opacity: .7; border: 1px solid rgba(128,128,128,.25); }

/* ── Chat conversation ────────────────────────────────────── */
.tk-chat-wrap {
  background: var(--pop-bg);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.09);
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 640px;
  width: 100%;
}


.tk-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 400px;
}

/* Message bubbles */
.tk-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}
/* LTR: my messages right, others left */
.tk-msg.client { align-self: flex-end; align-items: flex-end; }
.tk-msg.admin  { align-self: flex-start; align-items: flex-start; }

/* RTL: swap sides — my messages on right (flex-start), others on left (flex-end) */
html.rtl .tk-msg.client { align-self: flex-start; align-items: flex-start; }
html.rtl .tk-msg.admin  { align-self: flex-end;   align-items: flex-end; }

.tk-msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: .9rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
}
.tk-msg.client .tk-msg-bubble {
  background: var(--button-bg);
  color: #fff;
  border-bottom-inline-end: 4px solid rgba(0,0,0,.12);
  border-radius: 18px 18px 4px 18px;
}
.tk-msg.admin .tk-msg-bubble {
  background: var(--pop-bg2);
  color: var(--text-color);
  border-bottom-inline-start: 4px solid rgba(91,190,88,.3);
  border-radius: 18px 18px 18px 4px;
}

/* RTL: swap border-radius tail to match physical alignment */
html.rtl .tk-msg.client .tk-msg-bubble { border-radius: 18px 18px 18px 4px; }
html.rtl .tk-msg.admin  .tk-msg-bubble { border-radius: 18px 18px 4px 18px; }
.tk-msg-time {
  font-size: .68rem;
  color: #aaa;
  margin-top: 3px;
  padding: 0 4px;
}
.tk-msg-label {
  font-size: .7rem;
  font-weight: 700;
  margin-bottom: 3px;
  padding: 0 4px;
  color: #888;
}
.tk-msg.admin .tk-msg-label { color: var(--button-bg); }

/* ── Chat input area ──────────────────────────────────────── */
.tk-chat-input-wrap {
  border-top: 1px solid rgba(0,0,0,.08);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.tk-chat-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,.13);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: .9rem;
  resize: none;
  background: var(--body-bg);
  color: var(--text-color);
  min-height: 42px;
  max-height: 120px;
  transition: border-color .2s;
  font-family: inherit;
  direction: rtl;
}
.tk-chat-input:focus { outline: none; border-color: var(--button-bg); }
.tk-send-btn {
  background: var(--button-bg);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1rem;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(91,190,88,.35);
}
.tk-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(91,190,88,.45); }
.tk-send-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; transform: none; }

/* ── Wait warning banner ──────────────────────────────────── */
.tk-wait-banner {
  background: rgba(255,160,50,.14);
  border: 1px solid rgba(255,160,50,.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .83rem;
  color: #b96500;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 14px 10px;
}

/* ── Ticket footer actions ────────────────────────────────── */
.tk-actions-bar {
  display: flex;
  gap: 10px;
  padding: 10px 14px 14px;
  justify-content: flex-end;
  border-top: 1px solid rgba(0,0,0,.06);
}
.tk-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity .15s, transform .1s;
}
.tk-btn:hover { opacity: .88; transform: translateY(-1px); }
.tk-btn.close-btn  { background: rgba(179,27,27,.1); color: #b31b1b; border: 1px solid rgba(179,27,27,.2); }
.tk-btn.reopen-btn { background: rgba(91,190,88,.12); color: var(--button-bg); border: 1px solid rgba(91,190,88,.3); }
.tk-btn.status-btn { background: rgba(73,179,255,.1); color: #1a7ec7; border: 1px solid rgba(73,179,255,.25); }

/* ── Star Rating ──────────────────────────────────────────── */
.tk-stars {
  display: flex;
  gap: 5px;
  direction: ltr;
}
.tk-star {
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--border-color);
  transition: color .15s, transform .1s;
  line-height: 1;
}
.tk-star.selected, .tk-star.hover { color: #f4c430; transform: scale(1.18); }
.tk-rate-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tk-rate-card {
  background: var(--pop-bg);
  border-radius: 20px;
  padding: 30px 28px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
}
.tk-rate-card h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--text-color); }
.tk-rate-card p  { margin: 0 0 20px; color: #888; font-size: .88rem; }
.tk-rate-card .tk-stars { justify-content: center; margin-bottom: 22px; }
.tk-rate-btns { display: flex; gap: 10px; justify-content: center; }
.tk-rate-btns button {
  border: none; border-radius: 10px; padding: 10px 22px;
  font-size: .9rem; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.tk-rate-btns button:hover { opacity: .85; }
.tk-rate-confirm { background: var(--button-bg); color: #fff; }
.tk-rate-skip    { background: var(--input-bg); color: var(--text-color); }

/* ── Separator between sections ──────────────────────────── */
.tk-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0 24px;
  color: #aaa;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.tk-separator::before, .tk-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ══════════════════════════════════════════════════════════
   CLIENT PAGE — Full-height chat layout (support.php)
   ══════════════════════════════════════════════════════════ */
.tk-client-page {
  height: calc(100vh - var(--menu-height) - 50px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--body-bg);
}

.tk-client-page #tkClientWrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tk-client-page .tk-chat-wrap {
  flex: 1;
  min-height: 0;
  max-width: 100%;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  box-shadow: none;
}

.tk-client-page .tk-messages {
  max-height: none;
  flex: 1;
  min-height: 0;
}

.tk-client-page .tk-chat-input-wrap {
  flex-shrink: 0;
}

.tk-client-page .tk-actions-bar {
  flex-shrink: 0;
}

.tk-client-page .tk-new-form {
  box-sizing: border-box;
  max-width: 600px;
  margin: 24px auto;
  width: calc(100% - 32px);
}

/* ══════════════════════════════════════════════════════════
   ADMIN DASHBOARD — Email-client layout
   ══════════════════════════════════════════════════════════ */
.tk-dashboard {
  display: flex;
  height: calc(100vh - var(--menu-height) - 56px);
  overflow: hidden;
  background: var(--body-bg);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.tk-sidebar {
  width: 300px;
  flex-shrink: 0;
  border-inline-end: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--pop-bg);
  transition: transform .25s;
}
.tk-sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-color);
}
.tk-sidebar-header h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
}
.tk-sidebar-header h2 i { color: var(--button-bg); }

/* Sidebar header row (title + new ticket btn) */
.tk-sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.tk-sidebar-header-row h2 { margin: 0; }

/* New ticket "+" button */
.tk-new-ticket-btn {
  background: var(--button-bg);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .9rem;
  flex-shrink: 0;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(91,190,88,.35);
}
.tk-new-ticket-btn:hover  { transform: scale(1.12); box-shadow: 0 4px 14px rgba(91,190,88,.45); }
.tk-new-ticket-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; transform: none; }

/* Filter tabs */
.tk-filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tk-filter-tab {
  border: none;
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tk-filter-tab.active, .tk-filter-tab:hover {
  background: var(--button-bg);
  color: #fff;
}
.tk-filter-tab .count-badge {
  background: rgba(255,255,255,.3);
  padding: 1px 6px;
  border-radius: 20px;
  font-size: .68rem;
}

/* Ticket list */
.tk-ticket-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.tk-ticket-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,.05);
  transition: background .12s;
  position: relative;
}
.tk-ticket-item:hover   { background: rgba(91,190,88,.06); }
.tk-ticket-item.active  { background: rgba(91,190,88,.12); border-inline-start: 3px solid var(--button-bg); }
.tk-ticket-item.unread .tk-ti-name {
  font-weight: 800;
  color: var(--button-bg);
}
.tk-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--button-bg);
  flex-shrink: 0;
  animation: tkPulse 1.6s ease-in-out infinite;
}
@keyframes tkPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.3); }
}

/* ── Client floating "new message" button ─────────────────── */
.tk-new-msg-btn {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--button-bg);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 18px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(91,190,88,.4);
  animation: tkSlideUp .25s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tk-new-msg-btn:hover { filter: brightness(1.1); }
@keyframes tkSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.tk-ti-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.tk-ti-name {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.tk-ti-time {
  font-size: .7rem;
  color: #aaa;
  white-space: nowrap;
}
.tk-ti-subject {
  font-size: .82rem;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.tk-ti-preview {
  font-size: .77rem;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main panel ───────────────────────────────────────────── */
.tk-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--body-bg);
}
.tk-main-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #ccc;
  font-size: 1.1rem;
}
.tk-main-empty i { font-size: 3rem; }

/* Admin dynamic content area */
.tk-admin-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Shared panel header — used by admin AND client */
.tk-panel-header {
  flex-shrink: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--pop-bg);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Collapse header on desktop when it only holds the hidden mobile toggle */
@media (min-width: 681px) {
  .tk-panel-header:has(> .tk-mobile-toggle:only-child) {
    padding: 0;
    border-bottom-color: transparent;
  }
}
.tk-panel-info {
  flex: 1;
  min-width: 0;
}
.tk-panel-subject {
  font-size: .98rem;
  font-weight: 700;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-panel-meta {
  font-size: .72rem;
  color: #aaa;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  overflow: hidden;
}
.tk-copy-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid var(--border-color, #e5e7eb);
  background: transparent;
  color: var(--button-bg, #5bbe58);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  font-family: inherit;
}
.tk-copy-email-btn:hover { background: var(--button-bg, #5bbe58); color: #fff; }
.tk-copy-email-btn.copied { background: var(--button-bg, #5bbe58); color: #fff; }
.tk-copy-icon { opacity: .6; font-size: .65rem; }
.tk-panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Rating bar */
.tk-rating-bar {
  padding: 6px 20px;
  background: rgba(244,196,48,.08);
  font-size: .8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Closed notice */
.tk-closed-notice {
  padding: 14px 20px;
  text-align: center;
  color: #999;
  font-size: .85rem;
  flex-shrink: 0;
}

/* Messages area in admin */
.tk-admin-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Admin reply area */
.tk-reply-area {
  flex-shrink: 0;
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  background: var(--pop-bg);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.tk-reply-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,.13);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: .9rem;
  resize: none;
  background: var(--body-bg);
  color: var(--text-color);
  min-height: 44px;
  max-height: 140px;
  font-family: inherit;
  direction: rtl;
  transition: border-color .2s;
}
.tk-reply-input:focus { outline: none; border-color: var(--button-bg); }

/* Stars display in ticket info */
.tk-rating-display {
  display: flex;
  align-items: center;
  gap: 2px;
  direction: ltr;
}
.tk-rating-display .tk-star-icon {
  font-size: .95rem;
  color: var(--border-color);
}
.tk-rating-display .tk-star-icon.filled { color: #f4c430; }

/* ── Mobile sidebar toggle (inside .tk-panel-header) ─────── */
.tk-mobile-toggle {
  display: none;
  background: rgba(91,190,88,.12);
  color: var(--button-bg);
  border: 1px solid rgba(91,190,88,.3);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: .9rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.tk-mobile-toggle:hover { background: rgba(91,190,88,.22); }
.tk-mobile-overlay {
  display: none;
  position: fixed;
  top: calc(var(--menu-height, 60px) + var(--tk-topbar-height, 56px));
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.45);
  z-index: 5;
}

/* ── Scrollbar ────────────────────────────────────────────── */
.tk-messages::-webkit-scrollbar,
.tk-ticket-list::-webkit-scrollbar,
.tk-admin-messages::-webkit-scrollbar { width: 5px; }
.tk-messages::-webkit-scrollbar-thumb,
.tk-ticket-list::-webkit-scrollbar-thumb,
.tk-admin-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 3px;
}

/* ── No tickets placeholder ───────────────────────────────── */
.tk-no-tickets {
  padding: 30px 16px;
  text-align: center;
  color: #bbb;
  font-size: .88rem;
}
.tk-no-tickets i { font-size: 2.2rem; margin-bottom: 8px; display: block; }

/* ── Ticket info row (admin sidebar) ──────────────────────── */
.tk-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: .8rem;
  border-bottom: 1px solid rgba(0,0,0,.05);
  gap: 8px;
}
.tk-info-row .label { color: #999; font-weight: 600; }
.tk-info-row .value { color: var(--text-color); text-align: inline-end; word-break: break-word; }

/* ── Resend activation button ────────────────────────────── */
.tk-resend-activation-btn {
  background: rgba(73,179,255,.1);
  color: #1a7ec7;
  border: 1px solid rgba(73,179,255,.3) !important;
  white-space: nowrap;
}
.tk-resend-activation-btn:hover { background: rgba(73,179,255,.18); }

/* ── Activation log bar ──────────────────────────────────── */
.tk-activation-log {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: .82rem;
  background: rgba(255,160,50,.1);
  border-bottom: 1px solid rgba(255,160,50,.3);
  color: #b96500;
  flex-shrink: 0;
}
.tk-activation-log i { flex-shrink: 0; }
.tk-activation-log.sent {
  background: rgba(91,190,88,.1);
  border-bottom-color: rgba(91,190,88,.3);
  color: #1e7a1b;
}
/* ── Change email toggle button ──────────────────────────── */
.tk-change-email-toggle {
  margin-inline-start: auto;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 8px;
  padding: 4px 11px;
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .18s, transform .15s;
}
.tk-change-email-toggle:hover { background: rgba(255,255,255,.3); }
.tk-change-email-toggle .fa-pen { transition: transform .25s; }
.tk-change-email-toggle.active { background: rgba(255,255,255,.3); }
.tk-change-email-toggle.active .fa-pen { transform: rotate(45deg); }

/* ── Change email sliding bar ────────────────────────────── */
.tk-change-email-bar {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s cubic-bezier(.4,0,.2,1),
              padding .28s cubic-bezier(.4,0,.2,1),
              opacity .22s ease;
  opacity: 0;
  background: var(--pop-bg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  padding: 0 16px;
}
.tk-change-email-bar > * { min-height: 0; overflow: visible; }
.tk-change-email-bar.open {
  grid-template-rows: 1fr;
  padding: 12px 16px;
  opacity: 1;
}

/* Inner flex row (revealed by grid) */
.tk-change-email-bar .tk-change-email-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding-top: 10px; /* room for floating label above input */
}

/* ── Fancy input field ───────────────────────────────────── */
.tk-change-email-field {
  flex: 1;
  position: relative;
  min-width: 0;
}
.tk-ce-icon {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .82rem;
  color: var(--text-color);
  opacity: .4;
  pointer-events: none;
  transition: opacity .2s, color .2s;
  z-index: 1;
}
.tk-change-email-input {
  width: 100%;
  height: 44px;
  padding: 0 13px 0 40px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--body-bg);
  color: var(--text-color);
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}
html.rtl .tk-change-email-input { padding: 0 40px 0 13px; }
.tk-change-email-input::placeholder { color: transparent; }
.tk-change-email-input:focus {
  border-color: var(--button-bg);
  box-shadow: 0 0 0 3px rgba(91,190,88,.15);
}
.tk-change-email-input:focus ~ .tk-ce-icon,
.tk-change-email-input:not(:placeholder-shown) ~ .tk-ce-icon { opacity: .7; color: var(--button-bg); }

/* Floating label — comes after icon in DOM, use general sibling */
.tk-ce-label {
  position: absolute;
  inset-inline-start: 38px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  color: var(--text-color);
  opacity: .5;
  pointer-events: none;
  transition: top .18s, font-size .18s, opacity .18s, color .18s, background .18s;
  padding: 0 3px;
  background: transparent;
  white-space: nowrap;
}
/* input → icon → label: use :has or JS .filled class */
.tk-change-email-field:focus-within .tk-ce-label,
.tk-change-email-field.filled .tk-ce-label {
  top: -1px;
  transform: translateY(-100%) translateY(6px);
  font-size: .72rem;
  opacity: 1;
  color: var(--button-bg);
  background: var(--body-bg);
}

/* Send button */
.tk-ce-send-btn { white-space: nowrap; flex-shrink: 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 680px) {
  .tk-dashboard { position: relative; }

  .tk-sidebar {
    position: fixed;
    top: calc(var(--menu-height, 60px) + var(--tk-topbar-height, 56px));
    bottom: 0;
    inset-inline-start: 0;
    width: 82vw;
    max-width: 300px;
    z-index: 6;
    transform: translateX(-110%);
    border-inline-end: none;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  html.rtl .tk-sidebar { transform: translateX(110%); }

  .tk-sidebar.open { transform: translateX(0) !important; }
  .tk-mobile-overlay.visible { display: block; }

  /* Toggle button visible on mobile, inside the panel header */
  .tk-mobile-toggle { display: flex; }

  .tk-chat-wrap, .tk-new-form { max-width: 100%; border-radius: 0; }
  .tk-messages { max-height: 60vh; }

  .tk-admin-messages { padding: 12px; }
  .tk-panel-header { padding: 8px 10px; gap: 8px; }
  .tk-reply-area { padding: 8px 10px; }
  .tk-panel-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .tk-panel-actions .tk-btn,
  .tk-panel-actions select,
  .tk-panel-actions button {
    width: 100%;
    justify-content: center;
    font-size: .8rem;
    padding: 7px 10px;
    box-sizing: border-box;
  }
  .tk-panel-header {
    flex-wrap: wrap;
  }
}
