:root {
  --bg: #f4f6f5; --surface: #ffffff; --surface-2: #f0f3f2; --text: #17201d; --muted: #5f6b67;
  --border: #dde3e1; --brand: #0b7a5e; --brand-ink: #ffffff; --brand-soft: #e2f3ed;
  --a: #2457c5; --a-soft: #e5edfb; --b: #9a5b00; --b-soft: #fbf0df;
  --ok: #137a3a; --ok-soft: #e1f4e7; --warn: #a15c00; --warn-soft: #fdf1dd; --err: #b42318; --err-soft: #fde8e6;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,20,.06), 0 2px 8px rgba(16,24,20,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412; --surface: #171e1b; --surface-2: #1e2723; --text: #e6ece9; --muted: #96a39e;
    --border: #2b3632; --brand: #2fb68c; --brand-ink: #062118; --brand-soft: #173a2f;
    --a: #8db0ff; --a-soft: #1c2a49; --b: #f0b35c; --b-soft: #3a2b14;
    --ok: #5fd28a; --ok-soft: #173826; --warn: #f0b35c; --warn-soft: #3a2b14; --err: #ff8a80; --err-soft: #3d1c1a;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
h2 { font-size: 18px; margin: 0 0 4px; } h3 { font-size: 15px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 16px; }
a { color: var(--brand); }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 10px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.logo { color: var(--brand); font-size: 20px; }
nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font: inherit; cursor: pointer; }
nav button:hover { background: var(--surface-2); color: var(--text); }
nav button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.pulse { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.banner { background: var(--warn-soft); color: var(--warn); padding: 8px 20px; font-size: 13px; }
main { padding: 16px 24px; max-width: 1920px; width: 100%; margin: 0 auto; box-sizing: border-box; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 12px; }

.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 12px; border-radius: 8px;
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--err); }
.btn.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); font-weight: 500; }
.btn.warn:hover { filter: brightness(0.96); }
.btn.accent-blue { color: var(--a); border-color: var(--a); background: var(--a-soft); font-weight: 500; }
.btn.accent-blue:hover { filter: brightness(0.96); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.muted-action { opacity: .85; cursor: default; color: var(--muted); background: var(--surface-2); border-color: var(--border); font-weight: 500; pointer-events: none; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { padding: 2px; height: 36px; width: 60px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.phone-group { display: flex; gap: 8px; align-items: center; width: 100%; }
.phone-group select { width: 175px; flex-shrink: 0; cursor: pointer; }
.phone-group input { flex: 1; min-width: 0; }

.table-wrap { overflow-x: auto; }
.table-accounts-wrap {
  min-height: 400px;
  padding-bottom: 120px;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; }
th.col-actions, td.col-actions { text-align: right; white-space: nowrap; }
.col-actions-row { display: inline-flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }

/* Balanced Accounts Table Layout */
.table-accounts {
  width: 100%;
  border-collapse: collapse;
}
.table-accounts th,
.table-accounts td {
  padding: 11px 14px;
  vertical-align: middle;
}
.table-accounts .col-sel {
  width: 44px;
  text-align: center;
  padding: 11px 6px;
}
.table-accounts .col-name {
  min-width: 150px;
}
.table-accounts .col-phone {
  white-space: nowrap;
}
.table-accounts .col-mode {
  white-space: nowrap;
  min-width: 185px;
}
.table-accounts .col-status {
  white-space: nowrap;
}
.table-accounts .col-app-status {
  min-width: 145px;
  white-space: nowrap;
}
.table-accounts .col-wa-status {
  min-width: 135px;
  white-space: nowrap;
}
.table-accounts th.col-notify,
.table-accounts td.col-notify {
  width: 115px;
  white-space: nowrap;
  text-align: center;
  padding: 11px 12px;
}
.table-accounts th.col-actions {
  width: 135px;
  white-space: nowrap;
  text-align: center;
  padding: 11px 12px;
}
.table-accounts td.col-actions {
  width: 135px;
  white-space: nowrap;
  text-align: center;
  padding: 11px 12px;
}
.table-accounts th.col-actions-more,
.table-accounts td.col-actions-more {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  white-space: nowrap;
  text-align: center;
  padding: 11px 6px;
}
.table-accounts td.col-actions .row,
.table-accounts td.col-actions .col-actions-row {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

/* Actions 3-dots Menu */
.actions-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-more-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.btn-more-dots:hover,
.btn-more-dots.open {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.actions-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 4px;
  min-width: 140px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: thMenuPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.actions-dropdown.hidden {
  display: none !important;
}

.actions-dropdown.drop-up {
  top: auto;
  bottom: calc(100% + 4px);
}

.actions-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.actions-item:hover {
  background: var(--surface-2);
  color: var(--brand);
}

.actions-item svg {
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.actions-item:hover svg {
  color: var(--brand);
}

.actions-item.danger {
  color: var(--err);
}

.actions-item.danger:hover {
  background: var(--err-soft, rgba(239, 68, 68, 0.08));
  color: var(--err);
}

.actions-item.danger svg {
  color: var(--err);
}

.actions-item.danger:hover svg {
  color: var(--err);
}

/* User Manage Dropdown Button & Menu */
.user-manage-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.user-manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 600;
  padding: 5px 12px;
  min-width: 96px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-manage-btn.open,
.user-manage-btn:hover {
  background: var(--surface-2);
  border-color: var(--brand);
}

.user-manage-btn svg {
  transition: transform 0.15s ease;
}

.user-manage-btn.open svg {
  transform: rotate(180deg);
}

.user-manage-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 5px;
  min-width: 170px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: thMenuPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-manage-dropdown.hidden {
  display: none !important;
}

.user-manage-dropdown.drop-up {
  top: auto;
  bottom: calc(100% + 4px);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.12), 0 -2px 6px rgba(0, 0, 0, 0.04);
  animation: thMenuPopUp 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes thMenuPopUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.users-scroll-container {
  max-height: calc(100vh - 340px);
  min-height: 260px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 8px;
}

.users-scroll-container thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}


/* Column Header Dropdowns */
.table-accounts th.th-dropdownable {
  position: relative;
  z-index: 20;
}

.table-accounts th.th-dropdownable.th-open,
.table-accounts th.th-dropdownable:has(.th-btn.open) {
  z-index: 150;
}

.table-accounts th .th-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  padding: 5px 8px;
  margin: -5px -8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.table-accounts th .th-btn:hover,
.table-accounts th .th-btn.open {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.table-accounts th.th-active .th-btn {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: rgba(18, 140, 126, 0.25);
  font-weight: 700;
}


.table-accounts th .th-chevron {
  transition: transform 0.15s ease;
  opacity: 0.6;
}

.table-accounts th .th-btn.open .th-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.table-accounts th .sort-dir {
  font-weight: 800;
  color: var(--brand);
  font-size: 12px;
}

.th-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 5px;
  min-width: 210px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-transform: none;
  animation: thMenuPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.th-dropdown.hidden {
  display: none !important;
}

.th-dropdown.align-right {
  left: auto;
  right: 6px;
}

@keyframes thMenuPop {
  from { opacity: 0; transform: translateY(-3px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.th-dropdown-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 6px 10px 3px;
}

.th-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 3px 6px;
}

.th-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  letter-spacing: normal;
  text-transform: none;
}

.th-dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.th-dropdown-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.th-dropdown-item .check {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  margin-left: auto;
}

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.muted { background: var(--surface-2); color: var(--muted); }
.pill.A { background: var(--a-soft); color: var(--a); }
.pill.B { background: var(--b-soft); color: var(--b); }

.status-cell-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.btn-icon-notify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--warn);
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.btn-icon-notify:hover {
  background: var(--warn-soft);
  border-color: var(--warn);
  transform: scale(1.08);
}
.btn-icon-notify:active { transform: scale(0.95); }
.btn-icon-notify:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-icon-notify.sending { animation: bell-pulse 1s infinite alternate; }
.btn-icon-notify.sent { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
@keyframes bell-pulse {
  from { transform: scale(0.95); opacity: 0.7; }
  to { transform: scale(1.1); opacity: 1; }
}

.btn-notify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-notify:hover {
  background: var(--surface-2);
  border-color: #cbd5e1;
  color: #111827;
}
.btn-notify:active {
  transform: scale(0.97);
}
.btn-notify:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-notify.sending {
  animation: bell-pulse 1s infinite alternate;
}
.btn-notify.sent {
  color: var(--ok);
  border-color: var(--ok);
  background: var(--ok-soft);
}
@media (prefers-color-scheme: dark) {
  .btn-notify {
    color: #e5e7eb;
    border-color: var(--border);
    background: var(--surface);
  }
  .btn-notify:hover {
    background: var(--surface-2);
    border-color: #4b5563;
    color: #ffffff;
  }
}

.btn-notify-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-notify-all:hover {
  background: var(--surface-2);
  border-color: #94a3b8;
}
.btn-notify-all.sending {
  animation: bell-pulse 1s infinite alternate;
}
.btn-notify-all.sent {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
}
@media (prefers-color-scheme: dark) {
  .btn-notify-all {
    color: #e5e7eb;
    border-color: var(--border);
    background: var(--surface);
  }
  .btn-notify-all:hover {
    background: var(--surface-2);
    border-color: #4b5563;
    color: #ffffff;
  }
}

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on[data-mode=A] { background: var(--a-soft); color: var(--a); }
.seg button.on[data-mode=B] { background: var(--b-soft); color: var(--b); }

.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 210px;
  max-width: 320px;
}
.search-wrap .search-icon {
  position: absolute;
  left: 9px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.search-wrap .search-input {
  width: 100%;
  padding: 6px 28px 6px 31px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-wrap .search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search-wrap .search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-wrap .search-clear:hover {
  color: var(--text);
  background: var(--surface-2);
}

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 700px) { .legend { grid-template-columns: 1fr; } }
.legend .card { padding: 12px 14px; }
.legend p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tpl { cursor: pointer; padding: 0; overflow: hidden; }
.tpl.selected { outline: 2px solid var(--brand); }
.tpl .meta { padding: 10px 12px; }
.tpl .meta small { color: var(--muted); }

.phone { aspect-ratio: 9 / 16; border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 16px; color: #fff; font-size: 15px; font-weight: 600; white-space: pre-wrap; overflow: hidden; position: relative; background: #000; }
.phone img, .phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; background: linear-gradient(transparent, rgba(0,0,0,.7)); font-weight: 500; font-size: 13px; }
.tpl .phone { border-radius: 0; max-height: 220px; aspect-ratio: auto; height: 220px; }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; display: flex; min-width: 120px; }
.progress span { display: block; height: 100%; }
.progress .done { background: var(--ok); } .progress .await { background: var(--b); } .progress .fail { background: var(--err); }

.code { font: 700 34px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 18px; background: var(--surface-2); border-radius: 10px; }
ol.steps { padding-left: 18px; margin: 8px 0; } ol.steps li { margin: 4px 0; }
.qr { display: block; width: 220px; height: 220px; margin: 0 auto; background: #fff; border-radius: 8px; }

dialog {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  outline: none !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  color: var(--text) !important;
  padding: 24px 28px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.22), 0 0 1px rgba(0, 0, 0, 0.08) !important;
  width: min(540px, calc(100vw - 32px)) !important;
  max-width: 100vw !important;
  margin: auto !important;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(4px) !important;
}

dialog.wide {
  width: min(680px, calc(100vw - 32px)) !important;
}

.template-download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 4px;
}
.template-info { flex: 1; }
.template-info p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.template-badge {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 4px;
  margin-bottom: 3px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.drop-zone-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.drop-zone-primary {
  font-weight: 600;
  color: var(--text);
  font-size: 13.5px;
}

.file-selected-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ok-soft);
  border: 1px solid var(--ok);
  color: var(--ok);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 8px;
}

.preview-summary-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.preview-mini-table {
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
}
.preview-mini-table table {
  font-size: 12.5px;
  width: 100%;
}
.preview-mini-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 1;
  font-size: 11px;
}

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; transition: transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--err); color: #fff; }

.modal-form-error {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  line-height: 1.4;
}
.modal-form-error.hidden {
  display: none !important;
}

.modal-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
  margin-top: 24px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--border) !important;
}

