@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255,255,255,.86);
  --surface2: #ffffff;
  --surface3: #f2f2f7;
  --border: rgba(0,0,0,.08);
  --border2: rgba(0,0,0,.13);
  --accent: #0071e3;
  --accent2: #005bbf;
  --accent-glow: rgba(0,113,227,.14);
  --green: #248a3d;
  --red: #d70015;
  --yellow: #b26a00;
  --text: #1d1d1f;
  --text2: #515154;
  --text3: #86868b;
  --radius: 8px;
  --radius-sm: 8px;
  --shadow: 0 18px 45px rgba(0,0,0,.08);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea { font: inherit; }
button { letter-spacing: 0; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: rgba(255,255,255,.72);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex;
  flex-direction: column;
  padding: 1.15rem .85rem;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.75rem;
  padding: .45rem .55rem;
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(180deg, #1b84ff, #006edb);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: inset 0 1px rgba(255,255,255,.32), 0 8px 20px rgba(0,113,227,.22);
}

.logo-text {
  font-size: .98rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
}
.logo-sub { font-size: .72rem; color: var(--text3); font-weight: 500; margin-top: .12rem; }

nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: .68rem;
  min-height: 40px;
  padding: .58rem .72rem;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: .9rem;
  font-weight: 520;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
  text-decoration: none;
}
.nav-item:hover { background: rgba(0,0,0,.045); color: var(--text); }
.nav-item.active {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 22px rgba(0,0,0,.05);
}
.nav-icon { font-size: 1rem; width: 19px; text-align: center; opacity: .9; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .08rem .42rem;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border); }

.main {
  margin-left: 248px;
  flex: 1;
  width: calc(100% - 248px);
  max-width: 980px;
  padding: 2.25rem 2rem 3rem;
}

.page { display: none; }
.page.active { display: block; animation: fadeUp .24s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 1.35rem; }
.page-header h1 { font-size: 2rem; line-height: 1.12; font-weight: 720; letter-spacing: 0; }
.page-header p  { color: var(--text2); font-size: .96rem; margin-top: .38rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 1px rgba(0,0,0,.03), 0 12px 34px rgba(0,0,0,.045);
}
.card-title {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: .85rem;
}

textarea, input[type="text"], input[type="password"], input[type="datetime-local"] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .96rem;
  padding: .78rem .9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea:focus, input:focus { outline: none; border-color: rgba(0,113,227,.72); box-shadow: 0 0 0 4px var(--accent-glow); }
textarea::placeholder, input::placeholder { color: #a1a1a6; }
textarea { resize: vertical; line-height: 1.45; }

.upload-zone {
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  margin-top: 1rem;
  background: #fbfbfd;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: #f5faff; box-shadow: 0 0 0 4px var(--accent-glow); }
.upload-zone-icon { font-size: 1.45rem; margin-bottom: .35rem; }
.upload-zone-text { font-size: .9rem; color: var(--text2); font-weight: 520; }
.upload-zone-hint { font-size: .78rem; color: var(--text3); margin-top: .22rem; }

.media-preview {
  margin-top: .85rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.media-preview img, .media-preview video {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
.media-preview-info {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  padding: .65rem .8rem;
  background: #fff;
  font-size: .84rem;
  color: var(--text2);
  border-top: 1px solid var(--border);
}
.btn-remove-media {
  background: transparent; border: none; color: var(--red);
  cursor: pointer; font-size: .82rem; padding: .25rem .5rem;
  border-radius: 7px; transition: background .16s ease;
}
.btn-remove-media:hover { background: rgba(215,0,21,.08); }

.destinations { display: flex; flex-direction: column; gap: .55rem; }
.checkbox-label {
  display: flex; align-items: center; gap: .72rem;
  min-height: 46px;
  padding: .72rem .85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  user-select: none;
  font-size: .92rem;
}
.checkbox-label:hover { border-color: rgba(0,113,227,.42); background: #fbfdff; box-shadow: 0 0 0 4px rgba(0,113,227,.07); }
.checkbox-label input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.dest-icon { font-size: 1rem; }
.dest-type { font-size: .74rem; color: var(--text3); margin-left: auto; text-transform: capitalize; }

.schedule-toggle {
  display: flex; align-items: center; gap: .72rem;
  padding: .76rem .85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: .75rem;
  user-select: none;
  color: var(--text2);
}
.schedule-toggle input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.schedule-picker { margin-top: .5rem; }

.btn-primary {
  width: 100%; background: var(--accent); border: none;
  border-radius: var(--radius-sm); color: #fff; cursor: pointer;
  font-size: .98rem; font-weight: 650; padding: .86rem 1rem;
  transition: background .16s ease, transform .12s ease, box-shadow .16s ease;
  box-shadow: 0 10px 24px rgba(0,113,227,.22);
  margin-bottom: 1rem;
}
.btn-primary:hover:not(:disabled) { background: var(--accent2); box-shadow: 0 12px 30px rgba(0,113,227,.28); }
.btn-primary:active:not(:disabled) { transform: scale(.99); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  background: #fff; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text); cursor: pointer;
  font-size: .86rem; font-weight: 560; padding: .5rem .9rem;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
  white-space: nowrap; text-decoration: none; display: inline-block;
}
.btn-secondary:hover { border-color: rgba(0,113,227,.5); background: #fbfdff; box-shadow: 0 0 0 4px rgba(0,113,227,.07); }

.btn-ghost {
  background: transparent; border: none; color: var(--text2);
  cursor: pointer; font-size: .84rem; padding: .38rem .65rem;
  border-radius: 7px; transition: background .15s ease, color .15s ease;
}
.btn-ghost:hover { background: rgba(0,0,0,.05); color: var(--text); }

.btn-danger {
  background: rgba(215,0,21,.07); border: 1px solid rgba(215,0,21,.18);
  border-radius: 7px; color: var(--red); cursor: pointer;
  font-size: .8rem; font-weight: 560; padding: .34rem .68rem;
  transition: background .15s ease, border-color .15s ease;
}
.btn-danger:hover { background: rgba(215,0,21,.11); border-color: rgba(215,0,21,.28); }

.status-card { animation: fadeUp .28s ease; }
#statusList { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
#statusList li {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem .85rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  font-size: .9rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#statusList li.success { border-color: rgba(36,138,61,.35); box-shadow: inset 3px 0 0 var(--green); }
#statusList li.error   { border-color: rgba(215,0,21,.35); box-shadow: inset 3px 0 0 var(--red); }
.status-name { flex: 1; font-weight: 560; }
.status-msg  { font-size: .78rem; color: var(--text2); }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sched-list { display: flex; flex-direction: column; gap: .75rem; }
.sched-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}
.sched-item.sent    { box-shadow: inset 3px 0 0 var(--green), 0 8px 24px rgba(0,0,0,.04); }
.sched-item.failed  { box-shadow: inset 3px 0 0 var(--red), 0 8px 24px rgba(0,0,0,.04); }
.sched-item.partial { box-shadow: inset 3px 0 0 var(--yellow), 0 8px 24px rgba(0,0,0,.04); }
.sched-item.pending { box-shadow: inset 3px 0 0 var(--accent), 0 8px 24px rgba(0,0,0,.04); }

.sched-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.sched-body   { font-size: .9rem; line-height: 1.45; color: var(--text2); margin-top: .55rem; white-space: pre-wrap; word-break: break-word; }
.sched-footer { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .7rem; font-size: .76rem; color: var(--text3); }
.sched-time   { font-size: .82rem; font-weight: 650; color: var(--text); }
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 650;
}
.badge-pending  { background: rgba(0,113,227,.11); color: var(--accent); }
.badge-sent     { background: rgba(36,138,61,.1); color: var(--green); }
.badge-failed   { background: rgba(215,0,21,.1); color: var(--red); }
.badge-partial  { background: rgba(178,106,0,.1); color: var(--yellow); }
.sched-dest-tags { display: flex; gap: .38rem; flex-wrap: wrap; }
.dest-tag {
  background: #f5f5f7; border: 1px solid var(--border);
  border-radius: 7px; padding: .18rem .5rem; font-size: .72rem; color: var(--text2);
}

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .84rem; color: var(--text2); margin-bottom: .42rem; font-weight: 560; }
.field input { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.field .hint { font-size: .76rem; color: var(--text3); margin-top: .38rem; line-height: 1.45; }
.section-label { font-size: .74rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; }

.channel-row { display: flex; gap: .55rem; align-items: center; margin-bottom: .55rem; }
.channel-row input { font-size: .88rem; padding: .6rem .75rem; }
.channel-row input:first-child { flex: 1.2; }
.channel-row input:last-of-type { flex: 1.8; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.wa-status { display: flex; align-items: center; gap: .52rem; font-size: .84rem; color: var(--text2); margin-bottom: 1rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-online  { background: var(--green); box-shadow: 0 0 0 4px rgba(36,138,61,.12); }
.dot-offline { background: var(--text3); }
.dot-pulse   { background: var(--yellow); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.42} }

.qr-box {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 1.35rem; background: #fff;
  border: 1px dashed var(--border2); border-radius: var(--radius-sm); margin-bottom: 1rem;
}
.qr-box img { border-radius: 8px; width: 220px; height: 220px; }
.qr-hint { font-size: .82rem; color: var(--text2); text-align: center; line-height: 1.55; }

.group-list { list-style: none; margin-top: .55rem; display: flex; flex-direction: column; gap: .4rem; max-height: 220px; overflow-y: auto; }
.group-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: .58rem .72rem; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .86rem; gap: .55rem;
}
.group-list li span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-jid { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .72rem; color: var(--text3); }
.btn-use {
  background: var(--accent); border: none; border-radius: 7px; color: #fff;
  cursor: pointer; font-size: .76rem; font-weight: 600; padding: .3rem .68rem;
  transition: background .16s ease; white-space: nowrap;
}
.btn-use:hover { background: var(--accent2); }
.btn-load-groups {
  background: #fff; border: 1px dashed rgba(0,113,227,.45);
  border-radius: var(--radius-sm); color: var(--accent); cursor: pointer;
  font-size: .84rem; font-weight: 560; padding: .58rem .9rem; width: 100%; margin-top: .55rem;
  transition: background .16s ease, box-shadow .16s ease;
}
.btn-load-groups:hover:not(:disabled) { background: #f5faff; box-shadow: 0 0 0 4px rgba(0,113,227,.07); }
.btn-load-groups:disabled { opacity: .5; cursor: not-allowed; }

.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  padding: .82rem 1rem; border-radius: 8px; font-size: .88rem; font-weight: 560;
  opacity: 0; transform: translateY(12px);
  transition: opacity .24s ease, transform .24s ease; pointer-events: none; z-index: 200;
  max-width: 340px;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { color: var(--green); }
.toast.error   { color: var(--red); }
.toast.info    { color: var(--accent); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--text3); }
.empty-icon { font-size: 2.2rem; margin-bottom: .75rem; opacity: .75; }
.empty p { font-size: .92rem; }

hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }

.sched-actions { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; flex-wrap: wrap; }
.btn-small { font-size: .8rem; padding: .34rem .68rem; }
.sched-edit-form { display: flex; flex-direction: column; gap: .78rem; }
.edit-label { font-size: .74rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--text3); }
.edit-destinations { display: flex; flex-direction: column; gap: .48rem; max-height: 220px; overflow-y: auto; padding-right: .25rem; }
.edit-destination { padding: .65rem .8rem; }
.edit-note { color: var(--text3); font-size: .8rem; line-height: 1.4; }
.edit-actions { display: flex; gap: .6rem; align-items: center; justify-content: flex-end; margin-top: .25rem; }
.btn-inline { width: auto; margin-bottom: 0; padding-left: 1rem; padding-right: 1rem; }

.edit-media-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem .85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.edit-media-title { display: block; color: var(--text3); font-size: .72rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; margin-bottom: .15rem; }
.edit-media-name { color: var(--text2); font-size: .88rem; }
.edit-remove-media { display: flex; align-items: center; gap: .4rem; color: var(--red); font-size: .82rem; cursor: pointer; white-space: nowrap; }
.edit-remove-media input { accent-color: var(--red); }
.edit-media-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: .9rem;
  background: #fff;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: .86rem;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.edit-media-picker:hover { border-color: var(--accent); background: #f5faff; color: var(--text); box-shadow: 0 0 0 4px rgba(0,113,227,.07); }
.edit-media-picker input { display: none; }
.edit-media-preview {
  padding: .65rem .8rem;
  background: #f5faff;
  border: 1px solid rgba(0,113,227,.2);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: .82rem;
  word-break: break-word;
}

.bulk-scheduler {
  margin-top: 1.15rem;
}

.bulk-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.bulk-head h2 {
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: .25rem;
}

.bulk-head p:not(.card-title) {
  color: var(--text2);
  font-size: .9rem;
  line-height: 1.45;
}

.bulk-date-field label,
.bulk-grid label span,
.bulk-message-field span {
  display: block;
  color: var(--text3);
  font-size: .76rem;
  font-weight: 700;
  margin-bottom: .38rem;
}

.bulk-date-field input,
.bulk-grid input {
  width: 100%;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin-top: .85rem;
}

.bulk-status {
  color: var(--text3);
  font-size: .84rem;
  font-weight: 560;
}

.bulk-list {
  display: grid;
  gap: .85rem;
  margin-top: 1rem;
}

.bulk-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .95rem;
  box-shadow: 0 8px 22px rgba(0,0,0,.035);
}

.bulk-item.bulk-ok {
  border-color: rgba(36,138,61,.35);
  box-shadow: inset 3px 0 0 var(--green), 0 8px 22px rgba(0,0,0,.035);
}

.bulk-item.bulk-error {
  border-color: rgba(215,0,21,.32);
  box-shadow: inset 3px 0 0 var(--red), 0 8px 22px rgba(0,0,0,.035);
}

.bulk-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .8rem;
}

.bulk-check {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  cursor: pointer;
}

