:root {
  --bg: #f3f6f1;
  --surface: #ffffff;
  --surface-soft: #f7fbf4;
  --border: #dfe8da;
  --text: #121713;
  --muted: #667265;
  --primary: #5bb947;
  --primary-strong: #2f8f38;
  --accent: #f2b705;
  --brand-black: #151515;
  --brand-green: #5bb947;
  --brand-green-dark: #2f8f38;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d99a00;
  --purple: #7457e6;
  --shadow: 0 14px 34px rgba(18, 23, 19, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 22% -12%, rgba(91, 185, 71, 0.12), transparent 32%),
    linear-gradient(180deg, #fbfdf9 0%, var(--bg) 42%, #eef4ec 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
textarea,
button {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 260px;
  padding: 22px 18px;
  overflow-y: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f6faf4 100%);
  color: var(--text);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 24px rgba(18, 23, 19, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.brand-logo {
  width: 104px;
  height: auto;
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 30px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: #263328;
  font-weight: 750;
}

.side-nav a:hover,
.side-nav a.is-active {
  background: #eaf6e5;
  color: var(--brand-green-dark);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #eef3eb;
  color: #3b473d;
  font-size: 11px;
  font-weight: 900;
}

.side-nav a:hover .nav-icon,
.side-nav a.is-active .nav-icon {
  background: var(--primary);
  color: #ffffff;
}

.nav-dot,
.event-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--primary);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 13px;
  border-radius: 8px;
  background: var(--brand-black);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(21, 21, 21, 0.18);
}

.sidebar-footer .nav-icon {
  background: var(--primary);
  color: #ffffff;
}

.sidebar-footer strong,
.sidebar-footer small {
  display: block;
  line-height: 1.2;
}

.sidebar-footer small {
  color: #b9d8b2;
}

.main-area {
  width: 100%;
  min-width: 0;
  margin-left: 260px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.menu-toggle {
  display: none;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.global-search {
  flex: 1;
}

.global-search input,
.inline-form input,
.inline-form select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.stack input,
.stack select,
.stack textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.global-search input {
  max-width: 520px;
  box-shadow: 0 8px 22px rgba(18, 23, 19, 0.04);
}

.top-filter {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #303b32;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(18, 23, 19, 0.04);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu strong,
.user-menu small {
  display: block;
  text-align: right;
}

.user-menu small,
.muted-text {
  color: var(--muted);
}

.notification-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22);
}

.content {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-heading h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-grid,
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.integration-tile,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 10px;
  min-height: 126px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--tone, var(--primary));
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  font-size: 34px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.metric-top,
.metric-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.metric-top {
  min-height: 36px;
  color: #253027;
  font-weight: 800;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: var(--tone, var(--primary));
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 12px 22px var(--tone-shadow, rgba(91, 185, 71, 0.22));
}

.metric-foot {
  font-size: 13px;
}

.trend-up {
  color: var(--success) !important;
  font-weight: 900;
}

.sparkline {
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 86px;
  height: 34px;
  opacity: 0.85;
  background:
    linear-gradient(140deg, transparent 0 36%, var(--tone, var(--primary)) 37% 43%, transparent 44%) 0 8px / 30px 24px repeat-x;
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.tone-green {
  --tone: var(--primary);
  --tone-shadow: rgba(91, 185, 71, 0.24);
}

.tone-gold {
  --tone: var(--accent);
  --tone-shadow: rgba(242, 183, 5, 0.24);
}

.tone-purple {
  --tone: var(--purple);
  --tone-shadow: rgba(116, 87, 230, 0.22);
}

.tone-red {
  --tone: var(--danger);
  --tone-shadow: rgba(220, 38, 38, 0.2);
}

.tone-dark {
  --tone: var(--brand-black);
  --tone-shadow: rgba(21, 21, 21, 0.18);
}

.panel,
.integration-tile {
  padding: 18px;
}

.panel + .panel,
.two-column + .panel {
  margin-top: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.dashboard-grid .panel {
  margin-top: 0;
}

.dashboard-grid > .panel:nth-child(1),
.dashboard-grid > .panel:nth-child(4),
.dashboard-grid > .panel:nth-child(5) {
  grid-column: span 5;
}

.dashboard-grid > .panel:nth-child(2) {
  grid-column: span 4;
}

.channel-panel {
  grid-column: span 3;
}

.side-panel {
  grid-column: span 2;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.panel-header,
.tile-footer,
.inline-actions,
.inline-form,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel h2,
.integration-tile h2 {
  margin: 0;
  font-size: 18px;
}

.line-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 220px;
  padding: 26px 12px 14px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(102, 114, 101, 0.16) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, #ffffff 0%, #f7fbf4 100%);
}

.line-chart::before {
  content: "";
  position: absolute;
  inset: auto 12px 14px;
  height: 72%;
  background: linear-gradient(180deg, rgba(91, 185, 71, 0.34), rgba(91, 185, 71, 0.02));
  clip-path: polygon(0 74%, 7% 66%, 14% 44%, 21% 52%, 28% 37%, 35% 58%, 42% 49%, 50% 22%, 57% 8%, 64% 48%, 71% 62%, 78% 34%, 86% 42%, 94% 28%, 100% 55%, 100% 100%, 0 100%);
}

.line-chart span {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 5px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--primary), rgba(91, 185, 71, 0.12));
}

.bar-chart {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  height: 220px;
  padding: 12px 8px 0;
  border-radius: 8px;
  background:
    linear-gradient(to bottom, rgba(102, 114, 101, 0.14) 1px, transparent 1px) 0 0 / 100% 25%,
    #ffffff;
}

.bar-chart > div {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-width: 42px;
}

.bar {
  display: block;
  width: min(54px, 80%);
  min-height: 18px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--primary), var(--brand-green-dark));
  box-shadow: 0 12px 22px rgba(91, 185, 71, 0.18);
}

