:root {
  --primary: #25D366;
  --primary-dark: #1DA851;
  --bg: #F4F6F8;
  --bg-card: #FFFFFF;
  --bg-hover: #F0F2F5;
  --border: #E2E5E9;
  --text: #1F2933;
  --text-muted: #6B7684;
  --sidebar-bg: #111B21;
  --sidebar-text: #D1D7DB;
  --sidebar-active: #202C33;
  --status-connected: #25D366;
  --status-disconnected: #E64545;
  --status-sent: #25D366;
  --status-failed: #E64545;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ── Login ─────────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0B141A 0%, #111B21 100%);
}
.login-screen { padding: 1rem; }
.login-box {
  width: 360px;
  max-width: 100%;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.login-logo .chat { color: var(--primary); }
.login-sub { text-align: center; color: var(--text-muted); margin-bottom: 1.75rem; font-size: 0.85rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.field-row { display: flex; gap: 0.75rem; }
.field-row .form-group { flex: 1; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity .15s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #06301A; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: var(--status-disconnected); color: #fff; }
.error-msg { background: rgba(230,69,69,0.12); color: var(--status-disconnected); padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.8rem; margin-bottom: 1rem; }

/* ── App layout ────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-logo { padding: 1.25rem 1.1rem; font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo .chat { color: var(--primary); }
.sidebar-section-label { padding: 1rem 1.1rem 0.4rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #5B6870; }
.sidebar-nav-groups { flex: 1; padding-bottom: 1rem; overflow-y: auto; }
.sidebar-nav { flex: 1; padding-bottom: 1rem; }
.sidebar-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  font-size: 0.88rem;
  position: relative;
  color: inherit;
  text-decoration: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.04); }
.sidebar-item.active { background: var(--sidebar-active); color: #fff; border-left: 3px solid var(--primary); padding-left: calc(1.1rem - 3px); }
.sidebar-item i { width: 16px; text-align: center; }
.status-dot { position: relative; display: inline-flex; width: 8px; height: 8px; border-radius: 50%; background: var(--status-disconnected); }
.status-dot.connected { background: var(--status-connected); }
.status-dot-ping { position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
.sidebar-footer { padding: 1rem 1.1rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.8rem; }
.sidebar-footer .btn { border: none; }
.sidebar-user-name { color: var(--sidebar-text); opacity: 0.6; font-size: 0.78rem; margin-bottom: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  gap: 0.75rem;
}
.topbar h1 { font-size: 1.1rem; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.content { padding: 1.5rem; flex: 1; overflow-y: auto; }

.hamburger-btn {
  display: none;
  width: 36px; height: 36px; flex-shrink: 0;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 1rem;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 850;
}
.sidebar-overlay.active { display: block; }

/* ── Cards / Tables ────────────────────────────────────────────────── */
.card { background: var(--bg-card); border-radius: 10px; box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-header h2 { margin: 0; font-size: 1rem; }
.card-body { padding: 1.25rem; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border); }
td { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
.sort-icon { font-size: 0.7em; opacity: 0.4; }
.sort-icon.active { opacity: 1; color: var(--primary); }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; color: var(--text-muted); font-size: 0.78rem; }
.row-meta .badge { font-size: 0.72rem; }
tr:last-child td { border-bottom: none; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.5; }

.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-connected { background: rgba(37,211,102,0.14); color: var(--status-connected); }
.badge-disconnected { background: rgba(230,69,69,0.14); color: var(--status-disconnected); }
.badge-paused { background: rgba(107,118,132,0.14); color: var(--text-muted); }
.badge-sent { background: rgba(37,211,102,0.14); color: var(--status-sent); }
.badge-failed { background: rgba(230,69,69,0.14); color: var(--status-failed); }
.badge-info { background: rgba(37,211,102,0.14); color: var(--status-connected); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.status-toggle {
  width: 40px; height: 22px;
  background: var(--status-disconnected);
  border-radius: 999px;
  position: relative;
  border: none;
  flex-shrink: 0;
}
.status-toggle.on { background: var(--status-connected); }
.status-toggle-knob {
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: left .15s;
}
.status-toggle.on .status-toggle-knob { left: 21px; }

label.switch-row { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; margin-bottom: 0; }
.switch-row-label { font-size: 0.9rem; color: var(--text); font-weight: 600; }
.switch { position: relative; flex-shrink: 0; width: 40px; height: 22px; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { display: block; width: 40px; height: 22px; background: var(--text-muted); border-radius: 999px; position: relative; transition: background .15s; }
.switch-knob { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left .15s; }
.switch input:checked + .switch-track { background: var(--status-connected); }
.switch input:checked + .switch-track .switch-knob { left: 21px; }

.detail-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.detail-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-size: 0.82rem; }
.detail-value { font-weight: 600; font-size: 0.88rem; text-align: right; }

.filter-bar { display: flex; gap: 0.6rem; flex-wrap: wrap; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); }
.filter-bar input, .filter-bar select {
  padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.filter-bar input { flex: 1; min-width: 160px; }

.row-actions { display: flex; gap: 0.4rem; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--status-disconnected); border-color: var(--status-disconnected); }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border-radius: 12px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 1rem; }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--text-muted); }
.modal-body { padding: 1.3rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1rem 1.3rem; border-top: 1px solid var(--border); }

