/* TehProf.kz Support — Design System v3 */
/* Modern, brand-aligned, centralized tokens */

/* Global scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light, #ebeef1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted, #8c939b); }
* { scrollbar-width: thin; scrollbar-color: var(--border-light, #ebeef1) transparent; }

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ═══ Light theme (default) ═══ */
:root {
  /* Brand palette (aligned with logo: lightest → main matches logo face) */
  --brand-lightest: #5bc0eb;
  --brand-light: #4ab8e2;
  --brand-main: #3a9fd8;
  --brand-dark: #2176ae;
  --brand-darkest: #1a5a96;

  /* Backgrounds */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --card-bg: #ffffff;
  --surface-hover: #f8f9fb;

  /* Borders */
  --border: #dce1e6;
  --border-light: #ebeef1;

  /* Text */
  --text: #1a1d21;
  --text-secondary: #555e68;
  --text-muted: #8c939b;

  /* Accent (brand-aligned) */
  --accent: #3a9fd8;
  --accent-hover: #2176ae;
  --accent-light: rgba(58,159,216,0.07);
  --accent-text: #ffffff;

  /* Semantic colors */
  --success: #16a34a;
  --success-bg: rgba(22,163,74,0.08);
  --warning: #ca8a04;
  --warning-bg: rgba(202,138,4,0.08);
  --danger: #dc2626;
  --danger-bg: rgba(220,38,38,0.06);
  --info: #0284c7;
  --info-bg: rgba(2,132,199,0.07);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);

  /* Radii */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 20px;
  --fs-3xl: 24px;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --lh-tight: 1.2;
  --lh-normal: 1.4;
  --lh-relaxed: 1.55;

  /* Spacing scale (4px base) */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Gradient (brand 3D style) */
  --gradient-brand: linear-gradient(135deg, var(--brand-main) 0%, var(--brand-dark) 100%);
  --gradient-brand-light: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-main) 100%);
  --gradient-brand-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);

  /* Layout */
  --header-bg: rgba(255,255,255,0.92);
  --header-border: var(--border-light);
  --input-bg: var(--surface);
  --badge-text: #fff;
  --msg-support-bg: #f0f4f8;
}

/* ═══ Dark theme ═══ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-lightest: #8edaf4;
    --brand-light: #7dd3f0;
    --brand-main: #5bc0eb;
    --brand-dark: #3a9fd8;
    --brand-darkest: #2176ae;
    --bg: #0f1115;
    --surface: #1a1d23;
    --card-bg: #1a1d23;
    --surface-hover: #22262d;
    --border: #2d3139;
    --border-light: #23272e;
    --text: #e8eaed;
    --text-secondary: #adb3bc;
    --text-muted: #6e7681;
    --accent: #5bc0eb;
    --accent-hover: #7dd3f0;
    --accent-light: rgba(91,192,235,0.1);
    --accent-text: #0f1115;
    --success: #4ade80;
    --success-bg: rgba(74,222,128,0.1);
    --warning: #facc15;
    --warning-bg: rgba(250,204,21,0.1);
    --danger: #f87171;
    --danger-bg: rgba(248,113,113,0.08);
    --info: #38bdf8;
    --info-bg: rgba(56,189,248,0.1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
    --gradient-brand: linear-gradient(135deg, var(--brand-main) 0%, var(--brand-dark) 100%);
    --gradient-brand-light: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-main) 100%);
    --gradient-brand-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    --header-bg: rgba(15,17,21,0.92);
    --header-border: var(--border-light);
    --input-bg: #15171c;
    --msg-support-bg: #1e2228;
  }
}

[data-theme="dark"] {
  --brand-lightest: #8edaf4;
  --brand-light: #7dd3f0;
  --brand-main: #5bc0eb;
  --brand-dark: #3a9fd8;
  --brand-darkest: #2176ae;
  --bg: #0f1115;
  --surface: #1a1d23;
  --card-bg: #1a1d23;
  --surface-hover: #22262d;
  --border: #2d3139;
  --border-light: #23272e;
  --text: #e8eaed;
  --text-secondary: #adb3bc;
  --text-muted: #8b929a;
  --accent: #5bc0eb;
  --accent-hover: #7dd3f0;
  --accent-light: rgba(91,192,235,0.1);
  --accent-text: #0f1115;
  --success: #4ade80;
  --success-bg: rgba(74,222,128,0.1);
  --warning: #facc15;
  --warning-bg: rgba(250,204,21,0.1);
  --danger: #f87171;
  --danger-bg: rgba(248,113,113,0.08);
  --info: #38bdf8;
  --info-bg: rgba(56,189,248,0.1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
  --gradient-brand: linear-gradient(135deg, var(--brand-main) 0%, var(--brand-dark) 100%);
  --gradient-brand-light: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-main) 100%);
  --gradient-brand-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  --header-bg: rgba(15,17,21,0.92);
  --header-border: var(--border-light);
  --input-bg: #15171c;
  --msg-support-bg: #1e2228;
}

[data-theme="light"] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-hover: #f8f9fb;
  --border: #dce1e6;
  --border-light: #ebeef1;
  --text: #1a1d21;
  --text-secondary: #555e68;
  --text-muted: #8c939b;
  --accent: #3a9fd8;
  --accent-hover: #2176ae;
  --accent-light: rgba(58,159,216,0.07);
  --accent-text: #ffffff;
  --success: #16a34a;
  --success-bg: rgba(22,163,74,0.08);
  --warning: #ca8a04;
  --warning-bg: rgba(202,138,4,0.08);
  --danger: #dc2626;
  --danger-bg: rgba(220,38,38,0.06);
  --info: #0284c7;
  --info-bg: rgba(2,132,199,0.07);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --header-bg: rgba(255,255,255,0.92);
  --header-border: var(--border-light);
  --input-bg: var(--surface);
  --msg-support-bg: #f0f4f8;
}

/* ═══ Base ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; background: var(--bg); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ═══ Clean background — subtle gradient instead of orbs ═══ */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg) 60%, rgba(58,159,216,0.03) 100%);
}