.bulk-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.bulk-check span {
  color: var(--text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-card-status {
  color: var(--text3);
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}

.bulk-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: .8rem;
  margin-bottom: .8rem;
}

.bulk-message-field {
  display: block;
}

.bulk-message {
  min-height: 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .86rem;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    bottom: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: .75rem;
  }
  .logo { margin-bottom: .7rem; }
  nav { flex-direction: row; overflow-x: auto; padding-bottom: .15rem; }
  .sidebar-footer { border-top: none; padding-top: .45rem; }
  .main { margin-left: 0; width: 100%; padding: 1.35rem 1rem 2rem; }
  .page-header h1 { font-size: 1.65rem; }
  .card { padding: 1rem; }
  .sched-header, .edit-actions, .edit-media-current { flex-direction: column; align-items: stretch; }
  .sched-actions, .edit-actions .btn-secondary, .btn-inline { width: 100%; }
  .bulk-head, .bulk-grid { grid-template-columns: 1fr; }
  .bulk-actions .btn-secondary, .bulk-actions .btn-primary { width: 100%; }
  .bulk-item-top { align-items: flex-start; flex-direction: column; }
  .bulk-check span { white-space: normal; }
  .channel-row { flex-direction: column; align-items: stretch; }
  .toast { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
}

/* Sidebar polish */
.sidebar {
  width: 272px;
  padding: 1.4rem 1rem 1rem;
  background: rgba(248,248,250,.82);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.7);
}

.logo {
  gap: .85rem;
  margin-bottom: 2.1rem;
  padding: .35rem .45rem .9rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.15rem;
  box-shadow: inset 0 1px rgba(255,255,255,.36), 0 14px 30px rgba(0,113,227,.2);
}

.logo-text {
  font-size: 1.08rem;
  font-weight: 720;
  letter-spacing: 0;
}

.logo-sub {
  font-size: .78rem;
  color: #7b7b80;
  font-weight: 520;
}

nav {
  gap: .38rem;
}

.nav-item {
  min-height: 44px;
  gap: .8rem;
  padding: .68rem .72rem;
  border-radius: 8px;
  color: #5f6067;
  font-size: .95rem;
  font-weight: 620;
}

.nav-item:hover {
  background: rgba(0,0,0,.045);
  color: #1d1d1f;
}

.nav-item.active {
  background: rgba(0,113,227,.1);
  border-color: transparent;
  color: #0057b8;
  box-shadow: none;
}

.nav-item.active .nav-icon {
  opacity: 1;
  filter: saturate(1.15);
}

.nav-icon {
  width: 22px;
  font-size: 1.05rem;
  opacity: .62;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid rgba(0,0,0,.08);
}

.sidebar-footer .nav-item {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: #5f6067;
}

.sidebar-footer .nav-item:hover {
  background: rgba(0,0,0,.045);
  color: #1d1d1f;
}

.main {
  margin-left: 272px;
  width: calc(100% - 272px);
}

@media (max-width: 760px) {
  .sidebar {
    width: 100%;
    padding: .8rem .85rem;
  }

  .logo {
    margin-bottom: .65rem;
    padding: .15rem .25rem .65rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .nav-item {
    min-height: 40px;
    white-space: nowrap;
  }

  .main {
    margin-left: 0;
    width: 100%;
  }
}

/* Professional sidebar icons */
.logo-icon {
  position: relative;
}

.app-mark,
.nav-icon {
  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.app-mark {
  width: 24px;
  height: 24px;
  color: #fff;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 11.5 20 4l-7.5 16-1.8-6.7L4 11.5Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m20 4-9.3 9.3' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 11.5 20 4l-7.5 16-1.8-6.7L4 11.5Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m20 4-9.3 9.3' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.nav-icon {
  width: 21px;
  height: 21px;
  color: currentColor;
  opacity: .72;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  opacity: 1;
}

.icon-send {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16v14H4V5Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m4 7 8 6 8-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16v14H4V5Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m4 7 8 6 8-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-clock {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='8' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 8v4l3 2' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='8' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 8v4l3 2' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-history {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16M4 12h16M4 19h16' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M8 5v14' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16M4 12h16M4 19h16' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M8 5v14' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.icon-chart {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 19V5' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M5 19h14' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M8 16v-5M12 16V8M16 16v-3' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 19V5' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M5 19h14' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M8 16v-5M12 16V8M16 16v-3' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.icon-settings {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 15.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4Z' stroke='black' stroke-width='2'/%3E%3Cpath d='M18.4 13.6c.1-.5.1-1.1 0-1.6l2-1.5-2-3.5-2.4 1a7 7 0 0 0-1.4-.8L14.2 4h-4.4l-.4 3.2c-.5.2-1 .5-1.4.8L5.6 7l-2 3.5 2 1.5a6.8 6.8 0 0 0 0 1.6l-2 1.5 2 3.5 2.4-1c.4.3.9.6 1.4.8l.4 3.2h4.4l.4-3.2c.5-.2 1-.5 1.4-.8l2.4 1 2-3.5-2-1.5Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 15.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4Z' stroke='black' stroke-width='2'/%3E%3Cpath d='M18.4 13.6c.1-.5.1-1.1 0-1.6l2-1.5-2-3.5-2.4 1a7 7 0 0 0-1.4-.8L14.2 4h-4.4l-.4 3.2c-.5.2-1 .5-1.4.8L5.6 7l-2 3.5 2 1.5a6.8 6.8 0 0 0 0 1.6l-2 1.5 2 3.5 2.4-1c.4.3.9.6 1.4.8l.4 3.2h4.4l.4-3.2c.5-.2 1-.5 1.4-.8l2.4 1 2-3.5-2-1.5Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.collector-status {
  color: var(--text3);
  font-size: .82rem;
  white-space: nowrap;
}
.collector-status.error { color: var(--red); }

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.preview-header .card-title { margin-bottom: .75rem; }
#previewMeta {
  color: var(--text3);
  font-size: .78rem;
  margin-bottom: .75rem;
}
.platform-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.platform-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem;
  min-width: 0;
}
.platform-preview-title {
  color: var(--text3);
  font-size: .72rem;
  font-weight: 700;
  margin-bottom: .65rem;
  text-transform: uppercase;
}
.platform-bubble {
  min-height: 86px;
  max-height: 220px;
  overflow: auto;
  padding: .78rem .85rem;
  border-radius: 8px;
  font-size: .92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.whatsapp-preview {
  background: #e8f6e9;
  color: #18251b;
}
.telegram-preview {
  background: #eef6ff;
  color: #172334;
}
.platform-bubble code {
  background: rgba(0,0,0,.08);
  padding: .08rem .25rem;
  border-radius: 4px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .95rem;
}
.history-main { min-width: 0; flex: 1; }
.history-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .45rem;
}
.history-platform {
  font-size: .68rem;
  font-weight: 800;
  padding: .18rem .5rem;
  border-radius: 99px;
}
.history-platform.telegram { background: rgba(41,182,246,.15); color: #1679b4; }
.history-platform.whatsapp { background: rgba(34,197,94,.15); color: var(--green); }
.history-destination {
  font-size: .88rem;
  font-weight: 650;
  color: var(--text);
}
.history-date {
  color: var(--text3);
  font-size: .78rem;
  margin-left: auto;
}
.history-message {
  color: var(--text2);
  font-size: .88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  margin-bottom: .65rem;
}
.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.history-actions {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}
.error-tag { color: var(--red); border-color: rgba(215,0,21,.22); }
.settings-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .platform-preview-grid { grid-template-columns: 1fr; }
  .history-item { flex-direction: column; }
  .history-date { margin-left: 0; }
}


/* Apostador PRO Apple-inspired refresh */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface2: #ffffff;
  --surface3: #f6f6f8;
  --border: rgba(29,29,31,.08);
  --border2: rgba(29,29,31,.15);
  --accent: #34c77b;
  --accent2: #25a966;
  --accent-glow: rgba(52,199,123,.18);
  --green: #2fbf71;
  --text: #0d0d0f;
  --text2: #696a70;
  --text3: #9b9ca1;
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 18px 45px rgba(20,20,25,.07);
}

body {
  background: #fbfbfd;
}

.layout {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  height: auto;
  min-height: 76px;
  padding: 0 28px;
  background: rgba(255,255,255,.86);
  border-right: 0;
  border-bottom: 1px solid rgba(29,29,31,.07);
  box-shadow: none;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-direction: row;
  align-items: center;
  gap: 30px;
}

.logo {
  margin: 0;
  padding: 0;
  border-bottom: 0;
  min-width: 255px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #101012;
  box-shadow: 0 10px 25px rgba(16,16,18,.12);
}

.logo-text {
  font-size: 1.08rem;
  font-weight: 760;
  letter-spacing: 0;
  white-space: nowrap;
}

.logo-text span {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 8px;
  margin-left: 5px;
  border-radius: 999px;
  background: #f2b134;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  vertical-align: 2px;
}

.logo-sub {
  display: none;
}

.sidebar nav {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  justify-content: center;
  gap: 16px;
  overflow-x: auto;
  padding: 0;
}

.sidebar-footer {
  margin: 0;
  padding: 0;
  border-top: 0;
  flex: 0 0 auto;
}

.nav-item,
.sidebar-footer .nav-item {
  width: auto;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #9a9ba1;
  font-size: .95rem;
  font-weight: 670;
  gap: 9px;
  white-space: nowrap;
}

.nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: #f5f5f7;
  color: #111113;
}

.nav-item.active {
  background: #fff;
  border-color: rgba(29,29,31,.09);
  color: #111113;
  box-shadow: 0 2px 8px rgba(20,20,25,.06);
}

.nav-item.active .nav-icon {
  color: #111113;
}

.main {
  margin-left: 0;
  width: 100%;
  max-width: none;
  padding: 48px 28px 64px;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 22px;
}

.page-header h1 {
  font-size: clamp(2.1rem, 3vw, 3.5rem);
  font-weight: 780;
  line-height: 1.04;
  letter-spacing: 0;
}

.page-header p {
  font-size: 1.05rem;
  color: #77787d;
  margin-top: 8px;
}

.hello-text {
  color: #7b7c82;
  font-weight: 560;
  margin-bottom: 4px;
}

.hello-text::after {
  content: 'danielgsz';
  color: #111113;
  font-weight: 760;
  margin-left: 4px;
}

.pro-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 94px;
  padding: 18px 22px;
  margin: 0 0 28px;
  background: #fff;
  border: 1px solid rgba(29,29,31,.09);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(20,20,25,.03);
}

.banner-icon {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: #58d06f;
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.banner-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.banner-copy strong {
  font-size: 1.08rem;
  font-weight: 760;
}

.banner-copy span,
.banner-metric small,
.stat-card small {
  color: #85868c;
}

.banner-metric {
  text-align: right;
}

.banner-metric b {
  display: block;
  color: #32b76c;
  font-size: 1.05rem;
  margin-top: 2px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 18px;
  padding: 22px;
  min-height: 124px;
  box-shadow: 0 1px 2px rgba(20,20,25,.03);
}

.stat-card span,
.card-title,
.platform-preview-title,
.edit-label,
.section-label {
  color: #8c8d92;
  font-size: .74rem;
  font-weight: 780;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin: 14px 0 6px;
  font-size: 1.35rem;
  font-weight: 780;
  letter-spacing: 0;
}

.composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 18px;
  align-items: start;
}

.composer-shell > .card,
.status-card {
  margin-bottom: 0;
}

.composer-shell > .card:nth-child(1) {
  grid-row: span 2;
}

.composer-shell > .card:nth-child(2) {
  grid-row: span 2;
}

.composer-shell > .card:nth-child(3),
.composer-shell > .card:nth-child(4),
.composer-shell > .btn-primary {
  grid-column: 1 / -1;
}

.card {
  background: #fff;
  border: 1px solid rgba(29,29,31,.09);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(20,20,25,.03);
}

textarea,
input[type="text"],
input[type="password"],
input[type="datetime-local"] {
  background: #f7f7f9;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 1rem;
}

textarea {
  min-height: 210px;
}

textarea:focus,
input:focus {
  background: #fff;
  border-color: rgba(52,199,123,.55);
  box-shadow: 0 0 0 5px rgba(52,199,123,.14);
}

.upload-zone,
.edit-media-picker,
.qr-box {
  background: #fbfbfd;
  border-color: rgba(29,29,31,.13);
  border-radius: 18px;
}

.upload-zone:hover,
.upload-zone.drag,
.edit-media-picker:hover,
.btn-load-groups:hover:not(:disabled) {
  border-color: rgba(52,199,123,.55);
  background: #f5fff9;
  box-shadow: 0 0 0 5px rgba(52,199,123,.12);
}

.checkbox-label,
.schedule-toggle,
.platform-preview,
.sched-item,
.history-item,
#statusList li,
.group-list li,
.edit-media-current {
  background: #fff;
  border-color: rgba(29,29,31,.09);
  border-radius: 16px;
}

.checkbox-label:hover {
  border-color: rgba(52,199,123,.46);
  background: #fbfffd;
  box-shadow: 0 0 0 5px rgba(52,199,123,.1);
}

.btn-primary {
  justify-self: end;
  width: auto;
  min-width: 210px;
  border-radius: 999px;
  padding: 15px 26px;
  background: #55b97a;
  box-shadow: 0 12px 28px rgba(47,160,93,.22);
}

.btn-primary:hover:not(:disabled),
.btn-use:hover {
  background: #45a96b;
  box-shadow: 0 14px 34px rgba(47,160,93,.26);
}

.btn-secondary,
.btn-load-groups,
.btn-use {
  border-radius: 999px;
}

.platform-preview-grid {
  gap: 14px;
}

.platform-bubble {
  border-radius: 16px;
  min-height: 140px;
  background: #f5f5f7;
}

.whatsapp-preview {
  background: #effaf3;
}

.telegram-preview {
  background: #f1f7ff;
}

.toast {
  border-radius: 18px;
}

@media (max-width: 980px) {
  .sidebar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
  }
  .logo {
    min-width: auto;
    width: 100%;
  }
  .sidebar nav {
    justify-content: flex-start;
    width: calc(100% - 150px);
  }
  .sidebar-footer {
    margin-left: auto;
  }
  .composer-shell,
  .quick-stats {
    grid-template-columns: 1fr;
  }
  .composer-shell > .card:nth-child(1),
  .composer-shell > .card:nth-child(2),
  .composer-shell > .card:nth-child(3),
  .composer-shell > .card:nth-child(4),
  .composer-shell > .btn-primary {
    grid-column: auto;
    grid-row: auto;
  }
  .btn-primary {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    padding: 12px 14px;
  }
  .sidebar nav {
    width: 100%;
  }
  .sidebar-footer {
    width: 100%;
  }
  .main {
    padding: 28px 16px 42px;
  }
  .pro-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .banner-metric {
    width: 100%;
    text-align: left;
  }
  .page-header h1 {
    font-size: 2.15rem;
  }
  .platform-preview-grid {
    grid-template-columns: 1fr;
  }
}

/* Apostador PRO system icon from provided mark */
.app-mark {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M11.15 2.25C6.42 2.66 2.66 6.42 2.25 11.15C6.74 10.94 10.94 6.74 11.15 2.25Z'/%3E%3Cpath fill='black' d='M12.85 2.25C13.06 6.74 17.26 10.94 21.75 11.15C21.34 6.42 17.58 2.66 12.85 2.25Z'/%3E%3Cpath fill='black' d='M2.25 12.85C2.66 17.58 6.42 21.34 11.15 21.75C10.94 17.26 6.74 13.06 2.25 12.85Z'/%3E%3Cpath fill='black' d='M12.85 21.75C17.58 21.34 21.34 17.58 21.75 12.85C17.26 13.06 13.06 17.26 12.85 21.75Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M11.15 2.25C6.42 2.66 2.66 6.42 2.25 11.15C6.74 10.94 10.94 6.74 11.15 2.25Z'/%3E%3Cpath fill='black' d='M12.85 2.25C13.06 6.74 17.26 10.94 21.75 11.15C21.34 6.42 17.58 2.66 12.85 2.25Z'/%3E%3Cpath fill='black' d='M2.25 12.85C2.66 17.58 6.42 21.34 11.15 21.75C10.94 17.26 6.74 13.06 2.25 12.85Z'/%3E%3Cpath fill='black' d='M12.85 21.75C17.58 21.34 21.34 17.58 21.75 12.85C17.26 13.06 13.06 17.26 12.85 21.75Z'/%3E%3C/svg%3E");
}

/* Minimal polish pass */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface2: #ffffff;
  --surface3: #f7f7f8;
  --border: rgba(17, 17, 19, .075);
  --border2: rgba(17, 17, 19, .13);
  --accent: #57c77b;
  --accent2: #3fb467;
  --text: #121214;
  --text2: #6f7075;
  --text3: #a0a1a7;
  --shadow: 0 1px 2px rgba(17,17,19,.03), 0 10px 30px rgba(17,17,19,.035);
}

