/* Support submit + CS inbox + ticket thread — loaded after dashboard.css. */

/* submission modal */
.support-type-row{ display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.support-type-btn{
  flex:1 1 40%; min-width:120px; padding:12px 8px; border-radius:12px; cursor:pointer; font-weight:700; font-size:13px;
  color:var(--text-muted); background:var(--surface-2); border:1px solid var(--border);
  transition:all .15s var(--ease);
}
.support-type-btn:hover{ color:var(--text); border-color:rgba(232,25,44,0.4); }
.support-type-btn.active{ color:#fff; background:rgba(232,25,44,0.2); border-color:rgba(232,25,44,0.8); }
.support-attach{
  display:inline-flex; align-items:center; justify-content:center; gap:6px; cursor:pointer;
  height:38px; padding:0 14px; box-sizing:border-box; flex:0 0 auto;
  font-size:13px; font-weight:600; line-height:1;
  color:var(--text); border-radius:10px; background:var(--surface-2);
  border:1px solid var(--border); transition:border-color .15s var(--ease), background .15s var(--ease);
}
.support-attach:hover{ border-color:rgba(232,25,44,0.45); background:rgba(232,25,44,0.08); }
.support-reply-imgname{
  flex:1; min-width:0; font-size:12px; color:var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.support-error{ color:#ff6b78; font-size:13px; margin-top:8px; min-height:16px; }
.support-result{ text-align:center; padding:24px 8px; }
.support-result-ic{ font-size:42px; }
.support-result-title{ font-size:16px; font-weight:700; color:var(--text); margin-top:10px; }
.support-result-sub{ font-size:13px; color:var(--text-muted); margin-top:6px; }
.support-id{ font-family:ui-monospace,Menlo,Consolas,monospace; font-weight:800; color:#ff8a94; letter-spacing:.5px; }

/* status chips */
.support-chip{ display:inline-block; padding:2px 9px; border-radius:999px; font-size:11px; font-weight:700; }
.support-chip-open{ background:rgba(52,152,219,0.18); color:#7ec7f0; }
.support-chip-in_progress{ background:rgba(241,196,15,0.18); color:#f5d76e; }
.support-chip-resolved{ background:rgba(46,204,113,0.18); color:#7ee2a8; }
.support-chip-closed{ background:rgba(150,150,150,0.16); color:#b7b7b7; }

/* ticket list rows */
.support-list{ display:flex; flex-direction:column; gap:8px; }
.support-loading{ color:var(--text-muted); font-size:13px; padding:16px; text-align:center; }
.support-row{
  display:flex; align-items:center; gap:12px; padding:12px 14px; cursor:pointer;
  border-radius:12px; background:var(--surface-2); border:1px solid var(--border);
  transition:all .15s var(--ease);
}
.support-row:hover{ border-color:rgba(232,25,44,0.4); transform:translateX(2px); }
.support-row-main{ flex:1; min-width:0; }
.support-row-top{ display:flex; align-items:center; gap:8px; }
.support-row-subject{ font-size:14px; font-weight:600; color:var(--text); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.support-row-meta{ font-size:12px; color:var(--text-muted); margin-top:2px; }
.support-row-caret{ font-size:20px; color:var(--text-muted); }
.support-unread{ display:inline-block; width:8px; height:8px; border-radius:50%; background:#ff3b47; box-shadow:0 0 6px rgba(255,59,71,0.8); }

/* thread */
.support-thread-head{ display:flex; align-items:flex-start; gap:12px; margin-bottom:14px; }
.support-back{
  background:var(--surface-2); border:1px solid var(--border); color:var(--text);
  border-radius:10px; padding:8px 14px; height:36px; box-sizing:border-box;
  cursor:pointer; font-weight:700; flex-shrink:0;
  display:inline-flex; align-items:center;
}
.support-back:hover{ border-color:rgba(232,25,44,0.4); background:rgba(232,25,44,0.12); }
.support-thread-title{ flex:1; }
.support-thread-subject{ font-size:15px; font-weight:700; color:var(--text); margin-top:4px; }
.support-thread{
  display:flex; flex-direction:column; min-height:0;
  background:linear-gradient(180deg, rgba(22,26,34,0.92), rgba(12,14,20,0.96));
  border:1px solid var(--border); border-radius:16px; overflow:hidden;
}
.support-thread-scroll{
  display:flex; flex-direction:column; gap:12px; flex:1; min-height:160px;
  overflow:auto; padding:14px 16px;
}
.support-msg{ max-width:78%; padding:10px 14px; }
.support-msg-user{
  align-self:flex-start; margin-right:auto;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:4px 16px 16px 16px;
}
.support-msg-staff{
  align-self:flex-end; margin-left:auto;
  background:rgba(232,25,44,0.14); border:1px solid rgba(232,25,44,0.3);
  border-radius:16px 4px 16px 16px;
}
.support-msg-head{ font-size:11px; font-weight:700; color:var(--text-muted); margin-bottom:4px; }
.support-msg-body{ font-size:13px; color:var(--text); line-height:1.5; word-break:break-word; }
.support-msg-img{ max-width:100%; max-height:220px; border-radius:10px; margin-top:8px; display:block; }
.support-reply-box{
  flex:0 0 auto; margin:0; border-top:1px solid var(--border);
  padding:12px 14px 14px; background:rgba(8,10,14,0.45);
}
.support-reply-input{ width:100%; min-height:72px; resize:vertical; margin:0; }
.support-reply-bar{
  display:flex; align-items:center; gap:10px;
  margin-top:10px; min-height:38px;
}
.support-send-btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:38px; padding:0 18px; box-sizing:border-box; flex:0 0 auto; margin:0 0 0 auto;
  border:none; border-radius:10px; cursor:pointer;
  font-family:'DM Sans',sans-serif; font-size:13px; font-weight:700; line-height:1;
  letter-spacing:.4px; color:#fff;
  background:var(--grad-crimson);
  box-shadow:0 8px 18px -10px rgba(232,25,44,0.7);
  transition:filter .15s var(--ease), transform .15s var(--ease);
}
.support-send-btn:hover{ filter:brightness(1.08); }
.support-send-btn:active{ transform:scale(0.98); }
.support-status-ctl{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.support-status-ctl label{ font-size:12px; font-weight:700; color:var(--text-muted); }
.support-status-ctl select{ width:auto; min-width:160px; }

/* owner queue */
.support-owner-filters{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.support-owner-filters select, .support-owner-filters input{ width:auto; min-width:150px; flex:0 1 auto; }
.support-owner-filters input{ flex:1; min-width:200px; }
.support-count{ font-size:12px; color:var(--text-muted); margin-right:14px; }
.support-count b{ color:var(--text); font-size:13px; }

@media (max-width:640px){
  .support-msg{ max-width:92%; }
}

.support-hint{ font-size:12px; color:var(--text-muted); margin-left:10px; }

/* ─── CS Panel (#view-cs) + Survey Panel (#view-survey-panel) ─── */
#view-cs.active,
#view-survey-panel.active{ display:flex; height:100vh; min-height:0; overflow:hidden; }
#view-cs .dash-main,
#view-survey-panel .dash-main{ min-height:0; overflow:hidden; }
#view-cs .dash-content,
#view-survey-panel .dash-content{
  display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden;
  padding-bottom:18px;
}
#view-cs .sidebar .sb-logo-text,
#view-survey-panel .sidebar .sb-logo-text{
  letter-spacing:3px;
  background:var(--grad-crimson); -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent;
}
.cs-stat-row{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; flex:0 0 auto; }
.cs-stat{
  flex:1; min-width:108px; padding:12px 14px; border-radius:14px;
  background:rgba(16,19,26,0.72); border:1px solid var(--border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.04);
}
.cs-stat-hot{
  background:linear-gradient(180deg, rgba(232,25,44,0.18), rgba(232,25,44,0.06));
  border-color:rgba(232,25,44,0.4);
}
.cs-stat-n{ font-family:'Bebas Neue',sans-serif; font-size:32px; line-height:1; color:var(--text); letter-spacing:1px; }
.cs-stat-hot .cs-stat-n{ color:#FF2D42; }
.cs-stat-l{ font-size:11px; color:var(--text-muted); margin-top:4px; font-weight:600; letter-spacing:.4px; text-transform:uppercase; }
.cs-filters{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
  margin-bottom:14px; flex:0 0 auto;
  padding:10px 12px; border-radius:14px;
  background:rgba(16,19,26,0.55); border:1px solid var(--border);
}
.cs-filters .field-input{ width:auto; min-width:150px; flex:1 1 150px; margin:0; height:38px; }
.cs-refresh-btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:38px; padding:0 16px; box-sizing:border-box; flex:0 0 auto; margin:0;
  border-radius:10px; cursor:pointer; font-weight:700; font-size:13px;
  color:var(--text); background:rgba(232,25,44,0.14);
  border:1px solid rgba(232,25,44,0.4);
}
.cs-refresh-btn:hover{ background:rgba(232,25,44,0.24); }
.cs-layout{
  display:flex; flex:1; min-height:0;
}
.cs-main{
  flex:1; min-width:0; min-height:0; display:grid;
  grid-template-columns:minmax(240px,320px) 1fr; gap:0;
  border:1px solid var(--border); border-radius:18px; overflow:hidden;
  background:rgba(10,12,18,0.55);
  box-shadow:0 24px 60px -36px #000, inset 0 1px 0 rgba(255,255,255,0.04);
}
#cs-list.support-list{
  min-height:0; overflow:auto; padding:10px;
  border-right:1px solid var(--border); background:rgba(8,10,14,0.35);
  gap:6px;
}
#cs-thread.support-thread{
  min-height:0; height:100%; border:none; border-radius:0;
  background:linear-gradient(180deg, rgba(18,22,30,0.4), rgba(10,12,18,0.7));
}
.cs-thread-empty{ display:flex; align-items:center; justify-content:center; }
.support-row{
  position:relative;
}
.support-row.active{
  border-color:rgba(232,25,44,0.5); background:rgba(232,25,44,0.1);
  transform:none;
}
.support-row.active::before{
  content:""; position:absolute; left:0; top:8px; bottom:8px; width:3px;
  border-radius:0 3px 3px 0; background:var(--grad-crimson);
}
.support-row-static{ cursor:default; }
.support-row-static:hover{ transform:none; }
.support-list-head{ font-size:12px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--text-muted); margin:12px 0 6px; }
.support-ticket-banner{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  margin:0 16px 4px; padding:8px 12px; border-radius:10px;
  background:rgba(232,25,44,0.08); border:1px solid rgba(232,25,44,0.22);
  font-size:13px; color:var(--text-muted);
}
.support-thread-head{ padding:14px 16px 8px; margin:0; }
.support-thread-date{ font-size:12px; color:var(--text-muted); font-weight:500; margin-left:8px; }
.support-thread-guild{ font-size:12px; color:var(--text-muted); margin-top:4px; }
.support-msg-system a{ color:var(--crimson-2); font-weight:700; }
.support-chip-pending_decision{ background:rgba(52,152,219,0.18); color:#7ec7f0; }
.support-chip-approved{ background:rgba(46,204,113,0.18); color:#7ee2a8; }
.support-chip-rejected{ background:rgba(232,25,44,0.16); color:#ff8a94; }
.cs-detail-ctl{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:12px 16px 0; margin:0;
}
.cs-fav-btn{
  height:36px; padding:0 14px; box-sizing:border-box;
  display:inline-flex; align-items:center;
  border-radius:10px; cursor:pointer; font-weight:700; font-size:13px;
  color:var(--text); background:var(--surface-2); border:1px solid var(--border);
}
.cs-fav-btn.on{ color:#f5d76e; border-color:rgba(241,196,15,0.5); background:rgba(241,196,15,0.12); }
.cs-status-select{ width:auto; min-width:150px; height:36px; margin:0; }
@media (max-width:1100px){
  #view-cs.active,
  #view-survey-panel.active{ height:auto; overflow:visible; }
  .cs-layout{ display:block; }
  .cs-main{ grid-template-columns:1fr; min-height:70vh; }
  .cs-thread-empty{ display:none; }
  #cs-list.support-list,
  #cs-survey-list.support-list{ border-right:none; }
}

.support-msg-system{ align-self:center; text-align:center; font-size:12px; color:var(--text-muted); font-style:italic; padding:6px 12px; background:var(--surface-3); border:1px solid var(--border); border-radius:10px; max-width:90%; }
.support-closed-bar{
  flex:0 0 auto; padding:14px 16px; text-align:center;
  font-size:13px; font-weight:600; color:var(--text-muted); line-height:1.45;
  background:rgba(8,10,14,0.55); border-top:1px solid var(--border);
}
#view-cs .sb-foot{
  display:flex; flex-direction:column; gap:2px;
  padding:10px 8px 14px;
}
#view-cs .sb-foot .nav-item{ margin-bottom:0; }
#view-cs .cs-search{
  width:240px; min-width:140px; height:38px; margin:0;
}
#cs-thread.support-thread{ display:flex; flex-direction:column; }
#acct-pane-support .support-thread{
  min-height:420px; display:flex; flex-direction:column;
}

/* Role-aware close/reopen controls */
.support-close-btn{ padding:8px 14px; border-radius:10px; cursor:pointer; font-weight:700; font-size:13px;
  color:#ffb4bb; background:rgba(232,25,44,0.10); border:1px solid rgba(232,25,44,0.35); }
.support-close-btn:hover{ background:rgba(232,25,44,0.18); border-color:rgba(232,25,44,0.6); }
.cs-reopen-btn{ padding:8px 14px; border-radius:10px; cursor:pointer; font-weight:700; font-size:13px;
  color:#7ee2a8; background:rgba(46,204,113,0.12); border:1px solid rgba(46,204,113,0.4); }
.cs-reopen-btn:hover{ background:rgba(46,204,113,0.2); }
.cs-status-locked{ font-size:12px; font-weight:700; color:var(--text-muted); padding:8px 12px;
  background:var(--surface-3); border:1px solid var(--border); border-radius:10px; }

/* Themed confirm dialog (close ticket, etc.) — matches dashboard modals */
.support-confirm-ov{ position:fixed; inset:0; z-index:11200; display:flex; align-items:center; justify-content:center;
  padding:20px; background:rgba(4,5,8,0.72); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.support-confirm{ width:min(440px,94vw); border-radius:16px; overflow:hidden;
  background:linear-gradient(180deg, rgba(22,26,34,0.98), rgba(12,14,20,0.99));
  border:1px solid rgba(255,255,255,0.1); box-shadow:0 40px 100px -30px rgba(0,0,0,0.92);
  animation:acctPop .18s var(--ease, ease); }
.support-confirm-body{ padding:22px 22px 8px; font-size:14px; line-height:1.6; color:var(--text); }
.support-confirm-actions{ display:flex; justify-content:flex-end; gap:10px; padding:16px 22px 20px; }
.support-confirm-cancel, .support-confirm-ok{ padding:9px 18px; border-radius:10px; cursor:pointer; font-weight:700; font-size:14px; }
.support-confirm-cancel{ background:var(--surface-3); color:var(--text); border:1px solid var(--border); }
.support-confirm-cancel:hover{ border-color:rgba(255,255,255,0.25); }
.support-confirm-ok{ background:var(--crimson, #E8192C); color:#fff; border:1px solid var(--crimson, #E8192C); }
.support-confirm-ok.danger{ background:linear-gradient(135deg,#E8192C,#b3121f); }
.support-confirm-ok:hover{ filter:brightness(1.08); }

/* ─── Survey campaigns + read-only responses ─── */
.survey-preview-cta{
  margin-top:10px; height:34px; padding:0 14px; border-radius:10px;
  border:1px solid rgba(232,25,44,0.45); background:rgba(232,25,44,0.16);
  color:#fff; font-weight:800; cursor:default;
}
.owner-survey-history-row{ cursor:pointer; }
#view-survey.active{
  display:block; min-height:100vh; overflow:auto;
  background:
    radial-gradient(circle at 20% 10%, rgba(232,25,44,0.18), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(20,184,166,0.10), transparent 30%),
    var(--bg);
}
.survey-shell{
  min-height:100vh; width:100%; padding:0 22px 52px; box-sizing:border-box;
}
.survey-nav{
  max-width:980px; margin:0 auto; padding-left:0; padding-right:0;
}
.survey-card{
  width:min(860px,100%); margin:28px auto 0; padding:28px;
  border:1px solid rgba(255,255,255,0.09); border-radius:18px;
  background:linear-gradient(180deg, rgba(20,23,31,0.92), rgba(10,12,18,0.96));
  box-shadow:0 34px 110px -44px rgba(0,0,0,0.95), inset 0 1px 0 rgba(255,255,255,0.05);
}
.survey-kicker{
  font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:800;
  letter-spacing:1.4px; text-transform:uppercase; color:#ff8a94;
}
.survey-card h1{
  margin:8px 0 8px; color:var(--text); font-family:'Bebas Neue',sans-serif;
  font-size:clamp(42px, 8vw, 72px); line-height:.92; letter-spacing:0;
}
.survey-card p{ margin:0; color:var(--text-muted); line-height:1.55; }
.survey-form{ margin-top:24px; display:flex; flex-direction:column; gap:18px; }
.survey-question{
  padding:16px; border-radius:12px; border:1px solid var(--border);
  background:rgba(255,255,255,0.025);
}
.survey-rating{
  display:grid; grid-template-columns:repeat(5, minmax(42px, 1fr)); gap:8px; margin-top:10px;
}
.survey-rating label{ cursor:pointer; }
.survey-rating input{ position:absolute; opacity:0; pointer-events:none; }
.survey-rating span{
  height:44px; display:flex; align-items:center; justify-content:center;
  border-radius:10px; border:1px solid var(--border); background:var(--surface-2);
  color:var(--text-muted); font-weight:900; transition:all .15s var(--ease);
}
.survey-rating input:checked + span{
  background:rgba(232,25,44,0.2); border-color:rgba(232,25,44,0.75); color:#fff;
  box-shadow:0 10px 28px -18px rgba(232,25,44,0.9);
}
.survey-check{
  display:flex; gap:10px; align-items:flex-start; color:var(--text-muted);
  font-size:13px; line-height:1.4; cursor:pointer;
}
.survey-check input{ margin-top:2px; accent-color:var(--crimson); }
.survey-submit{
  height:46px; border:0; border-radius:12px; color:#fff; cursor:pointer;
  background:var(--grad-crimson); font-weight:900; font-size:14px;
  box-shadow:0 18px 34px -22px rgba(232,25,44,0.9);
}
.survey-submit:disabled{ opacity:.65; cursor:wait; }
.survey-score{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:42px; height:24px; padding:0 8px; border-radius:999px;
  color:#fff; background:rgba(232,25,44,0.18); border:1px solid rgba(232,25,44,0.4);
  font-size:12px; font-weight:900;
}
.cs-survey-main{ grid-template-columns:minmax(260px,380px) 1fr; min-height:520px; }
.survey-detail{ height:100%; overflow:auto; }
.survey-answer-grid{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px;
  padding:0 16px 14px;
}
.survey-answer,.survey-text-answer{
  border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,0.025);
}
.survey-answer{ padding:12px; }
.survey-answer b,.survey-text-answer b{
  display:block; color:var(--text-muted); font-size:11px; text-transform:uppercase; letter-spacing:.8px;
}
.survey-answer span{ display:block; margin-top:5px; color:var(--text); font-weight:800; }
.survey-text-answer{ margin:0 16px 12px; padding:14px; }
.survey-text-answer p{ margin:7px 0 0; color:var(--text); line-height:1.55; font-size:14px; }
#sp-campaigns-pane{ overflow:auto; min-height:0; }
#sp-responses-pane{
  display:flex; flex-direction:column; flex:1; min-height:0;
}
#view-survey-panel .cs-survey-main{ flex:1; min-height:0; }

@media (max-width:760px){
  .survey-card{ padding:20px; border-radius:14px; }
  .survey-rating{ grid-template-columns:repeat(5,1fr); }
  .survey-answer-grid{ grid-template-columns:1fr; }
  .cs-survey-main{ grid-template-columns:1fr; }
}

/* A message can carry up to 5 images (2026-09-22). They wrap in a row instead
   of stacking one enormous screenshot per line. Shared by the customer pane and
   the CS panel — both go through supportRenderThread. */
.support-msg-shots{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;}
.support-msg-shots .support-msg-img{max-width:160px;max-height:112px;object-fit:cover;margin-top:0;}
.topbar-feedback-dot{display:inline-block;min-width:8px;height:8px;padding:0 4px;border-radius:999px;
  background:#E8192C;color:#fff;font-size:10px;font-weight:700;line-height:8px;margin-left:5px;
  vertical-align:middle;}