/* ═══ Layout ═══ */
.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.app-header .logo { height: 200px; margin: -68px -20px; pointer-events: none; }
.app-header .title { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.app-header .spacer { flex: 1; }
.header-nav { display: flex; gap: 2px; margin-left: 8px; }
.header-tab {
  padding: 4px 10px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-radius: 6px; white-space: nowrap; transition: all 0.15s;
}
.header-tab:hover { color: var(--text); background: var(--bg-hover, rgba(0,0,0,0.04)); }
.header-tab.active { color: var(--accent); font-weight: 600; background: var(--accent-light); }
[data-theme="dark"] .header-tab { color: var(--text-secondary); }
[data-theme="dark"] .header-tab:hover { color: #fff; background: rgba(255,255,255,0.08); }
[data-theme="dark"] .header-tab.active { color: var(--accent); background: var(--accent-light); }
.header-tab-secondary { font-size: 12px; opacity: 0.7; margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; }
.header-tab-secondary:hover { opacity: 1; }
.header-tab-secondary.active { opacity: 1; }
.app-content {
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 40px);
}
.app-content.wide { max-width: 1800px; }

/* ═══ Cards ═══ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, border-color 200ms ease;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 18px 22px; overflow-wrap: break-word; word-break: break-word; min-width: 0; }
.sub-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-light); }
.sub-tab {
  padding: 8px 18px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent; transition: all .15s;
}
.sub-tab:hover { color: var(--text-primary); }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600; font-size: 15px;
}

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: 500 13px/1.3 var(--font);
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--gradient-brand-accent); color: var(--accent-text); border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(58,159,216,0.2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gradient-brand); border-color: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(58,159,216,0.3);
}
.btn-secondary {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-light); }
.btn-back {
  background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500;
}
.btn-back:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.btn-back svg { width: 16px; height: 16px; }
.btn-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--danger-bg); color: var(--danger); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-remove:hover { background: var(--danger); color: #fff; }
.btn-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-close:hover { background: var(--surface-hover); color: var(--text); }
.btn-close-sm { width: 24px; height: 24px; border-radius: 6px; }
.btn-xs { padding: 3px 10px; font-size: 11px; border-radius: 6px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-success { background: #22c55e; color: #fff; border: none; }
.btn-success:hover:not(:disabled) { background: #16a34a; }

/* ═══ Status Badges ═══ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.badge::before {
  content: ''; display: block;
  width: 7px; height: 7px; border-radius: 50%;
}
.badge-new { background: var(--info-bg); color: var(--info); }
.badge-new::before { background: var(--info); }
.badge-in_progress, .badge-reopened { background: var(--warning-bg); color: var(--warning); }
.badge-in_progress::before, .badge-reopened::before { background: var(--warning); }
.badge-estimated { background: rgba(139,92,246,0.08); color: #7c3aed; }
.badge-estimated::before { background: #7c3aed; }
.badge-done { background: var(--success-bg); color: var(--success); }
.badge-done::before { background: var(--success); }
.badge-closed { background: rgba(140,147,155,0.1); color: var(--text-muted); }
.badge-closed::before { background: var(--text-muted); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }
.badge-cancelled::before { background: var(--danger); }

/* Priority badges */
.priority { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 6px; }
.priority-critical { background: var(--danger-bg); color: var(--danger); }
.priority-high { background: var(--warning-bg); color: var(--warning); }
.priority-medium { background: var(--info-bg); color: var(--info); }
.priority-low { background: rgba(140,147,155,0.08); color: var(--text-muted); }

/* ═══ Forms ═══ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-label .required { color: var(--danger, #e53935); font-weight: 700; }
.form-input:invalid:not(:placeholder-shown) { border-color: var(--danger, #e53935); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 14px/1.5 var(--font);
  color: var(--text);
  transition: border-color 200ms, box-shadow 200ms;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; }

/* ═══ Table ═══ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap--sticky { max-height: calc(100vh - 200px); overflow-y: auto; overflow-x: auto; }
.table-wrap--sticky .table thead th { position: sticky; top: 0; z-index: 2; background: var(--card-bg); box-shadow: 0 1px 0 var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
.table th {
  text-align: left; padding: 8px 6px;
  font-weight: 600; font-size: 11px; color: var(--text-muted);
  border-bottom: 2px solid var(--border-light);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Sticky toolbar area above ticket list */
.tickets-sticky-header { position: sticky; top: 0; z-index: 10; background: var(--bg); padding-bottom: 4px; box-shadow: 0 1px 0 var(--border-light); }

/* Sortable column headers */
.sortable-th { cursor: pointer; user-select: none; transition: color 120ms; }
.sortable-th:hover { color: var(--accent); }
.sortable-th.sort-active { color: var(--accent); }

/* Sticky thead */
.table thead th { background: var(--card-bg); position: sticky; top: 0; z-index: 2; }
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table tr { cursor: pointer; transition: background 120ms ease; }
.table tr:hover { background: var(--accent-light); }
.table .subject { font-weight: 500; color: var(--accent); overflow-wrap: break-word; word-break: break-word; }
.table .subject.truncate { max-width: clamp(200px, 40vw, 600px); }
.table tr.error-resolved-row { cursor: default; }
.table tr.error-resolved-row:hover { background: transparent; }

/* ═══ Chat / Messages ═══ */
.chat-container {
  display: flex; flex-direction: column;
  min-height: 200px; max-height: calc(100vh - 260px);
}
.chat-container .messages { flex: 1; min-height: 0; max-height: none; }
.chat-container .chat-input-area {
  flex-shrink: 0; margin-top: 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .15s;
}
.chat-container .chat-input-area:focus-within {
  border-color: var(--accent);
}
/* Textarea inside unified input area — borderless */
.chat-input-area .form-textarea {
  border: none; border-radius: 0; background: transparent;
  resize: none; box-shadow: none; outline: none;
  padding: 8px 12px;
}
.chat-input-area .form-textarea:focus { box-shadow: none; border: none; }
/* Auto-resize textarea */
.msg-auto-resize {
  overflow-y: hidden; min-height: 36px; max-height: 120px;
  line-height: 1.5;
}
.msg-auto-resize.scrollable { overflow-y: auto; }
.messages {
  display: flex; flex-direction: column; gap: 4px; padding: 8px 0;
  max-height: 50vh; overflow-y: auto; scroll-behavior: smooth;
}
.scroll-down-btn {
  position: absolute; bottom: 70px; right: 16px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-light);
  background: var(--surface); color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: opacity .15s;
}
.scroll-down-btn:hover { background: var(--bg-hover); }
/* ═══ Ticket Detail — full-height chat layout ═══ */
.ticket-detail-layout {
  display: grid; grid-template-columns: 1fr 260px; gap: 12px;
  height: calc(100vh - var(--td-top-offset, 110px)); min-height: 400px;
}
/* Client detail: smaller header (no nav bar) → less offset */
.client-detail-layout { --td-top-offset: 60px; }
.ticket-detail-main {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.ticket-detail-header {
  flex-shrink: 0;
}
.ticket-detail-chat {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.ticket-detail-chat .messages {
  flex: 1; min-height: 0; max-height: none; overflow-y: auto;
  padding: 8px 12px; gap: 4px;
}
.ticket-detail-chat .chat-input-area {
  flex-shrink: 0; margin: 0; border: none; border-top: 1px solid var(--border-light);
  border-radius: 0; background: var(--surface);
}
.ticket-detail-chat .chat-input-area:focus-within {
  border-color: var(--accent);
}
/* Chat/History tabs */
.td-chat-tabs {
  display: flex; gap: 0; align-items: center; border-bottom: 1px solid var(--border-light);
  background: var(--bg); flex-shrink: 0;
}
.td-chat-tab {
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  border: none; background: none; color: var(--text-secondary);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.td-chat-tab:hover { color: var(--text); }
.td-chat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.td-chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
/* History timeline */
.td-history-timeline { padding: 12px 16px; overflow-y: auto; flex: 1; }
.td-history-empty { padding: 40px 16px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.td-history-item {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.td-history-item:last-child { border-bottom: none; }
.td-history-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-light, rgba(37,99,235,.1));
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin-top: 2px;
}
.td-history-content { flex: 1; min-width: 0; }
.td-history-title { font-size: 12px; font-weight: 600; color: var(--text); }
.td-history-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.td-history-comment {
  font-size: 11px; color: var(--text-secondary); margin-top: 4px;
  padding: 4px 8px; background: var(--bg); border-radius: 4px;
  border-left: 2px solid var(--accent);
}
.td-history-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.ticket-detail-sidebar {
  overflow-y: auto; min-height: 0;
}
/* Ticket detail — compact header */
.td-topbar {
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
  flex-wrap: wrap;
}
.td-title { font-size: 15px; font-weight: 700; }
.td-subject { padding: 4px 0; }
.td-desc {
  font-size: 12px; line-height: 1.4; color: var(--text-muted);
  margin-top: 2px; max-height: 40px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.td-topbar-sep { width: 1px; height: 16px; background: var(--border-light); margin: 0 2px; }
.td-action-btn { transition: opacity .15s; }
.td-action-btn:hover { opacity: .7; }
/* Sidebar info grid */
.td-info-grid { display: flex; flex-direction: column; gap: 6px; }
.td-info-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.td-info-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.td-info-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.td-info-link:hover { text-decoration: underline; }
/* Participants */
.td-participants-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.td-participant { display: flex; align-items: center; gap: 4px; padding: 3px 0; font-size: 12px; }
.td-participant-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-participant-type { font-size: 9px; color: var(--text-muted); white-space: nowrap; }
.td-participant-rm { opacity: 0; transition: opacity .15s; padding: 1px; color: var(--text-muted); }
.td-participant:hover .td-participant-rm { opacity: 1; }
.td-participant-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.td-participant-result { display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer; border-radius: 4px; }
.td-participant-result:hover { background: var(--bg-hover); }

/* Participant sides (client/executor) */
.td-side-header { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px; }
.td-participants-side { padding: 4px 0; }
.td-participants-divider { height: 1px; background: var(--border-light); margin: 6px 0; }
.td-participants-sub { margin-top: 4px; padding-left: 4px; }
.td-participants-sub > .td-info-label { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; display: block; }
.td-participants-add { display: flex; gap: 2px; margin-top: 4px; }

/* @-mention highlight */
.msg-mention { color: var(--accent); font-weight: 500; }

.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
.messages::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Date separator (WhatsApp-style) */
.date-separator {
  align-self: center; padding: 2px 10px;
  background: var(--surface-hover); border-radius: 6px;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  margin: 4px 0 2px; user-select: none;
}

.msg {
  max-width: 80%; padding: 6px 10px 3px;
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
  font-size: 13px; line-height: 1.45;
  overflow-wrap: break-word; word-break: break-word; min-width: 0;
  position: relative;
}
.msg a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(var(--primary-rgb, 59,130,246), 0.3);
  transition: text-decoration-color .15s;
}
.msg a:hover {
  text-decoration-color: var(--primary);
}
.msg-client {
  background: var(--accent-light); color: var(--text);
  align-self: flex-start;
}
.msg-support {
  background: var(--msg-support-bg, #f0f4f8); border: 1px solid var(--border-light);
  align-self: flex-end;
  border-radius: var(--radius) var(--radius) 4px var(--radius);
}
.msg-system {
  align-self: flex-start; text-align: left;
  font-size: 12px; color: var(--text-secondary);
  padding: 6px 10px; margin: 2px 0;
  background: linear-gradient(135deg, rgba(167,139,250,0.08), rgba(125,211,252,0.08));
  border-radius: 4px var(--radius) var(--radius) var(--radius);
  max-width: 80%; line-height: 1.4;
  border-left: 2px solid rgba(167,139,250,0.3);
}
.msg-system.msg-status {
  align-self: center; text-align: center;
  font-size: 11px; color: var(--text-muted);
  padding: 2px 10px; margin: 1px 0;
  opacity: 0.6; line-height: 1.3;
  background: none; border-radius: 0;
  max-width: 100%; border-left: none;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.msg-status-avatar {
  width: 14px; height: 14px; border-radius: 50%; vertical-align: middle;
}
.avatar-bot { background: linear-gradient(135deg, #a78bfa, #7dd3fc); }
.avatar-bot img { border-radius: 50%; width: 100%; height: 100%; object-fit: cover; }
.msg-bot-name { font-weight: 600; color: #8b5cf6; font-size: 10px; }
.msg-ai-badge { font-size: 9px; font-weight: 600; color: var(--brand-main); background: rgba(58,159,216,.1); padding: 1px 5px; border-radius: 4px; letter-spacing: .3px; }
.msg-author { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-bottom: 1px; overflow: hidden; max-width: 100%; }
.msg-time {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  font-size: 10px; color: var(--text-muted); margin-top: 4px;
  min-height: 16px;
}
.msg-time-inline {
  font-size: 10px; color: var(--text-muted); opacity: 0.7;
  line-height: 1;
}
.msg-meta-right {
  display: inline-flex; align-items: center; gap: 2px; margin-left: auto;
}

/* ═══ Message context menu ═══ */
.msg-menu-wrap { position: absolute; top: 4px; right: 4px; z-index: 10; }
.msg { position: relative; }
.msg-menu-btn {
  opacity: 0; transition: opacity 0.15s;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; font-size: 16px; line-height: 1;
  box-shadow: var(--shadow-sm);
}
.msg:hover .msg-menu-btn, .msg-menu-btn:focus { opacity: 1; }
.msg-menu-btn:hover { background: var(--surface-hover); color: var(--text); }
[data-theme="dark"] .msg-menu-btn { background: var(--card-bg); border: 1px solid var(--border); color: var(--text-secondary); opacity: 0.5; }
[data-theme="dark"] .msg:hover .msg-menu-btn { opacity: 1; }
[data-theme="dark"] .msg-menu-btn:hover { background: var(--surface-hover); color: #fff; }
[data-theme="dark"] .msg-menu-dropdown { background: var(--card-bg); border-color: var(--border); }
.msg-menu-dropdown {
  display: none; position: absolute; right: 0;
  bottom: 100%; margin-bottom: 2px;
  min-width: 180px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 4px 0; z-index: 10000;
}
.msg-menu-dropdown.open { display: block; }
.msg-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 13px; color: var(--text);
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.msg-menu-item:hover { background: var(--surface-hover); }
.msg-menu-item:active { background: var(--surface-hover); }
.msg-menu-item.danger { color: var(--danger); }
.msg-menu-item.danger:hover { background: var(--danger-bg); }

/* Deleted message */
.msg-deleted-text { opacity: 0.5; font-style: italic; color: var(--text-muted); }
.msg-edited-mark { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

/* Edit inline */
.msg-edit-area {
  width: 100%; min-height: 60px; padding: 8px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; resize: vertical;
  background: var(--surface); color: var(--text);
}
.msg-edit-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ═══ File chips ═══ */
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12px; color: var(--accent);
  cursor: pointer; text-decoration: none;
  transition: background 150ms, border-color 150ms;
}
.file-chip:hover { background: var(--accent-light); border-color: var(--accent); }

/* ═══ Progress bar (hours) ═══ */
.hours-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.hours-track {
  flex: 1; height: 6px;
  background: var(--border-light);
  border-radius: 3px; overflow: hidden;
}
.hours-fill {
  height: 100%; border-radius: 3px;
  background: var(--accent);
  transition: width 300ms ease;
}
.hours-fill.warning { background: var(--warning); }
.hours-fill.danger { background: var(--danger); }

/* ═══ Filter bar ═══ */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 0;
}
.filter-chip {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; background: var(--surface);
  color: var(--text-secondary);
  transition: all 150ms ease;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.filter-chip.active {
  background: var(--accent); color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(58,159,216,0.2);
}

/* ═══ Theme toggle ═══ */
.theme-toggle {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-muted); font-size: 16px;
  transition: all 150ms;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }

/* ═══ Empty state ═══ */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 44px; margin-bottom: 16px; opacity: 0.4; }
.empty-state .empty-illustration { margin-bottom: 20px; opacity: 0.5; }
.empty-state .empty-illustration svg { width: 80px; height: 80px; }
.empty-state .title { font-size: 17px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state .desc { font-size: 14px; margin-bottom: 20px; color: var(--text-muted); }

/* ═══ OAuth / Auth ═══ */
.btn-oauth-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 200ms;
}
.btn-oauth-google:hover { background: var(--surface-hover); border-color: var(--accent); }
.btn-oauth-google svg { flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  max-width: 360px; margin: 16px auto;
  color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ═══ Auth Split Layout ═══ */
.auth-split {
  display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 56px); gap: 0;
}
.auth-brand {
  background: var(--gradient-brand, linear-gradient(135deg, var(--brand-main, #2176ae) 0%, var(--brand-dark, #1a5a96) 100%));
  color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px 40px;
}
.auth-brand h2 { font-size: 28px; font-weight: 800; margin-bottom: 12px; color: #fff; }
.auth-brand p { font-size: 15px; line-height: 1.7; opacity: .85; margin-bottom: 24px; }
.auth-brand-features { list-style: none; padding: 0; }
.auth-brand-features li {
  padding: 8px 0; font-size: 14px; display: flex; align-items: center; gap: 10px; opacity: .9;
}
.auth-brand-features li svg { flex-shrink: 0; opacity: .7; }
.auth-form-side {
  display: flex; align-items: center; justify-content: center; padding: 40px 32px;
  background: var(--surface);
}
.auth-form-card { width: 100%; max-width: 400px; }
.auth-form-card h1 { font-size: var(--fs-2xl); font-weight: 700; margin-bottom: 4px; color: var(--text); }
.auth-form-card .auth-subtitle { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 24px; }
@media(max-width:800px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-side { min-height: calc(100vh - 56px); }
}

/* ═══ Loading ═══ */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 48px; }

/* ═══ Tabs ═══ */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); }
.tabs-sticky { position: sticky; top: var(--header-h, 52px); z-index: 40; background: var(--bg); padding-top: 4px; }
.tab {
  padding: 12px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 150ms, border-color 150ms;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ═══ Modal (unified system) ═══ */
.modal-overlay,
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: modalFadeIn 0.2s ease;
}
.modal-overlay.closing,
.modal-backdrop.closing { animation: modalFadeOut 0.15s ease forwards; }

.modal-dialog,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
  max-width: 560px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.closing .modal-dialog,
.closing .modal-card { animation: modalSlideOut 0.15s ease forwards; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3,
.modal-header .modal-title { font-size: 17px; font-weight: 600; color: var(--text); margin: 0; }
.modal-header .modal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}
.modal-footer.justify-between { justify-content: space-between; }

/* Modal animations */
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalSlideIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modalSlideOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.95) translateY(8px); } }

/* ═══ Drawer (slide-out panel) ═══ */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  animation: modalFadeIn 0.25s ease;
}
.drawer-overlay.closing { animation: modalFadeOut 0.2s ease forwards; }

.drawer-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001;
  width: 520px; max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0,0,0,0.15), -2px 0 8px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  animation: drawerSlideIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.drawer-overlay.closing .drawer-panel { animation: drawerSlideOut 0.2s ease forwards; }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.drawer-header h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; }
.drawer-close {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.drawer-close:hover { background: var(--surface-hover); color: var(--text); }

.drawer-body {
  flex: 1; overflow-y: auto; padding: 24px;
  overscroll-behavior: contain;
}

.drawer-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

@keyframes drawerSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes drawerSlideOut { from { transform: translateX(0); } to { transform: translateX(100%); } }

@media(max-width:560px) {
  .drawer-panel { width: 100vw; border-left: none; }
  .drawer-body { padding: 16px; }
  .drawer-header { padding: 16px; }
  .drawer-footer { padding: 12px 16px; }
}

/* Participant search modal (people picker) */
.pp-search { position: relative; margin-bottom: 12px; }
.pp-search .form-input { padding-left: 36px; }
.pp-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.pp-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.pp-tab {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.pp-tab:hover { border-color: var(--accent); color: var(--accent); }
.pp-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pp-results { max-height: 300px; overflow-y: auto; margin: 0 -24px; padding: 0 24px; }
.pp-result {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  cursor: pointer; border-radius: var(--radius-sm); transition: background 0.12s;
}
.pp-result:hover { background: var(--accent-light); }
.pp-result-info { flex: 1; min-width: 0; }
.pp-result-name { font-size: 13px; font-weight: 500; color: var(--text); }
.pp-result-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.pp-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.pp-empty svg { margin-bottom: 8px; opacity: 0.4; }
.pp-empty-text { font-size: 13px; }

/* Confirm modal icon */
.modal-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 16px; }
.modal-icon-danger { background: var(--danger-bg); color: var(--danger); }
.modal-icon-warning { background: var(--warning-bg); color: var(--warning); }
.modal-icon-info { background: var(--info-bg); color: var(--info); }
.modal-icon-success { background: var(--success-bg); color: var(--success); }

/* ═══ Stats cards (admin) ═══ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* F58: Client Dashboard — trend chart + responsive */
.cd-stats-6{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.cd-trend-chart{display:flex;align-items:flex-end;gap:4px;height:100px;padding-top:8px}
.cd-trend-bar-wrap{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px}
.cd-trend-bar{width:100%;min-width:8px;background:var(--accent);border-radius:3px 3px 0 0;transition:height .3s ease}
.cd-trend-label{font-size:9px;color:var(--text-muted);white-space:nowrap}
@media(max-width:768px){.cd-grid{grid-template-columns:1fr!important}.cd-stats-6{grid-template-columns:repeat(2,1fr)}}

/* ═══ Settings ═══ */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; }
.setting-info .name { font-size: 14px; font-weight: 500; }
.setting-info .desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle {
  position: relative; width: 42px; height: 24px;
  background: var(--border); border-radius: 12px;
  cursor: pointer; transition: background 200ms;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 200ms;
}
.toggle.on::after { transform: translateX(18px); }

/* ═══ Responsive ═══ */

/* Mobile — compact & touch-friendly */
/* Responsive nav: scrollable on medium screens */
@media (max-width: 960px) {
  .header-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .header-nav::-webkit-scrollbar { display: none; }
  .header-tab { padding: 4px 8px; font-size: 12px; }
  #codeBadgeWrap { display: none !important; }
}

@media (max-width: 640px) {
  html { font-size: 13px; }

  /* --- Header: compact single row --- */
  .app-header { padding: 6px 10px; gap: 6px; flex-wrap: wrap; }
  .header-nav { order: 10; width: 100%; margin: 2px 0 0; gap: 0; overflow-x: auto; }
  .header-tab { padding: 3px 8px; font-size: 11px; }
  .app-header .logo { height: 80px; margin: -20px -6px; }
  .app-header .title { font-size: 13px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Hide verbose user info on mobile — role shown via tab access */
  #userInfoWrap { display: none !important; }

  .app-content { padding: 10px 10px; }
  .card-body { padding: 10px 12px; }
  .card-header { padding: 10px 12px; font-size: 14px; }

  /* --- Tabs: horizontal scroll --- */
  .tabs {
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    gap: 0;
    padding-bottom: 0;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    padding: 10px 14px;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* --- Filters: stacked --- */
  .filters { gap: 6px; padding: 8px 0; }
  .filter-chip { padding: 6px 12px; font-size: 12px; }

  /* --- Stats --- */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .value { font-size: 22px; }
  .stat-card .label { font-size: 11px; }

  /* --- Buttons: touch targets min 44px --- */
  .btn { min-height: 42px; padding: 10px 16px; font-size: 14px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; font-size: 13px; }
  .btn-xs { min-height: 30px; padding: 4px 10px; font-size: 12px; }

  /* --- Table: compact for mobile --- */
  .table th, .table td { padding: 8px 8px; font-size: 12px; }
  .table .subject.truncate { max-width: 160px; }

  /* --- Mobile ticket cards (rendered by JS) --- */
  .mobile-ticket-cards { display: flex; flex-direction: column; gap: 8px; }
  .mobile-ticket-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
  }
  .mobile-ticket-card:active { background: var(--surface-hover); border-color: var(--accent); }
  .mobile-ticket-card .mtc-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
  }
  .mobile-ticket-card .mtc-id { font-weight: 700; font-size: 13px; color: var(--text); }
  .mobile-ticket-card .mtc-subject {
    font-size: 14px; font-weight: 500; color: var(--accent);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.4;
    margin-bottom: 6px;
    overflow-wrap: break-word; word-break: break-word;
  }
  .mobile-ticket-card .mtc-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 11px; color: var(--text-muted);
  }
  .mobile-ticket-card .mtc-portal {
    font-size: 12px; color: var(--accent); font-weight: 500;
  }
  .mobile-ticket-card .mtc-actions {
    display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end;
  }
  .mobile-ticket-card .mtc-actions .btn { min-height: 32px; padding: 5px 12px; font-size: 12px; }

  /* --- Chat messages: wider on mobile --- */
  .msg { max-width: 92%; font-size: 14px; padding: 10px 14px; -webkit-touch-callout: none; }
  /* On touch: menu button always visible (no hover on mobile) */
  .msg-menu-btn { opacity: 0.6; width: 32px; height: 32px; font-size: 18px; }
  .msg-menu-item { padding: 12px 16px; font-size: 15px; min-height: 44px; }
  .msg-menu-dropdown { min-width: 200px; }

  /* --- Modal: near full-screen --- */
  .modal-overlay, .modal-backdrop { padding: 6px; }
  .modal-dialog, .modal-card { max-width: 100%; border-radius: var(--radius); max-height: 95vh; }
  .modal-header h3 { font-size: 15px; }
  .modal-body { padding: 14px; }

  /* --- Forms: 16px to prevent iOS zoom --- */
  .form-input, .form-textarea, .form-select { font-size: 16px; padding: 10px 12px; }

  /* --- Stack layouts --- */
  .ticket-detail-grid { grid-template-columns: 1fr; gap: 10px; }
  .ticket-detail-layout { grid-template-columns: 1fr; height: auto; }
  .ticket-detail-sidebar { order: -1; max-width: 100%; }
  .ticket-detail-chat .messages { max-height: 60vh; }
  .ticket-list-layout { flex-direction: column; gap: 10px; }
  .ticket-list-sidebar { width: 100%; order: -1; position: static; }

  /* --- Ticket detail: compact topbar --- */
  .td-topbar { gap: 4px; }
  .td-title { font-size: 13px; }
  .td-topbar-sep { display: none; }
  .td-info-row { font-size: 11px; }
  .td-chat-tab { padding: 6px 10px; font-size: 12px; }

  /* --- Chat input: mobile-friendly --- */
  .chat-toolbar { flex-wrap: wrap; }
  .chat-toolbar .btn-toolbar { min-width: 36px; min-height: 36px; }

  /* --- File preview: remove button always visible on touch --- */
  .chat-file-remove { opacity: 1; }

  /* --- Messages: file attachments --- */
  .msg-file-card { max-width: 100%; }

  /* --- Sidebar cards compact --- */
  .ticket-detail-sidebar .card-body { padding: 8px 10px; }
  .td-info-grid { gap: 4px; }

  /* --- Empty state --- */
  .empty-state { padding: 32px 14px; }
  .empty-state .icon { font-size: 36px; }
  .empty-state .title { font-size: 16px; }

  /* --- Search full-width --- */
  .search-input { min-width: 0; width: 100%; }

  /* --- Dashboard: single column --- */
  .dashboard-grid { grid-template-columns: 1fr; }

  /* --- Headings: smaller on mobile --- */
  h2 { font-size: 16px !important; }

  /* --- Toast: full width at bottom --- */
  .toast-container { left: 10px; right: 10px; bottom: 10px; }
  .toast { max-width: 100%; }

  /* --- Settings sub-tabs: scrollable --- */
  .setting-row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 0; }
  .setting-info { width: 100%; }
}

/* Tablet */
@media (max-width: 800px) and (min-width: 641px) {
  .app-content { padding: 20px 16px; }
  .ticket-list-layout { flex-direction: column; gap: 14px; }
  .ticket-list-sidebar { width: 100%; order: -1; position: static; }
  /* Tabs: scrollable on tablet too */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }
  .ticket-detail-layout { grid-template-columns: 1fr; height: auto; }
  .ticket-detail-chat .messages { max-height: 50vh; }
}