body { background: #fafafa; }

.sidebar {
  min-height: 72px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(17,17,19,.065);
}

.logo { min-width: 250px; gap: 14px; }
.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #fff;
  color: #111113;
  border: 1px solid rgba(17,17,19,.08);
  box-shadow: 0 1px 2px rgba(17,17,19,.04);
}
.logo-icon .app-mark { width: 25px; height: 25px; color: #111113; }
.banner-icon .app-mark { color: #fff; }

.logo-text { font-size: 1.02rem; font-weight: 760; }
.logo-text span {
  height: 18px;
  padding: 0 8px;
  background: #efb33c;
  box-shadow: none;
}

.nav-item,
.sidebar-footer .nav-item {
  min-height: 42px;
  padding: 0 16px;
  color: #a0a1a7;
  font-weight: 680;
}
.nav-item:hover,
.sidebar-footer .nav-item:hover { background: #f6f6f7; }
.nav-item.active {
  background: #fff;
  border-color: rgba(17,17,19,.08);
  box-shadow: 0 1px 2px rgba(17,17,19,.04);
}

.main { padding-top: 44px; }
.page { max-width: 1380px; }
.page-header h1 { font-weight: 780; }
.page-header p { color: #7c7d82; }

.pro-banner,
.stat-card,
.card,
.platform-preview,
.checkbox-label,
.schedule-toggle,
.sched-item,
.history-item,
#statusList li,
.group-list li,
.edit-media-current {
  box-shadow: 0 1px 2px rgba(17,17,19,.03);
  border-color: rgba(17,17,19,.075);
}

.pro-banner { min-height: 86px; }
.banner-icon { background: #57c77b; box-shadow: none; }
.stat-card { min-height: 112px; }

.btn-primary {
  background: #57b879;
  box-shadow: none;
}
.btn-primary:hover:not(:disabled) {
  background: #43a967;
  box-shadow: none;
}

.upload-zone,
.edit-media-picker,
.qr-box,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime-local"] {
  background: #f7f7f8;
}


/* IA Atendimento */
.icon-ai::before { content: "AI"; font-size: .72rem; font-weight: 800; letter-spacing: 0; }

input[type="number"], input[type="time"] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .96rem;
  padding: .78rem .9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input[type="number"]:focus, input[type="time"]:focus { outline: none; border-color: rgba(0,113,227,.72); box-shadow: 0 0 0 4px var(--accent-glow); }

.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 1rem;
  align-items: start;
}

.ai-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
}
.ai-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ai-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d2d2d7;
  cursor: pointer;
  transition: background .18s ease;
}
.ai-switch span::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.ai-switch input:checked + span { background: var(--accent); }
.ai-switch input:checked + span::after { transform: translateX(20px); }

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .78rem;
  color: var(--text2);
  font-weight: 650;
  margin-bottom: .4rem;
}
.field-row-2, .field-row-3 {
  display: grid;
  gap: .85rem;
}
.field-row-2 { grid-template-columns: minmax(0, 1fr) 160px; }
.field-row-3 { grid-template-columns: minmax(0, 1fr) 120px 120px; }

.prompt-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 1rem;
}
.prompt-summary strong, .prompt-summary span { display: block; }
.prompt-summary strong { font-size: .9rem; color: var(--text); }
.prompt-summary span { font-size: .8rem; color: var(--text3); margin-top: .15rem; }

.card-subsection {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfbfd;
  padding: .85rem;
  margin-bottom: 1rem;
}
.ai-days {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .2rem;
}
.ai-days label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: .78rem;
  color: var(--text2);
  cursor: pointer;
}
.ai-days input { accent-color: var(--accent); }

.ai-conversations-card { position: sticky; top: 1rem; }
.ai-conversations-list { display: flex; flex-direction: column; gap: .85rem; }
.ai-conversation {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: .9rem;
}
.ai-conversation.needs-human {
  border-color: rgba(215,0,21,.35);
  box-shadow: 0 0 0 4px rgba(215,0,21,.06);
}
.ai-conv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .8rem;
  margin-bottom: .65rem;
}
.ai-conv-head strong { display: block; font-size: .92rem; color: var(--text); }
.ai-conv-head small { display: block; font-size: .72rem; color: var(--text3); margin-top: .14rem; word-break: break-all; }
.ai-conv-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.ai-alert {
  background: rgba(215,0,21,.08);
  color: var(--red);
  border-radius: 7px;
  padding: .55rem .65rem;
  font-size: .8rem;
  margin-bottom: .65rem;
}
.ai-thread {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  max-height: 320px;
  overflow: auto;
}
.ai-msg {
  border-radius: 8px;
  padding: .55rem .65rem;
  background: var(--surface3);
}
.ai-msg.assistant { background: #eef6ff; }
.ai-msg span {
  display: block;
  font-size: .68rem;
  font-weight: 750;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: .18rem;
}
.ai-msg p {
  font-size: .84rem;
  line-height: 1.4;
  color: var(--text2);
  white-space: pre-wrap;
}

.ai-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.ai-modal-backdrop[hidden] { display: none; }
.ai-modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
  padding: 1.2rem;
}
.ai-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ai-modal h2 { font-size: 1.15rem; line-height: 1.2; }
.ai-modal p { color: var(--text2); font-size: .86rem; margin-top: .25rem; }
.ai-modal textarea { min-height: 360px; }
.ai-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1rem;
}
.btn-inline { width: auto; margin-bottom: 0; }

@media (max-width: 900px) {
  .ai-grid, .field-row-2, .field-row-3 { grid-template-columns: 1fr; }
  .ai-conversations-card { position: static; }
  .ai-conv-head { flex-direction: column; }
  .ai-conv-actions { justify-content: flex-start; }
}

/* IA Atendimento refinado */
.icon-ai {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Crect x='7' y='7' width='10' height='10' rx='3' stroke='black' stroke-width='2'/%3E%3Cpath d='M10 13.5 11.2 10h1.6l1.2 3.5M10.4 12.4h3.2' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Crect x='7' y='7' width='10' height='10' rx='3' stroke='black' stroke-width='2'/%3E%3Cpath d='M10 13.5 11.2 10h1.6l1.2 3.5M10.4 12.4h3.2' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.icon-ai::before { content: none; }

.ai-page-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ai-title-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #111113;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  position: relative;
  flex: 0 0 auto;
}
.ai-title-icon::before {
  content: "";
  position: absolute;
  inset: 14px;
  background: #fff;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='5' y='5' width='14' height='14' rx='4' stroke='black' stroke-width='2'/%3E%3Cpath d='M9 14.5 10.5 9h3l1.5 5.5M9.7 12.5h4.6' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='5' y='5' width='14' height='14' rx='4' stroke='black' stroke-width='2'/%3E%3Cpath d='M9 14.5 10.5 9h3l1.5 5.5M9.7 12.5h4.6' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.ai-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.ai-status-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 72px;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 1px rgba(0,0,0,.03), 0 10px 26px rgba(0,0,0,.04);
}
.ai-status-card strong,
.ai-status-card small { display: block; }
.ai-status-card strong { font-size: .9rem; color: var(--text); }
.ai-status-card small { font-size: .78rem; color: var(--text3); margin-top: .16rem; }
.ai-status-card .ai-test-btn { margin-left: auto; white-space: nowrap; }
.ai-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a1a1a6;
  box-shadow: 0 0 0 4px rgba(161,161,166,.12);
  flex: 0 0 auto;
}
.ai-status-card.ok .ai-status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(36,138,61,.12); }
.ai-status-card.warn .ai-status-dot { background: var(--yellow); box-shadow: 0 0 0 4px rgba(178,106,0,.12); }
.ai-status-card.bad .ai-status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(215,0,21,.1); }

select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .96rem;
  padding: .78rem .9rem;
  cursor: pointer;
}
select:focus { outline: none; border-color: rgba(0,113,227,.72); box-shadow: 0 0 0 4px var(--accent-glow); }

@media (max-width: 900px) {
  .ai-status-grid { grid-template-columns: 1fr; }
  .ai-page-title { align-items: flex-start; }
}

