/* ============================================================
   Support Chat – agent dashboard + login
   ============================================================ */
:root {
  /* ==== 2026-09-13 design refresh - approved mockup, see TODO item 14 ====
     One system now shared by Dashboard.aspx, Settings.aspx (admin) and
     Login.aspx - previously Settings.aspx carried its own competing blue
     (#3498db) and its own .btn/.card rules that silently overrode these
     because its inline <style> loads after this file's <link>. Everything
     below is now the single source of truth for color/buttons/badges;
     Settings.aspx's local <style> block only adds what's genuinely unique
     to it (forms, pills, code preview). */
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --surface-hover: #f1f5f9;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --text:      #0f172a;
  --text-mut:  #64748b;
  --text-faint:#94a3b8;
  --primary:   #4f46e5;
  --primary-d: #4338ca;
  --primary-l: #eef2ff;
  --accent:    #0ea5e9;
  --success:     #059669;
  --success-bg:  #ecfdf5;
  --success-dot: #10b981;
  --warn:      #b45309;
  --warn-bg:   #fffbeb;
  --warn-dot:  #f59e0b;
  --danger:    #dc2626;
  --danger-bg: #fef2f2;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 8px 24px -8px rgba(15,23,42,.14);
  --shadow-lg: 0 24px 60px -16px rgba(15,23,42,.35);
  --topbar-h:  64px;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN  (Pages/Agent/Login.aspx)
   ============================================================ */
.login-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% -10%, #e0e7ff 0%, transparent 55%),
    radial-gradient(1000px 500px at 100% 0%, #cffafe 0%, transparent 45%),
    var(--bg);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -16px rgba(79,70,229,.25);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}
.login-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.login-mark svg { width: 22px; height: 22px; }
.login-box h1 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; }
.login-box h2 { font-size: 13.5px; font-weight: 500; color: var(--text-mut); margin-bottom: 26px; }
/* Shown only on a company's own login link (Login.aspx?company=slug) -
   see Login.aspx.vb - confirms which self-hosted company this is before
   the agent types anything in. */
.login-company-badge {
  display: block;
  background: var(--primary-l);
  color: var(--primary-dark, var(--primary));
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.login-box .form-group { margin-bottom: 14px; }
.login-box label { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.login-box .form-control,
.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="email"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-l);
}
.login-box .btn,
.login-box button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.login-box .btn:hover { background: var(--primary-d); }
.login-box .btn:active { transform: scale(.99); }
.error-message {
  display: block;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 13px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.desktop-app-hint {
  text-align: center;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.desktop-app-hint a {
  font-size: 12.5px;
  color: var(--text-mut);
  text-decoration: none;
}
.desktop-app-hint a:hover { color: var(--primary); text-decoration: underline; }

/* ============================================================
   DASHBOARD SHELL
   ============================================================ */
body.app-dashboard {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.app-dashboard form#form1 {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 16px; height: 16px; }
.topbar-logo { display: none; } /* superseded by .brand-mark */
.topbar-title { letter-spacing: -.01em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions .vsep { width: 1px; height: 24px; background: var(--border); margin: 0 2px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 14px 0 12px;
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
  transition: background .12s, border-color .12s;
}
.status-pill .status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.online  { color: var(--success); }
.status-pill.online  .status-dot { box-shadow: 0 0 0 3px var(--success-bg); }
.status-pill.offline { color: var(--text-mut); }
.status-pill.offline .status-dot { box-shadow: 0 0 0 3px var(--surface-hover); }
.status-pill:hover { background: var(--surface-hover); }

.agent-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mut);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-logout {
  color: var(--text-mut);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  transition: background .12s, color .12s;
}
.btn-logout:hover { background: var(--surface-hover); color: var(--text); }

.btn-top {
  background: transparent;
  color: var(--text-mut);
  border: 0;
  font-size: 13.5px;
  font-weight: 600;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, color .12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-top:hover { background: var(--surface-hover); color: var(--text); }
a.btn-top { display: inline-flex; text-decoration: none; }

/* Board */
.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
  overflow: hidden;
}
.col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.col-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.col-head h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mut); }
.count-badge {
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-mut);
  font-size: 11.5px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
}
.col-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.no-chats {
  margin: auto;
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
  padding: 32px 12px;
}