.modal-actions .spacer {
  flex: 1 !important;
}

.modal-actions .btn {
  padding: 8px 18px !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.modal-actions .btn.danger {
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  background: #ffffff !important;
}

.modal-actions .btn.danger:hover {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
}

.modal-actions .btn:not(.primary):not(.danger) {
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
}

.modal-actions .btn:not(.primary):not(.danger):hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.modal-actions .btn.primary {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #ffffff !important;
}

input.input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.empty { padding: 32px; text-align: center; color: var(--muted); }
.estimate { background: var(--brand-soft); color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.checklist { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.checklist label { flex-direction: row; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 400; }
.checklist label:last-child { border-bottom: 0; }

.user-badge { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-role-pill { padding: 2px 8px; border-radius: 99px; font-weight: 600; font-size: 11px; text-transform: uppercase; }
.user-role-admin { background: var(--ok-soft); color: var(--ok); }
.user-role-accountant { background: var(--a-soft); color: var(--a); }
.user-role-marketing { background: var(--b-soft); color: var(--b); }

/* =========================================================================
   CLEAN, MODERN, PROFESSIONAL PRODUCTION LOGIN
   ========================================================================= */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background: #070b10 url('login-bg.jpg') no-repeat center center / cover;
  color: #f1f5f9;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(11, 15, 20, 0.70) 0%, rgba(7, 11, 16, 0.88) 100%);
  pointer-events: none;
}

.login-box {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  background: rgba(17, 23, 34, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 40px 34px;
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.75), 0 0 40px -10px rgba(16, 185, 129, 0.2);
}

.login-brand-header {
  text-align: center;
  margin-bottom: 26px;
}

.brand-logo-circle {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.45);
}

.wa-icon {
  width: 26px;
  height: 26px;
  color: #ffffff;
}

.login-brand-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.login-brand-header p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-wrap input {
  width: 100%;
  background: #090d13;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 38px 10px 14px;
  font-size: 14px;
  color: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.input-wrap input::placeholder {
  color: #475569;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.btn-toggle-pwd:hover {
  color: #cbd5e1;
}

.notice-pill {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
  text-align: center;
}

.btn-submit {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
  margin-top: 4px;
}

.btn-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 24px -4px rgba(16, 185, 129, 0.45);
}

.btn-submit:active {
  transform: scale(0.99);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-text {
  min-height: 0;
  margin: 0;
  color: #f87171;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.error-text:empty {
  display: none;
}

.error-text:not(:empty) {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.forgot-pwd-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: #10b981;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.forgot-pwd-link:hover {
  color: #34d399;
  text-decoration: underline;
}

.success-notice {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 13px;
  text-align: center;
  line-height: 1.4;
}

/* Template 3-dots menu */
.tpl .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}

.tpl-meta-info {
  min-width: 0;
  flex: 1;
}

.tpl-meta-info strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.tpl-more-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.tpl-more-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.tpl-dropdown {
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  min-width: 130px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tpl-dropdown.hidden {
  display: none !important;
}

.tpl-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.tpl-dropdown-item:hover {
  background: var(--surface-2);
}

.tpl-dropdown-item.danger {
  color: var(--err);
}

.tpl-dropdown-item.danger:hover {
  background: var(--err-soft);
}

/* =========================================================================
   MOCK DESIGN: Add Numbers Dropdown & Modals (Single + Bulk Wizard)
   ========================================================================= */

.add-numbers-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.btn-add-numbers {
  background: #0b7a5e;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(11, 122, 94, 0.28);
  letter-spacing: -0.01em;
  user-select: none;
}

.btn-add-numbers:hover {
  background: #09634d;
  box-shadow: 0 6px 18px rgba(11, 122, 94, 0.36);
  transform: translateY(-1px);
}

.btn-add-numbers:active {
  transform: translateY(0);
}

.btn-add-numbers .chevron-icon {
  transition: transform 0.2s ease;
}

.btn-add-numbers.open .chevron-icon {
  transform: rotate(180deg);
}

.add-numbers-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.add-numbers-menu.hidden {
  display: none !important;
}

.add-numbers-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease;
}

.add-numbers-item:hover {
  background: var(--surface-2);
}

.add-numbers-item .item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.add-numbers-item .item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.add-numbers-item .item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.add-numbers-item .item-desc {
  font-size: 12px;
  color: var(--muted);
}

/* Modal header with close X */
.modal-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header-row p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Mode toggle in Single Number Modal */
.mode-toggle-group {
  display: inline-flex;
  gap: 8px;
  margin-top: 4px;
}

.mode-toggle-btn {
  width: 58px;
  height: 38px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-toggle-btn:hover {
  border-color: #cbd5e1;
}

.mode-toggle-btn.active, .mode-toggle-btn.active-a {
  border: 1.5px solid #2563eb !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.mode-toggle-btn.active-b {
  border: 1.5px solid #7c3aed !important;
  background: #f5f3ff !important;
  color: #6d28d9 !important;
}

.mode-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
}

.mode-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}

.mode-badge-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-badge-circle.a {
  background: #2563eb;
}

.mode-badge-circle.b {
  background: #7c3aed;
}

.mode-info-col ul {
  margin: 4px 0 0;
  padding-left: 16px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.mode-info-col li {
  margin-bottom: 2px;
}

.phone-group select#singleCountryCode {
  width: 80px;
  flex-shrink: 0;
  padding: 10px 8px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}

/* Stepper Bar in Bulk Upload Wizard */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
}