/* Large screens */
@media (min-width: 1200px) {
  .table td, .table th { padding: 10px 8px; }
  .table .subject.truncate { max-width: clamp(250px, 30vw, 500px); }
  .ticket-detail-grid { grid-template-columns: 1fr 320px; gap: 24px; }
  .ticket-list-sidebar { width: 300px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (min-width: 1600px) {
  .table .subject.truncate { max-width: clamp(360px, 35vw, 600px); }
  .ticket-detail-grid { grid-template-columns: 1fr 360px; gap: 28px; }
}

/* ═══ Utilities ═══ */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ Language selector ═══ */
.lang-select {
  height: 34px;
  padding: 0 26px 0 10px;
  font: 600 12px/1 var(--font);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.lang-select:hover { color: var(--accent); border-color: var(--accent); }
.lang-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.lang-select option { background: var(--surface); color: var(--text); }

/* ═══ Search input in filters ═══ */
.search-input {
  padding: 8px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: 13px var(--font);
  color: var(--text);
  min-width: 200px;
  transition: border-color 200ms, box-shadow 200ms;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ═══ Drop zone ═══ */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer;
  transition: border-color 150ms, background 150ms;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent); background: var(--accent-light);
}
.drop-zone-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.drop-zone-label {
  font: 13px var(--font); color: var(--text-muted);
  pointer-events: none;
}
.drop-zone-files {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
  justify-content: center;
}
.drop-zone-hidden { display: none; }
.drop-zone-wrap { position: relative; }

/* ═══ Chat file previews (inline in chat-input-area) ═══ */
.chat-input-area.drag-active {
  border-color: var(--accent) !important;
  background: var(--accent-light);
}
.chat-files-preview {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 10px 2px; border-top: 1px solid var(--border-light);
}
.chat-file-thumb {
  position: relative; width: 64px; flex-shrink: 0; text-align: center;
}
.chat-file-img {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border-light);
  display: block; margin: 0 auto;
}
.chat-file-icon {
  width: 60px; height: 60px; display: flex;
  align-items: center; justify-content: center;
  background: var(--surface-hover); border: 1px solid var(--border-light);
  border-radius: 6px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
}
.chat-file-name {
  font-size: 10px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 64px; margin-top: 2px;
}
.chat-file-remove {
  position: absolute; top: -4px; right: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none;
  font-size: 12px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.chat-file-thumb:hover .chat-file-remove { opacity: 1; }

/* Video thumbnail preview */
.chat-file-video-thumb {
  width: 60px; height: 60px; display: flex;
  align-items: center; justify-content: center;
  background: var(--surface-hover); border: 1px solid var(--border-light);
  border-radius: 6px; position: relative; overflow: hidden;
}
.chat-file-video-thumb svg {
  position: relative; z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

/* Send button spinner */
.send-spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-toolbar-send.is-sending {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 36px; pointer-events: none;
}
.btn-toolbar-send.is-sending .send-label {
  font-size: 11px; white-space: nowrap;
}

.btn-attach {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 4px 8px; cursor: pointer; color: var(--text-muted);
  font: 12px var(--font); transition: color 150ms, border-color 150ms;
}
.btn-attach:hover { color: var(--accent); border-color: var(--accent); }
.file-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; font: 11px var(--font);
  background: var(--surface-hover); border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* ═══ Voice input button ═══ */
.btn-voice {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer;
  transition: all 150ms; flex-shrink: 0;
}
.btn-voice:hover { color: var(--accent); border-color: var(--accent); }
.btn-voice.recording {
  color: #ef4444; border-color: #ef4444;
  animation: pulse-voice 1.2s ease-in-out infinite;
}
@keyframes pulse-voice {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.msg-input-row {
  position: relative;
}
.msg-input-row .form-textarea { width: 100%; min-height: 40px; padding-right: 44px; }
.msg-input-row .btn-voice {
  position: absolute; bottom: 6px; right: 6px;
  width: 30px; height: 30px; z-index: 2;
}
/* Form textarea with actions toolbar below */
.form-textarea-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  transition: border-color 200ms, box-shadow 200ms;
}
.form-textarea-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-textarea-wrap .form-textarea {
  width: 100%; min-height: 80px;
  border: none; background: transparent;
  box-shadow: none; outline: none;
  resize: none;
}
.form-textarea-wrap .form-textarea:focus {
  box-shadow: none; border: none;
}
.form-textarea-actions {
  display: flex; gap: 4px; justify-content: flex-end;
  padding: 4px 8px 6px;
}
.form-textarea-actions .btn-voice,
.form-textarea-actions .btn-toolbar {
  width: 30px; height: 30px;
  border: none; background: none;
  color: var(--text-muted); border-radius: 6px;
  padding: 4px; cursor: pointer;
}
.form-textarea-actions .btn-voice:hover,
.form-textarea-actions .btn-toolbar:hover {
  color: var(--accent); background: var(--accent-light);
}
/* Voice btn in toolbar — override absolute positioning */
.chat-toolbar .btn-voice {
  position: static; width: auto; height: auto;
  border: none; background: none; padding: 5px 7px;
  color: var(--text-muted); border-radius: 6px;
}
.chat-toolbar .btn-voice:hover { color: var(--accent); border: none; background: var(--accent-light); }
.chat-toolbar .btn-voice.recording {
  color: #ef4444; background: rgba(239, 68, 68, 0.1);
  animation: pulse-voice 1.2s ease-in-out infinite;
}

/* ═══ Custom Date Picker ═══ */
.dp-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg, #f4f6f8); color: var(--text-muted);
  transition: border-color 150ms;
}
.dp-trigger:hover { border-color: var(--accent); color: var(--text); }
.dp-dropdown {
  position: fixed; z-index: 10000;
  padding: 8px;
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 240px;
}
.dp-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; padding: 0 2px;
}
.dp-month-year { font-size: 13px; font-weight: 600; color: var(--text); }
.dp-nav {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-muted); padding: 2px 6px;
  border-radius: 4px; line-height: 1;
}
.dp-nav:hover { background: var(--surface-hover, #f8f9fb); color: var(--text); }
.dp-days-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 10px; color: var(--text-muted);
  margin-bottom: 2px; font-weight: 600;
}
.dp-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.dp-day, .dp-empty {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border: none; border-radius: 6px; cursor: pointer;
  background: none; color: var(--text); transition: all 100ms;
}
.dp-day:hover:not(.dp-disabled):not(.dp-selected) { background: var(--surface-hover, #f8f9fb); }
.dp-day.dp-selected { background: var(--accent); color: #fff; font-weight: 600; }
.dp-day.dp-today { border: 1px solid var(--accent); }
.dp-day.dp-disabled { color: var(--text-muted); opacity: 0.35; cursor: not-allowed; }
.dp-empty { cursor: default; }

/* ═══ Unread Badge ═══ */
.unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
  background: #ef4444; color: #fff; line-height: 1;
  margin-left: 6px; vertical-align: middle;
}
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  color: #fff; line-height: 1; margin-left: 3px;
  vertical-align: middle; cursor: pointer; transition: opacity 0.15s;
}
.nav-badge:hover { opacity: 0.8; }
.nav-badge-new { background: #ef4444; }
.nav-badge-unread { background: var(--accent, #3a9fd8); }
.ticket-id-cell { position: relative; white-space: nowrap; }
.msg-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; font-size: 10px; font-weight: 600;
  background: var(--bg-tertiary); color: var(--text-muted); line-height: 1;
  margin-left: 4px; vertical-align: middle;
}

/* ═══ File Preview ═══ */
.file-preview {
  display: inline-block; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; text-decoration: none; color: var(--text);
  max-width: 280px; transition: border-color 150ms;
}
.file-preview:hover { border-color: var(--accent); }
.file-preview-img {
  display: block; width: 100%; max-height: 200px; object-fit: cover;
  background: var(--surface-hover);
}
.file-preview-info {
  padding: 8px 10px; font-size: 11px; line-height: 1.3;
  display: flex; flex-direction: column; gap: 2px;
}
.file-preview-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}
.file-type-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 20px; padding: 0 6px;
  border-radius: 4px; font-size: 10px; font-weight: 700;
  color: #fff; letter-spacing: 0.3px; flex-shrink: 0;
}

/* Attachment tabs */
.att-tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  border-bottom: 2px solid var(--border-light);
}
.att-tab {
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); cursor: pointer; transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}
.att-tab:hover { color: var(--text); }
.att-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.att-panel { display: flex; flex-wrap: wrap; gap: 8px; }
.att-panel .file-chip,
.att-panel .file-preview { margin: 0; }

/* Link items in attachments panel */
.link-item { width: 100%; display: flex; flex-direction: column; gap: 2px; }
.link-author {
  font-size: 11px; font-weight: 600; color: var(--accent);
  cursor: pointer; line-height: 1.2;
  transition: color 150ms;
}
.link-author:hover { color: var(--accent-hover); text-decoration: underline; }
.link-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.link-url {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; min-width: 0; flex: 1;
  background: var(--surface-hover); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--accent);
  cursor: pointer; text-decoration: none; transition: background 150ms, border-color 150ms;
}
.link-url:hover { background: var(--accent-light); border-color: var(--accent); }
.link-url .truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-copy-btn {
  flex-shrink: 0; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-hover); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text-muted);
  cursor: pointer; transition: all 150ms;
}
.link-copy-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }

/* Link preview cards (OG metadata) in chat messages */
.link-preview-card {
  display: flex; gap: 10px; margin-top: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); border-left: 3px solid var(--accent);
  background: var(--surface-hover);
  text-decoration: none; color: inherit;
  max-width: 360px; overflow: hidden;
  transition: border-color 150ms, background 150ms;
  cursor: pointer;
}
.link-preview-card:hover { border-color: var(--accent); background: var(--bg-alt); }
.link-preview-img {
  width: 60px; height: 60px; min-width: 60px;
  object-fit: cover; border-radius: var(--radius-sm);
  background: var(--bg-alt);
}
.link-preview-text { min-width: 0; flex: 1; overflow: hidden; }
.link-preview-title {
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  line-height: 1.3; margin-bottom: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.link-preview-desc {
  font-size: 11px; color: var(--text-secondary); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.link-preview-domain {
  font-size: 10px; color: var(--text-muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Compact preview in right-side messages */
.msg-support .link-preview-card { border-left-color: var(--accent); }
.msg-client .link-preview-card { border-left-color: var(--success); }

/* Message highlight animation (scroll-to) */
.msg-highlight {
  animation: msg-flash 2s ease;
}
@keyframes msg-flash {
  0%, 100% { background: transparent; }
  15% { background: var(--accent-light); }
  70% { background: var(--accent-light); }
}

/* Settings gear button */
.btn-settings {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); transition: transform .2s, background .15s;
}
.btn-settings:hover { background: var(--surface-hover); }
.btn-settings svg { flex-shrink: 0; }

/* Message original text block */
.msg-original {
  margin-top: 8px; padding: 6px 10px;
  background: rgba(148,163,184,.12); border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0; font-size: 12px; color: var(--text-muted, #64748b);
  line-height: 1.4;
}
.msg-original-label {
  font-weight: 600; font-size: 10px; text-transform: uppercase;
  margin-right: 4px; color: var(--accent);
}
/* Ticket original text */
.ticket-original-text {
  font-size: 12px; color: var(--text-muted, #64748b); margin-top: 4px;
  padding: 6px 10px; background: rgba(148,163,184,.12);
  border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0;
}

/* Two-column ticket detail layout */
.ticket-detail-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px;
}
.ticket-detail-main { min-width: 0; overflow: hidden; }
.ticket-detail-sidebar { min-width: 0; max-width: 320px; overflow-wrap: break-word; word-break: break-word; }
@media (max-width: 720px) {
  .ticket-detail-grid {
    grid-template-columns: 1fr;
  }
  .ticket-detail-sidebar { order: -1; }
}

/* Danger button */
.btn-danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* modal-backdrop + modal-card → unified in Modal section above */

/* ═══ Toast ═══ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  color: #fff; font-size: 13px; font-weight: 500;
  animation: toast-in 0.3s ease;
  max-width: 380px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast-success { background: #16a34a; }
.toast-error { background: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ Chat toolbar (attach + templates + send) ═══ */
.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-top: 1px solid var(--border-light);
  position: relative;
}
.btn-toolbar {
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 5px 7px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.btn-toolbar:hover {
  color: var(--text);
  background: var(--accent-light);
}
.btn-toolbar-send {
  background: var(--accent); color: #fff !important;
  border: none; border-radius: 6px; cursor: pointer;
  padding: 5px 7px; display: inline-flex; align-items: center;
  transition: background .15s;
}
.btn-toolbar-send:hover { background: var(--accent-hover); }
.btn-toolbar-send:disabled { opacity: 0.5; cursor: default; }

/* ═══ Note toggle (eye icon) ═══ */
.note-toggle-btn { line-height: 0; }
.note-toggle {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 12px; color: var(--text-muted); user-select: none;
  transition: color .2s;
}
.note-toggle input[type="checkbox"] { display: none; }
.note-toggle-icon { display: inline-flex; align-items: center; }

/* ═══ Template dropdown ═══ */
.template-dropdown {
  position: fixed; z-index: 1000;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 400px; max-height: 300px;
  overflow-y: auto; padding: 0;
}
.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
  position: sticky; top: 0; z-index: 1;
}
.template-header-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-add-template {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0;
  padding: 3px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.btn-add-template:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.template-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; cursor: pointer; font-size: 13px; line-height: 1.4;
  transition: background .1s;
}
.template-item:hover { background: var(--accent-light); }
.template-item .template-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-item .template-del {
  flex-shrink: 0; margin-left: 8px; color: var(--text-muted);
  font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 4px;
}
.template-item .template-del:hover { color: var(--danger); background: var(--danger-bg); }
.template-empty { padding: 12px; text-align: center; color: var(--text-secondary, var(--text)); font-size: 13px; }

/* ═══ Quoted message block ═══ */
.msg-quote {
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.msg-quote-author {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 2px;
}
.msg-quote-text {
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ═══ Internal note style ═══ */
.msg-note {
  background: var(--warning-bg) !important;
  border-left: 3px solid var(--warning) !important;
}
.msg-note .msg-author::after { content: ' (заметка)'; font-size: 10px; color: var(--warning); font-weight: 400; }

/* ═══ Channel messages (WhatsApp, Telegram, MAX, Email) ═══ */
.msg-channel-whatsapp { border-left: 3px solid #25D366 !important; background: rgba(37,211,102,0.06) !important; }
.msg-channel-telegram, .msg-channel-telegram_bot { border-left: 3px solid #229ED9 !important; background: rgba(34,158,217,0.06) !important; }
.msg-channel-telegram_chat { border-left: 3px solid #229ED9 !important; background: rgba(34,158,217,0.08) !important; }
.msg-channel-max { border-left: 3px solid #5B2EFF !important; background: rgba(91,46,255,0.06) !important; }
.msg-channel-email { border-left: 3px solid #EA4335 !important; background: rgba(234,67,53,0.06) !important; }
.msg-channel-icon { flex-shrink: 0; min-width: 16px; width: 16px; height: 16px; }
.msg-channel-phone { font-size: 10px; color: var(--text-muted); margin-left: 4px; font-weight: 400; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Channel send buttons in chat toolbar */
.channel-send-btns { display: inline-flex; gap: 2px; align-items: center; }
/* Channel toggle buttons (WhatsApp/Telegram) — work like note toggle */
.btn-channel-toggle { display: inline-flex; align-items: center; padding: 4px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; background: transparent; color: var(--text-muted); transition: all 0.2s; position: relative; }
.btn-channel-toggle:hover { color: var(--text); background: var(--accent-light); }
.btn-channel-toggle.ch-toggle-active { box-shadow: 0 0 0 2px currentColor; transform: scale(1.1); }
.btn-channel-toggle.ch-toggle-active[data-ch="whatsapp"] { color: #25D366; background: rgba(37,211,102,0.15); box-shadow: 0 0 0 2px #25D366; }
.btn-channel-toggle.ch-toggle-active[data-ch="telegram_chat"],
.btn-channel-toggle.ch-toggle-active[data-ch="telegram_bot"],
.btn-channel-toggle.ch-toggle-active[data-ch="telegram"] { color: #229ED9; background: rgba(34,158,217,0.18); box-shadow: 0 0 0 2px #229ED9; }
.btn-channel-toggle.ch-toggle-active[data-ch="max"] { color: #5B2EFF; background: rgba(91,46,255,0.15); box-shadow: 0 0 0 2px #5B2EFF; }
@keyframes ch-pulse { 0%,100% { box-shadow: 0 0 0 2px currentColor; } 50% { box-shadow: 0 0 0 4px currentColor, 0 0 12px currentColor; } }
.btn-channel-toggle.ch-toggle-active { animation: ch-pulse 2s ease-in-out 3; }
.ch-phone-dropdown { position: absolute; bottom: 100%; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); padding: 6px 0; z-index: 50; min-width: 280px; font-size: 13px; white-space: nowrap; }
.ch-phone-dropdown .ch-phone-item { padding: 8px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.ch-phone-dropdown .ch-phone-item:hover { background: var(--accent-light); }
.ch-phone-dropdown .ch-phone-icon { flex-shrink: 0; color: var(--text-muted); display: flex; }
.ch-phone-dropdown .ch-phone-num { font-weight: 600; color: var(--text); }
.ch-phone-label { color: var(--text-muted); font-size: 11px; margin-left: auto; }

/* ═══ Sort mini button ═══ */
.btn-sort-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer;
  padding: 0; transition: all 0.15s;
}
.btn-sort-mini:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ═══ License rows ═══ */
.lic-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 3px 0; gap: 8px;
}
.lic-row > span:first-child { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.lic-row-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap; }
.lic-date { white-space: nowrap; }
.lic-link {
  color: var(--accent); text-decoration: none; font-weight: 500;
}
.lic-link:hover { text-decoration: underline; }
.btn-renew-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--warning); cursor: pointer; padding: 0;
  transition: all 0.15s; flex-shrink: 0;
}
.btn-renew-mini:hover { background: var(--warning-bg); border-color: var(--warning); }

/* ═══ Result message style (completion) ═══ */
.msg-result {
  background: rgba(34, 197, 94, 0.12) !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  border-left: 4px solid #22c55e !important;
  align-self: flex-end !important;
  max-width: 90%;
}
.msg-result-label {
  font-size: 11px;
  font-weight: 600;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.msg-result .msg-author {
  color: #22c55e;
  font-weight: 600;
}

/* Status change messages — single-line, like WhatsApp "X changed the subject" */
.msg-status {
  background: transparent !important;
  border: none !important;
  align-self: center !important;
  max-width: 90%;
  opacity: 0.45;
  padding: 1px 12px !important;
  margin: 1px 0 !important;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

/* Reassign messages — centered like status, but with accent color */
.msg-reassign {
  background: transparent !important;
  border: none !important;
  align-self: center !important;
  max-width: 90%;
  padding: 2px 12px !important;
  margin: 2px 0 !important;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  color: var(--accent);
  opacity: 0.7;
}

/* Screen share card in chat — see also .msg-ss-client / .msg-ss-support */
.ss-card {
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
  max-width: 280px;
}
.ss-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}
.ss-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: ssLivePulse 1.5s ease-in-out infinite;
}
.ss-card-time {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg-tertiary, rgba(0,0,0,0.08));
  padding: 1px 6px;
  border-radius: 4px;
}
@keyframes ssLivePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
/* Ended screen share card — dimmed, no interaction */
.ss-card-ended {
  border-color: var(--border-color);
  opacity: 0.6;
}
.ss-card-ended .ss-card-header {
  color: var(--text-secondary);
}
.ss-preview-ended {
  cursor: default !important;
  filter: grayscale(0.5);
}
.ss-preview-ended:hover {
  filter: grayscale(0.5) !important;
  transform: none !important;
}
/* Screen share preview — gradient with monitor illustration */
.ss-preview-ph {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d1b69 50%, #1a3350 100%);
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s ease;
}
.ss-preview-ph::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(59,130,246,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(139,92,246,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.ss-preview-ph:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.ss-preview-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  opacity: 0.5;
}
.ss-preview-play {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(59,130,246,0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}
.ss-preview-ph:hover .ss-preview-play {
  transform: scale(1.1);
}
.ss-preview-label {
  position: relative;
  z-index: 2;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.ss-full-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
}
.ss-full-btn svg {
  flex-shrink: 0;
}

/* Screen share in chat — always on client side (flex-start = left in admin) */
.msg-screen-share {
  max-width: 300px;
  background: transparent !important;
  border: none !important;
  padding: 4px 0 !important;
  opacity: 1 !important;
  text-align: center;
}
.msg-screen-share.ss-outgoing {
  align-self: flex-end !important;
}
.msg-screen-share:not(.ss-outgoing) {
  align-self: flex-start !important;
}
/* Expired/ended session — dim the card */
/* ss-pending: hide live indicators until _initScreenPreviews confirms */
.msg-screen-share.ss-pending .ss-live-dot { display: none; }
.msg-screen-share.ss-pending .ss-full-btn { visibility: hidden; }
.msg-screen-share.ss-pending .ss-preview-play { display: none; }

.msg-screen-share.ss-ended .ss-card {
  border-color: var(--border-light);
  opacity: 0.65;
}
.msg-screen-share.ss-ended .ss-live-dot { display: none; }
.msg-screen-share.ss-ended .ss-full-btn {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}
.msg-screen-share.ss-ended .ss-preview-ph {
  cursor: default;
  pointer-events: none;
}
.msg-screen-share.ss-ended .ss-preview-play { display: none; }

/* Message role badges */
.msg-role-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.msg-role-badge-resp {
  background: rgba(58,159,216,0.12);
  color: var(--accent);
}
.msg-role-badge-coexec {
  background: rgba(139,92,246,0.12);
  color: #7c3aed;
}
.msg-role-badge-obs {
  background: rgba(107,114,128,0.12);
  color: var(--text-muted);
}

/* Role-colored left border on support messages */
.msg-role-co-executor {
  border-left: 3px solid #7c3aed !important;
  background: rgba(139,92,246,0.04) !important;
}
.msg-role-observer {
  border-left: 3px solid var(--text-muted) !important;
  background: rgba(107,114,128,0.04) !important;
}
.msg-role-responsible {
  border-left: 3px solid var(--accent) !important;
}

/* Screen share status badge (operator sidebar) */
.ss-status-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.ss-status-badge.ss-connected {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}
.ss-status-badge.ss-ended {
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
  color: var(--text-secondary);
}

/* Pointer fade animation (operator video) */
@keyframes fadeOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Delivery status checkmarks */
.msg-delivery {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
}
.msg-sent { color: var(--text-muted); opacity: 0.5; }
.msg-delivered { color: var(--text-muted); opacity: 0.7; }
.msg-read { color: var(--accent); opacity: 0.85; }
.msg-failed { color: var(--danger); opacity: 0.85; font-weight: 700; font-size: 12px; }

/* Like / Dislike reactions */
.msg-reactions {
  display: inline-flex;
  gap: 2px;
  margin-left: 8px;
  vertical-align: middle;
}
.btn-reaction {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  opacity: 0.65;
  transition: opacity .15s, background .15s, color .15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.btn-reaction:hover {
  opacity: 1;
  background: var(--bg-subtle);
}
.btn-reaction.active {
  opacity: 1;
}
.msg:hover .btn-reaction {
  opacity: 0.85;
}
.msg:hover .btn-reaction:hover,
.msg:hover .btn-reaction.active {
  opacity: 1;
}

/* ═══ Dashboard analytics ═══ */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dashboard-grid .card { overflow: hidden; min-width: 0; }
@media (max-width: 640px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* Vertical bar chart */
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 0 4px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 32px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 4px; transition: height .3s; }
.chart-bar-wrap:hover .chart-bar { background: var(--accent-hover); }
.chart-bar-label { font-size: 9px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }

/* Horizontal bars */
.hbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hbar-row:last-child { margin-bottom: 0; }
.hbar-label { width: 110px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; height: 18px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; transition: width .4s; }
.hbar-value { width: 32px; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text); }

/* ═══ Widget management ═══ */
.widget-card { transition: opacity .2s; }
.widget-card.widget-inactive { opacity: .55; }
.widget-embed-code {
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 12px; font-size: 11px; line-height: 1.5; overflow-x: auto;
  white-space: pre-wrap; word-break: break-all; max-height: 120px;
  font-family: 'SF Mono', Monaco, Consolas, monospace; color: var(--text-secondary);
}
.widget-type-option {
  cursor: pointer; border: 2px solid var(--border-light); border-radius: 12px;
  padding: 12px 16px; text-align: center; transition: border-color .2s;
}
.widget-type-option input { display: none; }
.widget-type-option.active { border-color: var(--accent); background: var(--accent-light); }
.widget-type-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border); border-radius: 22px; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Inline toggle (label > hidden checkbox + this span) */
.toggle-switch-inline {
  position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0;
}
.toggle-switch-inline .toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border); border-radius: 22px; transition: .2s;
}
.toggle-switch-inline .toggle-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.toggle-switch-inline.active .toggle-slider { background: var(--success); }
.toggle-switch-inline.active .toggle-slider::before { transform: translateX(18px); }

/* Module toggles in settings */
.module-toggles { display: flex; flex-direction: column; gap: 2px; }
.module-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 10px; transition: background .15s;
}
.module-toggle-row:hover { background: var(--surface); }
.module-toggle-info { display: flex; align-items: center; gap: 12px; }
.module-toggle-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface); color: var(--accent); }
.module-toggle-name { font-weight: 600; font-size: 14px; }

/* Settings content width limiter */
.settings-content { max-width: 860px; }

.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }

/* ═══ Ticket list two-column layout ═══ */
.ticket-list-layout {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
.ticket-list-main {
  flex: 1;
  min-width: 0;
}
.ticket-list-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 8px;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
@media (max-width: 800px) {
  .ticket-list-layout { flex-direction: column; }
  .ticket-list-sidebar { width: 100%; order: -1; }
}

/* ═══ Avatars ═══ */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--accent); overflow: hidden; flex-shrink: 0;
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-group { display: inline-flex; gap: 4px; align-items: center; }
.contact-link { color: var(--accent); cursor: pointer; }
.contact-link:hover { text-decoration: underline; }
.contact-list-item { transition: background 0.15s; }
.contact-list-item:hover { background: var(--bg-alt); }
.contact-list-item + .contact-list-item { border-top: 1px solid var(--border); }

/* Marketplace */
.marketplace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mk-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 20px; transition: box-shadow 0.2s; }
.mk-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.mk-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mk-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mk-card-name { font-weight: 600; font-size: 15px; }
.mk-card-price { font-size: 13px; color: var(--text-muted); }
.mk-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.mk-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mk-status-ok { border-color: var(--success); }
.mk-status-warn { border-color: var(--warning); }
.mk-status-locked { opacity: 0.7; }
.mk-card-settings .ch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.badge-warn { background: var(--warning); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.badge-danger { background: var(--danger); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
@media (max-width: 600px) { .marketplace-grid { grid-template-columns: 1fr; } .mk-card-settings .ch-grid { grid-template-columns: 1fr; } }

/* Avatar lightbox */
.avatar-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms;
}
.avatar-lightbox.active { opacity: 1; pointer-events: auto; cursor: pointer; }
.avatar-lightbox-content {
  text-align: center; cursor: default;
}
.avatar-lightbox-content img {
  max-width: min(320px, 90vw); max-height: 320px;
  border-radius: 50%; object-fit: cover;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  border: 3px solid #fff;
}
.avatar-lightbox-name {
  margin-top: 12px; color: #fff; font-size: 16px; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Tenant Code Badge (AnyDesk-style) */
.tenant-code-badge {
  background: var(--gradient-brand);
  color: #fff; border-radius: 14px; padding: 14px 24px;
  text-align: center; cursor: pointer; user-select: none;
  transition: transform 200ms, box-shadow 200ms;
  box-shadow: 0 4px 16px rgba(58,159,216,0.25);
  min-width: 180px;
}
.tenant-code-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(58,159,216,0.35); }
.tenant-code-badge:active { transform: translateY(0); }
.tcb-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 4px; }
.tcb-code { font-size: 24px; font-weight: 700; letter-spacing: 3px; font-family: var(--font-mono, 'SF Mono', Monaco, monospace); }
.tcb-hint { font-size: 11px; opacity: 0.6; margin-top: 4px; }

/* Header Code Badge (compact, for admin header) */
.header-code-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  background: var(--gradient-brand); color: #fff;
  font-size: 13px; user-select: none; transition: all 200ms;
  box-shadow: 0 2px 8px rgba(58,159,216,0.2);
}
.header-code-badge:hover { box-shadow: 0 4px 14px rgba(58,159,216,0.35); transform: translateY(-1px); }
.header-code-badge:active { transform: translateY(0); }
.hcb-label { opacity: 0.8; font-weight: 500; }
.hcb-code { font-weight: 700; letter-spacing: 2px; font-family: var(--font-mono, 'SF Mono', Monaco, monospace); }

/* Link Code / Registration Screens */
.lc-wrap { display:flex; justify-content:center; align-items:flex-start; min-height:calc(100vh - 64px); padding:16px 16px; }
.lc-inner { width:100%; max-width:920px; }
.lc-icon { width:56px; height:56px; border-radius:16px; display:inline-flex; align-items:center; justify-content:center; margin-bottom:10px; background:var(--gradient-brand); box-shadow:0 6px 24px rgba(58,159,216,0.25); animation:lc-float 3s ease-in-out infinite; }
.lc-icon svg { width:28px; height:28px; stroke:#fff; }
@keyframes lc-float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-4px); } }
.lc-title { font-size:20px; font-weight:700; color:var(--text); margin:0 0 4px; }
.lc-desc { font-size:14px; color:var(--text-secondary); margin:0; }
.lc-cards { display:flex; gap:16px; flex-wrap:wrap; }
.lc-card { flex:1 1 340px; background:var(--surface); border-radius:16px; padding:28px 24px; border:1px solid var(--border-light,var(--border)); box-shadow:0 2px 12px rgba(0,0,0,0.04); transition:transform 200ms,box-shadow 200ms; position:relative; overflow:hidden; cursor:pointer; }
.lc-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--accent),#7c3aed); opacity:0; transition:opacity 200ms; }
.lc-card:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,0.08); }
.lc-card:hover::before { opacity:1; }
.lc-card-icon { width:44px; height:44px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; margin-bottom:14px; }
.lc-card-icon svg { width:22px; height:22px; stroke:#fff; }
.lc-card-icon.blue { background:var(--gradient-brand); }
.lc-card-icon.purple { background:linear-gradient(135deg,#7c3aed,#5b21b6); }
.lc-card h3 { font-size:17px; font-weight:600; margin:0 0 6px; color:var(--text); }
.lc-card p { font-size:14px; color:var(--text-secondary); margin:0 0 16px; line-height:1.5; }
.lc-code-input { width:100%; padding:14px 16px; border:2px solid var(--border); border-radius:12px; font-size:20px; font-weight:600; letter-spacing:4px; text-align:center; background:var(--bg); color:var(--text); outline:none; transition:border-color 200ms,box-shadow 200ms; font-family:var(--font-mono,'SF Mono',Monaco,monospace); text-transform:uppercase; box-sizing:border-box; }
.lc-code-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(58,159,216,0.12); }
.lc-code-input::placeholder { letter-spacing:2px; font-weight:400; }
.lc-btn { width:100%; padding:11px 20px; border:none; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; transition:all 200ms; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.lc-btn-primary { background:var(--gradient-brand); color:#fff; box-shadow:0 4px 14px rgba(58,159,216,0.3); }
.lc-btn-primary:hover { box-shadow:0 6px 20px rgba(58,159,216,0.4); transform:translateY(-1px); }
.lc-btn-primary:active { transform:translateY(0); }
.lc-btn-primary:disabled { opacity:0.6; cursor:not-allowed; transform:none; }
.lc-btn-outline { background:transparent; color:var(--text); border:2px solid var(--border); box-shadow:none; }
.lc-btn-outline:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-light); }
.lc-or { text-align:center; color:var(--text-muted); font-size:14px; font-weight:500; margin:10px 0; }
.lc-back-btn { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text-secondary); font-size:13px; font-weight:500; cursor:pointer; transition:all 200ms; margin-bottom:12px; }
.lc-back-btn:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-light); }
.lc-field { margin-bottom:10px; }
.lc-label { display:block; font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:4px; text-transform:uppercase; letter-spacing:0.5px; }
.lc-input-wrap { position:relative; }
.lc-input-icon { position:absolute; left:12px; top:19px; transform:translateY(-50%); width:16px; height:16px; color:var(--text-muted); pointer-events:none; }
.lc-field-input { width:100%; padding:10px 14px 10px 38px; border:2px solid var(--border); border-radius:10px; font-size:14px; background:var(--bg); color:var(--text); outline:none; transition:border-color 200ms,box-shadow 200ms; box-sizing:border-box; }
.lc-field-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(58,159,216,0.12); }
.lc-field-input::placeholder { color:var(--text-muted); }
.lc-field-input.invalid { border-color:var(--danger); }
.lc-field-input.invalid:focus { box-shadow:0 0 0 3px rgba(239,68,68,0.12); }
.lc-field-input.valid { border-color:var(--success); }
.form-input.valid { border-color:var(--success); }
.form-input.invalid { border-color:var(--danger); }
.form-input.invalid:focus { box-shadow:0 0 0 3px rgba(239,68,68,0.12); }
.form-input.valid:focus { box-shadow:0 0 0 3px rgba(34,197,94,0.12); }
.lc-field-hint { font-size:12px; color:var(--danger); margin-top:4px; display:none; }
.lc-field-input.invalid + .lc-field-hint,
.lc-field-input.invalid ~ .lc-field-hint { display:block; }
.lc-divider { display:flex; align-items:center; gap:16px; margin:24px 0; color:var(--text-muted); font-size:13px; }
.lc-divider::before,.lc-divider::after { content:''; flex:1; height:1px; background:var(--border); }