/* Cards - status now reads from a badge (see BADGES below), not a
   left-border color stripe, so the same visual language works in both
   the dashboard's card lists AND the admin panel's data tables. */
.chat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.chat-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--text-mut);
}
.chat-card .card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-card .card-top { display: flex; align-items: center; gap: 8px; }
.chat-card .visitor-name { font-weight: 700; font-size: 14px; }
.chat-card .website-name { font-size: 11.5px; color: var(--text-faint); }
.chat-card .last-message {
  font-size: 12.5px; color: var(--text-mut);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-card .timestamp { font-size: 11px; color: var(--text-faint); margin-left: auto; flex-shrink: 0; }
.chat-card .card-actions { display: flex; gap: 6px; flex-shrink: 0; }
/* A colleague's active chat, shown for visibility only - no Öppna/Stäng. */
.active-card-other { opacity: .65; }
.handled-by-badge {
  font-size: 12px; color: var(--text-faint); white-space: nowrap;
  font-style: italic;
}

/* Badges / status pills - one meaning per badge, reused in the dashboard's
   card lists AND the admin panel's data tables. */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.badge-warn    { background: var(--warn-bg);    color: var(--warn); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-neutral { background: var(--surface-hover); color: var(--text-mut); }
.badge-primary { background: var(--primary-l);  color: var(--primary-d); }

/* Buttons - one system, four meanings, two sizes. Used everywhere:
   dashboard topbar/cards/chat modal AND the admin panel. */
.btn {
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-mut); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.icon-btn {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-mut);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .12s, color .12s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn svg { width: 16px; height: 16px; }

/* Status bar */
.statusbar {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 9px 20px;
  font-size: 12.5px;
  color: var(--text-mut);
}

/* ============================================================
   CHAT MODAL
   ============================================================ */
.chat-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.chat-modal-content {
  /* Must be a positioning context: #videoOverlay/#screenOverlay are
     position:absolute children of this box, meant to dock/clip WITHIN it
     (a small 300x400 corner panel for the call, a full fill for the shared-
     screen view). Without "position: relative" here, an absolutely
     positioned child with no other positioned ancestor skips straight past
     a position:static parent and anchors to .chat-modal instead - which is
     position:fixed;inset:0, i.e. the WHOLE BROWSER VIEWPORT, not this
     ~560x640px centered box - and escapes this box's overflow:hidden
     clipping entirely. That's what made the video call look like it was
     taking over the screen instead of sitting in its own small corner. */
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.chat-modal-header {
  flex-shrink: 0;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-modal-header h3 { font-size: 14.5px; font-weight: 800; }
.chat-tabs-bar {
  flex-shrink: 0;
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.chat-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-mut);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 160px;
}
.chat-tab.active { background: var(--surface); color: var(--primary); box-shadow: inset 0 2px 0 var(--primary); }
.chat-tab .tab-label { overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.chat-tab .tab-unread {
  background: var(--danger, #e33);
  color: #fff;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
}
.chat-tab .tab-close {
  opacity: .7;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.chat-tab .tab-close:hover { opacity: 1; }
.close-chat-btn {
  background: transparent;
  border: 0;
  color: var(--text-mut);
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.close-chat-btn:hover { background: var(--surface-hover); color: var(--text); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.chat-message {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: msgIn .18s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chat-message.agent-message {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-message.visitor-message {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-message.system-message {
  align-self: center;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
  max-width: 90%;
  text-align: center;
}
.chat-message .message-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10.5px;
  opacity: .75;
  margin-bottom: 2px;
}
.chat-message p { margin: 0; }
.chat-message .att-image {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  cursor: pointer;
}
.chat-message .att-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.chat-message .att-file .att-name { text-decoration: underline; word-break: break-all; }

/* Typing indicator */
.dash-typing {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-mut);
  background: var(--surface-2);
}
.dash-typing .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: blink 1.2s infinite;
}
.dash-typing .dot:nth-child(2) { animation-delay: .15s; }
.dash-typing .dot:nth-child(3) { animation-delay: .3s; }
.dash-typing em { font-style: italic; margin-left: 4px; }
@keyframes blink { 0%,60%,100% { opacity:.3 } 30% { opacity:1 } }

/* Input area */
.chat-input-area {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-area textarea {
  flex: 1;
  resize: none;
  padding: 9px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  max-height: 110px;
  line-height: 1.4;
}
.chat-input-area textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }

.icon-btn {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: #e2e8f0; }
.icon-btn:active { transform: scale(.92); }
.icon-btn-video:hover { background: #d1fae5; }
.send-btn {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.send-btn:hover { background: var(--primary-d); }
.send-btn:active { transform: scale(.92); }

.dash-emoji-panel {
  position: absolute;
  bottom: 58px;
  left: 10px;
  width: min(300px, calc(100% - 20px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 190px;
  overflow-y: auto;
  z-index: 30;
}
.dash-emoji-panel.visible { display: grid; }
.dash-emoji-panel button {
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 6px;
}
.dash-emoji-panel button:hover { background: var(--surface-2); }

/* Header extra actions + pop panels (transfer / phrases) */
.chat-modal-header { position: relative; }
/* Whole chat window moveable/resizable - user's ask 2026-09-14. The
   header is the drag handle (own class so #internalModal/#phraseModal/
   #changePasswordModal, which reuse .chat-modal-header, are unaffected);
   .floating is added by JS the first time a drag/resize starts, switching
   .chat-modal-content from its normal flex-centered position:relative to
   an explicit position:fixed rect so it can move/resize freely - see the
   chat-window drag/resize code in Dashboard.aspx. */
.chat-window-draggable-header { cursor: move; }
.chat-window-resize-handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 20;
  background: rgba(15, 23, 42, .35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  background-image:
    linear-gradient(135deg,
      transparent 0 42%, rgba(255,255,255,.85) 42% 50%, transparent 50% 60%,
      rgba(255,255,255,.85) 60% 68%, transparent 68% 78%,
      rgba(255,255,255,.85) 78% 86%, transparent 86% 100%);
}
.chat-window-resize-handle:hover,
.chat-window-resize-handle.dragging { background-color: rgba(15, 23, 42, .5); }
/* Only #chatModal's content ever gets .floating (see resetChatWindowGeometry()) -
   plain .chat-modal-content's own centering/sizing rules stay untouched for
   every other modal that reuses the class. */
#chatModal > .chat-modal-content.floating { max-width: none; margin: 0; }
.modal-head-actions { display: flex; align-items: center; gap: 4px; }
/* head-btn is now just an alias onto the shared icon-btn look - the modal
   header used to be solid indigo with translucent-white buttons; now it's
   the same white surface as the rest of the app, so its buttons use the
   same icon-btn as everywhere else. Kept as a class (not renamed in markup)
   since Dashboard.aspx's JS toggles it in several places. */
.head-btn {
  background: transparent;
  border: 0;
  color: var(--text-mut);
  font-size: 12.5px;
  font-weight: 600;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, color .12s;
}
.head-btn:hover { background: var(--surface-hover); color: var(--text); }
.head-btn-danger { background: var(--surface); color: var(--danger); border: 1px solid #fecaca; padding: 0 11px; }
.head-btn-danger:hover { background: var(--danger-bg); }

.pop-panel {
  position: absolute;
  z-index: 45;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: min(300px, calc(100% - 24px));
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}
#transferPanel { right: 12px; top: 46px; }
/* Explicit position needed here (unlike #remoteHelpPanel, which gets away
   without one) - .chat-modal-header has align-items:center, so a .pop-panel
   with no top/bottom offset is vertically CENTERED on its OWN height by the
   flex layout's static-position rules. #remoteHelpPanel is short enough
   (~74px) that the resulting few-px overlap into the header is unnoticeable;
   #vcPanel's 5 rows (~207px) centered the same way pushed its top edge ~73px
   ABOVE the header, clipped by .chat-modal-content's rounded-corner overflow
   - found live 2026-09-16 testing against the real deployed site (the
   panel's first row, "Sida", was invisible). */
#vcPanel { left: 12px; top: 46px; }
.pop-panel.pop-up { bottom: 58px; left: 10px; }
.pop-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-mut); padding: 6px 8px 8px;
}
.link-btn { background: 0; border: 0; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0; }
.pop-panel .row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: 0; border: 0;
  padding: 9px 8px; border-radius: 8px;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.pop-panel .row:hover { background: var(--surface-2); }
.pop-panel .row .p-title { font-weight: 600; }
.pop-panel .row .dot-on, .pop-panel .row .dot-off {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.pop-panel .row .dot-on { background: var(--success); }
.pop-panel .row .dot-off { background: #cbd5e1; }
.pop-panel .empty { padding: 10px 8px; font-size: 12.5px; color: var(--text-mut); }

/* Phrase manager modal */
.phrase-mgr { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.phrase-mgr-list { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.phrase-mgr-list .item {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  display: flex; gap: 10px; align-items: flex-start;
}
.phrase-mgr-list .item .txt { flex: 1; min-width: 0; }
.phrase-mgr-list .item .t { font-weight: 700; font-size: 13px; }
.phrase-mgr-list .item .b { font-size: 12.5px; color: var(--text-mut); white-space: pre-wrap; }
.phrase-mgr-list .item .acts { display: flex; gap: 6px; flex-shrink: 0; }
.phrase-form { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.phrase-form input, .phrase-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px;
  font: inherit; font-size: 13.5px; outline: none; resize: vertical;
}
.phrase-form input:focus, .phrase-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.phrase-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Chatthistorik (feature roadmap #4) - reuses .phrase-mgr-list's .item/.txt/
   .t/.b row styling above, just adds a pointer/hover since history rows are
   clickable (phrase items aren't - their actions live in .acts instead). */
.history-search-row { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.history-search-row input[type="text"] { flex: 1; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 13.5px; outline: none; }
.history-search-row select { padding: 9px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 13px; }
.phrase-mgr-list .item.history-item { cursor: pointer; }
.phrase-mgr-list .item.history-item:hover { background: var(--surface-2); }
.phrase-mgr-list .empty { padding: 10px 8px; font-size: 12.5px; color: var(--text-mut); }

/* Video overlay - only #screenOverlay (viewing a visitor's shared screen)
   actually shows this fullscreen inside the modal. The VIDEO CALL itself
   (#videoOverlay) is a small floating panel instead - same approach as the
   visitor widget - so the chat and Fjärrhjälp/RustDesk stay usable at the
   same time, without a separate window to juggle. */
.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #0b1220;
  display: none;
  flex-direction: column;
}
#videoOverlay {
  inset: auto 16px 16px auto;
  width: 300px;
  height: 400px;
  min-width: 260px;
  min-height: 340px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 46;
}
/* Resize grip, bottom-right corner - see makeVideoOverlayResizable() in
   Dashboard.aspx. Same diagonal-stripe look as a native OS resize handle,
   drawn purely in CSS (no image asset to deploy) - added 2026-09-14 once
   group video calls (item 30) made the fixed 300x400 panel too cramped to
   comfortably fit more than one remote tile side by side. Enlarged +
   given its own visible background chip (2026-09-14, same day) - the
   original 18x18px transparent-background version was reported as "can
   move but not resize" and, not being able to test this live myself, the
   most likely explanation is the original handle was too small/low-
   contrast to actually find and grab reliably against a busy video
   background, not a functional bug - this version is bigger and always
   visibly there regardless of what's playing behind it.
   ALSO double-check when testing: grab the very bottom-right CORNER
   specifically (cursor should turn into a diagonal resize arrow) - if it
   still doesn't work even now that it's clearly visible, that points to
   an actual functional bug rather than a discoverability one, and needs
   different follow-up (e.g. the browser console during the drag). */
.video-resize-handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 47;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  background-image:
    linear-gradient(135deg,
      transparent 0 42%, rgba(255,255,255,.85) 42% 50%, transparent 50% 60%,
      rgba(255,255,255,.85) 60% 68%, transparent 68% 78%,
      rgba(255,255,255,.85) 78% 86%, transparent 86% 100%);
}
.video-resize-handle:hover,
.video-resize-handle.dragging { background-color: rgba(255,255,255,.1); }
.video-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #0b1220;
  display: flex;
  flex-direction: column;
}
.video-remote {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b1220;
}
/* Holds one .video-remote-tile per OTHER participant (group video calls) -
   visually identical to the old single <video> when there's only one tile
   (flex with one child fills 100%), splits evenly side-by-side for two. */
.remote-tiles {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 2px;
}
.video-remote-tile {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #0b1220;
}
.video-remote-tile .video-remote { position: absolute; inset: 0; }
/* Bottom bar for #screenOverlay (the rare inline fallback when the screen-
   share popup window couldn't open - see openScreenHelpPopup()). These
   classes were used in the markup but never actually defined anywhere,
   rendering as totally unstyled default buttons - the same "looks like the
   80s" bug fixed for the video call's precall buttons, just missed here. */
.video-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.btn-endcall, .btn-popout {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-endcall:active, .btn-popout:active { transform: scale(.96); }
.btn-endcall { background: var(--danger); color: #fff; }
.btn-endcall:hover { background: #dc2626; }
.btn-popout { background: rgba(255,255,255,.16); color: #fff; }
.btn-popout:hover { background: rgba(255,255,255,.26); }
.video-local-tile {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 112px;
  height: 152px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.6);
  background: #1e293b;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: right .2s, top .2s, width .2s, height .2s, inset .2s;
  cursor: grab;
  touch-action: none;
}
.video-local-tile.dragging { cursor: grabbing; transition: none; }
/* Pre-call ("green room"): the local preview fills the whole panel instead
   of sitting as a small corner tile - there's no remote video yet. Not
   draggable in this state (see makeVideoOverlayDraggable's .main guard). */
.video-local-tile.main {
  inset: 0;
  right: auto; top: auto;
  width: auto; height: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: default;
}
.video-local {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Mirror the self-view like every other video call app does. */
  transform: scaleX(-1);
}
.local-mic-off {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.video-topbar {
  position: absolute;
  left: 0; right: 0; top: 0;
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent);
  /* Drag handle for the video panel - see makeVideoOverlayDraggable() -
     touch-action:none stops mobile touch-scroll from fighting the drag. */
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.video-topbar.dragging { cursor: grabbing; }

/* Bottom control bar - dark pill row of circular buttons, Teams-style. */
.video-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
}
.vctl-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: background .15s, transform .1s;
}
.vctl-btn:hover { background: rgba(255,255,255,.24); }
.vctl-btn:active { transform: scale(.94); }
.vctl-btn.active { background: var(--primary); }
/* "off" state (muted mic / camera off): red fill + a slash drawn across the icon - one rule, no separate icon assets needed. */
.vctl-btn.off { background: var(--danger); }
.vctl-btn.off::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; top: 50%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transform: rotate(-45deg);
}
.vctl-btn.vctl-end {
  width: 56px;
  height: 56px;
  background: var(--danger);
  font-size: 22px;
}
.vctl-btn.vctl-end:hover { background: #dc2626; }
/* Video pop-out (2026-09-24) - see openVideoPopout() in Dashboard.aspx.
   A bit smaller than its neighbours so 5 buttons still fit the panel's
   260px minimum width. While popped out, #videoStage lives in the
   Picture-in-Picture window (html.sc-video-pip, which gets a copy of this
   stylesheet) and the empty #videoOverlay stays hidden no matter what the
   call code does with its display. */
.vctl-btn.vctl-popout { width: 40px; height: 40px; font-size: 18px; }
#videoOverlay.popped-out { display: none !important; }
html.sc-video-pip, html.sc-video-pip body { height: 100%; margin: 0; overflow: hidden; background: #0b1220; }
html.sc-video-pip body { display: flex; }
html.sc-video-pip .video-resize-handle { display: none; }
html.sc-video-pip .video-topbar { cursor: default; }
#videoCallStatus { font-size: 13px; font-weight: 600; }

/* Pre-call ("green room") action row - sits just above the control bar.
   Dedicated dark-theme buttons (NOT the light-admin-panel .btn/.btn-primary
   classes - those are designed for the white Settings/board UI and look
   like unstyled 90s buttons on a dark video background). */
.precall-actions {
  position: absolute;
  left: 0; right: 0; bottom: 78px;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0 20px;
  z-index: 4;
}
.precall-btn {
  flex: 1;
  max-width: 160px;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.precall-btn:active { transform: scale(.97); }
.precall-btn-secondary { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.precall-btn-secondary:hover { background: rgba(255,255,255,.22); }
.precall-btn-primary { background: var(--success); color: #fff; }
.precall-btn-primary:hover { background: #0da271; }
.precall-btn-danger { background: var(--danger); color: #fff; }
.precall-btn-danger:hover { background: #dc2626; }

/* Background picker popover. Top-anchored (not bottom) for the same reason
   as the visitor widget's equivalent - the pre-call preview's action row
   shrinks .video-stage's usable height, and a bottom-anchored popover can
   overshoot above the stage's top edge there. .video-stage itself has no
   overflow:hidden so nothing was actually being clipped on this side, but
   matching the fix keeps both sides consistent and safe against future
   layout changes. */
.video-popover {
  position: absolute;
  right: 16px;
  top: 44px;
  bottom: auto;
  max-height: calc(100% - 56px);
  overflow-y: auto;
  z-index: 5;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-lg);
  width: 230px;
}
.video-popover-title { color: #fff; font-size: 12px; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bg-opt {
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  font-size: 11.5px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #334155;
  text-align: center;
  padding: 2px;
  transition: border-color .15s, transform .1s;
}
.bg-opt:hover { border-color: rgba(255,255,255,.4); transform: scale(1.04); }
.bg-opt.selected { border-color: var(--accent); }
.bg-opt.bg-swatch { color: transparent; }
.bg-upload { position: relative; overflow: hidden; }

@media (max-width: 720px) {
  .video-local-tile { width: 84px; height: 116px; right: 10px; top: 10px; }
  .video-popover { right: 10px; width: 200px; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hidden { display: none !important; }

/* Board toast (transfer notice etc.) */
.board-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #1e293b;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 2000;
}
.board-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   RESPONSIVE  ·  phones / small tablets
   ============================================================ */
@media (max-width: 720px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-title { display: none; }
  .agent-chip { display: none; }
  .status-pill { padding: 7px 11px; }
  .btn-top { font-size: 0; padding: 8px 10px; }
  .btn-top::first-letter { font-size: 15px; }

  .board {
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
    gap: 12px;
    padding: 12px;
    overflow-y: auto;
  }
  .col { min-height: 240px; }

  .chat-modal { padding: 0; }
  .chat-modal-content {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .chat-message { max-width: 88%; }
  .video-local { width: 92px; height: 126px; bottom: 70px; right: 10px; }

  .chat-modal-header h3 { font-size: 13px; }
  .modal-head-actions { gap: 5px; }
  .head-btn { font-size: 11.5px; padding: 6px 8px; }
  #transferPanel { right: 6px; }
  /* Fullscreen here already - nothing to move/resize (JS also skips
     activating drag/resize below this width, see chatWindowIsFloatable()). */
  .chat-window-draggable-header { cursor: default; }
  .chat-window-resize-handle { display: none; }
}

@media (max-width: 380px) {
  .status-pill .status-label { display: none; }
}

/* ============================================================
   Intern chatt med kollegor ("fråga en kollega")
   ============================================================ */
.top-badge {
  display: inline-block; min-width: 17px; padding: 0 4px; margin-left: 6px;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
  background: var(--danger); color: #fff; border-radius: 9px;
}
/* Always-visible "how many colleagues are online right now" indicator
   (2026-09-14, requested for checking at a glance after being away for a
   while) - separate from .top-badge above, which is the unread-message
   count and hides at 0. This one deliberately never hides, including at
   0, since "nobody's online" is itself useful information here. */
.online-badge {
  display: inline-flex; align-items: center; gap: 4px; min-width: 17px;
  padding: 0 6px; margin-left: 6px; font-size: 11px; font-weight: 700;
  line-height: 17px; text-align: center; background: var(--surface-hover);
  color: var(--text-mut); border-radius: 9px;
}
.online-badge .online-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-mut);
  flex-shrink: 0;
}
.online-badge.has-online { background: var(--success-bg); color: var(--success); }
.online-badge.has-online .online-dot { background: var(--success-dot); }
/* Floating "bring the chat back" button - shown only while the chat modal
   is auto-hidden because a Fjärrhjälp screen-share popup is connected (see
   hideChatForRemoteDesk()/restoreChatAfterRemoteDesk()). Fixed on the
   dashboard itself (agent-side only), not part of any modal. */
.reopen-chat-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 900;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background .15s, transform .1s;
}
.reopen-chat-fab:hover { background: var(--primary-d); }
.reopen-chat-fab:active { transform: scale(.97); }
.reopen-chat-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 8px;
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
  background: var(--danger); color: #fff; border-radius: 9px;
}
.internal-chat { max-width: 720px; width: 92vw; height: 76vh; max-height: 640px; }
.internal-chat .chat-modal-header h3 small { color: var(--text-mut); font-weight: 500; }
.internal-body { display: flex; flex: 1; min-height: 0; }
.internal-list {
  width: 210px; flex: none; border-right: 1px solid var(--border);
  overflow-y: auto; background: var(--surface-2);
}
.internal-list .empty { padding: 16px; font-size: 12.5px; color: var(--text-mut); }
.internal-peer {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--text); text-align: left;
  border-bottom: 1px solid var(--border);
}
.internal-peer:hover { background: var(--surface); }
.internal-peer.active { background: var(--primary-l); font-weight: 600; }
.internal-peer .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.internal-peer .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-on  { background: var(--success); }
.dot-off { background: var(--border); }
.peer-badge {
  min-width: 17px; padding: 0 4px; font-size: 11px; font-weight: 700;
  line-height: 17px; text-align: center; background: var(--danger);
  color: #fff; border-radius: 9px;
}
.peer-invite-btn, .peer-call-btn, .peer-msg-btn {
  flex: none; border: 0; border-radius: 6px; width: 26px; height: 26px;
  font-size: 13px; line-height: 1; cursor: pointer; background: var(--surface);
  color: var(--text); display: flex; align-items: center; justify-content: center;
}
.peer-invite-btn:hover, .peer-call-btn:hover, .peer-msg-btn:hover { background: var(--primary-l); }
.internal-conv { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.internal-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.im-msg { max-width: 78%; align-self: flex-start; }
.im-msg.im-mine { align-self: flex-end; }
.im-body {
  padding: 8px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.4;
  background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word;
}
.im-mine .im-body { background: var(--primary); border-color: var(--primary); color: #fff; }
.im-time { font-size: 10.5px; color: var(--text-mut); margin-top: 2px; }
.im-mine .im-time { text-align: right; }
.internal-typing { padding: 2px 14px 6px; font-size: 12px; color: var(--text-mut); font-style: italic; }
.internal-compose { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.internal-compose textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font: inherit; font-size: 13.5px; max-height: 90px;
}
.internal-compose textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
@media (max-width: 560px) {
  .internal-chat { width: 96vw; height: 82vh; }
  .internal-list { width: 132px; }
}

/* Visitor context panel (agent) */
.vc-content { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 4px; }
.vc-row {
  display: flex; gap: 8px; padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.4;
}
.vc-row:last-child { border-bottom: 0; }
.vc-label { flex: 0 0 62px; color: var(--text-mut); font-weight: 600; }
.vc-value { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
.vc-tags-row { display: flex; gap: 6px; padding: 8px 4px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.vc-tags-row input {
  flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 8px;
  font: inherit; font-size: 12.5px; outline: none;
}
.vc-tags-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.vc-tags-saved { padding: 4px 4px 0; font-size: 11.5px; color: var(--success); }

/* Fjärrhjälp-panel (agent) */
.rh-agent-info {
  margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.5; color: var(--text);
}
.rh-id-big {
  display: inline-block; margin: 4px 0; font-size: 20px; font-weight: 800;
  letter-spacing: 1px; color: var(--primary);
  user-select: all;
}
#screenOverlay .video-remote { object-fit: contain; background: #000; }

/* ============================================================
   ADMIN PANEL SHELL  (Pages/Admin/Settings.aspx)
   2026-09-13 - was its own competing design (blue #3498db, different
   fonts/radii) in Settings.aspx's own <style> block; now shares this
   file's tokens/buttons/badges. This section adds only the layout pieces
   Settings.aspx needs that Dashboard.aspx doesn't (a left settings nav,
   the two-column shell, a data table) - buttons/badges/topbar above.
   ============================================================ */
.admin-shell { display: flex; flex: 1; min-height: 0; }
.admin-subnav {
  width: 220px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.admin-subnav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-mut);
  cursor: pointer;
  border: 0; background: transparent; width: 100%; text-align: left;
  font-family: inherit;
  transition: background .12s, color .12s;
}
.admin-subnav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.admin-subnav-item:hover { background: var(--surface-hover); color: var(--text); }
.admin-subnav-item.active { background: var(--primary-l); color: var(--primary-d); }
.admin-content {
  flex: 1; min-width: 0;
  padding: 28px 32px;
  overflow-y: auto;
}
.admin-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.admin-page-head h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.admin-page-head p { margin: 0; font-size: 13px; color: var(--text-mut); }

/* Data table (agents/companies/company-admins) */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