/* CRM Lovable */
.ai-crm-card { margin-top: 1rem; }
.crm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}
.crm-stats div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem;
}
.crm-stats span,
.crm-stats strong { display: block; }
.crm-stats span { color: var(--text3); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.crm-stats strong { color: var(--text); font-size: 1.1rem; margin-top: .2rem; }
.compact-toggle { min-height: 48px; margin-bottom: 0; }
.crm-message-versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.crm-message-versions textarea {
  min-height: 82px;
  resize: vertical;
}
.crm-message-versions textarea:first-child {
  grid-column: 1 / -1;
}
.crm-start-field { display: flex; flex-direction: column; }
.crm-import-form .btn-primary { margin-top: .15rem; }
.crm-queue-list { display: flex; flex-direction: column; gap: .55rem; margin-top: 1rem; }
.crm-queue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.crm-queue-item strong { display: block; font-size: .9rem; color: var(--text); }
.crm-queue-item small { display: block; font-size: .73rem; color: var(--text3); margin-top: .12rem; }
.crm-queue-item p { color: var(--text2); font-size: .8rem; line-height: 1.35; margin-top: .45rem; white-space: pre-wrap; }
.crm-queue-item > span {
  border-radius: 999px;
  padding: .25rem .55rem;
  font-size: .72rem;
  font-weight: 700;
  background: var(--surface3);
  color: var(--text2);
  white-space: nowrap;
}
.crm-queue-item.sent > span { background: rgba(36,138,61,.1); color: var(--green); }
.crm-queue-item.failed > span { background: rgba(215,0,21,.08); color: var(--red); }
.crm-queue-item.sending > span { background: rgba(178,106,0,.1); color: var(--yellow); }
.crm-error { color: var(--red) !important; }
.compact-empty { padding: 1rem; }

@media (max-width: 900px) {
  .crm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-queue-item { flex-direction: column; }
}

/* Visual review 20260603: minimal dashboard layer */
:root {
  --bg: #f6f7f8;
  --surface: #fff;
  --surface2: #fff;
  --surface3: #f4f5f6;
  --border: rgba(18,18,20,.075);
  --border2: rgba(18,18,20,.12);
  --accent: #111113;
  --accent2: #2b2b2f;
  --accent-glow: rgba(17,17,19,.08);
  --green: #2f9d62;
  --red: #d92d20;
  --yellow: #b7791f;
  --text: #111113;
  --text2: #62636a;
  --text3: #9b9ca3;
  --radius: 8px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(18,18,20,.04), 0 10px 28px rgba(18,18,20,.035);
}

html { background: var(--bg); }
body {
  background: linear-gradient(180deg, #fbfbfc 0, #f6f7f8 260px, #f6f7f8 100%);
  color: var(--text);
}

.layout { display: block; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  left: auto;
  bottom: auto;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 12px 28px;
  background: rgba(255,255,255,.86);
  border-right: 0;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: none;
}
.logo {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 12px;
}
.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.logo-text { font-size: 1rem; font-weight: 760; }
.logo-sub { display: none; }
.logo-text span {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e9b949;
  color: #fff;
  font-size: .66rem;
  vertical-align: 2px;
}
.sidebar nav {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
}
.sidebar-footer {
  margin: 0;
  padding: 0;
  border: 0;
}
.nav-item,
.sidebar-footer .nav-item {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: #8d8e95;
  font-size: .9rem;
  font-weight: 680;
  white-space: nowrap;
  gap: 9px;
}
.nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: #f3f4f5;
  color: var(--text);
}
.nav-item.active {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.nav-icon { width: 19px; height: 19px; }
.nav-badge { background: var(--red); }

.main {
  margin-left: 0;
  width: 100%;
  max-width: 1500px;
  padding: 36px 34px 56px;
}
.page { max-width: none; }
.page-header { margin-bottom: 22px; }
.page-header h1 {
  font-size: clamp(2rem, 3vw, 3.15rem);
  line-height: 1.04;
  font-weight: 800;
}
.page-header p {
  max-width: 760px;
  color: var(--text2);
  font-size: 1rem;
}

.card,
.pro-banner,
.stat-card,
.ai-status-card,
.ai-conversation,
.crm-stats div,
.crm-queue-item,
.platform-preview,
.checkbox-label,
.schedule-toggle,
.sched-item,
.history-item,
#statusList li,
.group-list li,
.edit-media-current,
.prompt-summary,
.card-subsection {
  border-radius: 8px;
  border-color: var(--border);
  background: #fff;
  box-shadow: var(--shadow);
}
.card {
  padding: 22px;
  margin-bottom: 16px;
}
.card-title,
.section-label {
  color: #8b8c93;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.hint { color: var(--text3); }

textarea,
input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="number"],
input[type="time"],
select {
  background: #f5f6f7;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 48px;
  padding: 13px 14px;
  color: var(--text);
  box-shadow: none;
}
textarea { min-height: 140px; }
textarea:focus,
input:focus,
select:focus {
  background: #fff;
  border-color: rgba(17,17,19,.28);
  box-shadow: 0 0 0 4px rgba(17,17,19,.06);
}

.btn-primary,
.btn-secondary,
.btn-load-groups,
.btn-use,
.btn-danger,
.btn-edit,
.btn-download,
.btn-telegram {
  min-height: 38px;
  border-radius: 999px;
  box-shadow: none;
}
.btn-primary {
  background: var(--text);
  min-width: 180px;
  padding: 12px 22px;
}
.btn-primary:hover:not(:disabled) { background: #2b2b2f; }
.btn-secondary,
.btn-load-groups,
.btn-use {
  background: #fff;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-secondary:hover,
.btn-load-groups:hover:not(:disabled),
.btn-use:hover {
  background: #f4f5f6;
  color: var(--text);
  box-shadow: none;
}
.btn-danger { border-radius: 999px; }

.quick-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-card { padding: 18px; }
.stat-card strong { font-size: 1.05rem; }
.pro-banner { padding: 18px; }
.composer-shell { gap: 16px; }
.platform-bubble { min-height: 108px; border-radius: 8px; }
.upload-zone { border-radius: 8px; background: #f7f8f9; }

.ai-page-header { margin-bottom: 18px; }
.ai-title-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--text);
  box-shadow: var(--shadow);
}
.ai-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ai-status-card {
  min-height: 64px;
  padding: 14px 16px;
}
.ai-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 16px;
}
.ai-card-head { margin-bottom: 14px; }
.ai-config-card textarea#aiTransferMessage { min-height: 112px; }
.ai-conversations-card { top: 92px; }
.ai-conversations-list { gap: 10px; }
.ai-thread { max-height: 260px; }
.ai-msg { border-radius: 8px; background: #f5f6f7; }
.ai-msg.assistant { background: #f0f7f3; }
.ai-modal { border-radius: 8px; }

.ai-crm-card {
  margin-top: 16px;
  padding-top: 20px;
}
.crm-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.crm-stats div { padding: 14px; }
.crm-stats strong { font-size: 1.25rem; }
.crm-import-form textarea#crmRawText { min-height: 132px; }
.crm-import-form textarea#crmMessagePrompt { min-height: 90px; }
.crm-queue-list { gap: 8px; }
.crm-queue-item { padding: 13px 14px; }

.empty {
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--text3);
}
.empty-icon { font-size: 1.8rem; filter: grayscale(1); opacity: .72; }
.toast { border-radius: 8px; box-shadow: 0 14px 38px rgba(0,0,0,.14); }

@media (max-width: 1120px) {
  .sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }
  .sidebar nav { justify-content: flex-start; }
  .sidebar-footer { justify-self: start; }
  .main { padding: 28px 18px 44px; }
  .ai-grid,
  .composer-shell { grid-template-columns: 1fr; }
  .ai-conversations-card { position: static; }
}
@media (max-width: 760px) {
  .sidebar { padding: 12px; }
  .logo { padding: 0; }
  .main { padding: 24px 14px 42px; }
  .page-header h1 { font-size: 2rem; }
  .quick-stats,
  .ai-status-grid,
  .crm-stats,
  .platform-preview-grid,
  .field-row-2,
  .field-row-3 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .btn-primary { width: 100%; }
}

/* Logo refinement 20260603: lighter brand mark */
.logo {
  min-width: 230px;
  gap: 10px;
}
.logo-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #111113 !important;
  border: 1px solid rgba(17, 17, 19, .10) !important;
  box-shadow: 0 1px 2px rgba(17,17,19,.035) !important;
}
.logo-icon .app-mark {
  width: 20px !important;
  height: 20px !important;
  color: #111113 !important;
}
.logo-text {
  font-size: .98rem !important;
  letter-spacing: 0 !important;
}
.logo-text span {
  height: 17px !important;
  padding: 0 7px !important;
  font-size: .68rem !important;
  background: #f1bd43 !important;
  color: #fff !important;
  box-shadow: none !important;
}
@media (max-width: 760px) {
  .logo { min-width: auto; }
  .logo-icon { width: 32px !important; height: 32px !important; }
}

/* IA header icon refinement 20260603 */
.ai-page-title {
  gap: 14px !important;
}
.ai-title-icon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid rgba(17,17,19,.10) !important;
  box-shadow: 0 1px 2px rgba(17,17,19,.035), 0 8px 20px rgba(17,17,19,.04) !important;
}
.ai-title-icon::before {
  inset: 10px !important;
  background: #111113 !important;
}
.ai-page-title h1 {
  line-height: 1 !important;
}
@media (max-width: 760px) {
  .ai-title-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }
  .ai-title-icon::before { inset: 9px !important; }
}


/* CRM file upload 20260603 */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.field-label-row label { margin: 0; }
.file-upload-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(17,17,19,.10);
  background: #fff;
  color: #111113;
  font-size: .82rem;
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(17,17,19,.035);
}
.file-upload-btn:hover { background: #f5f6f7; }
.sr-only-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.crm-file-info {
  min-height: 20px;
  margin: -2px 0 8px;
  color: var(--text3);
  font-size: .82rem;
}
@media (max-width: 760px) {
  .field-label-row { align-items: flex-start; flex-direction: column; }
  .file-upload-btn { width: 100%; }
}

/* Console-inspired layout 20260603 */
:root {
  --console-bg: #fbfbfb;
  --console-line: rgba(17,17,19,.085);
  --console-muted: #85868b;
  --console-soft: #f5f5f6;
}
body {
  background: var(--console-bg) !important;
  color: #050506 !important;
}
.layout {
  display: flex !important;
  min-height: 100vh !important;
  background: var(--console-bg) !important;
}
.sidebar {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  width: 248px !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 18px 14px !important;
  background: rgba(255,255,255,.96) !important;
  border-right: 1px solid var(--console-line) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) !important;
  z-index: 30 !important;
}
.logo {
  min-width: 0 !important;
  width: 100% !important;
  height: 48px !important;
  padding: 0 4px !important;
  margin: 0 0 22px !important;
  display: flex !important;
  align-items: center !important;
}
.logo-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 9px !important;
  border-color: rgba(17,17,19,.09) !important;
}
.logo-text {
  font-size: 1rem !important;
  font-weight: 720 !important;
}
.logo-text span {
  background: #f0bf4c !important;
  color: #fff !important;
}
.sidebar nav {
  display: flex !important;
  flex: 1 !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  gap: 6px !important;
  width: 100% !important;
  overflow: visible !important;
}
.sidebar nav::before {
  content: "CONTROLE";
  display: block;
  padding: 0 10px 8px;
  color: #b4b5ba;
  font-size: .72rem;
  font-weight: 820;
  letter-spacing: .16em;
}
.nav-item,
.sidebar-footer .nav-item {
  width: 100% !important;
  min-height: 40px !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 12px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #6d6e73 !important;
  box-shadow: none !important;
  font-size: .92rem !important;
  font-weight: 640 !important;
}
.nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: #f4f4f5 !important;
  color: #111113 !important;
}
.nav-item.active {
  background: #050506 !important;
  color: #fff !important;
  border-color: #050506 !important;
  box-shadow: none !important;
}
.nav-item.active .nav-icon {
  color: #fff !important;
  opacity: 1 !important;
}
.nav-icon {
  width: 18px !important;
  height: 18px !important;
  opacity: .68 !important;
}
.nav-badge {
  margin-left: auto !important;
  min-width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  background: #ef4444 !important;
  color: #fff !important;
  font-size: .68rem !important;
}
.sidebar-footer {
  width: 100% !important;
  margin-top: 16px !important;
  padding: 14px 0 0 !important;
  border-top: 1px solid var(--console-line) !important;
}
.main {
  width: calc(100% - 248px) !important;
  max-width: none !important;
  margin-left: 248px !important;
  padding: 44px 44px 64px !important;
  background: var(--console-bg) !important;
}
.page {
  max-width: 1560px !important;
  margin: 0 auto !important;
}
.page-header {
  margin: 0 0 44px !important;
  padding: 6px 0 0 !important;
}
.page-header h1 {
  margin: 0 0 10px !important;
  color: #050506 !important;
  font-size: clamp(2.35rem, 4vw, 3.55rem) !important;
  font-weight: 820 !important;
  line-height: .98 !important;
}
.page-header p,
.hello-text,
.hint {
  color: var(--console-muted) !important;
  font-size: 1rem !important;
}
.hello-text {
  margin-bottom: 8px !important;
  font-weight: 650 !important;
}
.pro-banner {
  display: none !important;
}
.quick-stats,
.ai-status-grid,
.crm-stats {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  margin-bottom: 36px !important;
}
.quick-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.stat-card,
.card,
.ai-status-card,
.crm-stats > div,
.card-subsection {
  background: #fff !important;
  border: 1px solid var(--console-line) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}
.stat-card,
.crm-stats > div,
.ai-status-card {
  min-height: 142px !important;
  padding: 28px 26px !important;
}
.stat-card span,
.crm-stats span,
.card-title,
.ai-status-card small,
label {
  color: #9a9ba1 !important;
  font-size: .78rem !important;
  font-weight: 820 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
}
.stat-card strong,
.crm-stats strong,
.ai-status-card strong {
  margin-top: 26px !important;
  display: block !important;
  color: #050506 !important;
  font-size: clamp(2rem, 3vw, 2.85rem) !important;
  font-weight: 820 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
}
.stat-card small,
.crm-stats small,
.ai-status-card small + span,
.card p,
.card small {
  color: #7e7f84 !important;
}
.card {
  padding: 26px !important;
}
.card-title {
  margin-bottom: 20px !important;
}
.composer-shell {
  display: grid !important;
  grid-template-columns: minmax(360px, 1.08fr) minmax(320px, .92fr) !important;
  gap: 18px !important;
  align-items: start !important;
}
.composer-shell > .card:nth-child(n) {
  grid-column: auto !important;
}
.composer-shell > .card:nth-child(1),
.composer-shell > .card:nth-child(2) {
  min-height: 430px !important;
}
.composer-shell > .card:nth-child(3),
.composer-shell > .card:nth-child(4) {
  min-height: 220px !important;
}
.composer-shell > .btn-primary {
  grid-column: 1 / -1 !important;
  width: 240px !important;
  justify-self: start !important;
}
input,
textarea,
select,
.edit-media-picker,
.upload-zone,
.platform-bubble {
  background: #f6f6f7 !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  color: #111113 !important;
  box-shadow: none !important;
}
textarea:focus,
input:focus,
select:focus {
  background: #fff !important;
  border-color: #050506 !important;
  box-shadow: 0 0 0 3px rgba(5,5,6,.06) !important;
}
.btn-primary,
button.btn-primary {
  min-height: 46px !important;
  border-radius: 999px !important;
  background: #050506 !important;
  color: #fff !important;
  border: 1px solid #050506 !important;
  box-shadow: none !important;
  font-weight: 760 !important;
}
.btn-secondary,
button.btn-secondary,
.file-upload-btn {
  min-height: 40px !important;
  border-radius: 999px !important;
  background: #fff !important;
  border: 1px solid var(--console-line) !important;
  color: #111113 !important;
  box-shadow: none !important;
  font-weight: 720 !important;
}
.btn-danger,
button.btn-danger {
  min-height: 40px !important;
  border-radius: 999px !important;
  background: #fff5f5 !important;
  border: 1px solid rgba(220,38,38,.18) !important;
  color: #d1433f !important;
  box-shadow: none !important;
}
.ai-page-header {
  margin-bottom: 28px !important;
}
.ai-page-title {
  align-items: center !important;
}
.ai-title-icon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
}
.ai-grid {
  gap: 18px !important;
}
.ai-config-card,
.ai-conversations-card,
.ai-crm-card {
  border-radius: 16px !important;
}
.ai-conversations-card {
  top: 32px !important;
}
.crm-import-form textarea#crmRawText {
  min-height: 220px !important;
}
.crm-import-form textarea#crmMessagePrompt {
  min-height: 128px !important;
}
.crm-queue-item {
  border-radius: 12px !important;
  border: 1px solid var(--console-line) !important;
  background: #fff !important;
}
.empty {
  border-radius: 14px !important;
  background: #fafafa !important;
}
@media (max-width: 1180px) {
  .sidebar {
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 12px 16px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--console-line) !important;
  }
  .sidebar nav {
    flex-direction: row !important;
    overflow-x: auto !important;
  }
  .sidebar nav::before,
  .sidebar-footer { display: none !important; }
  .main {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 28px 18px 52px !important;
  }
  .quick-stats,
  .ai-status-grid,
  .crm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .composer-shell,
  .ai-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: block !important;
  }
  .logo {
    margin-bottom: 12px !important;
  }
  .sidebar nav {
    display: flex !important;
  }
  .nav-item {
    width: auto !important;
    flex: 0 0 auto !important;
  }
  .page-header h1 {
    font-size: 2.2rem !important;
  }
  .quick-stats,
  .ai-status-grid,
  .crm-stats {
    grid-template-columns: 1fr !important;
  }
  .card,
  .stat-card,
  .crm-stats > div,
  .ai-status-card {
    padding: 20px !important;
  }
  .composer-shell > .btn-primary {
    width: 100% !important;
  }
}

