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

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

:root {
  --bg:     #0C0C0C;
  --bg2:    #141414;
  --bg3:    #1E1E1E;
  --border: rgba(255,255,255,0.07);

  /* Anthropic orange — cor de destaque principal */
  --accent:        #D97343;
  --accent-dim:    rgba(217,115,67,0.10);
  --accent-border: rgba(217,115,67,0.28);

  --text:  #E8E8E8;
  --text2: #808080;
  --text3: #3D3D3D;

  /* Verde mantido apenas para elementos do WhatsApp */
  --green:      #25D366;
  --green-dark: #128C7E;

  --red:    #E5534B;
  --blue:   #4D9EE5;
  --purple: #9B7FDB;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Screens ─── */
.screen { display: none; width: 100%; height: 100vh; }
.screen.active { display: flex; }

/* ─── Login / Connect ─── */
#screen-login  { align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #1a1410 0%, var(--bg) 70%); }
#screen-connect { align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #1a1410 0%, var(--bg) 70%); }

.connect-box {
  text-align: center;
  max-width: 380px;
  padding: 40px 32px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.connect-logo { margin-bottom: 16px; color: var(--accent); filter: drop-shadow(0 0 16px rgba(217,115,67,0.35)); }
.connect-box h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }

.provider-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 14px; }
.provider-btn { padding: 12px 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; color: var(--text2); cursor: pointer; text-align: left; font-family: inherit; transition: all 0.2s; }
.provider-btn:hover:not(:disabled) { border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }
.provider-btn.active { background: var(--accent-dim); border-color: var(--accent-border); color: var(--text); }
.provider-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.provider-btn-title { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.provider-btn-sub { display: block; font-size: 11px; line-height: 1.4; color: var(--text3); }
.provider-btn.active .provider-btn-sub { color: rgba(217,115,67,0.7); }

.provider-switch-feedback { margin-bottom: 12px; padding: 10px 12px; background: rgba(77,158,229,0.08); border: 1px solid rgba(77,158,229,0.18); border-radius: 10px; color: #a8cfff; font-size: 12px; line-height: 1.5; }
.connect-sub { font-size: 13px; color: var(--text2); margin-bottom: 28px; line-height: 1.5; }

#qr-wrap { margin: 0 auto 20px; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; background: white; border-radius: 10px; overflow: hidden; }
#qr-wrap img { width: 100%; height: 100%; display: block; }

.connect-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.connect-action-btn { padding: 9px 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 8px; color: var(--text2); font-size: 12px; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.connect-action-btn:hover { border-color: rgba(255,255,255,0.14); color: var(--text); }
.connect-action-btn.danger { background: rgba(229,83,75,0.08); border-color: rgba(229,83,75,0.2); color: #ff8b85; }
.connect-feedback { margin: 0 0 12px; padding: 10px 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 10px; color: var(--text2); font-size: 12px; line-height: 1.5; }

.qr-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #999; font-size: 13px; }
.spinner { width: 32px; height: 32px; border: 3px solid rgba(217,115,67,0.15); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.connect-hint { font-size: 11px; color: var(--text3); line-height: 1.5; }

/* ─── Layout ─── */
#screen-dashboard { flex-direction: row; }

/* ─── Sidebar ─── */
.sidebar { width: 230px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 0; }
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 0 20px 24px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.sidebar-logo-icon { color: var(--accent); line-height: 1; filter: drop-shadow(0 0 6px rgba(217,115,67,0.3)); }
.sidebar-logo-title { font-size: 15px; font-weight: 700; }

/* Status do WhatsApp — verde (semântico) */
.sidebar-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--green); margin-top: 2px; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
.sidebar-status.is-warning { color: #ffd166; }
.sidebar-status.is-error   { color: #ff8b96; }
.status-dot.is-warning { background: #ffd166; }
.status-dot.is-error   { background: #ff8b96; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.sidebar-nav { flex: 1; padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; border: none; background: none; color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; font-family: inherit; text-align: left; width: 100%; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-icon { display: inline-block; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; display: none; }
.nav-badge.visible { display: block; }

.sidebar-footer { padding: 16px 10px 0; border-top: 1px solid var(--border); margin-top: 12px; }
.btn-sidebar-action { width: 100%; padding: 8px 12px; background: none; border: 1px solid transparent; border-radius: 8px; color: var(--text2); font-size: 12px; cursor: pointer; font-family: inherit; transition: all 0.15s; text-align: left; display: flex; align-items: center; gap: 8px; }
.btn-sidebar-action:hover { background: rgba(255,255,255,0.05); border-color: var(--border); color: var(--text); }

/* ─── Main ─── */
.main { flex: 1; overflow-y: auto; padding: 32px; }
.main::-webkit-scrollbar { width: 4px; }
.main::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }

.connection-banner { margin-bottom: 18px; padding: 14px 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.connection-banner.is-warning { background: rgba(255,209,102,0.07); border-color: rgba(255,209,102,0.18); }
.connection-banner.is-error   { background: rgba(229,83,75,0.07); border-color: rgba(229,83,75,0.16); }
.connection-banner-text { font-size: 12px; line-height: 1.5; color: var(--text2); }
.connection-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tab-content { display: none; }
.tab-content.active { display: block; }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.3px; }
.page-header p { font-size: 13px; color: var(--text2); }

/* ─── Card ─── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 640px; }
.card-title { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 16px; }

.provider-note { margin-bottom: 18px; padding: 12px 14px; background: rgba(77,158,229,0.07); border: 1px solid rgba(77,158,229,0.15); border-radius: 10px; color: #a8cfff; font-size: 12px; line-height: 1.6; }

/* ─── Form ─── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.label-opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text3); }
.form-hint { font-size: 12px; color: var(--text3); margin-bottom: 10px; line-height: 1.5; }
.form-input { width: 100%; padding: 10px 13px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; font-family: inherit; transition: border-color 0.15s; }
.form-input::placeholder { color: var(--text3); }
.form-input:focus { outline: none; border-color: var(--accent-border); }
.form-textarea { width: 100%; min-height: 130px; padding: 11px 13px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; font-family: inherit; resize: vertical; line-height: 1.6; transition: border-color 0.15s; }
.form-textarea::placeholder { color: var(--text3); }
.form-textarea:focus { outline: none; border-color: var(--accent-border); }
.char-count { text-align: right; font-size: 11px; color: var(--text3); margin-top: 4px; }
.form-datetime { width: 100%; padding: 10px 13px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; font-family: inherit; color-scheme: dark; transition: border-color 0.15s; }
.form-datetime:focus { outline: none; border-color: var(--accent-border); }
body.theme-light .form-datetime { color-scheme: light; }

/* ─── Quick dates ─── */
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.quick-date-btn { padding: 5px 12px; background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: 100px; color: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; opacity: 0.85; }
.quick-date-btn:hover { opacity: 1; transform: translateY(-1px); }

/* ─── Type toggle ─── */
.type-toggle { display: flex; gap: 8px; }
.type-btn { padding: 8px 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.type-btn.active { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent); }
.type-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Recipient search ─── */
.recipient-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.btn-recipient-load { flex-shrink: 0; padding: 8px 14px; background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: 8px; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-recipient-load:hover:not(:disabled) { opacity: 0.85; transform: translateY(-1px); }
.btn-recipient-load:disabled { opacity: 0.6; cursor: not-allowed; }
.recipient-load-status { font-size: 12px; color: var(--text3); text-align: right; line-height: 1.4; }
.recipient-load-status[data-tone="success"] { color: var(--accent); }
.recipient-load-status[data-tone="warn"]    { color: #ffd43b; }
.recipient-load-status[data-tone="error"]   { color: var(--red); }
.recipient-progress { margin-bottom: 10px; }

.template-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.template-label { font-size: 11px; color: var(--text3); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.btn-template { padding: 5px 12px; background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: 8px; color: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; opacity: 0.85; }
.btn-template:hover { opacity: 1; transform: translateY(-1px); }

.recipient-progress-bar { height: 5px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.recipient-progress-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), #f0a070); border-radius: 999px; transition: width 0.25s ease; }
.recipient-progress-text { font-size: 11px; color: var(--text2); margin-top: 7px; line-height: 1.4; }
.recipient-search-wrap { position: relative; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--bg3); border: 1px solid rgba(255,255,255,0.10); border-radius: 10px; max-height: 200px; overflow-y: auto; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.search-results::-webkit-scrollbar { width: 3px; }
.search-results::-webkit-scrollbar-thumb { background: var(--bg); border-radius: 3px; }
.search-result-item { padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-dim); color: var(--accent); }
.search-result-empty { padding: 16px 14px; font-size: 13px; color: var(--text3); text-align: center; }
.recipient-selected { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--accent); }
.recipient-selected button { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 13px; padding: 0 4px; transition: color 0.15s; }
.recipient-selected button:hover { color: var(--red); }

/* ─── Quick replies ─── */
.quick-replies-wrap { display: flex; flex-direction: column; gap: 10px; }
.quick-replies-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.qr-chip { display: flex; align-items: center; gap: 6px; padding: 5px 12px; background: rgba(155,127,219,0.10); border: 1px solid rgba(155,127,219,0.22); border-radius: 100px; font-size: 12px; font-weight: 500; color: #b8a3f0; }
.qr-chip button { background: none; border: none; color: rgba(184,163,240,0.5); cursor: pointer; font-size: 12px; padding: 0; line-height: 1; transition: color 0.15s; }
.qr-chip button:hover { color: var(--red); }
.quick-reply-add { display: flex; gap: 8px; }
.quick-reply-add .form-input { flex: 1; }
.btn-add { padding: 10px 16px; background: rgba(155,127,219,0.10); border: 1px solid rgba(155,127,219,0.22); border-radius: 8px; color: #b8a3f0; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all 0.15s; }
.btn-add:hover { background: rgba(155,127,219,0.18); }

/* ─── File upload ─── */
.file-upload-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-file { padding: 9px 16px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text2); font-size: 13px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-file:hover { border-color: rgba(255,255,255,0.14); color: var(--text); }
.file-selected { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(77,158,229,0.07); border: 1px solid rgba(77,158,229,0.18); border-radius: 8px; font-size: 12px; color: var(--blue); }
.file-selected button { background: none; border: none; color: var(--text3); cursor: pointer; transition: color 0.15s; }
.file-selected button:hover { color: var(--red); }

/* ─── Buttons ─── */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent) 0%, #b85a2e 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.1px;
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(217,115,67,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-sm { padding: 6px 14px; font-size: 13px; margin: 0; }

/* ─── Feedback ─── */
.feedback { margin-top: 14px; padding: 11px 15px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.feedback.success { background: rgba(37,211,102,0.07); border: 1px solid rgba(37,211,102,0.18); color: #4fcf7f; }
.feedback.error   { background: rgba(229,83,75,0.07); border: 1px solid rgba(229,83,75,0.18); color: #ff8b85; }
.feedback.ok      { background: rgba(37,211,102,0.07); border: 1px solid rgba(37,211,102,0.18); color: #4fcf7f; }
.feedback.warn    { background: rgba(255,212,59,0.07); border: 1px solid rgba(255,212,59,0.16); color: #ffd43b; }
.queue-note { margin-bottom: 12px; padding: 10px 12px; background: rgba(255,212,59,0.07); border: 1px solid rgba(255,212,59,0.14); border-radius: 8px; color: #ffd43b; font-size: 12px; line-height: 1.5; }

/* ─── Pending list ─── */
.schedule-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; display: flex; gap: 16px; align-items: flex-start; transition: border-color 0.15s; }
.schedule-item:hover { border-color: rgba(255,255,255,0.10); }
.schedule-time-block { flex-shrink: 0; background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: 8px; padding: 9px 14px; text-align: center; min-width: 88px; }
.schedule-time-day  { font-size: 10px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.schedule-time-hour { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.schedule-info { flex: 1; min-width: 0; }
.schedule-recipient { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.schedule-msg { font-size: 13px; color: var(--text2); line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.schedule-doc { font-size: 11px; color: var(--blue); margin-top: 5px; }
.schedule-replies { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.schedule-reply-tag { font-size: 11px; padding: 3px 10px; background: rgba(155,127,219,0.10); border-radius: 100px; color: #b8a3f0; }
.schedule-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.btn-edit   { padding: 6px 12px; background: rgba(77,158,229,0.08); border: 1px solid rgba(77,158,229,0.18); color: var(--blue); border-radius: 7px; font-size: 12px; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.btn-edit:hover { background: rgba(77,158,229,0.14); }
.btn-cancel { padding: 6px 12px; background: rgba(229,83,75,0.07); border: 1px solid rgba(229,83,75,0.15); color: #ff8b85; border-radius: 7px; font-size: 12px; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.btn-cancel:hover { background: rgba(229,83,75,0.14); }

/* ─── Logs ─── */
.log-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; display: flex; align-items: flex-start; gap: 14px; }
.log-status { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.log-info { flex: 1; min-width: 0; }
.log-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; gap: 12px; }
.log-header-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.log-group { font-size: 13px; font-weight: 600; }
.log-date  { font-size: 11px; color: var(--text3); white-space: nowrap; }
.log-msg   { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-error { font-size: 11px; color: var(--red); margin-top: 4px; }
.btn-log-resend { padding: 6px 11px; background: rgba(37,211,102,0.08); border: 1px solid rgba(37,211,102,0.20); color: #4fcf7f; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.btn-log-resend:hover:not(:disabled) { background: rgba(37,211,102,0.14); }
.btn-log-resend:disabled { opacity: 0.6; cursor: wait; }
.btn-log-copy { padding: 6px 11px; background: rgba(77,158,229,0.08); border: 1px solid rgba(77,158,229,0.18); color: #7abcf0; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.btn-log-copy:hover { background: rgba(77,158,229,0.14); }

/* ─── Reports ─── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-grid .card { max-width: none; }
.btn-stat { width: 100%; text-align: left; padding: 10px 14px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.btn-stat-label { font-size: 13px; color: var(--text); }
.btn-stat-count { font-size: 13px; font-weight: 700; color: #b8a3f0; }
.btn-stat-bar { height: 4px; background: rgba(155,127,219,0.12); border-radius: 2px; margin-top: 6px; }
.btn-stat-fill { height: 100%; background: #9B7FDB; border-radius: 2px; transition: width 0.5s; }
.recipient-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 12px; }
.recipient-row:last-child { border-bottom: none; }
.recipient-row-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipient-row-stats { display: flex; gap: 14px; flex-shrink: 0; font-size: 12px; color: var(--text2); }
.recipient-row-stats strong { color: var(--accent); }
.response-item { padding: 10px 14px; background: var(--bg3); border-radius: 8px; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; font-size: 12px; }
.response-item-name { font-weight: 600; min-width: 120px; }
.response-item-btn { background: rgba(155,127,219,0.12); color: #b8a3f0; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.response-item-time { color: var(--text3); margin-left: auto; }

/* ─── Modal ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: var(--bg2); border: 1px solid rgba(255,255,255,0.09); border-radius: 16px; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 18px; cursor: pointer; transition: color 0.15s; }
.modal-close:hover { color: var(--red); }
.modal-body { padding: 22px 24px; }
.modal-body .card { max-width: none; }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); font-size: 14px; line-height: 1.8; }
.empty-icon { margin-bottom: 12px; opacity: 0.35; }

/* ─── Debug ─── */
#tab-debug { overflow-y: auto; }
#debug-log pre { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }

.btn-restart { background: rgba(229,83,75,0.12); color: #ff8b85; border-color: rgba(229,83,75,0.25); margin-top: 4px; }
.btn-restart:hover { background: rgba(229,83,75,0.20); }
.btn-theme-toggle { margin-top: 4px; }

/* ─── Tema claro ─── */
body.theme-light {
  --bg:     #F7F6F4;
  --bg2:    #FFFFFF;
  --bg3:    #EEECE9;
  --border: rgba(0,0,0,0.08);
  --text:   #1A1A1A;
  --text2:  #666666;
  --text3:  #AAAAAA;
  --accent:        #C4622E;
  --accent-dim:    rgba(196,98,46,0.08);
  --accent-border: rgba(196,98,46,0.25);
  --green:      #18A24A;
  --green-dark: #0F7A38;
  --red:    #D93025;
  --blue:   #1A6FD8;
  --purple: #6350C8;
}
body.theme-light #screen-login  { background: radial-gradient(ellipse at center, #f0e8e0 0%, var(--bg) 70%); }
body.theme-light #screen-connect { background: radial-gradient(ellipse at center, #f0e8e0 0%, var(--bg) 70%); }
body.theme-light .modal-overlay { background: rgba(0,0,0,0.45); }
body.theme-light .spinner { border-color: rgba(196,98,46,0.15); border-top-color: var(--accent); }
body.theme-light .search-results { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* ─── Chat ao vivo ─── */
/* ─── Chat tab full-height ─── */
.main.chat-mode { padding: 0; overflow: hidden; }
.main.crm-chat-mode { overflow: hidden; }
#tab-chat { flex-direction: column; overflow: hidden; }
#tab-chat.active { display: flex; height: 100%; }

/* ─── WhatsApp Web layout ─── */
.wa-layout { display: flex; flex: 1; height: 100%; overflow: hidden; }

/* Left sidebar */
.wa-sidebar { width: 340px; flex-shrink: 0; background: #111b21; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.06); }
.wa-sidebar-header { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,0.06); background: #202c33; }
.wa-sidebar-title { font-size: 18px; font-weight: 700; color: #e9edef; letter-spacing: -0.3px; }
.wa-sidebar-status { font-size: 11px; color: #8696a0; }
.wa-search-wrap { padding: 8px 10px; background: #111b21; flex-shrink: 0; }
.wa-search-box { display: flex; align-items: center; gap: 8px; background: #202c33; border-radius: 8px; padding: 8px 12px; color: #8696a0; }
.wa-search-input { background: none; border: none; outline: none; color: #e9edef; font-size: 13px; font-family: inherit; flex: 1; }
.wa-search-input::placeholder { color: #8696a0; }
.wa-conv-list { flex: 1; overflow-y: auto; }
.wa-conv-list::-webkit-scrollbar { width: 4px; }
.wa-conv-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.wa-empty { padding: 32px 16px; text-align: center; color: #8696a0; font-size: 13px; }
.wa-sync-empty { min-height: 180px; padding: 34px 22px; color: #9aa7af; font-size: 13px; line-height: 1.45; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.wa-sync-empty .spinner { width: 24px; height: 24px; }

/* Conversation items */
.conv-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid rgba(255,255,255,0.04); }
.conv-item:hover { background: #202c33; }
.conv-item.active { background: #2a3942; }
.conv-item-info { flex: 1; min-width: 0; }
.conv-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.conv-name { font-size: 14px; font-weight: 500; color: #e9edef; }
.conv-time { font-size: 11px; color: #8696a0; flex-shrink: 0; }
.conv-last { font-size: 12px; color: #8696a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Right main */
.wa-main { flex: 1; display: flex; flex-direction: column; background: #0b141a; overflow: hidden; position: relative; }
.wa-welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #8696a0; text-align: center; }
.wa-welcome h3 { font-size: 22px; font-weight: 300; color: #e9edef; letter-spacing: -0.3px; }
.wa-welcome p { font-size: 14px; }
.wa-welcome-icon { margin-bottom: 8px; }

.wa-convo { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.wa-convo-header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #202c33; flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.wa-convo-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0; }
.wa-convo-name { font-size: 15px; font-weight: 600; color: #e9edef; }
.wa-convo-sub { font-size: 11px; color: #8696a0; margin-top: 1px; }
.wa-header-btn { background: none; border: none; color: #8696a0; cursor: pointer; padding: 6px; border-radius: 50%; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.wa-header-btn:hover { background: rgba(255,255,255,0.08); color: #e9edef; }
.wa-sync-btn { width: 34px; height: 34px; flex-shrink: 0; }
.wa-sync-btn.spinning svg { animation: wa-spin 0.9s linear infinite; }
@keyframes wa-spin { to { transform: rotate(360deg); } }

/* Messages */
.wa-messages { flex: 1; overflow-y: auto; padding: 16px 80px; display: flex; flex-direction: column; gap: 2px; background: #0b141a; }
.wa-messages::-webkit-scrollbar { width: 4px; }
.wa-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
.chat-empty-area { display: flex; align-items: center; justify-content: center; height: 100%; color: #8696a0; font-size: 14px; }

/* Message bubbles */
.chat-msg { display: flex; flex-direction: column; max-width: 65%; margin-bottom: 2px; }
.chat-msg.out { align-self: flex-end; align-items: flex-end; }
.chat-msg.in  { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 8px 12px 8px 12px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; position: relative; }
.chat-msg.out .chat-bubble { background: #005c4b; border-bottom-right-radius: 2px; color: #e9edef; }
.chat-msg.in  .chat-bubble { background: #202c33; border-bottom-left-radius: 2px; color: #e9edef; }
.chat-msg-meta { font-size: 10px; color: #8696a0; margin-top: 2px; padding: 0 4px; }

/* Date separator */
.wa-date-sep { text-align: center; margin: 12px 0 8px; }
.wa-date-sep span { background: #182229; color: #8696a0; font-size: 11px; padding: 4px 10px; border-radius: 6px; }

/* Input bar */
.wa-input-bar { display: flex; align-items: flex-end; gap: 8px; padding: 10px 16px; background: #202c33; flex-shrink: 0; }
.wa-input { flex: 1; background: #2a3942; border: none; border-radius: 10px; color: #e9edef; font-size: 14px; font-family: 'Inter', sans-serif; padding: 11px 16px; outline: none; resize: none; max-height: 140px; line-height: 1.5; }
.wa-input::placeholder { color: #8696a0; }
.wa-send-btn { width: 42px; height: 42px; border-radius: 50%; background: #00a884; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; transition: all 0.15s; }
.wa-send-btn:hover:not(:disabled) { background: #02b58c; box-shadow: 0 4px 12px rgba(0,168,132,0.35); }
.wa-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* keep these IDs working for the existing JS */
#chat-messages { }
#chat-input-area { }
#chat-input { }
#chat-send-btn { }

/* ─── Novos contatos por dia ─── */
.new-contacts-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.new-contacts-bar-label { width: 44px; color: var(--text2); text-align: right; flex-shrink: 0; }
.new-contacts-bar-wrap { flex: 1; height: 16px; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; }
.new-contacts-bar-fill { height: 100%; background: linear-gradient(90deg, #b85a2e, var(--accent)); border-radius: 4px; transition: width 0.4s; }
.new-contacts-bar-count { width: 28px; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* ─── CRM ─── */
.crm-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#tab-crm { overflow: hidden; display: none; flex-direction: column; }
#tab-crm.active { display: flex; height: 100%; min-height: 0; }
#tab-crm.active { display: flex; }
.crm-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; min-height: 400px; }
.crm-board::-webkit-scrollbar { height: 5px; }
.crm-board::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
.crm-column { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; width: 256px; min-width: 256px; display: flex; flex-direction: column; overflow: hidden; }
.crm-col-header { display: flex; align-items: center; gap: 6px; padding: 11px 13px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.crm-col-title { font-size: 13px; font-weight: 600; flex: 1; }
.crm-col-count { font-size: 11px; background: var(--bg3); color: var(--text2); padding: 2px 7px; border-radius: 8px; }
.crm-col-actions { display: flex; gap: 4px; }
.crm-col-btn { background: none; border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; font-size: 12px; color: var(--text2); cursor: pointer; transition: all 0.12s; }
.crm-col-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.crm-cards { display: flex; flex-direction: column; gap: 7px; padding: 9px 9px 13px; overflow-y: auto; max-height: 70vh; }
.crm-cards::-webkit-scrollbar { width: 3px; }
.crm-cards::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
.crm-card { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; cursor: pointer; transition: all 0.12s; }
.crm-card:hover { border-color: var(--accent-border); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.25); }
.crm-card-label { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 5px; margin-bottom: 5px; }
.crm-card-name { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.crm-card-info { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.crm-card-checks { font-size: 11px; color: var(--accent); margin-top: 4px; }
.crm-card-note { font-size: 11px; color: var(--text3); margin-top: 4px; font-style: italic; }
.crm-empty-col { font-size: 12px; color: var(--text3); text-align: center; padding: 20px 0; }
.crm-add-card-btn { display: block; width: calc(100% - 18px); padding: 8px; background: none; border: 1px dashed var(--border); border-radius: 7px; color: var(--text3); font-size: 12px; cursor: pointer; transition: all 0.12s; margin: 0 9px 9px; }
.crm-add-card-btn:hover { border-color: var(--accent-border); color: var(--accent); }

/* CRM Detail View */
#crm-board-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
#crm-detail-view { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.main.crm-chat-mode #crm-detail-view { height: 100%; }
.crm-detail-header { display: flex; align-items: center; gap: 14px; padding: 0 0 12px; flex-shrink: 0; }
.crm-back-btn { background: var(--bg2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 13px; color: var(--text2); font-size: 13px; cursor: pointer; font-family: inherit; transition: all 0.12s; white-space: nowrap; }
.crm-back-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.14); }
.crm-detail-title { font-size: 17px; font-weight: 700; }
.crm-detail-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); flex: 1 1 auto; overflow: hidden; border: 1px solid rgba(255,255,255,0.06); border-radius: 0; background: #0b141a; min-height: 0; height: 0; }
.crm-detail-left { overflow-y: auto; padding: 20px; border-right: 1px solid rgba(255,255,255,0.06); background: #111b21; transition: width 0.18s ease, padding 0.18s ease, opacity 0.12s ease; color: #e9edef; }
.crm-detail-left .form-label { color: #8696a0; }
.crm-detail-left .form-input, .crm-detail-left .form-textarea { background: #202c33; border-color: rgba(255,255,255,0.08); color: #e9edef; }
.crm-detail-left .form-input::placeholder, .crm-detail-left .form-textarea::placeholder { color: #8696a0; }
.crm-detail-left::-webkit-scrollbar { width: 3px; }
.crm-detail-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }
.crm-detail-right { display: flex; flex-direction: column; overflow: hidden; background: #0b141a; min-width: 0; }
.crm-wa-convo { display: flex; min-height: 0; height: 100%; }
.crm-detail-messages { padding: 16px 80px; gap: 2px; min-height: 0; }
.crm-detail-input-area { display: flex; flex-shrink: 0; }
#crm-detail-view.crm-panel-collapsed .crm-detail-layout { grid-template-columns: 0 minmax(0, 1fr); }
#crm-detail-view.crm-panel-collapsed .crm-detail-left { padding: 0; border-right: 0; opacity: 0; overflow: hidden; }
.crm-panel-toggle { margin-right: 2px; }
.crm-label-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-label-btn { padding: 5px 13px; border: 1px solid var(--border); border-radius: 7px; background: none; color: var(--text2); font-size: 12px; cursor: pointer; transition: all 0.12s; font-family: inherit; }
.crm-label-btn:hover { border-color: rgba(255,255,255,0.14); color: var(--text); }
.crm-label-btn.active { border-color: var(--accent-border); color: var(--accent); background: var(--accent-dim); font-weight: 600; }
.crm-checks { display: flex; flex-direction: column; gap: 8px; }
.crm-check-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.crm-check-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }
.crm-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Prospects ─── */
.prospects-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prospects-table th { text-align: left; padding: 8px 12px; color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.prospects-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.prospects-table tr:last-child td { border-bottom: none; }
.prospects-table tr:hover td { background: rgba(255,255,255,0.02); }
.prospect-link { color: var(--accent); text-decoration: none; }
.prospect-link:hover { text-decoration: underline; }

/* ─── CRM Report charts ─── */
.crm-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.crm-bar-label { min-width: 130px; color: var(--text2); }
.crm-bar-wrap { flex: 1; height: 16px; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; }
.crm-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s; }
.crm-bar-count { width: 28px; font-weight: 700; text-align: right; flex-shrink: 0; }

@media (max-width: 760px) {
  .provider-selector { grid-template-columns: 1fr; }
  .recipient-tools { flex-direction: column; align-items: stretch; }
  .recipient-load-status { text-align: left; }
}

/* ─── Sidebar resize & collapse ─── */
.sidebar { position: relative; transition: width 0.22s cubic-bezier(.4,0,.2,1); overflow: hidden; }
.sidebar-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 4px; cursor: col-resize; z-index: 20; transition: background 0.15s; }
.sidebar-resize:hover, .sidebar-resize.dragging { background: rgba(217,115,67,0.5); }
.sidebar--collapsed { width: 56px !important; }
.sidebar--collapsed .nav-label,
.sidebar--collapsed .sidebar-logo-text,
.sidebar--collapsed .btn-label { display: none !important; }
.sidebar--collapsed .nav-item { justify-content: center; padding: 10px 0; gap: 0; }
.sidebar--collapsed .btn-sidebar-action { justify-content: center; padding: 9px 0; gap: 0; }
.sidebar--collapsed .nav-badge { display: none !important; }
.sidebar--collapsed .sidebar-logo { padding: 0 0 24px; justify-content: center; }
.sidebar--collapsed .sidebar-footer { padding-left: 4px; padding-right: 4px; }
.sidebar-toggle { background: none; border: none; color: var(--text3); cursor: pointer; padding: 2px 4px; border-radius: 4px; line-height: 1; flex-shrink: 0; transition: color 0.15s; margin-left: auto; font-size: 14px; display: flex; align-items: center; }
.sidebar-toggle:hover { color: var(--text2); }
.sidebar--collapsed .sidebar-toggle { margin-left: 0; transform: scaleX(-1); }

/* ─── Workspace sidenav ─── */
#ws-sidenav { width: 200px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--border); display: none; flex-direction: column; position: relative; overflow: hidden; transition: width 0.22s cubic-bezier(.4,0,.2,1); }
#ws-sidenav.visible { display: flex; }
.ws-sidenav-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 4px; cursor: col-resize; z-index: 20; transition: background 0.15s; }
.ws-sidenav-resize:hover, .ws-sidenav-resize.dragging { background: rgba(217,115,67,0.5); }
.ws-sidenav-inner { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-width: 0; }
.ws-sidenav-header { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ws-sidenav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 10px; }
.ws-space-list { flex: 1; padding: 6px; overflow-y: auto; }
.ws-space-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text2); border-radius: 6px; cursor: pointer; transition: all 0.12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-space-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.ws-space-item.active { background: var(--accent-dim); color: var(--accent); }
.ws-sidenav-footer { padding: 6px; border-top: 1px solid var(--border); flex-shrink: 0; }
.ws-new-space { width: 100%; padding: 7px 10px; background: none; border: 1px dashed rgba(255,255,255,0.1); border-radius: 6px; color: var(--text2); font-size: 12px; cursor: pointer; font-family: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 6px; }

/* ─── Workspace tab full-height layout ─── */
.main.ws-mode { padding: 0; overflow: hidden; }
#tab-workspace { flex-direction: column; overflow: hidden; }
#tab-workspace.active { display: flex; height: 100%; }
.ws-top { padding: 14px 20px 0; flex-shrink: 0; }
.ws-top h2 { font-size: 18px; font-weight: 700; margin-bottom: 2px; color: #d0d0d0; }
.ws-top p { font-size: 12px; color: #909090; margin-bottom: 0; }
.ws-filter-bar { display: flex; gap: 6px; padding: 10px 0 8px; overflow-x: auto; flex-wrap: nowrap; }
.ws-filter-bar::-webkit-scrollbar { display: none; }
.ws-filter-btn { padding: 4px 13px; border-radius: 20px; border: 1px solid var(--border); background: none; color: var(--text2); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; font-family: inherit; white-space: nowrap; flex-shrink: 0; }
.ws-filter-btn:hover { border-color: rgba(217,115,67,0.4); color: var(--text); }
.ws-filter-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.ws-table-wrap { flex: 1; overflow: auto; border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.ws-add-task-btn { display: flex; align-items: center; gap: 6px; margin: 6px 12px 10px; padding: 6px 12px; background: none; border: 1px dashed var(--border); border-radius: 6px; color: var(--text2); font-size: 12px; font-family: inherit; cursor: pointer; transition: all 0.15s; width: fit-content; }
.ws-add-task-btn:hover { border-color: var(--accent); color: var(--accent); }
.ws-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.ws-table-wrap::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }
.ws-table-wrap::-webkit-scrollbar-corner { background: transparent; }

/* ─── Workspace table ─── */
#workspace-table { width: 100%; border-collapse: collapse; min-width: 1500px; flex-shrink: 0; }
#workspace-table thead th { background: var(--bg2); position: sticky; top: 0; z-index: 5; padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text2); white-space: nowrap; border-bottom: 1px solid var(--border); letter-spacing: 0.5px; }
#workspace-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.1s; }
#workspace-table tbody tr:hover { background: rgba(255,255,255,0.04); }
#workspace-table tbody tr:hover td { color: var(--text); }
#workspace-table tbody td { padding: 8px 12px; font-size: 13px; vertical-align: middle; color: var(--text2); }
.ws-nome-cell { color: var(--text) !important; font-weight: 600; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ws-editable { cursor: pointer; }
.ws-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ws-dash { color: var(--text3) !important; }
.ws-invest { color: var(--accent) !important; font-weight: 700; }
.ws-tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 10px; background: rgba(77,100,160,0.15); color: #7090c0; margin-right: 3px; white-space: nowrap; }

/* ─── Inline picker dropdown ─── */
#ws-picker { position: fixed; z-index: 9999; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.7); padding: 4px; min-width: 170px; max-height: 300px; overflow-y: auto; display: none; }
#ws-picker::-webkit-scrollbar { width: 4px; }
#ws-picker::-webkit-scrollbar-thumb { background: var(--bg3); }
.ws-pick-opt { display: block; width: 100%; text-align: left; padding: 8px 12px; background: none; border: none; color: var(--text2); font-size: 13px; font-family: inherit; cursor: pointer; border-radius: 6px; transition: all 0.1s; white-space: nowrap; }
.ws-pick-opt:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.ws-pick-opt.cur { color: var(--accent); background: var(--accent-dim); }
.ws-pick-opt.clr { color: var(--text3); font-size: 12px; font-style: italic; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 2px; }
.ws-pick-input-wrap { padding: 8px 8px 4px; }
.ws-pick-input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; font-family: inherit; padding: 7px 10px; outline: none; }
.ws-pick-input:focus { border-color: var(--accent); }
.ws-pick-hint { font-size: 11px; color: var(--text3); padding: 2px 8px 8px; display: block; }

/* ─── Workspace table — clean headers ─── */
#workspace-table thead th {
  background: var(--bg);
  font-size: 10px !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,0.28) !important;
  letter-spacing: 1.2px !important;
  text-transform: uppercase !important;
  padding: 11px 12px !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-family: 'Inter', sans-serif !important;
}
#workspace-table thead th.ws-cb-th { width: 36px; padding: 0 !important; text-align: center !important; }

/* ─── Drag handle ─── */
.ws-drag-handle { display: inline-flex; align-items: center; margin-right: 8px; color: var(--text3); cursor: grab; opacity: 0; transition: opacity 0.15s; vertical-align: middle; flex-shrink: 0; }
.ws-drag-handle:active { cursor: grabbing; }
#workspace-table tbody tr:hover .ws-drag-handle { opacity: 1; }
#workspace-table tbody tr.ws-dragging { opacity: 0.35; }
#workspace-table tbody tr.ws-drag-above { box-shadow: 0 -2px 0 0 var(--accent) inset; }
#workspace-table tbody tr.ws-drag-below { box-shadow: 0 2px 0 0 var(--accent) inset; }

/* ─── Checkbox ─── */
.ws-cb-th { width: 40px; }
.ws-cb-td { width: 40px; padding: 0 0 0 4px !important; text-align: center !important; }
.ws-checkbox {
  width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.14); background: transparent;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  transition: all 0.15s; opacity: 0; display: block; margin: 0 auto;
  position: relative;
}
#workspace-table thead .ws-checkbox { opacity: 0.5; }
#workspace-table tbody tr:hover .ws-checkbox,
#workspace-table tbody tr.ws-selected .ws-checkbox { opacity: 1; }
.ws-checkbox:checked {
  background: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; opacity: 1 !important;
}
#workspace-table tbody tr.ws-selected { background: rgba(217,115,67,0.04); }
#workspace-table tbody tr.ws-selected td { color: var(--text); }

/* ─── Nome cell (clickable for notes) ─── */
.ws-nome-cell { cursor: pointer; }
.ws-nome-cell:hover .ws-nome-text { text-decoration: underline; text-decoration-color: rgba(255,255,255,0.2); }

/* ─── Notes panel ─── */
#ws-notes-panel {
  position: fixed; top: 0; right: 0; width: 460px; height: 100vh;
  background: var(--bg2); border-left: 1px solid var(--border);
  z-index: 800; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(.4,0,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
#ws-notes-panel.open { transform: translateX(0); }
.ws-notes-header {
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 12px; flex-shrink: 0;
}
.ws-notes-title { flex: 1; font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: -0.3px; word-break: break-word; }
.ws-notes-close {
  background: none; border: none; color: var(--text3); cursor: pointer;
  padding: 3px 6px; border-radius: 6px; font-size: 16px; line-height: 1;
  transition: all 0.15s; flex-shrink: 0;
}
.ws-notes-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.ws-notes-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 20px; }
#ws-notes-textarea {
  flex: 1; background: transparent; border: none;
  color: var(--text); font-size: 14px; font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.75; padding: 0; resize: none; outline: none;
}
#ws-notes-textarea::placeholder { color: var(--text3); }
.ws-notes-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.ws-notes-hint { font-size: 11px; color: var(--text3); }
.ws-notes-hint.saved { color: #4caf50; }

/* ─── Selection bar ─── */
#ws-selection-bar {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1a1a1a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 10px 16px;
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(217,115,67,0.12);
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  z-index: 600; white-space: nowrap;
}
#ws-selection-bar.visible { transform: translateX(-50%) translateY(0); }
.ws-sel-count { font-size: 12px; font-weight: 700; color: var(--accent); padding: 0 10px 0 4px; margin-right: 4px; border-right: 1px solid rgba(255,255,255,0.08); }
.ws-sel-btn {
  background: none; border: none; color: var(--text2); font-size: 12px;
  font-family: 'Inter', inherit; cursor: pointer; padding: 7px 12px;
  border-radius: 8px; transition: all 0.15s; display: flex; align-items: center;
  gap: 6px; font-weight: 500;
}
.ws-sel-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.ws-sel-btn.danger { color: #ef5350; }
.ws-sel-btn.danger:hover { background: rgba(229,83,75,0.1); color: #ff6b6b; }
.ws-sel-btn.close-btn { color: var(--text3); padding: 7px 8px; margin-left: 6px; border-left: 1px solid rgba(255,255,255,0.08); }
.ws-sel-btn.close-btn:hover { color: var(--text); }

/* ─── (floating chat removido) ─── */
#chat-float-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 700;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green); border: none; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  color: #fff;
}
#chat-float-btn.visible { display: flex; }
#chat-float-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(37,211,102,0.45); }
#chat-float-btn:active { transform: scale(0.96); }
#chat-float-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
#chat-float-badge.visible { display: flex; }

#chat-float-panel {
  position: fixed; bottom: 84px; right: 24px; z-index: 700;
  width: 340px; height: 520px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 20px 70px rgba(0,0,0,0.65);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.94) translateY(12px); opacity: 0; pointer-events: none;
  transition: all 0.22s cubic-bezier(.4,0,.2,1);
  transform-origin: bottom right;
}
#chat-float-panel.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

.cfp-header {
  background: #0d1a12; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cfp-header-icon { color: var(--green); display: flex; align-items: center; }
.cfp-header-title { flex: 1; font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.cfp-header-sub { font-size: 11px; color: rgba(255,255,255,0.35); font-weight: 400; }
.cfp-close {
  background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer;
  padding: 4px 6px; border-radius: 6px; font-size: 16px; line-height: 1;
  transition: all 0.15s;
}
.cfp-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

.cfp-back {
  background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer;
  padding: 4px; border-radius: 6px; display: none; align-items: center;
  transition: all 0.15s;
}
.cfp-back.visible { display: flex; }
.cfp-back:hover { color: #fff; }

#cfp-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* Conv list inside popup */
.cfp-conv-list { flex: 1; overflow-y: auto; }
.cfp-conv-list::-webkit-scrollbar { width: 3px; }
.cfp-conv-list::-webkit-scrollbar-thumb { background: var(--bg3); }
.cfp-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; transition: background 0.12s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cfp-conv-item:hover { background: rgba(255,255,255,0.04); }
.cfp-conv-item.active { background: rgba(37,211,102,0.07); }
.cfp-conv-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.cfp-conv-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfp-conv-last { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cfp-conv-time { font-size: 10px; color: var(--text3); flex-shrink: 0; margin-left: auto; align-self: flex-start; padding-top: 1px; }

/* Messages inside popup */
.cfp-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.cfp-msgs::-webkit-scrollbar { width: 3px; }
.cfp-msgs::-webkit-scrollbar-thumb { background: var(--bg3); }

/* Input inside popup */
.cfp-input-area {
  display: none; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--border); background: var(--bg2);
  align-items: flex-end; flex-shrink: 0;
}
.cfp-input-area.visible { display: flex; }
.cfp-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); font-size: 13px;
  font-family: 'Inter', sans-serif; padding: 8px 14px; outline: none;
  resize: none; max-height: 80px; line-height: 1.4;
  transition: border-color 0.15s;
}
.cfp-input:focus { border-color: rgba(37,211,102,0.4); }
.cfp-send {
  width: 36px; height: 36px; border-radius: 50%; background: var(--green);
  border: none; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: #fff; flex-shrink: 0;
  transition: all 0.15s;
}
.cfp-send:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(37,211,102,0.3); }
.cfp-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.chat-audio { height: 38px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.chat-file-link { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; color: #53bdeb; text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 6px; background: rgba(255,255,255,0.06); word-break: break-word; }
.chat-file-link:hover { text-decoration: underline; }

.crm-chat-attach-btn { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg2); color: var(--text2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.crm-chat-attach-btn:hover { color: var(--text); border-color: var(--accent-border); }
.crm-chat-attach-btn svg { width: 16px; height: 16px; }

.hidden { display: none !important; }
.ws-space-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-space-empty { color: var(--text3); font-size: 12px; padding: 10px; }
.ws-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 12px; color: var(--text2); }
.ws-check-grid label { display: flex; align-items: center; gap: 7px; }
.ws-check-grid input { accent-color: var(--accent); }
.ws-invite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 12px; }
.ws-invite-row span { color: var(--text2); }
.ws-invite-row button { border: 1px solid rgba(255,107,107,0.25); background: transparent; color: #ff8b96; border-radius: 6px; padding: 4px 9px; cursor: pointer; font-family: inherit; font-size: 12px; }
.ws-invite-row .ws-invite-edit-btn { border-color: rgba(99,102,241,0.3); color: #818cf8; }

.broadcast-layout { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px); gap: 16px; align-items: start; }
.broadcast-card { max-width: none; }
.broadcast-labels { display: flex; flex-wrap: wrap; gap: 8px; }
.broadcast-label-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; color: var(--text2); font-size: 12px; cursor: pointer; }
.broadcast-label-chip input { accent-color: var(--accent); }
.broadcast-targets { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: rgba(255,255,255,0.02); }
.broadcast-target-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 7px; cursor: pointer; }
.broadcast-target-row:hover { background: rgba(255,255,255,0.04); }
.broadcast-target-row input { accent-color: var(--accent); }
.broadcast-target-row span { display: flex; flex-direction: column; min-width: 0; }
.broadcast-target-row strong { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.broadcast-target-row small { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.broadcast-empty, .broadcast-summary { color: var(--text2); font-size: 12px; padding: 8px 0; }
@media (max-width: 900px) { .broadcast-layout { grid-template-columns: 1fr; } }

/* ── Broadcast multi-select label picker ── */
.bc-label-picker { position: relative; border: 1px solid var(--border); border-radius: 8px; background: var(--bg2); padding: 6px; min-height: 40px; cursor: text; }
.bc-label-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.bc-label-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 8px 3px 6px; font-size: 11px; font-weight: 600; color: #fff; cursor: default; }
.bc-label-chip button { background: none; border: none; color: inherit; cursor: pointer; padding: 0; font-size: 13px; line-height: 1; opacity: 0.75; }
.bc-label-chip button:hover { opacity: 1; }
.bc-label-input-wrap { display: flex; align-items: center; }
.bc-label-input { flex: 1; background: none; border: none; outline: none; font-size: 13px; font-family: inherit; color: var(--text); padding: 3px 4px; }
.bc-label-input::placeholder { color: var(--text3); }
.bc-label-dropdown { position: absolute; left: 0; right: 0; top: 100%; z-index: 500; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); max-height: 240px; overflow-y: auto; padding: 4px; margin-top: 4px; }
.bc-label-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; background: none; border: none; color: var(--text2); font-size: 13px; font-family: inherit; cursor: pointer; border-radius: 6px; text-align: left; }
.bc-label-opt:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.bc-label-opt .bc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bc-label-create { color: var(--accent); font-style: italic; }
.broadcast-search-wrap { margin-bottom: 8px; }
.broadcast-search-input { width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; font-family: inherit; padding: 8px 12px; outline: none; box-sizing: border-box; }
.broadcast-search-input:focus { border-color: var(--accent); }

/* ── Workspace label dots in NOME cell ── */
.ws-label-dots { display: inline-flex; gap: 3px; align-items: center; margin-left: 6px; }
.ws-label-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ws-label-btn { background: none; border: none; cursor: pointer; padding: 2px 3px; border-radius: 4px; color: var(--text3); opacity: 0; transition: opacity 0.1s; display: inline-flex; align-items: center; margin-left: 2px; }
tr:hover .ws-label-btn { opacity: 1; }
.ws-label-btn:hover { color: var(--accent); background: rgba(255,255,255,0.06); }

/* ── Workspace label picker panel ── */
#ws-label-picker { position: fixed; z-index: 9999; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.7); padding: 8px; min-width: 220px; max-height: 360px; overflow-y: auto; display: none; }
#ws-label-picker::-webkit-scrollbar { width: 4px; }
#ws-label-picker::-webkit-scrollbar-thumb { background: var(--bg3); }
.ws-lp-section { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; padding: 6px 8px 3px; }
.ws-lp-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 600; color: #fff; margin: 2px 4px; }
.ws-lp-chip-remove { background: none; border: none; color: inherit; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; opacity: 0.7; }
.ws-lp-chip-remove:hover { opacity: 1; }
.ws-lp-chips { padding: 4px 4px 2px; display: flex; flex-wrap: wrap; }
.ws-lp-input-wrap { padding: 6px 6px 4px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); }
.ws-lp-input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; font-family: inherit; padding: 6px 10px; outline: none; }
.ws-lp-input:focus { border-color: var(--accent); }
.ws-lp-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; background: none; border: none; color: var(--text2); font-size: 13px; font-family: inherit; cursor: pointer; border-radius: 6px; text-align: left; }
.ws-lp-row:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.ws-lp-row .ws-lp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ws-lp-create { color: var(--accent); font-style: italic; }
.ws-lp-delete { margin-left: auto; background: none; border: none; color: var(--text3); font-size: 12px; cursor: pointer; padding: 0 2px; border-radius: 4px; }
.ws-lp-delete:hover { color: #ff6b6b; }

/* ── Workspace top row ── */
.ws-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ws-search-trigger { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 8px; color: var(--text3); font-size: 12px; font-family: inherit; padding: 7px 12px; cursor: pointer; transition: all 0.15s; white-space: nowrap; margin-top: 4px; }
.ws-search-trigger:hover { background: rgba(255,255,255,0.08); color: var(--text2); border-color: rgba(255,255,255,0.15); }
.ws-kbd { display: inline-block; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; padding: 1px 5px; font-size: 10px; font-family: inherit; color: var(--text3); }

/* ── Workspace search modal ── */
#ws-search-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; }
.ws-search-modal { width: 600px; max-width: calc(100vw - 32px); background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,0.8); overflow: hidden; }
.ws-search-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ws-search-header svg { flex-shrink: 0; color: var(--text3); }
.ws-search-input { flex: 1; background: none; border: none; outline: none; font-size: 15px; font-family: inherit; color: var(--text); }
.ws-search-input::placeholder { color: var(--text3); font-size: 13px; }
.ws-search-esc { font-size: 11px; color: var(--text3); background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; flex-shrink: 0; cursor: pointer; }
.ws-search-results { max-height: 440px; overflow-y: auto; padding: 6px; }
.ws-search-results::-webkit-scrollbar { width: 4px; }
.ws-search-results::-webkit-scrollbar-thumb { background: var(--bg3); }
.ws-search-group { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; padding: 8px 10px 4px; }
.ws-search-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: background 0.1s; }
.ws-search-row:hover, .ws-search-row.ws-sr-active { background: rgba(255,255,255,0.06); }
.ws-search-row-name { flex: 1; font-size: 13px; color: var(--text); font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-search-row-name mark { background: none; color: var(--accent); font-weight: 700; }
.ws-search-empty { padding: 32px 16px; text-align: center; color: var(--text3); font-size: 13px; }
.ws-search-reset-warn { margin: 8px; padding: 14px 16px; background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3); border-radius: 10px; }
.ws-search-reset-warn p { font-size: 13px; color: #ff8b96; margin-bottom: 10px; line-height: 1.5; }
.ws-search-reset-btn { background: #c92a2a; color: #fff; border: none; border-radius: 7px; padding: 9px 18px; font-size: 13px; font-family: inherit; font-weight: 600; cursor: pointer; width: 100%; }
.ws-search-reset-btn:hover { background: #e03131; }
.ws-row-flash { animation: wsFlash 1.2s ease; }
@keyframes wsFlash { 0%,100% { background: transparent; } 25%,75% { background: rgba(99,102,241,0.18); } }
#impersonate-banner { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999; background: #7c3aed; color: #fff; padding: 10px 20px; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; box-shadow: 0 -2px 12px rgba(124,58,237,0.4); }

.group-safety-panel { margin: 12px 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,0.025); }
.group-safety-panel.is-warning { border-color: rgba(255,212,59,0.25); background: rgba(255,212,59,0.055); }
.group-safety-panel.is-ok { border-color: rgba(37,211,102,0.22); background: rgba(37,211,102,0.045); }
.group-safety-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.group-safety-head strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.group-safety-head small { display: block; color: var(--text2); font-size: 12px; line-height: 1.4; }
.group-safety-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.group-safety-actions .btn-primary, .group-safety-actions .btn-secondary { white-space: nowrap; padding: 10px 12px; }
@media (max-width: 720px) { .group-safety-actions { grid-template-columns: 1fr; } }
