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

:root {
  --bg: #f2f7f5;
  --surface: #ffffff;
  --surface-2: #e9f7f0;
  --ink: #16221d;
  --muted: #5a6a63;
  --line: #d7e3dc;
  --primary: #25d366;
  --primary-2: #0f8f4f;
  --accent: #0b5b3a;
  --shadow: 0 12px 36px rgba(16, 32, 24, 0.12);
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Sora", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}

.bg-orb {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(37, 211, 102, 0.3), transparent 60%);
  filter: blur(2px);
  z-index: 0;
}
.orb-1 { top: -120px; left: -120px; }
.orb-2 { bottom: -160px; right: -120px; }

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(22, 34, 29, 0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(22, 34, 29, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
}

.screen { display: none; min-height: 0; height: 100%; }
.screen.active { display: flex; }

#authScreen {
  justify-content: center;
  align-items: center;
  padding: 24px;
  min-height: 100vh;
  overflow: auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease;
}

.auth-card { width: min(520px, 100%); }

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand.mini { margin-bottom: 10px; }

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 14px;
  margin: 16px 0;
}

h1, h2, h3, h4 { margin: 0 0 10px; }
.muted { color: var(--muted); }
.msg { min-height: 22px; color: #c9415d; }

input, select, textarea, button {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
}

textarea { min-height: 84px; resize: vertical; }
button { cursor: pointer; }
button.primary {
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 600;
}
button.ghost {
  background: transparent;
  color: var(--ink);
}

.tabs { display: flex; gap: 8px; margin: 14px 0; }
.tab-btn { border: 1px solid var(--line); background: #fff; }
.tab-btn.active { background: var(--surface-2); }
.tab-content { display: none; gap: 10px; }
.tab-content.active { display: grid; }

#mainScreen { width: 100%; }
#mainScreen.screen.active {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}
#mainScreen.sidebar-collapsed.screen.active {
  grid-template-columns: 0 minmax(0, 1fr);
}
.sidebar {
  width: 260px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #f8fffb;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: width .22s ease, padding .22s ease, opacity .16s ease, border-right-color .16s ease;
  overflow: hidden;
}
.sidebar nav { display: grid; gap: 8px; }
.menu-btn { text-align: left; background: #fff; }
.menu-btn.active { background: var(--surface-2); border-color: #b9e7cc; }
.sidebar-toggle {
  width: 38px;
  min-width: 38px;
  height: 34px;
  align-self: flex-end;
  padding: 0;
  border-radius: 10px;
  border-color: #b8d7c8;
  margin-bottom: 2px;
}
.sidebar-expand {
  position: fixed;
  top: 10px;
  left: 10px;
  transform: none;
  width: auto;
  z-index: 1200;
  display: none;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.98);
  border-color: #8ccfb0;
  box-shadow: 0 8px 22px rgba(16, 32, 24, 0.18);
  align-items: center;
  gap: 4px;
  flex-direction: column-reverse; /* logo em cima, menu embaixo */
}
.sidebar-expand-icon {
  font-size: 20px;
  line-height: 1;
  color: #0d5131;
}
.sidebar-expand-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
#mainScreen.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-width: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}
#mainScreen.sidebar-collapsed .sidebar-expand {
  display: inline-flex;
}
#mainScreen.sidebar-collapsed main {
  padding-top: 18px;
  padding-left: 68px;
}
main {
  min-width: 0;
  width: 100%;
}

.status-card {
  border: 1px dashed #b7e8c8;
  background: #f0fff7;
  padding: 10px;
  border-radius: 12px;
}

main {
  flex: 1;
  padding: 18px;
  display: grid;
  gap: 14px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.topbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-actions { display: flex; gap: 8px; align-items: center; }

.panel { display: none; gap: 12px; }
.panel.active {
  display: grid;
  min-height: 0;
  overflow: auto;
}

#panelContacts,
#panelQuick,
#panelFlows,
#panelBranches,
#panelCompanies,
#panelUsers,
#panelWhatsapp {
  align-content: start;
}

#panelContacts .card,
#panelQuick .card,
#panelFlows .card,
#panelBranches .card,
#panelCompanies .card,
#panelUsers .card,
#panelWhatsapp .card {
  padding: 14px;
  border-radius: 14px;
}

#panelInbox {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#panelInbox .split {
  height: 100%;
  align-items: stretch;
  min-height: 0;
}

#panelInbox .split > .card {
  height: 100%;
  min-height: 0;
}

#panelInbox .split > .card:first-child {
  display: flex;
  flex-direction: column;
}

#conversationList {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#panelInbox .split > .card:last-child {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
}

#messages {
  flex: 1;
  min-height: 320px;
}

#panelInbox #messages {
  min-height: 0;
  height: 100%;
  max-height: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dash-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-period-btn {
  width: auto;
  padding: 8px 14px;
  border-radius: 10px;
}

.dash-period-btn.active {
  background: #eaf3ff;
  border-color: #3b82f6;
  color: #0f4ea8;
}