.wizard-step.active {
  color: #0b7a5e;
  font-weight: 700;
}

.wizard-step.completed {
  color: #0b7a5e;
  font-weight: 600;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.wizard-step.active .step-num {
  background: #0b7a5e;
  border-color: #0b7a5e;
  color: #ffffff;
}

.wizard-step.completed .step-num {
  background: #ecfdf5;
  border-color: #0b7a5e;
  color: #0b7a5e;
}

.wizard-divider {
  width: 48px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 14px;
}

.wizard-divider.completed {
  background: #0b7a5e;
}

/* =========================================================================
   NEW 3-STEP BULK UPLOAD WIZARD (Panels 1, 2, 3, 4, 5)
   ========================================================================= */

dialog.wide {
  width: min(720px, calc(100vw - 32px)) !important;
}

/* Stepper (3 Steps: Upload File -> Review & Add -> Complete) */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
}

.wizard-step.active {
  color: #0b7a5e;
  font-weight: 700;
}

.wizard-step.completed {
  color: #0b7a5e;
  font-weight: 600;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.wizard-step.active .step-num {
  background: #0b7a5e;
  border-color: #0b7a5e;
  color: #ffffff;
}

.wizard-step.completed .step-num {
  background: #0b7a5e;
  border-color: #0b7a5e;
  color: #ffffff;
}

.wizard-divider {
  width: 54px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 16px;
}

.wizard-divider.completed {
  background: #0b7a5e;
}

/* Success / Alert Banner */
.bulk-alert-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bulk-alert-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #059669;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.bulk-alert-text strong {
  display: block;
  font-size: 13.5px;
  color: #065f46;
}