/* Compact typography pass 20260603 */
.main {
  padding: 34px 38px 56px !important;
}
.page-header {
  margin-bottom: 28px !important;
}
.page-header h1 {
  font-size: clamp(2rem, 3vw, 2.75rem) !important;
  line-height: 1.04 !important;
  font-weight: 780 !important;
}
.ai-page-title {
  gap: 12px !important;
}
.ai-title-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
}
.ai-title-icon::before {
  inset: 8px !important;
}
.page-header p,
.hello-text,
.hint {
  font-size: .94rem !important;
  line-height: 1.45 !important;
}
.quick-stats,
.ai-status-grid,
.crm-stats {
  gap: 14px !important;
  margin-bottom: 28px !important;
}
.stat-card,
.crm-stats > div,
.ai-status-card {
  min-height: 108px !important;
  padding: 20px 22px !important;
}
.stat-card span,
.crm-stats span,
.card-title,
.ai-status-card small,
label {
  font-size: .7rem !important;
  letter-spacing: .12em !important;
}
.stat-card strong,
.crm-stats strong,
.ai-status-card strong {
  margin-top: 18px !important;
  font-size: clamp(1.45rem, 2.1vw, 2.05rem) !important;
  font-weight: 760 !important;
}
.ai-status-card {
  gap: 12px !important;
  align-items: center !important;
}
.ai-status-card strong {
  margin-top: 0 !important;
  font-size: clamp(1.35rem, 2vw, 1.9rem) !important;
}
.ai-status-card small {
  margin-top: 4px !important;
  font-size: .67rem !important;
}
.ai-status-dot {
  width: 11px !important;
  height: 11px !important;
}
.card {
  padding: 22px !important;
  border-radius: 14px !important;
}
.card-title {
  margin-bottom: 14px !important;
}
.ai-grid {
  gap: 16px !important;
}
.ai-config-card,
.ai-conversations-card,
.ai-crm-card,
.card-subsection {
  border-radius: 14px !important;
}
input,
textarea,
select {
  font-size: .95rem !important;
  border-radius: 10px !important;
}
.btn-primary,
button.btn-primary,
.btn-secondary,
button.btn-secondary,
.btn-danger,
button.btn-danger,
.file-upload-btn {
  min-height: 38px !important;
  font-size: .86rem !important;
}
.ai-config-card textarea#aiTransferMessage,
.crm-import-form textarea#crmMessagePrompt {
  min-height: 104px !important;
}
.crm-import-form textarea#crmRawText {
  min-height: 170px !important;
}
.empty {
  min-height: 140px !important;
}
@media (max-width: 760px) {
  .main { padding: 24px 14px 44px !important; }
  .page-header h1 { font-size: 1.9rem !important; }
  .stat-card,
  .crm-stats > div,
  .ai-status-card,
  .card { padding: 18px !important; }
}

/* Apple-like typography and softer ink 20260603 */
:root {
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --muted-apple: #86868b;
  --soft-black: #242426;
}
body,
button,
input,
textarea,
select {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif !important;
  color: var(--ink) !important;
  -webkit-font-smoothing: antialiased !important;
  text-rendering: optimizeLegibility !important;
}
.page-header h1 {
  color: var(--ink) !important;
  font-size: clamp(2rem, 2.8vw, 2.55rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}
.logo-text,
.nav-item,
.sidebar-footer .nav-item,
.btn-primary,
button.btn-primary,
.btn-secondary,
button.btn-secondary,
.btn-danger,
button.btn-danger,
.file-upload-btn {
  font-weight: 590 !important;
  letter-spacing: 0 !important;
}
.page-header p,
.hello-text,
.hint,
.card p,
.card small,
.stat-card small,
.crm-stats small,
.crm-file-info,
.empty,
input,
textarea,
select {
  color: var(--muted-apple) !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}
input,
textarea,
select {
  color: var(--ink) !important;
}
.stat-card span,
.crm-stats span,
.card-title,
.ai-status-card small,
label {
  color: var(--muted-apple) !important;
  font-size: .72rem !important;
  font-weight: 600 !important;
  letter-spacing: .04em !important;
  text-transform: none !important;
}
.stat-card strong,
.crm-stats strong,
.ai-status-card strong {
  color: var(--ink) !important;
  font-weight: 680 !important;
  letter-spacing: -0.01em !important;
}
.nav-item,
.sidebar-footer .nav-item {
  color: #6e6e73 !important;
}
.nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: #f5f5f7 !important;
  color: var(--ink) !important;
}
.nav-item.active,
.btn-primary,
button.btn-primary {
  background: var(--soft-black) !important;
  border-color: var(--soft-black) !important;
  color: #fff !important;
}
.nav-item.active .nav-icon {
  color: #fff !important;
}
.logo-icon .app-mark,
.ai-title-icon::before {
  color: var(--ink) !important;
  background: var(--ink) !important;
}
.ai-title-icon,
.logo-icon {
  color: var(--ink) !important;
}
.card,
.stat-card,
.ai-status-card,
.crm-stats > div,
.card-subsection {
  border-color: rgba(29,29,31,.10) !important;
}
textarea:focus,
input:focus,
select:focus {
  border-color: rgba(29,29,31,.55) !important;
  box-shadow: 0 0 0 3px rgba(29,29,31,.055) !important;
}

/* Brand header refinement 20260603 */
.logo {
  height: 44px !important;
  gap: 11px !important;
  padding: 0 2px !important;
}
.logo-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%) !important;
  border: 1px solid rgba(29,29,31,.095) !important;
  box-shadow: 0 1px 2px rgba(29,29,31,.045), 0 8px 18px rgba(29,29,31,.035) !important;
}
.logo-icon .app-mark {
  width: 19px !important;
  height: 19px !important;
  color: #2b2b2d !important;
  background-color: #2b2b2d !important;
}
.logo-text {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  color: #1d1d1f !important;
  font-size: .98rem !important;
  font-weight: 650 !important;
  letter-spacing: -0.005em !important;
}
.logo-text span {
  height: 20px !important;
  margin-left: 0 !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  background: #f3bf43 !important;
  color: #fff !important;
  font-size: .7rem !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
}
.logo-sub,
.hello-text {
  display: none !important;
}
@media (max-width: 760px) {
  .logo-icon {
    width: 32px !important;
    height: 32px !important;
  }
  .logo-text {
    font-size: .94rem !important;
  }
}

/* CRM upload button refinement 20260603 */
.file-upload-btn {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 11px !important;
  gap: 7px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(29,29,31,.08) !important;
  background: #f5f5f7 !important;
  color: #3a3a3c !important;
  font-size: .78rem !important;
  font-weight: 560 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}
.file-upload-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  opacity: .72;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 16V4M12 4 7.5 8.5M12 4l4.5 4.5M5 15v3.5A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5V15' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 16V4M12 4 7.5 8.5M12 4l4.5 4.5M5 15v3.5A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5V15' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.file-upload-btn:hover {
  background: #ededf0 !important;
  color: #1d1d1f !important;
  transform: none !important;
}
.field-label-row {
  align-items: center !important;
  margin-bottom: 10px !important;
}

/* Newsletter page 20260603 */
.icon-newsletter {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6.5h16v11H4v-11Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m5 8 7 5 7-5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6.5h16v11H4v-11Z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m5 8 7 5 7-5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
.newsletter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.newsletter-grid-bottom {
  grid-template-columns: minmax(360px, .88fr) minmax(0, 1.12fr);
}
.newsletter-card textarea {
  width: 100%;
  min-height: 150px;
}
.newsletter-card .btn-primary {
  margin-top: 12px;
}
@media (max-width: 1180px) {
  .newsletter-grid,
  .newsletter-grid-bottom { grid-template-columns: 1fr; }
}

/* Newsletter layout refinement 20260603 */
#page-newsletter .page-header {
  margin-bottom: 22px !important;
}
.newsletter-stats {
  margin-bottom: 18px !important;
}
.newsletter-grid,
.newsletter-grid-bottom {
  grid-template-columns: 1fr !important;
  gap: 18px !important;
}
.newsletter-grid {
  align-items: stretch !important;
}
.newsletter-card {
  overflow: hidden !important;
}
.newsletter-card .hint {
  max-width: 680px !important;
}
#nlSettingsForm {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 16px !important;
}
#nlSettingsForm .ai-card-head,
#nlImportForm .ai-card-head,
#nlCampaignForm .ai-card-head {
  margin-bottom: 4px !important;
}
#nlSettingsForm .field-row-2,
#nlSettingsForm .field-row-3 {
  display: grid !important;
  gap: 14px !important;
}
#nlSettingsForm .field-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
#nlSettingsForm .field-row-3 {
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, .45fr) minmax(150px, .55fr) !important;
}
#nlSettingsForm .field,
#nlImportForm .field,
#nlCampaignForm .field {
  min-width: 0 !important;
}
#nlSettingsForm input,
#nlSettingsForm select,
#nlImportForm textarea,
#nlCampaignForm input,
#nlCampaignForm textarea {
  width: 100% !important;
  min-width: 0 !important;
}
#nlSettingsForm input,
#nlSettingsForm select {
  height: 46px !important;
}
#nlSettingsForm .schedule-toggle.compact-toggle {
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 14px !important;
  background: #f5f5f7 !important;
  box-shadow: none !important;
}
#nlSettingsForm .btn-primary,
#nlImportForm .btn-primary,
#nlCampaignForm .btn-primary {
  width: auto !important;
  min-width: 180px !important;
  justify-self: start !important;
}
#nlImportForm {
  display: grid !important;
  gap: 14px !important;
}
#nlImportForm textarea {
  min-height: 180px !important;
}
.newsletter-grid:first-of-type {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr) !important;
}
.newsletter-flow-card {
  margin-bottom: 18px !important;
  padding: 18px 20px !important;
}
.newsletter-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.newsletter-flow div {
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 12px;
  background: #f8f8f9;
}
.newsletter-flow span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #242426;
  color: #fff;
  font-size: .78rem;
  font-weight: 650;
}
.newsletter-flow strong {
  display: block;
  margin-bottom: 4px;
  color: #1d1d1f;
  font-size: .92rem;
  font-weight: 620;
}
.newsletter-flow p {
  margin: 0;
  color: #86868b !important;
  font-size: .84rem !important;
  line-height: 1.35;
}
#nlCampaignForm textarea {
  min-height: 210px !important;
}
#nlQueueList {
  min-height: 280px;
}
@media (max-width: 1180px) {
  .newsletter-grid:first-of-type,
  #nlSettingsForm .field-row-2,
  #nlSettingsForm .field-row-3,
  .newsletter-flow {
    grid-template-columns: 1fr !important;
  }
}

/* Newsletter SMTP form cleanup 20260603 */
#nlSettingsForm {
  max-width: none !important;
}
#nlSettingsForm .field-row-2,
#nlSettingsForm .field-row-3 {
  align-items: end !important;
}
#nlSettingsForm .field-row-3 {
  grid-template-columns: minmax(320px, 1fr) 140px 150px !important;
}
#nlSettingsForm label {
  display: block !important;
  margin-bottom: 8px !important;
}
#nlSettingsForm input,
#nlSettingsForm select {
  height: 42px !important;
  padding: 0 14px !important;
  font-size: .92rem !important;
}
#nlSettingsForm .schedule-toggle.compact-toggle {
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0 12px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: #f5f5f7 !important;
}
#nlSettingsForm .schedule-toggle.compact-toggle input {
  position: relative !important;
  width: 34px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #d1d1d6 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  flex: 0 0 auto !important;
}
#nlSettingsForm .schedule-toggle.compact-toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
#nlSettingsForm .schedule-toggle.compact-toggle input:checked {
  background: #34c759 !important;
}
#nlSettingsForm .schedule-toggle.compact-toggle input:checked::before {
  transform: translateX(14px);
}
#nlSettingsForm .schedule-toggle.compact-toggle span {
  color: #6e6e73 !important;
  font-size: .86rem !important;
  font-weight: 520 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
#nlSettingsForm .btn-primary {
  min-width: 165px !important;
  height: 42px !important;
  margin-top: 2px !important;
}
#nlSettingsForm .ai-card-head {
  align-items: flex-start !important;
  border-bottom: 1px solid rgba(29,29,31,.07) !important;
  padding-bottom: 16px !important;
}
#nlSettingsForm #nlTestSMTP {
  min-width: 92px !important;
  height: 36px !important;
}
@media (max-width: 1180px) {
  #nlSettingsForm .field-row-2,
  #nlSettingsForm .field-row-3 {
    grid-template-columns: 1fr !important;
  }
}

/* Newsletter alignment fixes 20260603 */
#nlCampaignForm .field {
  display: grid !important;
  gap: 8px !important;
  margin-bottom: 14px !important;
}
#nlCampaignForm input {
  height: 44px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
}
#nlCampaignForm textarea {
  padding: 16px !important;
  border-radius: 12px !important;
}
#nlCampaignForm > .schedule-toggle.compact-toggle {
  width: fit-content !important;
  min-width: 190px !important;
  height: 42px !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0 14px !important;
  margin: 0 0 12px !important;
  border-radius: 999px !important;
  background: #f5f5f7 !important;
  border: 1px solid rgba(29,29,31,.08) !important;
  box-shadow: none !important;
}
#nlCampaignForm > .schedule-toggle.compact-toggle input {
  position: relative !important;
  width: 34px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #d1d1d6 !important;
  box-shadow: none !important;
  flex: 0 0 auto !important;
}
#nlCampaignForm > .schedule-toggle.compact-toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
#nlCampaignForm > .schedule-toggle.compact-toggle input:checked {
  background: #34c759 !important;
}
#nlCampaignForm > .schedule-toggle.compact-toggle input:checked::before {
  transform: translateX(14px);
}
#nlCampaignForm > .schedule-toggle.compact-toggle span {
  color: #6e6e73 !important;
  font-size: .86rem !important;
  font-weight: 520 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
#nlCampaignForm .btn-primary {
  margin-top: 0 !important;
}
#nlSettingsForm .field:has(#nlSecure) > label:first-child {
  margin-bottom: 8px !important;
}
#nlSettingsForm .field:has(#nlSecure) .schedule-toggle.compact-toggle {
  width: 126px !important;
  min-width: 126px !important;
  height: 42px !important;
}
#nlSettingsForm .field:has(#nlSecure) .schedule-toggle.compact-toggle span {
  white-space: nowrap !important;
  font-size: .82rem !important;
}
#nlSettingsForm .field:has(#nlSecure) {
  justify-self: start !important;
}
@supports not selector(:has(*)) {
  #nlSettingsForm .schedule-toggle.compact-toggle {
    max-width: 150px !important;
  }
}

/* Professional operations refresh 20260618 */
:root {
  --bg: #f4f6f8 !important;
  --surface: #ffffff !important;
  --surface2: #f8fafc !important;
  --surface3: #eef2f6 !important;
  --border: rgba(15, 23, 42, .09) !important;
  --border2: rgba(15, 23, 42, .16) !important;
  --accent: #0f172a !important;
  --accent2: #1f2a44 !important;
  --accent-soft: #e8f4f1 !important;
  --accent-green: #16825d !important;
  --accent-blue: #2563eb !important;
  --accent-amber: #b7791f !important;
  --green: #16825d !important;
  --red: #c2413b !important;
  --yellow: #b7791f !important;
  --text: #101827 !important;
  --text2: #526070 !important;
  --text3: #8a96a5 !important;
  --radius: 10px !important;
  --radius-sm: 8px !important;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 16px 40px rgba(15,23,42,.055) !important;
}