.dash-filter-custom {
  display: grid;
  grid-template-columns: auto 128px auto 128px auto;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.dash-filter-custom label {
  font-size: 12px;
  color: var(--muted);
}

.dash-filter-custom input {
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 12px;
}

#btnDashApply {
  width: auto;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.dash-chart {
  min-height: 220px;
}

.dash-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 200px;
}

.dash-bar-col {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.dash-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #5aa9ff, #3b82f6);
}

.dash-bar-total {
  font-weight: 700;
  font-size: 12px;
}

.dash-bar-day,
.dash-bar-date {
  color: var(--muted);
  font-size: 11px;
}

.dash-weekday {
  display: grid;
  gap: 6px;
}

.dash-weekday-head,
.dash-weekday-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px 70px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.dash-weekday-head {
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}

.dash-weekday-row {
  background: #f8fffb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.dash-weekday-row .pos {
  color: #116d34;
  font-weight: 700;
}

.dash-weekday-row .neg {
  color: #cc2f52;
  font-weight: 700;
}

.dash-weekday-row .neu {
  color: #6b7280;
  font-weight: 700;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 18px;
  border-left-width: 6px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat span {
  font-size: 15px;
  font-weight: 600;
}
.stat b { display: block; font-size: 46px; margin-top: 12px; line-height: 1; }

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #116d34;
  background: #e9fbe9;
  border: 1px solid #bfeccc;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.live-container {
  padding: 14px;
}

.live-container-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e9fbe9;
  border: 1px solid #bfeccc;
  color: #116d34;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #21b45c;
  box-shadow: 0 0 0 rgba(33, 180, 92, 0.55);
  animation: livePulse 1.2s infinite;
}

@keyframes livePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(33, 180, 92, 0.55); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(33, 180, 92, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(33, 180, 92, 0); }
}

.stat.status-open {
  border-left-color: #f4b400;
  background: #fffdf6;
}

.stat.status-pending {
  border-left-color: #3b82f6;
  background: #f5f9ff;
}

.stat.status-closed {
  border-left-color: #16a34a;
  background: #f4fff6;
}

.stat.status-cancel {
  border-left-color: #ef4444;
  background: #fff5f5;
}

.stat.status-total {
  border-left-color: #8b949e;
  background: #f8fafc;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.list li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.queue-board {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.queue-col {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fffb;
  min-height: 320px;
  padding: 8px;
}

.queue-col h5 {
  margin: 4px 0 8px;
  font-size: 13px;
}

.inbox-filter-row {
  margin-bottom: 8px;
}

.inbox-filter-row input {
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.queue-count {
  color: var(--muted);
  font-size: 12px;
}

.conv-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin-bottom: 8px;
  border-left-width: 6px;
}

.conv-card-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.conv-filial-bar {
  margin: -10px -10px 6px -10px;
  padding: 3px 10px;
  background: #eaffef;
  border-bottom: 1px solid #c3efd4;
  border-radius: 10px 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #0d5131;
}

.conv-filial-bar small {
  font-size: 11px;
  display: inline;
}

.conv-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.conv-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: #dff5e8;
  border: 1px solid #bde3cc;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
}

.conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conv-avatar span {
  display: none;
  font-size: 10px;
  font-weight: 700;
  color: #0d5131;
}

.conv-avatar.no-image span {
  display: inline;
}

.conv-open-btn {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.conv-name-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.conv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid transparent;
}

.conv-status-dot.is-open {
  background: #f4b400;
  border-color: #d89d00;
  animation: dotPulseOpenStrong 1.1s ease-in-out infinite;
}

.conv-status-dot.is-pending {
  background: #16a34a;
  border-color: #0f7a35;
  animation: dotPulsePending 1.8s ease-out infinite;
}

.conv-status-dot.is-closed {
  background: #64748b;
  border-color: #475569;
}

.conv-status-dot.is-cancel {
  background: #ef4444;
  border-color: #b91c1c;
}

@keyframes dotPulseOpen {
  0% { box-shadow: 0 0 0 0 rgba(244, 180, 0, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(244, 180, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 180, 0, 0); }
}

@keyframes dotPulseOpenStrong {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 180, 0, 0.65);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.5);
    box-shadow: 0 0 0 10px rgba(244, 180, 0, 0);
    filter: brightness(1.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 180, 0, 0);
    filter: brightness(1);
  }
}