.modal-schedule { max-width: 560px; }
.schedule-modal-col-left, .schedule-modal-col-right { min-width: 0; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.modal-import { max-width: 480px; }
.modal-import #importFileInput { margin-top: 0.6rem; width: 100%; }
.import-list-actions { display: flex; gap: 0.5rem; margin: 0.9rem 0 0.6rem; }
.import-contacts-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.import-contact-row {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.85rem;
}
.import-contact-row:last-child { border-bottom: none; }
.import-contact-row:hover { background: var(--bg-hover); }
.import-contact-row input[type="checkbox"] { flex-shrink: 0; }
.import-contact-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-contact-phone { color: var(--text-muted); white-space: nowrap; }
.import-contact-row.is-duplicate { opacity: 0.6; }

@media (min-width: 860px) {
  .modal-schedule { max-width: 940px; }
  .schedule-modal-grid { display: grid; grid-template-columns: 360px 1fr; gap: 1.1rem; align-items: start; }
  .modal-schedule.template-mode { max-width: 560px; }
  .schedule-modal-grid.template-mode-grid { grid-template-columns: 1fr; }
}

/* ── WhatsApp connect ──────────────────────────────────────────────── */
.wa-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 0.75rem; background: var(--bg-card); box-shadow: var(--shadow); }
.wa-card-info { display: flex; align-items: center; gap: 0.75rem; }
.wa-card-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.wa-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(37,211,102,0.12); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.wa-qr-container { text-align: center; }
.wa-qr-container img { width: 240px; height: 240px; border-radius: 8px; border: 1px solid var(--border); }
.wa-qr-counter { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.5rem; }
.wa-steps { color: var(--text-muted); font-size: 0.82rem; line-height: 1.6; margin-top: 0.75rem; }

/* ── Stats ─────────────────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border-radius: 10px; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat-card .value { font-size: 1.6rem; font-weight: 700; }
.stat-card .label { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.15rem; }

/* ── Company cards (dashboard admin) ──────────────────────────────────── */
.dash-section-header { margin-bottom: 0.9rem; }
.dash-section-header h2 { margin: 0; font-size: 1rem; }
.dash-company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.company-card { background: var(--bg-card); border-left: 4px solid var(--status-disconnected); border-radius: 10px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.company-card.active { border-left-color: var(--status-connected); }
.company-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.company-card-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.company-card-status { margin-top: 0.5rem; }
.company-card-meta { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; }
.company-card-meta i { width: 1rem; text-align: center; margin-right: 0.2rem; }
.company-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.company-card-footer .btn { padding: 0.4rem 0.8rem; font-size: 0.82rem; }

/* ── Toast ─────────────────────────────────────────────────────────── */
#toastContainer { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { display: flex; align-items: center; gap: 0.6rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 1rem; box-shadow: 0 4px 16px rgba(0,0,0,0.15); font-size: 0.85rem; animation: slideIn .2s ease-out; }

/* ── Rule type fields ──────────────────────────────────────────────── */
.weekday-picker { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.weekday-chip {
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
}
.weekday-chip.selected { background: var(--primary); color: #06301A; border-color: var(--primary); }
.hint { color: var(--text-muted); font-size: 0.76rem; margin-top: 0.3rem; }

.msg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.msg-toolbar-divider { width: 1px; height: 20px; background: var(--border); margin: 0 0.15rem; }
textarea.step-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
  min-height: 128px;
}
.wa-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-hover); padding: 0.05rem 0.3rem; border-radius: 4px; font-size: 0.85em; }
.wa-quote { display: block; padding-left: 0.6rem; border-left: 3px solid var(--border); color: var(--text-muted); }
.msg-preview {
  margin-top: 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.4rem;
}