html,
body {
  min-width: 0 !important;
  background: var(--bg) !important;
}
body {
  color: var(--text) !important;
  font-size: 15px !important;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 248px;
  height: 240px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(244,246,248,0)) !important;
  z-index: 0;
}
.layout,
.main,
.page {
  position: relative !important;
}
.layout {
  background: transparent !important;
}
.sidebar {
  width: 264px !important;
  padding: 20px 16px !important;
  background: #ffffff !important;
  border-right: 1px solid rgba(15,23,42,.08) !important;
  box-shadow: 8px 0 30px rgba(15,23,42,.025) !important;
}
.logo {
  height: auto !important;
  min-height: 48px !important;
  margin-bottom: 26px !important;
  padding: 0 4px 18px !important;
  border-bottom: 1px solid rgba(15,23,42,.08) !important;
}
.logo-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  background: #111827 !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 10px 22px rgba(15,23,42,.14) !important;
}
.logo-icon .app-mark {
  color: #fff !important;
}
.logo-text {
  color: #111827 !important;
  font-size: 1.02rem !important;
  font-weight: 780 !important;
}
.logo-text span {
  height: 18px !important;
  padding: 0 8px !important;
  background: #d99b20 !important;
  color: #fff !important;
  font-size: .66rem !important;
}
.sidebar nav::before {
  color: #a3adba !important;
  font-size: .68rem !important;
  letter-spacing: .18em !important;
}
.sidebar nav {
  gap: 4px !important;
}
.nav-item,
.sidebar-footer .nav-item {
  min-height: 42px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  color: #657386 !important;
  font-size: .92rem !important;
  font-weight: 640 !important;
}
.nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: #f3f6f9 !important;
  color: #111827 !important;
}
.nav-item.active {
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
}
.nav-icon {
  width: 18px !important;
  height: 18px !important;
}
.sidebar-footer {
  padding-top: 14px !important;
  border-top: 1px solid rgba(15,23,42,.08) !important;
}
.main {
  width: calc(100% - 264px) !important;
  margin-left: 264px !important;
  padding: 34px 36px 56px !important;
  background: transparent !important;
}
.page {
  max-width: 1480px !important;
}
.page-header {
  margin-bottom: 24px !important;
  padding-top: 0 !important;
}
.page-header h1,
.an-header h1 {
  color: #111827 !important;
  font-size: clamp(1.9rem, 2.4vw, 2.75rem) !important;
  font-weight: 780 !important;
  line-height: 1.05 !important;
}
.page-header p,
.an-header p {
  max-width: 760px !important;
  color: #5f6f82 !important;
  font-size: .98rem !important;
  line-height: 1.55 !important;
}
.pro-banner {
  display: flex !important;
  min-height: 82px !important;
  margin-bottom: 18px !important;
  padding: 16px 18px !important;
  background: linear-gradient(135deg, #111827, #1f2a44) !important;
  border: 0 !important;
  border-radius: 12px !important;
  color: #fff !important;
  box-shadow: 0 18px 42px rgba(15,23,42,.16) !important;
}
.banner-icon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.13) !important;
}
.banner-copy strong,
.banner-copy span,
.banner-metric small,
.banner-metric b {
  color: #fff !important;
}
.banner-copy span,
.banner-metric small {
  opacity: .72 !important;
}
.quick-stats,
.ai-status-grid,
.crm-stats,
.newsletter-stats {
  gap: 12px !important;
  margin-bottom: 18px !important;
}
.quick-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.ai-status-grid,
.crm-stats,
.newsletter-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.ai-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.stat-card,
.ai-status-card,
.crm-stats > div,
.newsletter-stats > div,
.channel-card,
.ch-card {
  min-height: 104px !important;
  padding: 18px !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
}
.stat-card span,
.crm-stats span,
.newsletter-stats span,
.card-title,
.section-label,
.chart-title,
.tbl-title,
.platform-preview-title,
.field label,
label {
  color: #7d8b9b !important;
  font-size: .72rem !important;
  font-weight: 780 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}
.stat-card strong,
.crm-stats strong,
.newsletter-stats strong,
.ai-status-card strong {
  margin: 14px 0 4px !important;
  color: #111827 !important;
  font-size: clamp(1.32rem, 1.7vw, 1.9rem) !important;
  line-height: 1.1 !important;
  font-weight: 780 !important;
}
.stat-card small,
.crm-stats small,
.newsletter-stats small,
.ai-status-card small,
.hint,
.crm-file-info {
  color: #7d8b9b !important;
  font-size: .82rem !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.card,
.chart-card,
.table-card,
.settings-card,
.ai-config-card,
.ai-conversations-card,
.ai-crm-card,
.newsletter-flow-card,
.newsletter-queue-card,
.prompt-summary,
.card-subsection,
.sched-item,
.history-item,
.ai-conversation,
.crm-queue-item,
.platform-preview,
.checkbox-label,
.schedule-toggle,
.group-list li,
#statusList li,
.edit-media-current,
.qr-box {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
}
.card,
.chart-card,
.table-card,
.settings-card {
  padding: 20px !important;
  margin-bottom: 14px !important;
}
.card-title,
.section-label,
.chart-title,
.tbl-title {
  margin-bottom: 14px !important;
}
.composer-shell,
.ai-grid,
.newsletter-grid,
.charts-grid,
.channel-grid,
.tables-grid {
  gap: 14px !important;
}
.composer-shell {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr) !important;
}
.composer-shell > .card:nth-child(1),
.composer-shell > .card:nth-child(2) {
  min-height: 0 !important;
}
.composer-shell > .card:nth-child(3),
.composer-shell > .card:nth-child(4) {
  min-height: 0 !important;
}
input,
textarea,
select,
.field input[type=number],
.field input[type=time],
.edit-media-picker,
.upload-zone,
.platform-bubble {
  min-height: 44px !important;
  background: #f7f9fb !important;
  border: 1px solid rgba(15,23,42,.08) !important;
  border-radius: 9px !important;
  color: #111827 !important;
  font-size: .94rem !important;
}
input,
select,
.field input[type=number],
.field input[type=time] {
  padding: 0 13px !important;
}
textarea {
  min-height: 128px !important;
  padding: 13px 14px !important;
  line-height: 1.5 !important;
}
#message {
  min-height: 180px !important;
}
.crm-import-form textarea#crmRawText {
  min-height: 168px !important;
}
.crm-import-form textarea#crmMessagePrompt {
  min-height: 92px !important;
}
.crm-message-versions textarea {
  min-height: 78px !important;
}
input:focus,
textarea:focus,
select:focus,
.field input:focus,
.field select:focus {
  background: #fff !important;
  border-color: rgba(22,130,93,.55) !important;
  box-shadow: 0 0 0 4px rgba(22,130,93,.11) !important;
}
.upload-zone,
.edit-media-picker,
.qr-box {
  border-style: dashed !important;
  background: #f8fafc !important;
}
.upload-zone:hover,
.upload-zone.drag,
.edit-media-picker:hover {
  border-color: rgba(22,130,93,.45) !important;
  background: #f2fbf7 !important;
}
.btn-primary,
button.btn-primary,
.btn-save {
  min-height: 44px !important;
  min-width: 170px !important;
  padding: 0 20px !important;
  border-radius: 9px !important;
  background: #111827 !important;
  color: #fff !important;
  border: 1px solid #111827 !important;
  box-shadow: none !important;
  font-size: .92rem !important;
  font-weight: 740 !important;
}
.btn-primary:hover:not(:disabled),
button.btn-primary:hover:not(:disabled),
.btn-save:hover {
  background: #263348 !important;
  border-color: #263348 !important;
}
.btn-secondary,
button.btn-secondary,
.btn-load-groups,
.btn-use,
.btn-refresh,
.file-upload-btn,
.btn-ghost {
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 9px !important;
  background: #fff !important;
  border: 1px solid var(--border2) !important;
  color: #334155 !important;
  box-shadow: none !important;
  font-size: .86rem !important;
  font-weight: 680 !important;
}
.btn-secondary:hover,
.btn-load-groups:hover:not(:disabled),
.btn-use:hover,
.btn-refresh:hover:not(:disabled),
.file-upload-btn:hover,
.btn-ghost:hover {
  background: #f3f6f9 !important;
  color: #111827 !important;
  border-color: rgba(15,23,42,.2) !important;
}
.btn-danger,
button.btn-danger {
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 9px !important;
}
.schedule-toggle,
.checkbox-label,
.dest-check,
.toggle-row {
  min-height: 44px !important;
  padding: 10px 12px !important;
  box-shadow: none !important;
}
.schedule-toggle span,
.checkbox-label span,
.dest-check,
.toggle-row {
  color: #526070 !important;
  font-size: .9rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-weight: 560 !important;
}
.platform-preview-grid,
.field-row-2,
.field-row-3 {
  gap: 12px !important;
}
.platform-bubble {
  min-height: 118px !important;
  padding: 14px !important;
}
.whatsapp-preview {
  background: #eef8f2 !important;
}
.telegram-preview {
  background: #eef5ff !important;
}
.ai-title-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
}
.ai-status-card {
  min-height: 86px !important;
  align-items: center !important;
}
.ai-status-card strong {
  margin: 0 0 3px !important;
  font-size: .98rem !important;
}
.ai-status-card small {
  display: block !important;
  margin: 0 !important;
}
.ai-status-dot,
.status-dot {
  width: 10px !important;
  height: 10px !important;
}
.ai-conversations-card {
  top: 24px !important;
}
.ai-thread {
  max-height: 300px !important;
}
.ai-msg {
  background: #f7f9fb !important;
  border-radius: 9px !important;
}
.ai-msg.assistant {
  background: #eef8f2 !important;
}
.prompt-summary,
.card-subsection {
  background: #f8fafc !important;
}
.crm-stats strong,
.newsletter-stats strong {
  font-size: 1.7rem !important;
}
.crm-queue-item,
.history-item,
.sched-item {
  padding: 14px 16px !important;
}
.crm-queue-item p,
.history-message,
.sched-body,
.ai-msg p {
  color: #526070 !important;
  font-size: .88rem !important;
}
.newsletter-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
.newsletter-flow div {
  background: #f8fafc !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}
.newsletter-flow span {
  background: #111827 !important;
}
.newsletter-flow strong {
  color: #111827 !important;
}
.range-tabs,
.page-tabs,
.tabs {
  border-color: var(--border) !important;
}
.range-tabs {
  background: #fff !important;
  border-radius: 10px !important;
}
.range-tab,
.page-tab,
.tab {
  border-radius: 8px !important;
  color: #526070 !important;
  font-weight: 680 !important;
}
.range-tab.active,
.page-tab.active,
.tab.active {
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
}
.chart-wrap {
  min-height: 210px !important;
}
.channel-card,
.ch-card {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}
.channel-card:hover,
.ch-card:hover,
.history-item:hover,
.sched-item:hover,
.crm-queue-item:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(15,23,42,.16) !important;
  box-shadow: 0 10px 28px rgba(15,23,42,.07) !important;
}
.empty,
.empty-block {
  min-height: 150px !important;
  background: #f8fafc !important;
  border: 1px dashed rgba(15,23,42,.12) !important;
  border-radius: 12px !important;
  color: #8a96a5 !important;
}
.toast {
  border-radius: 10px !important;
  border: 1px solid rgba(15,23,42,.1) !important;
  box-shadow: 0 18px 44px rgba(15,23,42,.18) !important;
}
@media (max-width: 1180px) {
  body::before { inset-left: 0 !important; }
  .layout { display: block !important; }
  .sidebar {
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    display: block !important;
    padding: 12px 16px !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(15,23,42,.08) !important;
  }
  .logo {
    margin-bottom: 10px !important;
    padding-bottom: 10px !important;
  }
  .sidebar nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    overflow-x: auto !important;
  }
  .sidebar nav::before,
  .sidebar-footer {
    display: none !important;
  }
  .nav-item {
    width: auto !important;
    flex: 0 0 auto !important;
  }
  .main {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 24px 18px 46px !important;
  }
  .composer-shell,
  .ai-grid,
  .newsletter-grid,
  .charts-grid,
  .tables-grid {
    grid-template-columns: 1fr !important;
  }
  .quick-stats,
  .ai-status-grid,
  .crm-stats,
  .newsletter-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .newsletter-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 720px) {
  .main {
    padding: 20px 12px 38px !important;
  }
  .page-header h1,
  .an-header h1 {
    font-size: 1.85rem !important;
  }
  .quick-stats,
  .ai-status-grid,
  .crm-stats,
  .newsletter-stats,
  .newsletter-flow,
  .platform-preview-grid,
  .field-row-2,
  .field-row-3 {
    grid-template-columns: 1fr !important;
  }
  .card,
  .stat-card,
  .ai-status-card,
  .crm-stats > div,
  .newsletter-stats > div,
  .chart-card,
  .table-card {
    padding: 16px !important;
  }
  .pro-banner {
    align-items: flex-start !important;
  }
  .banner-metric {
    width: 100% !important;
    text-align: left !important;
  }
  .composer-shell > .btn-primary,
  .btn-primary,
  button.btn-primary {
    width: 100% !important;
  }
}

/* SaaS minimal refresh inspired by Apostador PRO app 20260618 */
:root {
  --bg: #ffffff !important;
  --surface: #ffffff !important;
  --surface2: #fafafa !important;
  --surface3: #f5f5f5 !important;
  --border: rgba(17, 17, 19, .075) !important;
  --border2: rgba(17, 17, 19, .12) !important;
  --accent: #59c487 !important;
  --accent2: #45b374 !important;
  --accent-glow: rgba(89,196,135,.14) !important;
  --green: #4eb77b !important;
  --red: #d94a45 !important;
  --yellow: #b7791f !important;
  --text: #111113 !important;
  --text2: #77787d !important;
  --text3: #a1a2a7 !important;
  --radius: 18px !important;
  --radius-sm: 14px !important;
  --shadow: none !important;
}