.real-bars strong {
  font-size: 12px;
  color: var(--text);
  line-height: 1;
}

.bar-chart small {
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.channel-panel {
  display: grid;
  gap: 12px;
}

.donut-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  margin: 2px auto 6px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 28%, var(--accent) 28% 50%, var(--brand-black) 50% 75%, var(--purple) 75% 100%);
  box-shadow: inset 0 0 0 1px rgba(18, 23, 19, 0.05);
}

.donut-chart::before {
  content: "";
  position: absolute;
  inset: 38px;
  border-radius: 50%;
  background: #ffffff;
}

.donut-chart strong,
.donut-chart small {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.donut-chart strong {
  font-size: 34px;
  line-height: 1;
}

.donut-chart small {
  color: var(--muted);
}

.channel-list,
.integration-status-list,
.quick-actions {
  display: grid;
  gap: 10px;
}

.channel-list span,
.integration-status-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: #253027;
}

.channel-list span {
  justify-content: flex-start;
}

.channel-list strong {
  margin-left: auto;
}

.dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--muted);
}

.dot.green {
  background: var(--primary);
}

.dot.gold {
  background: var(--accent);
}

.dot.black {
  background: var(--brand-black);
}

.dot.purple {
  background: var(--purple);
}

.integration-status-list strong {
  font-size: 12px;
  text-transform: uppercase;
}

.integration-status-list .ok {
  color: var(--success);
}

.integration-status-list .warn {
  color: var(--warning);
}

.quick {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
}

.quick.green {
  background: rgba(91, 185, 71, 0.13);
  border-color: rgba(91, 185, 71, 0.24);
  color: var(--brand-green-dark);
}

.quick.black {
  background: #f1f3f0;
  border-color: #d9dfd6;
  color: var(--brand-black);
}

.quick.gold {
  background: rgba(242, 183, 5, 0.13);
  border-color: rgba(242, 183, 5, 0.24);
  color: #8a6100;
}

.quick.gray {
  background: #f8faf7;
  border-color: var(--border);
  color: #3b473d;
}

.integration-tile {
  display: grid;
  gap: 20px;
  min-height: 220px;
}