/* ═══ Utility Classes (token-based) ═══ */
/* Flex */
.flex{display:flex}.inline-flex{display:inline-flex}.flex-col{flex-direction:column}
.block{display:block}.inline-block{display:inline-block}
.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}
.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}
.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.min-w-0{min-width:0}.w-full{width:100%}

/* Gap (token-based) */
.gap-1{gap:var(--sp-1)}.gap-2{gap:var(--sp-2)}.gap-3{gap:var(--sp-3)}.gap-4{gap:var(--sp-4)}
.gap-5{gap:var(--sp-5)}.gap-6{gap:var(--sp-6)}.gap-8{gap:var(--sp-8)}
/* Legacy gap (px) for backwards compat */
.gap-px-4{gap:4px}.gap-px-6{gap:6px}.gap-px-10{gap:10px}.gap-px-14{gap:14px}

/* Margin */
.m-0{margin:0}
.mb-1{margin-bottom:var(--sp-1)}.mb-2{margin-bottom:var(--sp-2)}.mb-3{margin-bottom:var(--sp-3)}.mb-4{margin-bottom:var(--sp-4)}
.mb-5{margin-bottom:var(--sp-5)}.mb-6{margin-bottom:var(--sp-6)}
.mt-1{margin-top:var(--sp-1)}.mt-2{margin-top:var(--sp-2)}.mt-3{margin-top:var(--sp-3)}.mt-4{margin-top:var(--sp-4)}
.mt-5{margin-top:var(--sp-5)}

/* Padding */
.p-2{padding:var(--sp-2)}.p-3{padding:var(--sp-3)}.p-4{padding:var(--sp-4)}.p-6{padding:var(--sp-6)}

/* Typography (token-based) */
.text-xs{font-size:var(--fs-xs)}.text-sm{font-size:var(--fs-sm)}.text-base{font-size:var(--fs-base)}.text-md{font-size:var(--fs-md)}
.text-lg{font-size:var(--fs-lg)}.text-xl{font-size:var(--fs-xl)}.text-2xl{font-size:var(--fs-2xl)}
.text-muted{color:var(--text-muted)}.text-secondary{color:var(--text-secondary)}.text-accent{color:var(--accent)}
.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}
.font-normal{font-weight:var(--fw-normal)}.font-medium{font-weight:var(--fw-medium)}
.font-semibold{font-weight:var(--fw-semibold)}.font-bold{font-weight:var(--fw-bold)}
.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}
.hidden{display:none!important}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ═══ Typography ═══ */
.page-title{font-size:20px;font-weight:800;letter-spacing:-0.3px;color:var(--text);margin:0}
.section-title{font-size:16px;font-weight:700;color:var(--text);margin:0}
.section-label{font-size:13px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.5px;margin-bottom:10px}
.card-title{font-size:15px;font-weight:600;color:var(--text);margin:0}

/* ═══ Page Layout ═══ */
.page-header{display:flex;align-items:center;gap:10px;margin-bottom:16px}
.form-card{max-width:640px;margin:0 auto}
.form-card .card-body{padding:24px}
.form-card .form-group{margin-bottom:14px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:500px){.form-row{grid-template-columns:1fr}}
.form-actions{display:flex;justify-content:space-between;align-items:center;margin-top:20px;padding-top:16px;border-top:1px solid var(--border-light,var(--border))}
.action-card{border-radius:var(--radius);overflow:hidden;margin-bottom:14px}
.action-card .action-bar{height:3px}
.action-card .action-body{padding:16px 20px}
.info-block{margin-bottom:10px}
.info-block .info-label{font-size:12px;color:var(--text-muted);margin-bottom:2px}
.info-block .info-value{font-size:13px;font-weight:500;color:var(--text)}

/* ═══ Partners Page v2 — unified card layout ═══ */
.pp-page{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
.pp-back{display:flex;align-items:center;gap:10px;margin-bottom:4px}

/* Main card — single container for partners list + add */
.pp-main{background:var(--surface);border:1px solid var(--border-light);border-radius:var(--radius);overflow:hidden}
.pp-main-bar{height:3px;background:var(--gradient-brand)}
.pp-main-head{padding:16px 20px 0;display:flex;align-items:center;justify-content:space-between}
.pp-main-title{font-size:15px;font-weight:700;color:var(--text);display:flex;align-items:center;gap:8px}
.pp-main-title svg{width:18px;height:18px;stroke:var(--accent)}
.pp-count{font-size:12px;font-weight:600;color:var(--text-muted);background:var(--bg);padding:2px 8px;border-radius:10px}

/* Partner list items inside main card */
.pp-list{padding:12px 20px 0}
.pp-item{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border-light)}
.pp-item:last-child{border-bottom:none}
.pp-avatar{width:36px;height:36px;border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:14px;flex-shrink:0;background:var(--gradient-brand)}
.pp-item-info{flex:1;min-width:0}
.pp-name{font-weight:600;font-size:13px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pp-badge{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;color:var(--accent);margin-top:1px}
.pp-badge::before{content:'';width:5px;height:5px;border-radius:50%;background:var(--accent)}
.pp-desc{font-size:12px;color:var(--text-secondary);margin-top:2px;line-height:1.4}
.pp-specs{display:flex;flex-wrap:wrap;gap:3px;margin-top:4px}
.pp-spec{padding:2px 8px;border-radius:999px;font-size:10px;font-weight:600}
.pp-item-actions{display:flex;gap:4px;flex-shrink:0}

/* Add partner — footer of main card */
.pp-add{padding:14px 20px;border-top:1px solid var(--border-light);display:flex;align-items:center;gap:10px;background:var(--surface-hover,var(--bg))}
.pp-add-label{font-size:12px;font-weight:600;color:var(--text-muted);white-space:nowrap}
.pp-code-input{flex:1;padding:7px 12px;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:14px;font-weight:700;letter-spacing:3px;text-align:center;background:var(--surface);color:var(--text);outline:none;transition:border-color 200ms,box-shadow 200ms;font-family:var(--font-mono,'SF Mono',Monaco,monospace);text-transform:uppercase;max-width:160px}
.pp-code-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-light)}
.pp-code-input::placeholder{letter-spacing:2px;font-weight:500;opacity:0.35;font-size:12px}

/* Empty state inside main card */
.pp-empty{text-align:center;padding:32px 20px}
.pp-empty-icon{width:48px;height:48px;border-radius:var(--radius);background:var(--accent-light);display:inline-flex;align-items:center;justify-content:center;margin-bottom:10px}
.pp-empty-icon svg{width:24px;height:24px;stroke:var(--accent)}
.pp-empty-title{font-weight:600;font-size:14px;color:var(--text);margin-bottom:4px}
.pp-empty-desc{font-size:12px;color:var(--text-muted)}

/* Own tenant — compact info block */
.pp-own{background:var(--surface);border:1px solid var(--border-light);border-radius:var(--radius);overflow:hidden}
.pp-own-bar{height:3px;background:var(--gradient-brand)}
.pp-own-body{padding:16px 20px;display:flex;align-items:center;gap:12px}
.pp-own-info{flex:1;min-width:0}
.pp-own-label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.5px;margin-bottom:4px}
.pp-code-display{display:inline-flex;align-items:center;gap:8px;padding:5px 12px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm)}
.pp-code-val{font-size:15px;font-weight:700;letter-spacing:3px;font-family:var(--font-mono,'SF Mono',Monaco,monospace);color:var(--text)}
.pp-code-copy{background:none;border:none;color:var(--text-muted);cursor:pointer;padding:4px;border-radius:6px;transition:color 150ms,background 150ms;display:flex}
.pp-code-copy:hover{color:var(--accent);background:var(--accent-light)}