html,
body {
  background: #fff !important;
  color: #111113 !important;
}
body::before { display: none !important; }
.layout {
  display: block !important;
  min-height: 100vh !important;
  background: #fff !important;
}
.sidebar {
  position: sticky !important;
  inset: auto !important;
  top: 0 !important;
  z-index: 50 !important;
  width: 100% !important;
  min-height: 78px !important;
  height: 78px !important;
  display: grid !important;
  grid-template-columns: minmax(210px, auto) 1fr auto !important;
  align-items: center !important;
  gap: 26px !important;
  padding: 0 40px !important;
  background: rgba(255,255,255,.94) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(17,17,19,.065) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
}
.logo {
  min-width: 0 !important;
  width: auto !important;
  height: 78px !important;
  min-height: 78px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.logo-icon {
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
  background: #111113 !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
}
.logo-icon .app-mark {
  width: 18px !important;
  height: 18px !important;
  color: #fff !important;
}
.logo-text {
  color: #111113 !important;
  font-size: 1.05rem !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}
.logo-text span {
  display: inline-flex !important;
  align-items: center !important;
  height: 18px !important;
  padding: 0 8px !important;
  margin-left: 5px !important;
  border-radius: 999px !important;
  background: #efad2f !important;
  color: #fff !important;
  font-size: .66rem !important;
  font-weight: 820 !important;
  vertical-align: 2px !important;
}
.logo-sub,
.sidebar nav::before { display: none !important; }
.sidebar nav {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  width: auto !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  padding: 0 !important;
}
.sidebar-footer {
  display: flex !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.nav-item,
.sidebar-footer .nav-item {
  width: auto !important;
  min-height: 40px !important;
  height: 40px !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #8d8e94 !important;
  box-shadow: none !important;
  font-size: .91rem !important;
  font-weight: 680 !important;
  white-space: nowrap !important;
}
.nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: #f7f7f8 !important;
  color: #111113 !important;
}
.nav-item.active {
  background: #111113 !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
}
.nav-icon {
  width: 17px !important;
  height: 17px !important;
  opacity: .78 !important;
}
.nav-item.active .nav-icon { color: #fff !important; opacity: 1 !important; }
.nav-badge {
  min-width: 18px !important;
  height: 18px !important;
  background: #e85b57 !important;
  color: #fff !important;
}
.main {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  padding: 54px 56px 86px !important;
  background: #fff !important;
}
.page {
  max-width: 1780px !important;
  margin: 0 auto !important;
}
.page-header {
  margin: 0 0 20px !important;
  padding: 0 !important;
}
.page-header h1,
.an-header h1 {
  color: #111113 !important;
  font-size: clamp(1.7rem, 2.1vw, 2.45rem) !important;
  line-height: 1.08 !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
}
.page-header p,
.an-header p {
  color: #7c7d82 !important;
  max-width: 780px !important;
  font-size: .98rem !important;
  line-height: 1.5 !important;
}
.app-greeting h1 {
  font-size: 1.45rem !important;
}
.pro-banner {
  display: flex !important;
  min-height: 86px !important;
  margin: 18px 0 30px !important;
  padding: 18px 22px !important;
  background: #fff !important;
  color: #111113 !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}
.banner-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 14px !important;
  background: #5bd172 !important;
  color: #fff !important;
}
.banner-copy strong {
  color: #111113 !important;
  font-size: 1.02rem !important;
  font-weight: 760 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}
.banner-copy span,
.banner-metric small {
  color: #85868b !important;
  opacity: 1 !important;
}
.banner-metric b {
  color: #111113 !important;
}
.quick-stats,
.ai-status-grid,
.crm-stats,
.newsletter-stats,
.channel-grid {
  gap: 18px !important;
  margin-bottom: 28px !important;
}
.quick-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.ai-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.crm-stats,
.newsletter-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.stat-card,
.ai-status-card,
.crm-stats > div,
.newsletter-stats > div,
.ch-card,
.channel-card {
  min-height: 112px !important;
  padding: 22px !important;
  background: #fff !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}
.stat-card span,
.crm-stats span,
.newsletter-stats span,
.card-title,
.section-label,
.chart-title,
.tbl-title,
.platform-preview-title,
.field label,
label {
  color: #96979c !important;
  font-size: .73rem !important;
  font-weight: 780 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}
.stat-card strong,
.crm-stats strong,
.newsletter-stats strong {
  display: block !important;
  margin: 14px 0 4px !important;
  color: #111113 !important;
  font-size: 1.38rem !important;
  font-weight: 760 !important;
  line-height: 1.15 !important;
}
.stat-card small,
.crm-stats small,
.newsletter-stats small,
.hint,
.crm-file-info {
  color: #8d8e94 !important;
  font-size: .86rem !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.card,
.chart-card,
.table-card,
.settings-card,
.ai-config-card,
.ai-conversations-card,
.ai-crm-card,
.newsletter-flow-card,
.newsletter-queue-card,
.prompt-summary,
.card-subsection,
.sched-item,
.history-item,
.ai-conversation,
.crm-queue-item,
.platform-preview,
.checkbox-label,
.schedule-toggle,
.group-list li,
#statusList li,
.edit-media-current,
.qr-box,
.table-card {
  background: #fff !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}
.card,
.chart-card,
.table-card,
.settings-card {
  padding: 22px !important;
  margin-bottom: 18px !important;
}
.card-title,
.section-label,
.chart-title,
.tbl-title {
  margin-bottom: 16px !important;
}
.composer-shell,
.ai-grid,
.newsletter-grid,
.charts-grid,
.tables-grid {
  gap: 18px !important;
}
.composer-shell {
  grid-template-columns: minmax(0, 1fr) minmax(390px, .9fr) !important;
}
.composer-shell > .card:nth-child(1),
.composer-shell > .card:nth-child(2),
.composer-shell > .card:nth-child(3),
.composer-shell > .card:nth-child(4) {
  min-height: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
}
.composer-shell > .btn-primary {
  grid-column: 1 / -1 !important;
  justify-self: end !important;
  width: auto !important;
}
input,
textarea,
select,
.field input[type=number],
.field input[type=time],
.edit-media-picker,
.upload-zone,
.platform-bubble {
  background: #f7f7f8 !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  color: #111113 !important;
  box-shadow: none !important;
  font-size: .95rem !important;
}
input,
select,
.field input[type=number],
.field input[type=time] {
  min-height: 46px !important;
  padding: 0 14px !important;
}
textarea {
  min-height: 132px !important;
  padding: 15px 16px !important;
  line-height: 1.5 !important;
}
#message { min-height: 190px !important; }
.crm-import-form textarea#crmRawText { min-height: 180px !important; }
.crm-import-form textarea#crmMessagePrompt { min-height: 104px !important; }
.crm-message-versions textarea { min-height: 82px !important; }
input:focus,
textarea:focus,
select:focus,
.field input:focus,
.field select:focus {
  background: #fff !important;
  border-color: rgba(89,196,135,.58) !important;
  box-shadow: 0 0 0 4px rgba(89,196,135,.12) !important;
}
.upload-zone,
.edit-media-picker,
.qr-box {
  border: 1px dashed rgba(17,17,19,.13) !important;
  background: #fafafa !important;
}
.upload-zone:hover,
.upload-zone.drag,
.edit-media-picker:hover {
  border-color: rgba(89,196,135,.55) !important;
  background: #f5fff9 !important;
}
.btn-primary,
button.btn-primary,
.btn-save {
  min-height: 48px !important;
  min-width: 178px !important;
  padding: 0 24px !important;
  border-radius: 999px !important;
  background: #58bf83 !important;
  border: 1px solid #58bf83 !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: .94rem !important;
  font-weight: 760 !important;
}
.btn-primary:hover:not(:disabled),
button.btn-primary:hover:not(:disabled),
.btn-save:hover {
  background: #46ad72 !important;
  border-color: #46ad72 !important;
}
.btn-secondary,
button.btn-secondary,
.btn-load-groups,
.btn-use,
.btn-refresh,
.file-upload-btn,
.btn-ghost {
  min-height: 40px !important;
  padding: 0 15px !important;
  border-radius: 999px !important;
  background: #fff !important;
  border: 1px solid rgba(17,17,19,.1) !important;
  color: #4f5055 !important;
  box-shadow: none !important;
  font-size: .86rem !important;
  font-weight: 680 !important;
}
.btn-secondary:hover,
.btn-load-groups:hover:not(:disabled),
.btn-use:hover,
.btn-refresh:hover:not(:disabled),
.file-upload-btn:hover,
.btn-ghost:hover {
  background: #f7f7f8 !important;
  color: #111113 !important;
}
.btn-danger,
button.btn-danger {
  min-height: 40px !important;
  padding: 0 15px !important;
  border-radius: 999px !important;
  background: #fff6f6 !important;
  border: 1px solid rgba(217,74,69,.18) !important;
  color: #d94a45 !important;
}
.schedule-toggle,
.checkbox-label,
.dest-check,
.toggle-row {
  min-height: 48px !important;
  padding: 12px 14px !important;
}
.schedule-toggle span,
.checkbox-label span,
.dest-check,
.toggle-row,
#nlCampaignForm > .schedule-toggle.compact-toggle span,
#nlSettingsForm .schedule-toggle.compact-toggle span {
  color: #6f7075 !important;
  font-size: .91rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-weight: 560 !important;
}
.platform-preview-grid,
.field-row-2,
.field-row-3 {
  gap: 14px !important;
}
.platform-bubble {
  min-height: 120px !important;
  padding: 15px !important;
}
.whatsapp-preview { background: #effaf3 !important; }
.telegram-preview { background: #f1f7ff !important; }
.ai-title-icon {
  background: #fff !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  box-shadow: none !important;
}
.ai-title-icon::before { background: #111113 !important; }
.ai-status-card {
  min-height: 86px !important;
}
.ai-status-card strong {
  margin: 0 0 4px !important;
  font-size: .98rem !important;
  color: #111113 !important;
}
.ai-status-card small {
  margin: 0 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.ai-status-dot,
.status-dot {
  width: 10px !important;
  height: 10px !important;
}
.ai-conversations-card { top: 96px !important; }
.ai-msg { background: #f7f7f8 !important; border-radius: 14px !important; }
.ai-msg.assistant { background: #effaf3 !important; }
.prompt-summary,
.card-subsection {
  background: #fafafa !important;
}
.crm-queue-item,
.history-item,
.sched-item {
  padding: 16px !important;
}
.crm-queue-item p,
.history-message,
.sched-body,
.ai-msg p {
  color: #6f7075 !important;
  font-size: .88rem !important;
}
.newsletter-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}
.newsletter-flow div {
  background: #fafafa !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 16px !important;
}
.newsletter-flow span { background: #111113 !important; }
.range-tabs,
.page-tabs,
.tabs {
  border-color: rgba(17,17,19,.08) !important;
}
.range-tabs {
  background: #fff !important;
  border-radius: 999px !important;
}
.range-tab,
.page-tab,
.tab {
  border-radius: 999px !important;
  color: #77787d !important;
  font-weight: 680 !important;
}
.range-tab.active,
.page-tab.active,
.tab.active {
  background: #58bf83 !important;
  color: #fff !important;
  border-color: #58bf83 !important;
}
.channel-card:hover,
.ch-card:hover,
.history-item:hover,
.sched-item:hover,
.crm-queue-item:hover,
.stat-card:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(17,17,19,.13) !important;
  box-shadow: 0 12px 30px rgba(17,17,19,.045) !important;
}
.empty,
.empty-block {
  min-height: 150px !important;
  background: #fafafa !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 18px !important;
  color: #a1a2a7 !important;
}
.toast {
  border-radius: 16px !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  box-shadow: 0 18px 42px rgba(17,17,19,.12) !important;
}
@media (max-width: 1180px) {
  .sidebar {
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
    padding: 12px 16px !important;
  }
  .logo {
    height: 44px !important;
    min-height: 44px !important;
    margin-bottom: 10px !important;
  }
  .sidebar nav {
    justify-content: flex-start !important;
  }
  .sidebar-footer { display: none !important; }
  .main {
    padding: 30px 18px 56px !important;
  }
  .composer-shell,
  .ai-grid,
  .newsletter-grid,
  .charts-grid,
  .tables-grid {
    grid-template-columns: 1fr !important;
  }
  .quick-stats,
  .ai-status-grid,
  .crm-stats,
  .newsletter-stats,
  .newsletter-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 720px) {
  .main { padding: 24px 14px 44px !important; }
  .page-header h1,
  .an-header h1 { font-size: 1.78rem !important; }
  .quick-stats,
  .ai-status-grid,
  .crm-stats,
  .newsletter-stats,
  .newsletter-flow,
  .platform-preview-grid,
  .field-row-2,
  .field-row-3 {
    grid-template-columns: 1fr !important;
  }
  .card,
  .stat-card,
  .ai-status-card,
  .crm-stats > div,
  .newsletter-stats > div,
  .chart-card,
  .table-card {
    padding: 16px !important;
  }
  .pro-banner {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
  }
  .banner-metric {
    width: 100% !important;
    text-align: left !important;
  }
  .composer-shell > .btn-primary,
  .btn-primary,
  button.btn-primary {
    width: 100% !important;
  }
}

/* Brand mark white minimal correction 20260618 */
.sidebar .logo-icon,
.logo .logo-icon {
  background: #ffffff !important;
  color: #111113 !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  box-shadow: none !important;
}
.sidebar .logo-icon .app-mark,
.logo .logo-icon .app-mark {
  color: #111113 !important;
}
.logo-text {
  color: #111113 !important;
}
.logo-text span {
  background: #efad2f !important;
  color: #ffffff !important;
}

/* IA Atendimento organization tabs 20260618 */
.ai-subtabs {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 0 18px !important;
  padding: 4px !important;
  background: #f7f7f8 !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 999px !important;
}
.ai-subtab {
  min-height: 38px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #7c7d82 !important;
  font: inherit !important;
  font-size: .9rem !important;
  font-weight: 720 !important;
  cursor: pointer !important;
  letter-spacing: 0 !important;
}
.ai-subtab:hover { color: #111113 !important; }
.ai-subtab.active { background: #111113 !important; color: #fff !important; }
.ai-grid.ai-single-panel { grid-template-columns: minmax(0, 1fr) !important; }
.ai-grid.ai-single-panel .ai-conversations-card,
.ai-grid.ai-single-panel .ai-config-card { max-width: none !important; }
.ai-config-card[hidden],
.ai-conversations-card[hidden],
.ai-crm-card[hidden],
.ai-grid[hidden] { display: none !important; }
.ai-config-card .ai-card-head {
  padding-bottom: 16px !important;
  margin-bottom: 18px !important;
  border-bottom: 1px solid rgba(17,17,19,.08) !important;
}
.ai-config-card .btn-primary { width: auto !important; margin-top: 8px !important; }
.ai-conversations-card .empty { min-height: 230px !important; }
.ai-crm-card { margin-top: 0 !important; }
.ai-crm-card .crm-stats { margin-bottom: 18px !important; }
@media (max-width: 720px) {
  .ai-subtabs { width: 100% !important; display: flex !important; overflow-x: auto !important; }
  .ai-subtab { flex: 1 0 auto !important; padding: 0 12px !important; }
  .ai-config-card .btn-primary { width: 100% !important; }
}

/* CRM start toggle fix 20260618 */
.crm-start-field .compact-toggle,
.field.crm-start-field .schedule-toggle.compact-toggle {
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 14px !important;
  background: #f7f7f8 !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
.crm-start-field .compact-toggle input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 18px !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  accent-color: #58bf83 !important;
}
.crm-start-field .compact-toggle input[type="checkbox"]::before {
  content: none !important;
}
.crm-start-field .compact-toggle span {
  display: inline !important;
  color: #6f7075 !important;
  font-size: .91rem !important;
  font-weight: 560 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

/* Newsletter rich editor 20260619 */
.newsletter-editor-field { display: grid !important; gap: 10px !important; }
.newsletter-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 8px !important;
  background: #f7f7f8 !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 14px !important;
}
.newsletter-toolbar button {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(17,17,19,.09) !important;
  background: #fff !important;
  color: #4f5055 !important;
  font-size: .84rem !important;
  font-weight: 720 !important;
  cursor: pointer !important;
}
.newsletter-toolbar button:hover {
  background: #111113 !important;
  border-color: #111113 !important;
  color: #fff !important;
}
.newsletter-editor {
  min-height: 260px !important;
  padding: 18px !important;
  background: #fff !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 18px !important;
  color: #111113 !important;
  line-height: 1.6 !important;
  outline: none !important;
  overflow: auto !important;
}
.newsletter-editor:focus {
  border-color: rgba(89,196,135,.58) !important;
  box-shadow: 0 0 0 4px rgba(89,196,135,.12) !important;
}
.newsletter-editor:empty::before {
  content: attr(data-placeholder);
  color: #a1a2a7;
}
.newsletter-editor h2 {
  margin: 10px 0 8px !important;
  font-size: 1.35rem !important;
  line-height: 1.2 !important;
}
.newsletter-editor p { margin: 0 0 12px !important; }
.newsletter-editor ul { margin: 0 0 12px 22px !important; }
.newsletter-editor a { color: #16825d !important; }
.newsletter-editor img { max-width: 100% !important; height: auto !important; }
#nlCampaignForm textarea#nlText[hidden] { display: none !important; }

/* Header overflow fix 20260721 */
.sidebar {
  grid-template-columns: minmax(185px, max-content) minmax(0, 1fr) max-content !important;
  gap: 14px !important;
}
.sidebar nav {
  justify-content: flex-start !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}
.sidebar nav::-webkit-scrollbar { display: none !important; }
.nav-item,
.sidebar-footer .nav-item {
  padding: 0 11px !important;
  gap: 7px !important;
  font-size: .88rem !important;
}
.logo-text { font-size: 1rem !important; }
@media (max-width: 1320px) {
  .sidebar {
    grid-template-columns: minmax(170px, max-content) minmax(0, 1fr) !important;
  }
  .sidebar-footer {
    display: none !important;
  }
}
@media (max-width: 1180px) {
  .sidebar nav {
    display: flex !important;
    justify-content: flex-start !important;
  }
}

/* Apostador PRO model sync 20260729 */
:root {
  --bg: #f5f5f7 !important;
  --surface: rgba(255,255,255,.92) !important;
  --surface2: #ffffff !important;
  --surface3: #f1f2f4 !important;
  --border: rgba(17,17,19,.09) !important;
  --border2: rgba(17,17,19,.14) !important;
  --accent: #111113 !important;
  --accent2: #2b2b2f !important;
  --accent-glow: rgba(17,17,19,.08) !important;
  --green: #16825d !important;
  --red: #d94545 !important;
  --yellow: #b7791f !important;
  --text: #111113 !important;
  --text2: #686970 !important;
  --text3: #9a9ba1 !important;
  --radius: 8px !important;
  --radius-sm: 8px !important;
  --shadow: 0 18px 50px -32px rgba(0,0,0,.75) !important;
}

html,
body {
  background: var(--bg) !important;
}

body,
button,
input,
textarea,
select {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: 0 !important;
}

code,
pre,
.field input,
.channel-row input:last-of-type,
.group-jid,
.bulk-message {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

.page-header h1,
.an-header h1,
.bulk-head h2,
.banner-copy strong {
  font-family: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.sidebar {
  background: rgba(255,255,255,.94) !important;
  border-bottom: 1px solid rgba(17,17,19,.08) !important;
  box-shadow: 0 1px 0 rgba(17,17,19,.03) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
}

.logo-icon,
.sidebar .logo-icon,
.logo .logo-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #111113 !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  box-shadow: 0 1px 2px rgba(17,17,19,.04) !important;
}

.logo-icon .app-mark,
.sidebar .logo-icon .app-mark,
.logo .logo-icon .app-mark {
  color: #111113 !important;
}

.logo-text {
  color: #111113 !important;
  font-weight: 800 !important;
}

.logo-text span {
  background: #f2ae2e !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
}

.logo-sub {
  display: none !important;
}

.nav-item,
.sidebar-footer .nav-item {
  min-height: 46px !important;
  border-radius: 999px !important;
  color: #8a8b91 !important;
  font-weight: 760 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

.nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: #f2f3f5 !important;
  color: #111113 !important;
}

.nav-item.active {
  background: #111113 !important;
  color: #ffffff !important;
  border-color: #111113 !important;
  box-shadow: 0 14px 28px -18px rgba(17,17,19,.65) !important;
}

.nav-item.active .nav-icon {
  color: #ffffff !important;
  opacity: 1 !important;
}

.main {
  max-width: 1180px !important;
}

.page-header {
  margin-bottom: 28px !important;
}

.page-header h1,
.an-header h1 {
  color: #111113 !important;
  font-size: clamp(2rem, 3vw, 3.25rem) !important;
  line-height: .98 !important;
  font-weight: 800 !important;
}

.page-header p,
.an-header p {
  color: #7b7c82 !important;
  font-size: 1rem !important;
}

.pro-banner,
.card,
.stat-card,
.ai-status-card,
.crm-stats > div,
.newsletter-stats > div,
.chart-card,
.table-card,
.bulk-item,
.platform-preview,
.history-item,
.sched-item {
  background: #ffffff !important;
  border: 1px solid rgba(17,17,19,.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 1px 2px rgba(17,17,19,.03), 0 18px 50px -34px rgba(17,17,19,.42) !important;
}

.pro-banner {
  min-height: 112px !important;
  padding: 24px !important;
}

.banner-icon {
  background: #111113 !important;
  color: #ffffff !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

.banner-copy strong,
.card-title,
.section-label,
.platform-preview-title,
.edit-label {
  letter-spacing: .16em !important;
}

.banner-copy strong {
  color: #111113 !important;
  font-size: 1.12rem !important;
}

.banner-copy span,
.banner-metric small {
  color: #8a8b91 !important;
}

.banner-metric b {
  color: #111113 !important;
}

textarea,
input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="number"],
input[type="time"],
select,
.newsletter-editor {
  background: #f6f7f9 !important;
  border-color: transparent !important;
  border-radius: 16px !important;
  color: #111113 !important;
  box-shadow: inset 0 0 0 1px rgba(17,17,19,.035) !important;
}

textarea:focus,
input:focus,
select:focus,
.newsletter-editor:focus {
  background: #ffffff !important;
  border-color: rgba(17,17,19,.18) !important;
  box-shadow: 0 0 0 4px rgba(17,17,19,.07) !important;
}

.upload-zone,
.checkbox-label,
.schedule-toggle,
.qr-box,
.group-list li,
.edit-media-current,
.edit-media-picker,
.newsletter-toolbar {
  background: #f6f7f9 !important;
  border-color: rgba(17,17,19,.07) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

.upload-zone:hover,
.upload-zone.drag,
.checkbox-label:hover,
.edit-media-picker:hover,
.btn-load-groups:hover:not(:disabled) {
  background: #ffffff !important;
  border-color: rgba(17,17,19,.15) !important;
  box-shadow: 0 0 0 4px rgba(17,17,19,.05) !important;
}

.btn-primary,
button.btn-primary,
.btn-use {
  background: #111113 !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  box-shadow: 0 16px 30px -20px rgba(17,17,19,.75) !important;
}

.btn-primary:hover:not(:disabled),
button.btn-primary:hover:not(:disabled),
.btn-use:hover {
  background: #2b2b2f !important;
  box-shadow: 0 18px 34px -22px rgba(17,17,19,.8) !important;
}

.btn-secondary,
.btn-load-groups,
.newsletter-toolbar button {
  background: #ffffff !important;
  color: #111113 !important;
  border-color: rgba(17,17,19,.1) !important;
  border-radius: 999px !important;
  font-weight: 760 !important;
}

.btn-secondary:hover,
.btn-load-groups:hover:not(:disabled),
.newsletter-toolbar button:hover {
  background: #111113 !important;
  color: #ffffff !important;
  border-color: #111113 !important;
}

.nav-badge,
.badge-pending,
.range-tab.active,
.page-tab.active,
.tab.active,
.ai-subtab.active {
  background: #111113 !important;
  color: #ffffff !important;
}

.range-tabs,
.page-tabs,
.tabs,
.ai-subtabs {
  background: #eceef1 !important;
  border-color: rgba(17,17,19,.07) !important;
}

.range-tab,
.page-tab,
.tab,
.ai-subtab {
  color: #77787e !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}

.whatsapp-preview {
  background: #e8f4f1 !important;
  color: #12251d !important;
}

.telegram-preview {
  background: #eef3fb !important;
  color: #172334 !important;
}

.toast {
  border-radius: 16px !important;
}

@media (max-width: 720px) {
  .page-header h1,
  .an-header h1 {
    font-size: 2rem !important;
    line-height: 1.04 !important;
  }

  .pro-banner,
  .card,
  .stat-card,
  .ai-status-card,
  .crm-stats > div,
  .newsletter-stats > div,
  .chart-card,
  .table-card {
    border-radius: 16px !important;
  }
}

/* Apostador PRO control refinement 20260729 */
.nav-icon,
.banner-icon,
.upload-zone-icon,
.empty-icon,
.dest-icon {
  display: none !important;
}

.sidebar {
  min-height: 74px !important;
  padding: 12px 40px !important;
  gap: 20px !important;
}

.logo {
  gap: 10px !important;
}

.logo-icon,
.sidebar .logo-icon,
.logo .logo-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
}

.logo-icon .app-mark,
.sidebar .logo-icon .app-mark,
.logo .logo-icon .app-mark {
  width: 18px !important;
  height: 18px !important;
}

.logo-text {
  font-size: .92rem !important;
  line-height: 1 !important;
}

.logo-text span {
  padding: 3px 9px !important;
  font-size: .64rem !important;
}

.nav-item,
.sidebar-footer .nav-item {
  min-height: 38px !important;
  padding: 0 13px !important;
  gap: 0 !important;
  font-size: .82rem !important;
  font-weight: 740 !important;
  white-space: nowrap !important;
}

.main {
  max-width: 1080px !important;
  padding-top: 44px !important;
}

.page-header,
.an-header {
  margin-bottom: 22px !important;
}

.page-header h1,
.an-header h1 {
  font-size: clamp(1.72rem, 2.15vw, 2.3rem) !important;
  line-height: 1.08 !important;
  font-weight: 800 !important;
}

.page-header p,
.an-header p {
  max-width: 640px !important;
  font-size: .88rem !important;
  line-height: 1.45 !important;
}

.pro-banner {
  min-height: 82px !important;
  padding: 18px 20px !important;
  gap: 16px !important;
}

.banner-copy strong {
  display: block !important;
  font-size: .95rem !important;
  line-height: 1.15 !important;
  margin-bottom: 5px !important;
}

.banner-copy span {
  font-size: .84rem !important;
}

.banner-metric {
  min-width: 92px !important;
}

.banner-metric small {
  font-size: .72rem !important;
}

.banner-metric b {
  font-size: .95rem !important;
}

.quick-stats {
  gap: 14px !important;
}

.stat-card,
.card,
.table-card,
.chart-card,
.ai-status-card,
.newsletter-card,
.crm-card {
  padding: 18px !important;
}

.stat-card h3,
.card h3,
.table-card h3,
.chart-card h3 {
  font-size: 1.05rem !important;
  line-height: 1.2 !important;
}

.card-title,
.section-label,
.platform-preview-title,
.edit-label,
.bulk-date-field label,
.bulk-grid label span,
.bulk-message-field span {
  font-size: .68rem !important;
  letter-spacing: .12em !important;
  margin-bottom: 10px !important;
}

textarea,
input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="number"],
input[type="time"],
select {
  font-size: .88rem !important;
  padding: .72rem .82rem !important;
}

#messageInput,
textarea {
  min-height: 190px !important;
}

.composer-shell {
  gap: 16px !important;
}

.platform-preview-grid {
  gap: 12px !important;
}

.platform-preview {
  padding: 14px !important;
}

.platform-bubble {
  min-height: 118px !important;
  font-size: .88rem !important;
  line-height: 1.38 !important;
}

.checkbox-label,
.schedule-toggle,
.upload-zone,
.btn-primary,
button.btn-primary,
.btn-secondary,
.btn-load-groups {
  font-size: .84rem !important;
}

.btn-primary,
button.btn-primary {
  min-height: 42px !important;
  padding: .7rem 1rem !important;
}

.btn-secondary,
.btn-load-groups {
  min-height: 38px !important;
  padding: .55rem .85rem !important;
}

.history-message,
.sched-body,
.field .hint,
.bulk-head p:not(.card-title) {
  font-size: .82rem !important;
}

@media (max-width: 1180px) {
  .sidebar {
    padding: 12px 18px !important;
  }
}

@media (max-width: 720px) {
  .sidebar {
    padding: 10px 12px !important;
  }

  .main {
    padding-top: 26px !important;
  }

  .page-header h1,
  .an-header h1 {
    font-size: 1.72rem !important;
  }

  .pro-banner {
    min-height: 0 !important;
  }
}