.integration-tile p {
  color: var(--muted);
  line-height: 1.45;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.mini-metrics strong {
  color: var(--text);
  font-size: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.button.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(91, 185, 71, 0.18);
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.button.ghost:hover {
  border-color: rgba(91, 185, 71, 0.45);
  color: var(--brand-green-dark);
}

.button.full {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.success {
  background: rgba(0, 166, 80, 0.12);
  color: #04713b;
}

.badge.danger {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.badge.info {
  background: rgba(91, 185, 71, 0.14);
  color: var(--brand-green-dark);
}

.badge.warning {
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.badge.muted {
  background: #edf2f7;
  color: #475569;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.alert.success {
  border-color: rgba(0, 166, 80, 0.25);
  color: #04713b;
}

.alert.danger {
  border-color: rgba(220, 38, 38, 0.25);
  color: #991b1b;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdf9;
}

.row-actions,
.inline-actions {
  justify-content: flex-end;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.empty {
  color: var(--muted);
}

.event-list {
  display: grid;
  gap: 12px;
}

.event-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.event-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

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

.form-grid.compact {
  align-items: end;
}

.form-grid label,
.stack label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 14px;
}

.span-2 {
  grid-column: span 2;
}

.check-line {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.check-line input {
  width: auto;
}

.form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.message-preview {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--text);
  line-height: 1.5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.inline-form {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
  width: min(240px, 100%);
}

.inline-actions input {
  width: min(150px, 100%);
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.ai-answer-form {
  display: grid;
  gap: 8px;
  min-width: 320px;
  margin-top: 8px;
}

.ai-answer-form textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  line-height: 1.35;
}

.whatsapp-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: 680px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.whatsapp-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border-right: 1px solid var(--border);
  background: #f8fbf6;
}

.whatsapp-search {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.whatsapp-search input,
.whatsapp-search select,
.chat-compose textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.conversation-list {
  overflow: auto;
}

.conversation-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.conversation-row:hover,
.conversation-row.is-active {
  background: #eef8ea;
}

.conversation-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 900;
  text-transform: uppercase;
}

.conversation-row strong,
.conversation-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-row small,
.conversation-row em,
.chat-header small,
.chat-bubble small,
.chat-empty span {
  color: var(--muted);
  font-style: normal;
}

.conversation-row em {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  background:
    linear-gradient(135deg, rgba(91, 185, 71, 0.08) 25%, transparent 25%) 0 0 / 24px 24px,
    #f2f6ef;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
}

.chat-header strong,
.chat-header small {
  display: block;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 18px;
}

.chat-bubble {
  width: min(680px, 82%);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(18, 23, 19, 0.06);
}

.chat-bubble.out {
  align-self: flex-end;
  background: #e4f7de;
  border-color: rgba(91, 185, 71, 0.35);
}

.chat-bubble.in {
  align-self: flex-start;
}

.chat-bubble p {
  margin: 0 0 6px;
  line-height: 1.45;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.chat-compose textarea {
  resize: vertical;
}

.chat-empty {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 420px;
  color: var(--text);
  text-align: center;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 9px;
  min-width: 520px;
}

.permission-grid label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #334155;
  font-size: 13px;
}

.status-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.status-list dt {
  color: var(--muted);
  font-weight: 700;
}

.status-list dd {
  margin: 0;
}

.filter-row {
  margin-bottom: 16px;
}

.product-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  word-break: break-word;
}

.stock-total-panel {
  display: grid;
  align-content: center;
  gap: 8px;
}

.stock-total-panel span,
.stock-total-panel small {
  color: var(--muted);
}

.stock-total-panel strong {
  font-size: 56px;
  line-height: 1;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stock-card {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.stock-card span,
.stock-card small {
  color: var(--muted);
}

.stock-card strong {
  font-size: 34px;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 900;
}

.stock-pill.ok {
  background: rgba(0, 166, 80, 0.12);
  color: #04713b;
}

.stock-pill.zero {
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

.soft-text,
.soft-warning {
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #334155;
}

.soft-warning {
  background: rgba(217, 119, 6, 0.12);
  color: #7c2d12;
}

.json-box {
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--brand-black);
  color: #dcf8d6;
  font-size: 13px;
  line-height: 1.55;
}

.narrow {
  max-width: 620px;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 28% 14%, rgba(91, 185, 71, 0.34), transparent 26%),
    linear-gradient(135deg, #111311 0%, #1b211b 54%, #2f8f38 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(430px, 100%);
  padding: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.24);
}

.login-brand {
  color: var(--text);
}

.login-brand small {
  color: var(--muted);
}

.login-panel h1 {
  margin: 28px 0 18px;
  font-size: 28px;
}

.field-error {
  color: var(--danger);
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.ranking-row small,
.review-link-box span,
.review-public-muted {
  color: var(--muted);
}

.ranking-position {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-black);
  color: #ffffff;
  font-weight: 900;
}

.review-link-box {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  word-break: break-word;
}

.review-link-box a {
  color: var(--brand-green-dark);
  font-weight: 800;
}

.review-public-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(21, 21, 21, 0.94) 0%, rgba(21, 21, 21, 0.86) 42%, rgba(47, 143, 56, 0.88) 100%),
    #151515;
}

.review-public-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.review-public-panel {
  width: min(720px, 100%);
  padding: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.26);
}

.review-public-logo {
  width: 164px;
  height: auto;
  margin-bottom: 24px;
}

.review-public-panel h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.02;
}

.review-public-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.review-public-form label {
  display: grid;
  gap: 8px;
  color: #263328;
  font-weight: 800;
}

.review-public-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

.review-score-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.review-score-group legend {
  padding: 0;
  color: #263328;
  font-weight: 900;
}

.review-score-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 8px;
}