.bulk-alert-text span {
  font-size: 12.5px;
  color: #047857;
}

/* Panel 1: Center Hero Card */
.bulk-hero-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bulk-cloud-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.bulk-hero-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.bulk-hero-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.bulk-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.btn-dl-template {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-dl-template:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-upload-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: #0b7a5e;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(11, 122, 94, 0.25);
}

.btn-upload-file:hover {
  background: #09634d;
}

.bulk-supported-note {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Panel 2: Selected File Card */
.bulk-file-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bulk-file-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-file-icon {
  font-size: 26px;
  line-height: 1;
}

.bulk-file-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bulk-file-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.bulk-file-size {
  font-size: 12px;
  color: #64748b;
}

.btn-change-file {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-change-file:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Info Box */
.bulk-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}

.bulk-info-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.bulk-info-content strong {
  display: block;
  font-size: 13px;
  color: #1e3a8a;
  margin-bottom: 2px;
}

.bulk-info-content p {
  margin: 0;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.45;
}

/* Panel 3: Step 2 Validate & Review */
.bulk-validation-bar {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bulk-validation-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-report-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-report-dl:hover {
  background: #f0fdf4;
}

.bulk-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
}

.bulk-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bulk-table-wrap th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  z-index: 2;
}

.bulk-table-wrap td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.pill-status-valid {
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

.pill-status-invalid {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

.bulk-summary-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.badge-count-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-count-pill.valid {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-count-pill.invalid {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-count-pill.skipped {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Panel 4: Step 3 Complete Screen */
.bulk-complete-wrap {
  text-align: center;
  padding: 24px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.celebration-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  box-shadow: 0 10px 25px -4px rgba(16, 185, 129, 0.4);
  margin-bottom: 12px;
  position: relative;
}

.bulk-complete-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.bulk-complete-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0 0 24px;
}

.bulk-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 24px;
}

.bulk-metric-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.metric-circle-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 2px;
}

.metric-circle-icon.added {
  background: #dcfce7;
  color: #15803d;
}

.metric-circle-icon.skipped {
  background: #e2e8f0;
  color: #475569;
}

.metric-circle-icon.invalid {
  background: #fee2e2;
  color: #b91c1c;
}

.metric-num {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.metric-label {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.btn-view-numbers {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 8px;
  padding: 9px 24px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-view-numbers:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* =========================================================================
   PUBLISH PAGE REDESIGN
   ========================================================================= */

.publish-layout-v2 {
  display: grid;
  grid-template-columns: minmax(460px, 1.75fr) minmax(420px, 1.45fr) minmax(310px, 1.05fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}

@media (max-width: 1300px) {
  .publish-layout-v2 {
    grid-template-columns: 1fr 1fr;
  }
  .publish-col-preview {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .publish-layout-v2 {
    grid-template-columns: 1fr;
  }
}

.publish-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.publish-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.publish-card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-toggle-btns {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
}

.view-toggle-btn {
  border: none;
  background: transparent;
  padding: 5px 8px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Template Grid (Publish) */
.tpl-grid-pub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 14px;
  max-height: 670px;
  min-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.tpl-grid-pub::-webkit-scrollbar {
  width: 7px;
}

.tpl-grid-pub::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.tpl-grid-pub::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.tpl-grid-pub::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.tpl-grid-pub.list-mode {
  grid-template-columns: 1fr;
  gap: 8px;
}

.tpl-pub-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.tpl-pub-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tpl-pub-card.selected {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.tpl-pub-thumb {
  position: relative;
  height: 160px;
  background: #0f172a;
  overflow: hidden;
}

.tpl-pub-thumb .phone {
  height: 100%;
  width: 100%;
  border-radius: 0;
  max-height: 100%;
  font-size: 11px;
  padding: 8px;
}

.tpl-pub-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

.tpl-pub-footer {
  padding: 8px 10px;
  background: #ffffff;
}

.tpl-pub-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-pub-kind {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

/* List Mode for Templates */
.tpl-grid-pub.list-mode .tpl-pub-card {
  flex-direction: row;
  height: 64px;
}

.tpl-grid-pub.list-mode .tpl-pub-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.tpl-grid-pub.list-mode .tpl-pub-footer {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Numbers Table in Publish */
.pub-numbers-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.pub-numbers-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pub-filter-pill-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.12s;
}

.pub-filter-pill-btn:hover {
  background: var(--surface-2);
}

.pub-filter-pill-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(18, 140, 126, 0.35);
  font-weight: 600;
}

.pub-table-wrap {
  max-height: 380px;
  min-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.pub-table-wrap::-webkit-scrollbar {
  width: 7px;
}

.pub-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.pub-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.pub-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.pub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pub-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  z-index: 2;
}

.pub-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.pub-table tbody tr:last-child td {
  border-bottom: none;
}

.pub-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.pub-table tbody tr:hover {
  background: var(--surface-2);
}

.pub-table tbody tr.row-selected {
  background: rgba(18, 140, 126, 0.04);
}

/* Mode circular badge */
.mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.mode-badge.A {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.mode-badge.B {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
}

/* Variables Form */
.pub-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .pub-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Preview Column */
.publish-col-preview {
  display: flex;
  flex-direction: column;
}

.pub-post-card-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #000000;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  height: 340px;
  width: 100%;
  box-sizing: border-box;
}

.pub-post-media-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

.pub-post-media {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.pub-post-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

.pub-post-text-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #ffffff;
  text-align: center;
  box-sizing: border-box;
}

.pub-post-text-content {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.pub-post-empty {
  height: 340px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 20px;
}

.pub-preview-meta {
  padding: 2px 4px 8px;
}

.pub-preview-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.pub-preview-kind {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}

.pub-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(18, 140, 126, 0.07);
  border: 1px solid rgba(18, 140, 126, 0.2);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 14px;
  color: var(--text);
}

.pub-info-icon {
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-queue-campaign {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-queue-campaign:hover {
  background: #0d6e63;
}

/* User Role Cards in Users tab */
.user-role-card {
  flex: 1;
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.user-role-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-role-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ==================== QUEUE & HISTORY INLINE ACCORDION & SCROLL ==================== */
.queue-card-wrap {
  padding: 0;
  overflow: hidden;
}

.queue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.queue-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.queue-scroll-container {
  max-height: calc(100vh - 250px);
  min-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
  background: var(--surface);
}

.table-queue-campaigns {
  width: 100%;
  border-collapse: collapse;
}

.table-queue-campaigns thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 12px;
}

.table-queue-campaigns tbody tr.campaign-summary-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.table-queue-campaigns tbody tr.campaign-summary-row:hover {
  background: var(--surface-2);
}

.table-queue-campaigns tbody tr.campaign-summary-row.expanded,
.table-queue-campaigns tbody tr.campaign-summary-row.expanded td {
  background: #e6f4f1;
  border-bottom: none;
}

.table-queue-campaigns tbody tr.campaign-summary-row.expanded td:first-child {
  border-left: 4px solid var(--brand, #128c7e);
}

.table-queue-campaigns tbody tr.campaign-summary-row.expanded strong {
  color: #0b6858;
}

@media (prefers-color-scheme: dark) {
  .table-queue-campaigns tbody tr.campaign-summary-row.expanded,
  .table-queue-campaigns tbody tr.campaign-summary-row.expanded td {
    background: rgba(18, 140, 126, 0.18);
  }
  .table-queue-campaigns tbody tr.campaign-summary-row.expanded strong {
    color: #4ade80;
  }
}

.camp-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.camp-chevron-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.camp-chevron-btn.open {
  transform: rotate(90deg);
  color: var(--brand);
}

.campaign-expanded-cell {
  padding: 4px 14px 16px 14px !important;
  background: #f4f8f7;
  border-bottom: 2px solid #d7e7e3;
}

@media (prefers-color-scheme: dark) {
  .campaign-expanded-cell {
    background: rgba(18, 140, 126, 0.08);
    border-bottom: 2px solid rgba(18, 140, 126, 0.2);
  }
}

.campaign-nested-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.nested-posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.nested-posts-header h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.nested-posts-scroll {
  max-height: 270px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.nested-posts-scroll table {
  width: 100%;
  border-collapse: collapse;
}

.nested-posts-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 11px;
}

.nested-posts-scroll tbody td {
  padding: 8px 10px;
  font-size: 12.5px;
}