/* Become partner — CTA card */
.pp-become{background:var(--surface);border:1px solid var(--border-light);border-radius:var(--radius);padding:20px;display:flex;align-items:center;gap:16px;transition:border-color 200ms,box-shadow 200ms;cursor:pointer}
.pp-become:hover{border-color:var(--accent);box-shadow:var(--shadow-sm)}
.pp-become-icon{width:40px;height:40px;border-radius:var(--radius-sm);background:var(--gradient-brand);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.pp-become-icon svg{width:20px;height:20px;stroke:#fff}
.pp-become-body{flex:1;min-width:0}
.pp-become-title{font-weight:600;font-size:14px;color:var(--text);margin-bottom:2px}
.pp-become-desc{font-size:12px;color:var(--text-muted)}
.pp-become-arrow{color:var(--accent);display:flex;align-items:center;flex-shrink:0;transition:transform 200ms}
.pp-become:hover .pp-become-arrow{transform:translateX(3px)}

/* Registration form — replaces CTA card in-place */
.pp-form{background:var(--surface);border:1px solid var(--border-light);border-radius:var(--radius);overflow:hidden}
.pp-form-bar{height:3px;background:var(--gradient-brand)}
.pp-form-body{padding:20px}
.pp-form-head{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.pp-form-icon{width:36px;height:36px;border-radius:var(--radius-sm);background:var(--gradient-brand);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.pp-form-icon svg{width:18px;height:18px;stroke:#fff}
.pp-form-title{font-size:15px;font-weight:700;color:var(--text)}
.pp-form-desc{font-size:12px;color:var(--text-muted)}
.pp-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}
.pp-form-actions{display:flex;gap:8px;margin-top:14px}
.pp-form-actions .btn-primary{flex:1}

/* Password strength indicator */
.pp-pass-strength{display:flex;align-items:center;gap:8px;margin-top:6px}
.pp-pass-bar{flex:1;height:3px;background:var(--border-light);border-radius:2px;overflow:hidden}
.pp-pass-fill{height:100%;width:0;border-radius:2px;transition:width 300ms,background 300ms}
.pp-pass-label{font-size:11px;font-weight:600;white-space:nowrap;min-width:60px}

/* Verification step */
.pp-verify-group{padding:16px 20px;border-bottom:1px solid var(--border-light)}
.pp-verify-channel{display:flex;align-items:flex-start;gap:10px;margin-bottom:12px}
.pp-verify-icon{font-size:20px;line-height:1;min-width:24px;text-align:center}
.pp-verify-label{font-size:13px;font-weight:600;color:var(--text)}
.pp-verify-target{font-size:12px;color:var(--text-secondary);margin-top:2px}
.pp-verify-warn{font-size:11px;color:var(--danger);margin-top:2px}
.pp-verify-code-row{display:flex;gap:8px;justify-content:center}
.pp-verify-digit{width:40px;height:48px;text-align:center;font-size:20px;font-weight:700;border:1.5px solid var(--border-light);border-radius:var(--radius);background:var(--surface);color:var(--text);outline:none;transition:border-color 200ms}
.pp-verify-digit:focus{border-color:var(--brand);box-shadow:0 0 0 2px rgba(78,84,200,.15)}
.pp-verify-footer{display:flex;align-items:center;justify-content:center;gap:16px;padding:16px 20px 8px}
.pp-verify-timer{font-size:12px;color:var(--text-secondary)}
.pp-verify-resend{display:flex;justify-content:center;gap:12px;padding:0 20px 12px}
.pp-verify-resend .btn-link{font-size:12px;color:var(--brand);text-decoration:none;background:none;border:none;cursor:pointer;padding:0}
.pp-verify-resend .btn-link:disabled{color:var(--text-secondary);cursor:default}
.pp-verify-actions{display:flex;justify-content:center;gap:12px;padding:4px 20px 16px}
.pp-verify-info{padding:12px 20px;border-bottom:1px solid var(--border-light);display:flex;flex-direction:column;gap:6px}
.pp-verify-info-row{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-secondary)}
.pp-verify-info-icon{font-size:16px;min-width:20px;text-align:center}
.pp-verify-info-text{flex:1}
.pp-verify-info-text b{color:var(--text);font-weight:600}
.pp-verify-status{font-size:12px;font-weight:600;padding:1px 6px;border-radius:4px}
.pp-verify-ok{color:var(--success);background:rgba(34,197,94,.1)}
.pp-verify-fail{color:var(--danger);background:rgba(239,68,68,.1)}
.pp-verify-off{color:var(--text-secondary);background:var(--bg);font-size:11px}

@media(max-width:500px){
  .pp-form-grid{grid-template-columns:1fr}
  .pp-add{flex-wrap:wrap}
  .pp-code-input{max-width:none;flex:1}
  .pp-become{flex-direction:column;text-align:center}
  .pp-become-arrow{display:none}
  .pp-verify-digit{width:36px;height:42px;font-size:18px}
}

/* === Admin Channels Settings === */
.ch-badge{display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;margin-left:auto}
.ch-ok{background:rgba(34,197,94,.12);color:var(--success)}
.ch-warn{background:rgba(245,158,11,.12);color:#d97706}
.ch-off{background:rgba(239,68,68,.1);color:var(--danger)}
.ch-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ch-qr-wrap{text-align:center;padding:16px;background:var(--bg);border-radius:var(--radius);margin-top:8px}
.ch-qr-img{max-width:240px;border-radius:8px;border:1px solid var(--border-light)}
.ch-connected-info{display:flex;align-items:center;gap:8px;padding:12px;background:rgba(34,197,94,.06);border-radius:var(--radius);margin-top:8px}
.ch-banner{position:sticky;top:0;z-index:100;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;background:linear-gradient(135deg,#fef2f2,#fef9c3);border-bottom:2px solid var(--danger);font-size:13px}
.ch-banner-content{flex:1}
.ch-banner-content b{color:var(--danger)}
.ch-banner-link{color:var(--brand);font-weight:600;white-space:nowrap;text-decoration:none}
.ch-banner-link:hover{text-decoration:underline}
[data-theme="dark"] .ch-banner{background:linear-gradient(135deg,rgba(248,113,113,.12),rgba(250,204,21,.08));border-bottom-color:var(--danger)}
[data-theme="dark"] .ch-banner-content{color:var(--text)}
[data-theme="dark"] .ch-banner-link{color:var(--brand-light)}
.ch-banner--warn{background:linear-gradient(135deg,#fef9c3,#fef3c7);border-bottom-color:#d97706}
.ch-banner--warn .ch-banner-content{color:#92400e}
[data-theme="dark"] .ch-banner--warn{background:linear-gradient(135deg,rgba(250,204,21,.1),rgba(217,119,6,.08));border-bottom-color:#d97706}
[data-theme="dark"] .ch-banner--warn .ch-banner-content{color:#fbbf24}
.ch-banner--danger{background:linear-gradient(135deg,#fee2e2,#fecaca);border-bottom-color:#dc2626}
.ch-banner--danger .ch-banner-content{color:#991b1b}
[data-theme="dark"] .ch-banner--danger{background:linear-gradient(135deg,rgba(239,68,68,.12),rgba(220,38,38,.08));border-bottom-color:#dc2626}
[data-theme="dark"] .ch-banner--danger .ch-banner-content{color:#fca5a5}
@media(max-width:500px){.ch-grid{grid-template-columns:1fr}}

/* === Placement Banner (CRM/Task tab context) === */
.placement-banner{margin-bottom:12px;display:flex;align-items:center;gap:8px}
.placement-banner .badge-info{background:var(--accent);color:#fff;padding:4px 12px;font-size:13px;border-radius:6px}

/* === CRM Dashboard (placement tab in entity cards) === */
.crm-dash{padding:16px}
.crm-dash-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;flex-wrap:wrap;gap:8px}
.crm-dash-title{font-size:16px;font-weight:600;margin:0;color:var(--text)}
.crm-dash-actions{display:flex;gap:8px}
.crm-dash-section-title{font-size:13px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}
.crm-dash-list .empty-state{text-align:center;padding:24px;color:var(--text-muted)}
.crm-ticket-card{margin-bottom:8px;padding:0}
.crm-ticket-card-body{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;gap:8px}
.crm-ticket-info{flex:1;min-width:0}
.crm-ticket-link{text-decoration:none;color:var(--text);display:flex;align-items:center;gap:6px;font-size:14px}
.crm-ticket-link:hover{color:var(--accent)}
.crm-ticket-id{font-weight:600;color:var(--accent);white-space:nowrap}
.crm-ticket-subject{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-ticket-meta{display:flex;align-items:center;gap:6px;margin-top:4px;flex-wrap:wrap}
.crm-unlink-btn{opacity:.4;transition:opacity .15s}
.crm-unlink-btn:hover{opacity:1;color:var(--error)}

/* CRM Link Modal — search results */
.crm-search-results{max-height:350px;overflow-y:auto;border:1px solid var(--border);border-radius:8px}
.crm-search-item{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--border);gap:8px}
.crm-search-item:last-child{border-bottom:none}
.crm-search-item:hover{background:var(--bg-hover)}
.crm-search-item--linked{opacity:.5}
.crm-search-item-info{flex:1;min-width:0}

/* === Client Card Layout === */
.client-card-layout{display:grid;grid-template-columns:1fr 340px;gap:20px;max-width:1100px}
@media(max-width:900px){.client-card-layout{grid-template-columns:1fr;max-width:640px}}
.client-card-main{display:flex;flex-direction:column;gap:14px}
.client-card-sidebar{display:flex;flex-direction:column;gap:14px}

/* Info rows for view mode */
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:0}
@media(max-width:500px){.info-grid{grid-template-columns:1fr}}
.info-row{padding:10px 0;border-bottom:1px solid var(--border-light)}
.info-row:last-child{border-bottom:none}
.info-row .info-label{font-size:12px;color:var(--text-muted);margin-bottom:2px}
.info-row .info-value{font-size:13px;font-weight:500;color:var(--text)}
.info-row.full{grid-column:1/-1}

/* Toggle badges (view mode) */
.toggle-badge{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;padding:2px 10px;border-radius:10px}
.toggle-badge.on{background:rgba(22,163,74,.1);color:var(--success)}
.toggle-badge.off{background:var(--bg);color:var(--text-muted)}

/* Radio card (service level selector) */
.radio-card{display:flex;flex-direction:column;gap:4px;padding:12px 16px;border:2px solid var(--border);border-radius:var(--radius);cursor:pointer;flex:1;transition:border-color .2s,background .2s}
.radio-card:hover{border-color:var(--accent)}
.radio-card.active,.radio-card:has(input:checked){border-color:var(--accent);background:var(--accent-light,rgba(99,102,241,.06))}
.radio-card input[type="radio"]{display:none}

/* CSAT Stars */
.csat-stars{display:flex;justify-content:center;gap:8px;margin-bottom:4px}
.csat-star{background:none;border:none;cursor:pointer;padding:4px;border-radius:50%;transition:transform .15s}
.csat-star svg{transition:fill .15s,stroke .15s}
.csat-star:hover,.csat-star.hover{transform:scale(1.15)}
.csat-star.hover svg,.csat-star:hover svg{fill:var(--warning,#f59e0b);stroke:var(--warning,#f59e0b)}
.csat-star.active svg{fill:var(--warning,#f59e0b);stroke:var(--warning,#f59e0b)}
.csat-label{color:var(--text-muted);min-height:20px;margin-bottom:4px}

/* SLA */
.sla-breached{color:var(--danger) !important;font-weight:600}

/* Notification bell */
.notif-badge{position:absolute;top:-2px;right:-2px;background:var(--danger);color:#fff;font-size:10px;font-weight:700;min-width:16px;height:16px;line-height:16px;text-align:center;border-radius:8px;padding:0 4px}
.notif-dropdown{position:absolute;top:100%;right:0;width:340px;max-height:400px;background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 8px 24px rgba(0,0,0,.15);z-index:1000;overflow:hidden}
.notif-header{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid var(--border);font-size:13px;font-weight:600}
.notif-list{max-height:340px;overflow-y:auto}
.notif-item{padding:10px 12px;border-bottom:1px solid var(--border-light);cursor:pointer;font-size:13px;transition:background .15s}
.notif-item:hover{background:var(--hover)}
.notif-item.unread{background:var(--accent-light,rgba(99,102,241,.06))}
.notif-item .notif-time{font-size:11px;color:var(--text-muted);margin-top:2px}
.notif-item .notif-text{line-height:1.4}
.notif-empty{padding:24px;text-align:center;color:var(--text-muted);font-size:13px}

/* Bulk actions bar — floating sticky bottom */
.bulk-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
  animation: bulkSlideUp 0.2s ease-out;
}
@keyframes bulkSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Kanban */
.kanban-board{display:flex;gap:12px;overflow-x:auto;padding-bottom:12px;min-height:400px}
.kanban-col{flex:1;min-width:220px;max-width:280px;display:flex;flex-direction:column}
.kanban-col-header{padding:8px 12px;background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius) var(--radius) 0 0;display:flex;align-items:center;gap:8px}
.kanban-cards{flex:1;background:var(--bg);border:1px solid var(--border);border-top:none;border-radius:0 0 var(--radius) var(--radius);padding:8px;display:flex;flex-direction:column;gap:8px;overflow-y:auto;max-height:60vh}
.kanban-card{background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;cursor:pointer;transition:box-shadow .15s,border-color .15s}
.kanban-card:hover{border-color:var(--accent);box-shadow:0 2px 8px rgba(0,0,0,.08)}

/* License list */
.lic-item{padding:10px 0;border-bottom:1px solid var(--border-light)}
.lic-item:last-child{border-bottom:none}
.lic-product{font-weight:600;font-size:13px;color:var(--text);margin-bottom:2px}
.lic-meta{font-size:12px;color:var(--text-muted);display:flex;flex-wrap:wrap;gap:6px 14px}
.lic-status{display:inline-block;font-size:11px;font-weight:600;padding:1px 8px;border-radius:8px}
.lic-status.active{background:rgba(22,163,74,.1);color:var(--success)}
.lic-status.trial{background:rgba(2,132,199,.1);color:var(--info)}
.lic-status.expired{background:rgba(220,38,38,.08);color:var(--danger)}
.lic-status.blocked{background:rgba(220,38,38,.08);color:var(--danger)}

/* Edit button in card header */
.card-header-actions{display:flex;align-items:center;justify-content:space-between}
.card-header-actions .card-header-title{font-weight:600;font-size:15px}

/* Knowledge Base */
.kb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.kb-card{transition:border-color .15s,box-shadow .15s}
.kb-card:hover{border-color:var(--accent);box-shadow:0 2px 8px rgba(0,0,0,.08)}
.kb-card-title{font-size:15px;font-weight:600;margin:0 0 6px}
.kb-card-excerpt{font-size:13px;line-height:1.5;margin:0}
.kb-article-content{font-size:14px;line-height:1.7}

/* ═══ Guided Tour (F155) ═══ */
.tour-overlay{position:fixed;inset:0;z-index:10001;pointer-events:none}
.tour-overlay.tour-closing{animation:tourFadeOut .3s ease forwards}

/* Dark backdrop */
.tour-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0);transition:background .3s ease;pointer-events:none}
.tour-backdrop.tour-backdrop-active{background:rgba(0,0,0,.55);backdrop-filter:blur(2px);pointer-events:auto}

/* Spotlight hole — sits above backdrop, clips to target element */
.tour-spotlight{position:fixed;z-index:10002;border-radius:var(--radius);box-shadow:0 0 0 9999px rgba(0,0,0,.55);pointer-events:none;transition:all .35s cubic-bezier(.4,0,.2,1)}

/* Tooltip card */
.tour-tooltip{position:fixed;z-index:10003;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 12px 40px rgba(0,0,0,.2),0 4px 12px rgba(0,0,0,.08);padding:16px 20px;max-width:360px;min-width:260px;pointer-events:auto;display:none;animation:tourSlideIn .25s cubic-bezier(.34,1.4,.64,1)}
.tour-tooltip.tour-tooltip-visible{display:block}
.tour-tooltip.tour-fade-out{animation:tourFadeOut .2s ease forwards}

.tour-tooltip-header{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.tour-tooltip-icon{color:var(--accent);flex-shrink:0}
.tour-tooltip-title{font-weight:600;font-size:var(--fs-md);color:var(--text);flex:1}
.tour-step-counter{font-size:var(--fs-xs);color:var(--text-muted);background:var(--bg);padding:2px 8px;border-radius:10px;white-space:nowrap}
.tour-tooltip-text{font-size:var(--fs-base);color:var(--text-secondary);line-height:1.5;margin:0 0 12px}
.tour-tooltip-actions{display:flex;align-items:center;gap:6px}

/* Arrow */
.tour-tooltip-arrow{position:absolute;width:12px;height:12px;background:var(--surface);border:1px solid var(--border);transform:rotate(45deg);z-index:-1}
.tour-tooltip-arrow.arrow-up{top:-7px;border-bottom:none;border-right:none}
.tour-tooltip-arrow.arrow-down{bottom:-7px;border-top:none;border-left:none}

/* Splash (full-screen center card) */
.tour-splash{position:fixed;inset:0;z-index:10003;display:none;align-items:center;justify-content:center;pointer-events:auto;padding:24px}
.tour-splash.tour-fade-out{animation:tourFadeOut .2s ease forwards}
.tour-splash-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 16px 48px rgba(0,0,0,.2),0 6px 16px rgba(0,0,0,.1);padding:40px 36px 32px;max-width:440px;width:100%;text-align:center;animation:tourSlideIn .3s cubic-bezier(.34,1.4,.64,1)}
.tour-splash-icon{color:var(--accent);margin-bottom:16px}
.tour-splash-title{font-size:20px;font-weight:700;color:var(--text);margin:0 0 8px}
.tour-splash-text{font-size:var(--fs-md);color:var(--text-secondary);line-height:1.6;margin:0 0 20px}
.tour-splash-actions{display:flex;gap:8px;justify-content:center}

/* Progress dots */
.tour-dots{display:flex;gap:6px;justify-content:center;margin-bottom:16px}
.tour-dot{width:8px;height:8px;border-radius:50%;background:var(--border);transition:all .2s ease}
.tour-dot.active{background:var(--accent);transform:scale(1.3)}

/* Animations */
@keyframes tourSlideIn{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes tourFadeOut{to{opacity:0}}

/* Spotlight pulse on highlight */
.tour-spotlight{animation:tourSpotPulse 2s ease-in-out infinite}
@keyframes tourSpotPulse{0%,100%{box-shadow:0 0 0 9999px rgba(0,0,0,.55)}50%{box-shadow:0 0 0 9999px rgba(0,0,0,.5)}}

/* Mobile adjustments */
@media(max-width:640px){
  .tour-tooltip{max-width:calc(100vw - 24px);min-width:0;left:12px!important;right:12px!important;transform:none!important}
  .tour-splash-card{padding:28px 20px 24px}
  .tour-splash-title{font-size:18px}
}

/* Legacy onboarding (kept for fallback) */
.ob-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);backdrop-filter:blur(4px);z-index:1000;display:flex;align-items:center;justify-content:center;animation:modalFadeIn .2s ease;padding:24px}
.ob-overlay.closing{animation:modalFadeOut .15s ease forwards}
.ob-card{max-width:440px;width:100%;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 40px rgba(0,0,0,.18),0 4px 12px rgba(0,0,0,.08);animation:modalSlideIn .25s cubic-bezier(.34,1.56,.64,1)}

/* Timer widget */
.timer-widget{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:8px 12px;text-align:center}
.timer-display{font-family:monospace;font-size:20px;font-weight:700;color:var(--text);letter-spacing:2px}

/* === Demo Mode / Upsell === */

/* Plan badge in header */
.plan-badge{display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:600;padding:3px 10px;border-radius:12px;cursor:pointer;transition:all .15s ease;white-space:nowrap}
.plan-badge:hover{filter:brightness(1.1);transform:scale(1.03)}
.plan-badge svg{opacity:.6}
.plan-badge-free{background:var(--surface,#f1f5f9);color:var(--text-muted,#64748b);border:1px solid var(--border)}
.plan-badge-starter{background:#dbeafe;color:#2563eb;border:1px solid #93c5fd}
.plan-badge-pro{background:#ede9fe;color:#7c3aed;border:1px solid #c4b5fd}
.plan-badge-business{background:#fef3c7;color:#b45309;border:1px solid #fcd34d}
.plan-badge-demo{background:linear-gradient(135deg,#dcfce7,#d1fae5);color:#059669;border:1px solid #6ee7b7;font-weight:700}
.plan-badge-dot{width:6px;height:6px;border-radius:50%;background:#10b981;display:inline-block;animation:demoPulse 2s ease-in-out infinite}
@keyframes demoPulse{0%,100%{opacity:1}50%{opacity:.4}}

/* Upsell sidebar panel */
.upsell-panel{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;display:flex;justify-content:flex-end;pointer-events:none}
.upsell-panel.open{pointer-events:auto}
.upsell-panel.open .upsell-overlay{opacity:1}
.upsell-panel.open .upsell-content{transform:translateX(0)}
.upsell-overlay{position:absolute;inset:0;background:rgba(0,0,0,.4);opacity:0;transition:opacity .3s ease}
.upsell-content{position:relative;width:380px;max-width:90vw;height:100%;background:var(--card-bg);border-left:1px solid var(--border);padding:32px 24px;overflow-y:auto;transform:translateX(100%);transition:transform .3s ease;display:flex;flex-direction:column;align-items:center;gap:16px}
.upsell-close{position:absolute;top:12px;right:12px;background:none;border:none;font-size:24px;color:var(--text-muted);cursor:pointer;padding:4px 8px;line-height:1}
.upsell-close:hover{color:var(--text)}
.upsell-icon{margin-top:24px}
.upsell-title{font-size:20px;font-weight:700;text-align:center;margin:0}
.upsell-desc{text-align:center;color:var(--text-muted);font-size:14px;margin:0;line-height:1.5}
.upsell-demo-box{background:var(--accent-bg,rgba(37,99,235,.08));border:1px solid var(--accent);border-radius:12px;padding:16px;width:100%;text-align:center}
.upsell-demo-badge{font-size:13px;font-weight:600;color:var(--accent);margin-bottom:12px}
.upsell-divider{width:100%;text-align:center;position:relative;margin:4px 0}
.upsell-divider::before{content:'';position:absolute;top:50%;left:0;right:0;height:1px;background:var(--border)}
.upsell-divider span{position:relative;background:var(--card-bg);padding:0 12px;color:var(--text-muted);font-size:12px}
.upsell-compare-link{font-size:13px;color:var(--accent);text-decoration:none;margin-top:4px}
.upsell-compare-link:hover{text-decoration:underline}

/* View toggle (List / Kanban) */
.view-toggle{display:inline-flex;border:1px solid var(--border);border-radius:8px;overflow:hidden}
.view-toggle-btn{display:flex;align-items:center;justify-content:center;width:36px;height:32px;background:var(--card-bg);border:none;cursor:pointer;color:var(--text-muted);transition:all .15s}
.view-toggle-btn:not(:last-child){border-right:1px solid var(--border)}
.view-toggle-btn:hover{background:var(--surface);color:var(--text)}
.view-toggle-btn.active{background:var(--accent);color:#fff}
.view-toggle-btn.active:hover{background:var(--accent)}

/* === Pricing Page (unified with landing) === */
.pr-page-header{text-align:center;padding:24px 0 8px}
.pr-page-header h2{font-size:24px;font-weight:800;margin:0 0 6px;color:var(--text)}
.pr-page-header p{font-size:15px;color:var(--text-muted);margin:0}

/* Price cards grid */
.pr-cards-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin:24px 0 32px}
.pr-plan-card{background:var(--card-bg);border:2px solid var(--border);border-radius:14px;padding:22px 16px;text-align:center;position:relative;transition:border-color .2s,box-shadow .2s}
.pr-plan-card:hover{border-color:var(--accent);box-shadow:0 4px 16px rgba(0,0,0,.08)}
.pr-plan-popular{border-color:#10b981;box-shadow:0 4px 20px rgba(16,185,129,.15)}
.pr-plan-popular:hover{border-color:#059669}
.pr-plan-current{border-color:var(--accent);background:var(--accent-bg,rgba(37,99,235,.04))}
.pr-plan-enterprise{border-style:dashed;border-color:var(--text-muted)}
.pr-pop-badge{position:absolute;top:-11px;left:50%;transform:translateX(-50%);background:#10b981;color:#fff;font-size:11px;font-weight:700;padding:3px 14px;border-radius:10px;white-space:nowrap}
.pr-cur-badge{position:absolute;top:-11px;left:50%;transform:translateX(-50%);background:var(--accent);color:#fff;font-size:11px;font-weight:700;padding:3px 14px;border-radius:10px;white-space:nowrap}
.pr-plan-name{font-size:17px;font-weight:700;color:var(--text);margin-bottom:8px;margin-top:4px}
.pr-plan-price{margin-bottom:2px}
.pr-plan-amount{font-size:28px;font-weight:800;color:var(--text)}
.pr-plan-cur{font-size:13px;color:var(--text-muted)}
.pr-plan-period{font-size:12px;color:var(--text-muted);margin-bottom:14px;min-height:16px}
.pr-plan-cta-wrap{min-height:38px;display:flex;align-items:center;justify-content:center}
.pr-plan-cta{display:inline-block;padding:8px 18px;border-radius:8px;font-weight:600;font-size:13px;cursor:pointer;transition:all .2s;background:#10b981;color:#fff;border:2px solid #10b981}
.pr-plan-cta:hover{background:#059669;border-color:#059669}
.pr-plan-cta-outline{background:transparent;color:var(--accent);border:2px solid var(--accent)}
.pr-plan-cta-outline:hover{background:var(--accent);color:#fff}
.pr-plan-cta-current{font-size:12px;font-weight:600;color:var(--accent);opacity:.7}

/* Module comparison grid */
.pr-modules-title{text-align:center;font-size:18px;font-weight:700;margin:0 0 16px;color:var(--text)}
.pr-modules-grid{border:1px solid var(--border);border-radius:12px;overflow:hidden;margin-bottom:24px}
.pr-mg-head,.pr-mg-row{display:grid;grid-template-columns:200px repeat(5,1fr)}
.pr-mg-head{background:var(--surface);border-bottom:2px solid var(--border);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted)}
.pr-mg-head .pr-mg-plan-col{padding:10px 6px;text-align:center}
.pr-mg-head .pr-mg-name-col{padding:10px 14px}
.pr-mg-row{border-bottom:1px solid var(--border);cursor:pointer;transition:background .15s}
.pr-mg-row:last-child{border-bottom:none}
.pr-mg-row:hover{background:var(--accent-bg,rgba(37,99,235,.03))}
.pr-mg-name-col{padding:12px 14px;display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--text)}
.pr-mg-name-col svg{color:var(--text-muted);flex-shrink:0}
.pr-mg-arrow{margin-left:auto;font-size:18px;color:var(--text-muted);transition:color .15s}
.pr-mg-row:hover .pr-mg-arrow{color:var(--accent)}
.pr-mg-plan-col{padding:12px 6px;display:flex;align-items:center;justify-content:center}
.pr-mg-col-pop{background:rgba(16,185,129,.04)}
.pr-mg-col-cur{background:var(--accent-bg,rgba(37,99,235,.04))}
.pr-mg-bars{display:flex;gap:3px;align-items:flex-end}
.pr-mg-bar{width:10px;border-radius:2px;background:var(--border)}
.pr-mg-bar:nth-child(1){height:6px}
.pr-mg-bar:nth-child(2){height:10px}
.pr-mg-bar:nth-child(3){height:14px}
.pr-mg-bar:nth-child(4){height:18px}
.pr-mg-bar:nth-child(5){height:22px}
.pr-mg-bar-on{background:#10b981}

/* Demo CTA banner */
.pr-demo-cta{background:var(--surface);border-radius:12px;padding:24px;margin-bottom:24px}
.pr-demo-cta-inner{display:flex;align-items:center;justify-content:space-between;gap:20px}
.pr-demo-cta-inner strong{font-size:16px;color:var(--text)}
.pr-demo-cta-inner p{font-size:13px;color:var(--text-muted);margin:4px 0 0}

/* Detail modal */
.pr-detail-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);z-index:10000;display:none;align-items:center;justify-content:center;padding:20px}
.pr-detail-overlay.open{display:flex}
.pr-detail-modal{background:var(--card-bg,#fff);border-radius:16px;max-width:900px;width:100%;max-height:85vh;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.3);display:flex;flex-direction:column}
.pr-detail-head{padding:18px 24px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.pr-detail-head h3{font-size:18px;font-weight:700;color:var(--text);margin:0}
.pr-detail-close{cursor:pointer;font-size:28px;color:var(--text-muted);line-height:1;background:none;border:none;padding:0}
.pr-detail-close:hover{color:var(--text)}
.pr-detail-body{overflow-y:auto;padding:0}
.pr-detail-table{width:100%;border-collapse:collapse}
.pr-detail-table th{padding:10px 14px;text-align:center;font-weight:600;font-size:12px;border-bottom:2px solid var(--border);color:var(--text-muted);position:sticky;top:0;background:var(--card-bg)}
.pr-detail-table th:first-child{text-align:left;width:35%}
.pr-detail-table td{padding:10px 14px;border-bottom:1px solid var(--border);text-align:center;font-size:13px}
.pr-dt-feat{text-align:left!important;color:var(--text-muted)}
.pr-detail-table tr:last-child td{border-bottom:none}
.pr-detail-table tr:hover td{background:var(--accent-bg,rgba(37,99,235,.02))}
.pr-dt-pop{background:rgba(16,185,129,.04)}
.pr-dt-cur{background:var(--accent-bg,rgba(37,99,235,.04))}
.pr-dt-yes{color:#10b981;font-size:18px;font-weight:700}
.pr-dt-no{color:var(--text-muted);font-size:16px}
.pr-dt-val{font-weight:700;color:var(--accent);font-size:13px}

/* Responsive pricing */
@media(max-width:900px){
  .pr-cards-grid{grid-template-columns:repeat(3,1fr)}
  .pr-mg-head,.pr-mg-row{grid-template-columns:160px repeat(5,1fr)}
  .pr-mg-name-col{font-size:12px;padding:10px 8px}
}
@media(max-width:600px){
  .pr-cards-grid{grid-template-columns:repeat(2,1fr)}
  .pr-mg-head,.pr-mg-row{grid-template-columns:120px repeat(5,1fr)}
  .pr-mg-name-col span:not(.pr-mg-arrow){display:none}
}

/* Features landing */
.features-landing{max-width:1000px;margin:0 auto}
.features-hero{text-align:center;padding:40px 20px 32px}
.features-hero h1{font-size:28px;font-weight:800;margin:0 0 8px;background:linear-gradient(135deg,var(--accent),#8b5cf6);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.features-hero p{font-size:16px;color:var(--text-muted);margin:0 0 20px}
.features-hero-cta{display:flex;gap:12px;justify-content:center}
.features-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;padding:0 8px 32px}
.feature-card{background:var(--card-bg);border:1px solid var(--border);border-radius:12px;padding:20px 16px;text-align:center;transition:all .2s ease;cursor:default}
.feature-card:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.08)}
.feature-card h3{font-size:14px;font-weight:600;margin:8px 0 4px}
.feature-card-icon{width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;margin:0 auto}

/* Dashboard promo cards */
.dash-promo-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.dash-promo-card{display:flex;align-items:center;gap:12px;background:var(--card-bg);border:1px dashed var(--border);border-radius:10px;padding:14px 16px;cursor:pointer;transition:all .15s ease}
.dash-promo-card:hover{border-color:var(--accent);border-style:solid;background:var(--accent-bg,rgba(37,99,235,.04))}
.dash-promo-icon{width:40px;height:40px;min-width:40px;border-radius:10px;background:var(--accent-bg,rgba(37,99,235,.08));color:var(--accent);display:flex;align-items:center;justify-content:center}
.dash-promo-body{flex:1;min-width:0}
.dash-promo-title{font-size:13px;font-weight:600;color:var(--text)}
.dash-promo-desc{font-size:11px;color:var(--text-muted);margin-top:2px;line-height:1.3}
.dash-promo-badge{font-size:10px;font-weight:600;background:var(--accent-bg,rgba(37,99,235,.1));color:var(--accent);padding:2px 8px;border-radius:10px;white-space:nowrap}
.feature-locked{opacity:.7;cursor:pointer;position:relative}
.feature-locked:hover{opacity:1;border-color:#f59e0b}
.feature-lock-badge{font-size:11px;color:#f59e0b;font-weight:600;display:flex;align-items:center;gap:4px;justify-content:center;margin-top:4px}
.feature-ok-badge{color:#10b981;font-weight:700;font-size:16px;margin-top:2px}

/* ═══ White-Label Page ═══ */
.wl-page { max-width: 960px; margin: 0 auto; padding: 0 16px 32px; }
.wl-hero { text-align: center; padding: 24px 0 20px; }
.wl-hero-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 0; }
.wl-hero-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; max-width: 560px; margin-left: auto; margin-right: auto; line-height: 1.5; }

.wl-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; }
.wl-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.wl-section-icon { width: 36px; height: 36px; min-width: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.wl-section-icon svg { width: 18px; height: 18px; }
.wl-section-icon.identity { background: rgba(99, 102, 241, .1); color: #6366f1; }
.wl-section-icon.colors { background: rgba(236, 72, 153, .1); color: #ec4899; }
.wl-section-icon.contacts { background: rgba(16, 185, 129, .1); color: #10b981; }
.wl-section-icon.widget { background: rgba(245, 158, 11, .1); color: #f59e0b; }
.wl-section-icon.advanced { background: rgba(107, 114, 128, .1); color: #6b7280; }
.wl-section-icon.preview { background: rgba(37, 99, 235, .1); color: #2563eb; }
.wl-section-title { font-size: 15px; font-weight: 600; color: var(--text); }
.wl-section-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.wl-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wl-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .wl-grid-2, .wl-grid-3 { grid-template-columns: 1fr; } }

/* Logo upload cards */
.wl-logo-card { border: 2px dashed var(--border); border-radius: 10px; padding: 12px; text-align: center; transition: border-color .2s, background .2s; position: relative; }
.wl-logo-card:hover { border-color: var(--accent); background: var(--accent-bg, rgba(37,99,235,.03)); }
.wl-logo-card.light { background: #f8fafc; }
.wl-logo-card.dark { background: #1e293b; }
.wl-logo-card.fav { background: var(--bg); }
.wl-logo-preview { height: 48px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; overflow: hidden; }
.wl-logo-preview img { max-height: 48px; max-width: 100%; object-fit: contain; }
.wl-logo-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.wl-logo-hint { font-size: 10px; color: var(--text-muted); opacity: .7; margin-top: 4px; }
.wl-logo-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--accent); cursor: pointer; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--accent); background: transparent; transition: background .15s; }
.wl-logo-btn:hover { background: var(--accent-bg, rgba(37,99,235,.08)); }

/* Color picker row */
.wl-color-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); transition: border-color .2s; }
.wl-color-row:hover { border-color: var(--accent); }
.wl-color-swatch { width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; flex-shrink: 0; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.wl-color-swatch input[type="color"] { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); border: none; cursor: pointer; padding: 0; }
.wl-color-info { flex: 1; min-width: 0; }
.wl-color-name { font-size: 13px; font-weight: 500; color: var(--text); }
.wl-color-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.wl-color-hex { width: 80px; text-align: center; font-family: monospace; font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }

/* Preview cards */
.wl-preview-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .wl-preview-grid { grid-template-columns: 1fr; } }
.wl-preview-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.wl-preview-label { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .5px; }
.wl-preview-header { padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.wl-preview-header img { height: 28px; width: auto; }
.wl-preview-header span { font-weight: 600; font-size: 14px; }
.wl-preview-widget-mock { padding: 16px; background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wl-preview-widget-bubble { padding: 10px 16px; border-radius: 12px 12px 12px 4px; font-size: 13px; max-width: 220px; color: #fff; }
.wl-preview-widget-btn { padding: 8px 20px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #fff; border: none; cursor: default; }
.wl-preview-btn-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px; background: var(--bg); }
.wl-preview-btn { padding: 7px 16px; border-radius: 8px; font-size: 12px; font-weight: 500; border: none; color: #fff; }
.wl-preview-btn.outline { background: transparent; border: 1.5px solid; }
.wl-preview-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }

/* Actions bar */
.wl-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 0; }
.wl-actions .btn { min-width: 160px; justify-content: center; }

/* ===== Analytics Tabs (Sprint 5.1) ===== */
.analytics-tabs { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; padding: 2px 0; }
.analytics-tab { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-muted); background: transparent; transition: all .2s; white-space: nowrap; border: 1px solid transparent; }
.analytics-tab:hover { background: var(--bg-alt); color: var(--text); }
.analytics-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.analytics-tab.locked { opacity: .5; }
.analytics-tab.locked:hover { background: var(--bg-alt); opacity: .7; }
.analytics-content { min-height: 200px; }

/* === Compact Reminder Form === */
.rem-compact { display: flex; flex-direction: column; gap: 10px; }
.rem-section { }
.rem-when-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rem-time-select { flex: 1; min-width: 140px; font-size: 13px; padding: 6px 10px; }
.rem-time-custom { flex: 1; min-width: 160px; font-size: 13px; padding: 6px 10px; }
.rem-recipients-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rem-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-height: 28px; align-items: center; }
.rem-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 500;
  background: var(--accent); color: #fff;
}
.rem-chip-x { cursor: pointer; opacity: 0.7; font-size: 14px; line-height: 1; }
.rem-chip-x:hover { opacity: 1; }
.rem-chip-placeholder { font-size: 12px; color: var(--text-muted); }
.rem-add-person-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; border: 1px dashed var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s;
  flex-shrink: 0;
}
.rem-add-person-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.rem-comment { font-size: 13px !important; resize: none; border-radius: 8px !important; }
.rem-active-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.rem-active-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.rem-active-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.rem-active-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rem-active-time { font-size: 12px; font-weight: 500; color: var(--text); }
.rem-active-names { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Call cards in chat */
.msg-call { text-align: center; }
.call-card {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px;
  font-size: 13px; color: var(--text-secondary);
  background: var(--bg-secondary); border: 1px solid var(--border);
}
.call-card-icon { display: flex; align-items: center; }
.call-card-active { background: rgba(34,197,94,0.1); border-color: var(--success); color: var(--success); }
.call-card-ended { background: var(--bg-secondary); }
.call-card-missed { background: rgba(239,68,68,0.08); border-color: var(--danger); color: var(--danger); }

/* Incoming call ring animation */
@keyframes callRingPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70% { box-shadow: 0 0 0 14px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.call-ring-anim { animation: callRingPulse 1.5s ease-out infinite; }

/* === Inline Call Panel (inside ticket detail) === */
.inline-call-panel {
  position: relative; border-radius: 12px; padding: 16px 20px;
  background: linear-gradient(135deg, rgba(30,40,60,0.95), rgba(20,30,50,0.98));
  border: 1px solid var(--border); margin: 0 0 8px;
  backdrop-filter: blur(12px); box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.inline-call-panel .call-status-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.inline-call-panel .call-status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.inline-call-panel .call-status-dot.ringing {
  background: var(--warning); animation: callDotPulse 1s ease-in-out infinite;
}
.inline-call-panel .call-status-dot.active {
  background: var(--success); animation: callDotPulse 2s ease-in-out infinite;
}
.inline-call-panel .call-status-dot.ended { background: var(--text-muted); }
.inline-call-panel .call-status-label {
  font-size: 13px; font-weight: 600; color: var(--text); flex: 1;
}
.inline-call-panel .call-timer {
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); background: rgba(255,255,255,0.08); padding: 2px 10px;
  border-radius: 6px;
}
.inline-call-panel .call-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.inline-call-panel .call-ctl-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); color: var(--text);
  transition: background .15s, transform .1s;
}
.inline-call-panel .call-ctl-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
.inline-call-panel .call-ctl-btn.active { background: var(--primary); color: #fff; }
.inline-call-panel .call-ctl-btn.muted { background: rgba(255,100,100,0.2); color: var(--danger); }
.inline-call-panel .call-ctl-btn.end-call {
  background: var(--danger); color: #fff; width: 48px; height: 48px;
}
.inline-call-panel .call-ctl-btn.end-call:hover { background: #dc2626; transform: scale(1.08); }

/* Ringing wave animation around avatar */
@keyframes callDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes callRingWave {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}
.call-ring-waves {
  position: relative; width: 56px; height: 56px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.call-ring-waves .wave {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--success); animation: callRingWave 2s ease-out infinite;
}
.call-ring-waves .wave:nth-child(2) { animation-delay: 0.5s; }
.call-ring-waves .wave:nth-child(3) { animation-delay: 1s; }
.call-ring-waves .call-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--success); color: #fff; display: flex;
  align-items: center; justify-content: center; z-index: 1;
}

/* Call button — green circle above chat (in tabs row) */
.td-call-circle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; color: var(--success);
  border: 2px solid var(--success); cursor: pointer;
  margin-right: 8px; position: relative;
  transition: background .15s, transform .15s, color .15s;
  flex-shrink: 0;
}
.td-call-circle-btn:hover { background: var(--success); color: #fff; transform: scale(1.05); }
.td-call-circle-btn:active { transform: scale(0.95); }
.td-call-circle-btn svg { pointer-events: none; }

/* Contact channel icons (WA/TG next to phone) */
.contact-ch-icons { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.contact-ch-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  transition: transform 0.15s, opacity 0.15s; opacity: 0.7;
}
.contact-ch-icon:hover { opacity: 1; transform: scale(1.15); }
.contact-ch-icon svg { width: 12px; height: 12px; }

/* === Estimate approval card === */
.msg-estimate { max-width: 420px; }
.estimate-card {
  background: var(--card-bg, var(--bg-alt));
  border: 2px solid var(--accent, #f59e0b);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.estimate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent, #f59e0b), var(--primary, #2563eb));
}
.estimate-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-color);
}
.estimate-card-header svg {
  width: 18px; height: 18px;
  color: var(--accent, #f59e0b);
  flex-shrink: 0;
}
.estimate-card-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.estimate-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.estimate-card-row .est-label {
  color: var(--text-muted);
}
.estimate-card-row .est-value {
  font-weight: 600;
  color: var(--text-color);
}
.estimate-card-total {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}
.estimate-card-total .est-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent, #f59e0b);
}
.estimate-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-alt, rgba(0,0,0,0.03));
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.estimate-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.estimate-card-actions .btn {
  flex: 1;
  justify-content: center;
}
.estimate-card-hidden {
  border-color: var(--border-color);
  opacity: 0.85;
}
.estimate-card-hidden::before {
  background: var(--border-color);
}
.estimate-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ═══ Partner Program Landing ═══ */
.pp-landing { max-width: 800px; margin: 0 auto; }

.pp-hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-darkest) 50%, #0f2027 100%);
  border-radius: 16px; padding: 48px 32px; text-align: center; margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.pp-hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(91,192,235,0.15) 0%, transparent 70%); border-radius: 50%;
}
.pp-hero-content { position: relative; z-index: 1; }
.pp-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px;
  background: rgba(255,255,255,0.12); border-radius: 20px; font-size: 13px;
  font-weight: 600; color: rgba(255,255,255,0.9); margin-bottom: 16px; backdrop-filter: blur(4px);
}
.pp-hero-title { font-size: 28px; font-weight: 800; color: #fff; margin: 0 0 10px; line-height: 1.2; }
.pp-hero-sub { font-size: 15px; color: rgba(255,255,255,0.7); margin: 0 auto 24px; max-width: 480px; line-height: 1.5; }
.pp-hero-btn { padding: 12px 32px; font-size: 15px; font-weight: 600; border-radius: 10px; }
.pp-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pp-nfr-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 8px 16px;
  background: rgba(74,222,128,0.15); border: 1px solid rgba(74,222,128,0.3); border-radius: 8px;
  font-size: 13px; color: #4ade80;
}

.pp-section { margin-bottom: 24px; }
.pp-section-title { font-size: 20px; font-weight: 700; margin: 0 0 8px; text-align: center; }
.pp-section-sub { font-size: 14px; color: var(--text-muted); text-align: center; margin: 0 0 20px; }
.pp-subsection-title { font-size: 15px; font-weight: 600; margin: 20px 0 12px; }

/* Benefits row */
.pp-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pp-benefit-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 16px; text-align: center; transition: transform 0.15s, box-shadow 0.15s;
}
.pp-benefit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pp-benefit-icon { margin-bottom: 10px; }
.pp-benefit-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.pp-benefit-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Models — Referral vs Reseller */
.pp-models { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pp-model-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 20px; text-align: center; position: relative; transition: transform 0.15s;
}
.pp-model-card:hover { transform: translateY(-2px); }
.pp-model-premium { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pp-model-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 10px; white-space: nowrap;
}
.pp-model-header { margin-bottom: 12px; opacity: 0.6; }
.pp-model-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.pp-model-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.4; }
.pp-model-pct { font-size: 36px; font-weight: 800; color: var(--success); }
.pp-model-label { font-size: 12px; color: var(--text-muted); }

/* Price table */
.pp-price-table { overflow-x: auto; }
.pp-price-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pp-price-table th { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px; border-bottom: 2px solid var(--border); text-align: left; }
.pp-price-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.pp-row-highlight { background: var(--accent-light); }
.pp-earn { color: var(--success); font-weight: 700; }

/* Channels */
.pp-channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pp-channel-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; text-align: center; transition: transform 0.15s;
}
.pp-channel-card:hover { transform: translateY(-1px); }
.pp-channel-icon { margin-bottom: 8px; }
.pp-channel-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.pp-channel-desc { font-size: 11px; color: var(--text-muted); }

/* Example block */
.pp-example {
  background: linear-gradient(135deg, var(--surface) 0%, var(--card-bg) 100%);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.pp-example-header {
  display: flex; align-items: center; gap: 8px; padding: 14px 20px;
  font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--border-light);
}
.pp-example-body { padding: 16px 20px; }
.pp-example-line { font-size: 14px; margin-bottom: 8px; color: var(--text-muted); }
.pp-example-calc { font-size: 14px; margin-bottom: 4px; font-family: monospace; }
.pp-example-total {
  font-size: 24px; font-weight: 800; color: var(--success); margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--border-light);
}

@media (max-width: 600px) {
  .pp-hero { padding: 32px 20px; }
  .pp-hero-title { font-size: 22px; }
  .pp-benefits, .pp-channels { grid-template-columns: 1fr; }
  .pp-models { grid-template-columns: 1fr; }
}

/* === Client Cabinet Parity: Search + Filters + History + Participants === */
.cl-filter-bar { margin-bottom: 12px; }
.cl-search-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cl-search-wrap { position: relative; flex: 1; min-width: 180px; }
.cl-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.cl-search-input { padding-left: 32px !important; }
.cl-filter-select { width: auto; min-width: 130px; max-width: 180px; }
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-th:hover { color: var(--accent); }
.sortable-th svg { vertical-align: middle; margin-left: 2px; }

/* Ticket detail tabs */
.cl-detail-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 0; }
.cl-detail-tab { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s, border-color .15s; background: none; border-top: none; border-left: none; border-right: none; }
.cl-detail-tab:hover { color: var(--text); }
.cl-detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.cl-tab-content { display: none; }
.cl-tab-content.active { display: block; }

/* History timeline */
.cl-history-list { padding: 12px 0; }
.cl-history-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.cl-history-item:last-child { border-bottom: none; }
.cl-history-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg); color: var(--text-muted); }
.cl-history-icon.status { background: var(--accent-light, rgba(59,130,246,.1)); color: var(--accent); }
.cl-history-icon.assign { background: rgba(16,185,129,.1); color: var(--success); }
.cl-history-body { flex: 1; min-width: 0; }
.cl-history-title { font-size: 13px; font-weight: 500; }
.cl-history-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cl-history-comment { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* Participants list */
.cl-participants { padding: 0; }
.cl-participant { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.cl-participant-role { font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 1px 6px; border-radius: 4px; }

/* Typing indicator */
.cl-typing-indicator { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 12px; color: var(--text-muted); font-style: italic; }
.cl-typing-dots { display: flex; gap: 3px; }
.cl-typing-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); animation: cl-typing-bounce .6s infinite alternate; }
.cl-typing-dots span:nth-child(2) { animation-delay: .2s; }
.cl-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes cl-typing-bounce { 0% { opacity: .3; transform: translateY(0); } 100% { opacity: 1; transform: translateY(-3px); } }

/* View toggle */
.cl-view-toggle { display: flex; gap: 2px; background: var(--bg); border-radius: 6px; padding: 2px; }

/* Kanban view */
.cl-kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.cl-kanban-col { background: var(--bg); border-radius: 8px; padding: 8px; min-height: 100px; }
.cl-kanban-header { padding: 4px 4px 8px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cl-kanban-card { padding: 10px !important; margin-bottom: 8px; transition: box-shadow .15s ease; }
.cl-kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.cl-kanban-card:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
  .cl-kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cl-kanban { grid-template-columns: 1fr; }
}

/* Operator profile card */
.cl-operator-card { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.cl-operator-info { min-width: 0; }
.cl-operator-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.cl-operator-position { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cl-operator-phone { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.cl-operator-phone svg { flex-shrink: 0; }

/* SLA progress bar enhancements */
.sla-metric { }
.sla-metric.sla-breached .text-muted { color: var(--danger) !important; }

@media (max-width: 600px) {
  .cl-search-row { flex-direction: column; }
  .cl-search-wrap { min-width: 100%; }
  .cl-filter-select { width: 100%; max-width: 100%; }
}