.review-score-options label {
  position: relative;
  display: block;
}

.review-score-options input {
  position: absolute;
  opacity: 0;
}

.review-score-options span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
}

.review-score-options input:checked + span {
  border-color: var(--brand-green-dark);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(91, 185, 71, 0.18);
}

.report-filter {
  align-items: end;
}

.report-filter label {
  display: grid;
  gap: 7px;
  min-width: 180px;
  color: #334155;
  font-weight: 800;
}

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

.report-kpi-grid div {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.report-kpi-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-kpi-grid strong {
  font-size: 26px;
}

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

.diagnostic-panel {
  min-width: 0;
}

.diagnostic-list {
  display: grid;
  gap: 10px;
}

.diagnostic-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.diagnostic-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.diagnostic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.diagnostic-dot.success {
  background: var(--success);
}

.diagnostic-dot.warning {
  background: var(--warning);
}

.diagnostic-dot.danger {
  background: var(--danger);
}

.diagnostic-dot.info {
  background: var(--brand-green-dark);
}

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

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.checklist-item p {
  margin: 0;
  color: #263328;
  line-height: 1.35;
}

.diagnostic-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1320px) {
  .dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dashboard-grid > .panel:nth-child(1),
  .dashboard-grid > .panel:nth-child(4),
  .dashboard-grid > .panel:nth-child(5) {
    grid-column: 1 / -1;
  }

  .dashboard-grid > .panel:nth-child(2),
  .channel-panel,
  .side-panel {
    grid-column: span 3;
  }
}

@media (max-width: 1080px) {
  .whatsapp-shell {
    grid-template-columns: 1fr;
  }

  .whatsapp-list {
    max-height: 340px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnostic-layout,
  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .diagnostic-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-block;
  }

  .topbar {
    padding: 12px 16px;
  }

  .hide-mobile,
  .global-search {
    display: none;
  }

  .user-menu span {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 25px;
  }

  .dashboard-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid > .panel,
  .dashboard-grid > .panel:nth-child(1),
  .dashboard-grid > .panel:nth-child(2),
  .dashboard-grid > .panel:nth-child(4),
  .dashboard-grid > .panel:nth-child(5),
  .channel-panel,
  .side-panel {
    grid-column: 1 / -1;
  }

  .line-chart,
  .bar-chart {
    height: 190px;
  }

  .donut-chart {
    width: 146px;
    height: 146px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-list div {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .panel-header,
  .tile-footer,
  .inline-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    width: 94%;
  }

  .review-public-shell {
    padding: 16px;
  }

  .review-public-panel {
    padding: 22px;
  }

  .review-public-panel h1 {
    font-size: 30px;
  }

  .review-score-options {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
  }

  .report-kpi-grid {
    grid-template-columns: 1fr;
  }

  .diagnostic-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .diagnostic-actions {
    grid-template-columns: 1fr;
  }
}