.msg-type-toggle { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.msg-type-btn {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); font-weight: 600; font-size: 0.85rem;
}
.msg-type-btn.active { background: var(--primary); color: #06301A; border-color: var(--primary); }
.step-type-toggle .msg-type-btn { flex: 1 1 45%; }

.modal-section { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.9rem; }
.modal-section-header {
  width: 100%; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1rem; background: var(--bg); border: none; text-align: left;
  border-radius: 10px 10px 0 0;
}
.modal-section.collapsed .modal-section-header { border-radius: 10px; }
.modal-section-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; color: var(--text); }
.modal-section-summary {
  flex: 1; color: var(--text-muted); font-size: 0.82rem; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 0.2rem;
}
.modal-section:not(.collapsed) .modal-section-summary { display: none; }
.modal-section-chevron { color: var(--text-muted); transition: transform 0.15s; flex-shrink: 0; }
.modal-section.collapsed .modal-section-chevron { transform: rotate(-90deg); }
.modal-section-body { padding: 1rem; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; }
.modal-section.collapsed .modal-section-body { display: none; }

.combo { position: relative; }
.combo-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text); font-size: 14px; text-align: left;
}
.combo-trigger i { color: var(--text-muted); flex-shrink: 0; }
.combo-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); overflow: hidden;
}
.combo-search {
  width: 100%; padding: 0.6rem 0.8rem; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; font-size: 16px;
}
.combo-list { max-height: 220px; overflow-y: auto; }
.combo-item { padding: 0.6rem 0.8rem; cursor: pointer; font-size: 0.88rem; }
.combo-item:hover, .combo-item.selected { background: var(--bg-hover); }
.combo-item.selected { font-weight: 700; }
.combo-item-tag { color: var(--text-muted); font-size: 0.75rem; font-weight: 400; }
.combo-empty { padding: 0.8rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; }

.audio-recorder { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.audio-recorder audio { max-width: 100%; }
.recording-indicator {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--status-disconnected); font-weight: 600; font-size: 0.9rem;
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--status-disconnected); animation: pulse 1.2s infinite; }
.audio-level-bar { width: 100%; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.audio-level-fill { height: 100%; width: 0%; background: var(--status-disconnected); border-radius: 999px; transition: width .08s linear; }

.media-picker { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.media-preview-img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.file-picker-btn { cursor: pointer; }
.media-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.3rem; width: 100%; padding: 1.75rem 1rem;
  border: 2px dashed var(--border); border-radius: 10px; background: var(--bg);
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
}
.media-dropzone:hover, .media-dropzone.drag-over { border-color: var(--primary); background: rgba(37, 211, 102, 0.06); }
.media-dropzone-icon { font-size: 1.5rem; color: var(--text-muted); }
.media-dropzone.drag-over .media-dropzone-icon { color: var(--primary); }
.media-dropzone-text { font-size: 0.85rem; color: var(--text); }
.media-dropzone-link { font-size: 0.8rem; color: var(--primary); text-decoration: underline; }
.media-dropzone-compact { flex-direction: row; padding: 0.55rem 0.9rem; gap: 0.5rem; }
.media-dropzone-compact .media-dropzone-icon { font-size: 1rem; }
.media-dropzone-compact .media-dropzone-text { font-size: 0.8rem; }
.file-chip {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.6rem 0.9rem; font-size: 0.85rem; max-width: 100%;
}
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.step-card { border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem; margin-bottom: 0.75rem; background: var(--bg); }
.step-card[draggable="true"] { cursor: default; }
.step-card[draggable="true"]:active { opacity: 0.6; }
.step-card-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.step-drag-handle { cursor: grab; color: var(--text-muted); font-size: 0.9rem; }
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  font-weight: 700; font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0;
}
.step-type-toggle { flex: 1; }
.step-remove { flex-shrink: 0; }

.impersonate-banner {
  background: linear-gradient(90deg, #6C4FD1, #8B6DE0);
  color: #fff; text-align: center; padding: 0.5rem; font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
}
.impersonate-banner button { background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 0.25rem 0.75rem; border-radius: 6px; font-size: 0.75rem; }

.hidden { display: none !important; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.6; } 75%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 720px) {
  .sidebar { position: fixed; right: -230px; top: 0; bottom: 0; z-index: 900; transition: right .2s; max-width: 80vw; }
  .sidebar.open { right: 0; }
  .hamburger-btn { display: inline-flex; }
  .content { padding: 1rem; }
  table { font-size: 0.8rem; }

  .field-row { flex-direction: column; gap: 0; }

  .form-group input, .form-group select, .form-group textarea { font-size: 16px; }
  .filter-bar input, .filter-bar select { font-size: 16px; width: 100%; }

  .modal-overlay { padding: 0.5rem; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 12px 12px 0 0; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; }

  .icon-btn { width: 36px; height: 36px; }

  .wa-qr-container img { max-width: 100%; height: auto; }

  #toastContainer { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; }
  .toast { width: 100%; }

  th, td { padding: 0.6rem 0.85rem; }
  .card-header { padding: 0.9rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .card-body { padding: 1rem; }
}