@keyframes dotPulsePending {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.rename-icon-btn {
  width: auto;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid #f97316;
  background: #fff1e8;
  color: #9a3412;
  font-size: 14px;
  line-height: 1;
}

.conv-card.status-open {
  border-left-color: #f4b400;
}

.conv-card.status-pending {
  border-left-color: #3b82f6;
}

.conv-card.status-closed {
  border-left-color: #16a34a;
}

.conv-card.status-cancel {
  border-left-color: #ef4444;
}

.conv-card.selected {
  border-color: #83d9ab;
  box-shadow: 0 0 0 1px rgba(37, 211, 102, 0.25) inset;
}

.conv-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.conv-actions button {
  width: auto;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.conv-actions .action-open {
  background: #fff8e6;
  border-color: #f4b400;
  color: #8a6800;
}

.conv-actions .action-pending {
  background: #eaf3ff;
  border-color: #3b82f6;
  color: #0f4ea8;
}

.conv-actions .action-closed {
  background: #e9fbe9;
  border-color: #16a34a;
  color: #116d34;
}

.conv-actions .action-alert {
  background: #fff1e8;
  border-color: #f97316;
  color: #9a3412;
}

.conv-actions .action-cancel {
  background: #fff1f2;
  border-color: #ef4444;
  color: #b91c1c;
}

.conv-card small {
  line-height: 1.35;
  display: inline-block;
}

.queue-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 6px;
}

.split {
  display: grid;
  grid-template-columns: minmax(600px, 56%) minmax(380px, 44%);
  gap: 12px;
}
.messages {
  min-height: 320px;
  max-height: 440px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6fff9;
  display: grid;
  gap: 6px;
  align-content: start;
}
.bubble {
  padding: 6px 8px;
  border-radius: 10px;
  max-width: 66%;
  font-size: 16px;
  line-height: 1.45;
}
.bubble.in { background: #fff; border: 1px solid var(--line); justify-self: start; }
.bubble.out { background: #dcf9eb; border: 1px solid #b2ebd2; justify-self: end; }
.bubble .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.bubble .actions {
  display: flex;
  gap: 6px;
}
.bubble .actions button {
  width: auto;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.chat-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-head-text {
  min-width: 0;
}

.chat-head-text h4 {
  margin: 0;
  line-height: 1.1;
}

.chat-head-text small {
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  background: #dff5e8;
  border: 1px solid #bde3cc;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-avatar span {
  font-size: 12px;
  font-weight: 700;
  color: #0d5131;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.users-top-grid {
  display: grid;
  grid-template-columns: minmax(260px, 32%) minmax(0, 68%);
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 14, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.users-table-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.users-table-tools input {
  max-width: 320px;
}

.users-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: #fff;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.users-table th,
.users-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.users-table th {
  font-weight: 700;
  color: #24332c;
  background: #f6fbf8;
}

.users-table tr:last-child td {
  border-bottom: 0;
}

.users-name {
  font-weight: 700;
}

.users-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.users-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}

.users-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.users-avatar span {
  display: none;
}

.users-avatar.no-image span {
  display: inline;
}

.users-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.users-view-all {
  color: #116d34;
  font-weight: 700;
}

.users-view-branch {
  color: #0f4ea8;
  font-weight: 700;
}

.users-status-on {
  color: #116d34;
  font-weight: 700;
}

.users-status-off {
  color: #9a3412;
  font-weight: 700;
}

.users-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.users-actions .ghost {
  width: auto;
  padding: 5px 10px;
  border-radius: 9px;
}

#editUserModal .row {
  margin-bottom: 12px;
}

.composer {
  position: relative;
}

.composer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

#panelInbox .composer-row {
  gap: 6px;
}

#panelInbox .composer-row input,
#panelInbox .composer-row button {
  padding: 8px 10px;
  min-height: 38px;
  border-radius: 10px;
}

.emoji-btn {
  width: auto;
  min-width: 46px;
  font-size: 18px;
  line-height: 1;
}

.audio-btn {
  width: auto;
  min-width: 72px;
  font-weight: 600;
}

#panelInbox .emoji-btn {
  min-width: 40px;
  font-size: 16px;
}

#panelInbox .audio-btn {
  min-width: 64px;
}

#panelInbox #btnSendMsg {
  width: auto;
  min-width: 74px;
  padding-inline: 12px;
}

.audio-btn.recording {
  background: #ffe7ea;
  border-color: #ff9aa8;
  color: #9a1f35;
}

.emoji-picker {
  display: none;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.emoji-picker.show {
  display: grid;
}

.emoji-chip {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  font-size: 18px;
  cursor: pointer;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e5f9ef;
  border: 1px solid #b9e7cc;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.badge.ok { background: #d7fbe7; }

.pill {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f7fffb;
  border: 1px solid #d6f0e0;
  font-size: 13px;
}

code { background: #ecf7f1; padding: 2px 6px; border-radius: 6px; }

.qr-wrap {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px dashed #b7e8c8;
  border-radius: 12px;
  background: #f7fffb;
}

#waQrImg {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: none;
}

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

@media (max-width: 1000px) {
  #mainScreen.screen.active { grid-template-columns: 1fr; }
  #mainScreen.sidebar-collapsed .sidebar {
    width: 100%;
    padding: 18px;
    border-right-width: 0;
    border-right-color: var(--line);
    opacity: 1;
    pointer-events: auto;
  }
  #mainScreen.sidebar-collapsed .sidebar-expand {
    display: none;
  }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; }
  .bubble { max-width: 84%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .users-top-grid { grid-template-columns: 1fr; }
  .queue-board { grid-template-columns: 1fr; }
  .dashboard-filters { display: grid; }
  .dash-filter-custom {
    margin-left: 0;
    grid-template-columns: 1fr 1fr auto;
  }
  .dash-filter-custom label { display: none; }
  .dash-weekday-head,
  .dash-weekday-row { grid-template-columns: 1fr 56px 56px 56px; }
}
