:root {
  --whatabot-build: dashboard-d1-6;
  --bg: #f5f6fb;
  --side: #fff;
  --panel: #fff;
  --line: #e4e6ef;
  --text: #171a2a;
  --muted: #70758c;
  --purple: #7b3ff2;
  --purple2: #4c1fd6;
  --lav: #f2ecff;
  --lilac: #b58cff;
  --aqua: #2dd4bf;
  --green: #16b978;
  --greenbg: #e9f9f2;
  --red: #ef476f;
  --redbg: #fff0f3;
  --amber: #f59e0b;
  --shadow: 0 8px 25px rgba(67, 43, 133, 0.08);
  --shadow-strong: 0 22px 50px rgba(76, 31, 214, 0.2);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Poppins,
    Segoe UI,
    Arial,
    sans-serif;
  height: 100%;
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
}
.shell {
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
  height: 100vh;
}
.app-header {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 59px;
  margin: 7px 10px 0;
  padding: 7px 14px 7px 17px;
  overflow: visible;
  background:
    radial-gradient(
      circle at 88% 36%,
      rgba(45, 212, 191, 0.2) 0 58px,
      transparent 59px
    ),
    linear-gradient(105deg, rgba(181, 140, 255, 0.12), #fff 39%, #f8fbfb);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(67, 43, 133, 0.05);
}
.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 43px;
  flex: 0 0 auto;
}
.brand img {
  width: 178px;
  max-width: 100%;
  height: auto;
  display: block;
}
.top-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}
.header-profile {
  position: relative;
  z-index: 70;
  flex: 0 0 auto;
  margin-left: 8px;
}
.nav {
  border: 0;
  background: transparent;
  color: #4f546a;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.navico {
  width: 21px;
  text-align: center;
  color: #767b86;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}
.nav-label {
  display: none;
}
.nav:hover {
  background: #f6f3ff;
  color: var(--purple2);
}
.nav:hover .navico {
  color: var(--purple2);
}
.nav.active {
  width: auto;
  min-width: 42px;
  padding: 0 15px;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  color: #fff;
  box-shadow: 0 7px 18px rgba(111, 53, 242, 0.16);
}
.nav.active .nav-label {
  display: inline;
}
.nav.active .navico {
  color: #fff;
}
main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0 18px 9px;
  overflow: hidden;
}
.topbar {
  position: relative;
  z-index: 30;
  isolation: isolate;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 7px;
}
.header-title h1 {
  margin: 0;
  color: var(--purple2);
  font-size: 23px;
  letter-spacing: -0.5px;
}
.header-title h1 small {
  font-size: 9px;
  font-weight: 500;
  color: var(--purple2);
  background: var(--lav);
  border-radius: 999px;
  padding: 4px 7px;
  vertical-align: middle;
}
.header-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--purple), var(--purple2));
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 230px;
  min-width: 0;
  max-width: 230px;
  height: 42px;
  padding: 6px 8px 6px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(61, 43, 116, 0.05);
}
.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
  color: var(--purple2);
  border-color: rgba(123, 63, 242, 0.35);
  background: #fff;
}
.profile-trigger-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
  text-align: right;
}
.profile-trigger-copy small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.profile-trigger-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-chevron {
  color: var(--purple);
  font-size: 16px;
}
.profile-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 9px);
  right: 0;
  display: none;
  width: 322px;
  max-height: calc(100vh - 78px);
  gap: 8px;
  padding: 14px;
  overflow: auto;
  opacity: 1;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(123, 63, 242, 0.3);
  border-radius: 13px;
  box-shadow:
    var(--shadow-strong),
    0 2px 8px rgba(23, 26, 42, 0.08);
}
.profile-menu.open {
  display: grid;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-bottom: 2px;
}
.profile-avatar {
  width: 42px;
  height: 42px;
}
.profile-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.profile-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-copy span,
.profile-menu label,
.profile-menu label small {
  color: var(--muted);
  font-size: 9px;
}
.profile-menu label {
  display: grid;
  gap: 4px;
}
.profile-menu label small {
  line-height: 1.35;
}
.profile-company-switcher {
  display: none !important;
}
.profile-company-switcher.visible {
  display: grid !important;
}
.profile-action {
  width: 100%;
  text-align: center;
}
.profile-action.premium {
  background: linear-gradient(135deg, var(--purple), var(--purple2));
}
.profile-divider {
  border-top: 1px solid var(--line);
  margin: 1px 0;
}
.danger-link {
  color: var(--red) !important;
  border-color: #ffd8e0 !important;
}
.page {
  display: none;
  height: calc(100% - 88px);
  min-height: 0;
  overflow: hidden;
}
.page.active {
  display: block;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa;
}
.dot.good {
  background: var(--green);
}
.dot.bad {
  background: var(--red);
}
button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: 0.15s;
}
button.primary {
  background: var(--purple);
  color: #fff;
}
button.primary:hover {
  background: var(--purple2);
}
button.ghost {
  background: #fff;
  color: var(--purple2);
  border: 1px solid var(--line);
}
button.danger {
  background: var(--redbg);
  color: var(--red);
  border: 1px solid #ffd8e0;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
input,
select,
textarea {
  background: #fff;
  color: var(--text);
  border: 1px solid #dfe2ec;
  border-radius: 8px;
  padding: 7px 8px;
  outline: none;
  min-width: 0;
  font-size: 11px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #a584fa;
  box-shadow: 0 0 0 3px rgba(111, 53, 242, 0.08);
}
.panel,
.mini-stat,
.helper-card,
.action-legend {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.grid2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 9px;
}
.panel {
  padding: 12px;
  min-width: 0;
}
.panel-head,
.page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}
.panel h2,
.page-toolbar h2 {
  margin: 0;
  font-size: 15px;
}
.panel p,
.page-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}
.preview {
  white-space: pre-wrap;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  line-height: 1.45;
  color: #242738;
  font:
    10px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  height: calc(100% - 42px);
  overflow: hidden;
}
.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 31px;
  margin: 0 1px 6px;
}
.dashboard-overview-head {
  min-height: 43px;
}
.operational-card {
  border-color: rgba(123, 63, 242, 0.24);
}
.operational-card:nth-child(2) {
  border-color: rgba(45, 212, 191, 0.32);
}
.operational-icon {
  color: var(--purple);
  background: var(--lav);
}
.operational-card:nth-child(2) .operational-icon {
  color: #087f72;
  background: #e8fbf7;
}
.operational-card .metric-head strong {
  color: var(--purple2);
}
.operational-card:nth-child(2) .metric-head strong {
  color: #087f72;
}
.operational-progress {
  width: 100%;
  height: 7px;
  margin: 18px 0 17px;
  overflow: hidden;
  background: #ececf3;
  border-radius: 999px;
}
.operational-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--lilac));
  border-radius: inherit;
  transition: width 180ms ease;
}
.operational-card:nth-child(2) .operational-progress span {
  background: linear-gradient(90deg, #18bfae, var(--aqua));
}
.dashboard-section-head h2,
.dashboard-section-head p,
.studio-title h2,
.studio-title p,
.preview-title h2,
.preview-title p {
  margin: 0;
}
.dashboard-section-head h2,
.studio-title h2,
.preview-title h2 {
  font-size: 13px;
}
.dashboard-section-head p,
.studio-title p,
.preview-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}
.identity-head {
  margin-top: 7px;
}
.live-label,
.soft-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}
.live-label > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.14);
}
.soft-badge {
  padding: 4px 8px;
  color: var(--purple2);
  background: var(--lav);
  border-radius: 999px;
}
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}
.metric-card {
  min-width: 0;
  min-height: 104px;
  padding: 10px 12px 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.metric-head small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-head strong {
  display: block;
  margin-top: 1px;
  color: var(--purple2);
  font-size: 20px;
  line-height: 1.1;
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--purple);
  background: var(--lav);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
}
.sparkline {
  display: block;
  width: 100%;
  height: 29px;
  margin: 2px 0 0;
  overflow: visible;
}
.sparkline line {
  stroke: #ececf3;
  stroke-width: 1;
}
.sparkline polyline {
  fill: none;
  stroke: var(--purple);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}
.metric-card:nth-child(4) .sparkline polyline {
  stroke: var(--aqua);
}
.metric-card:nth-child(5) .sparkline polyline {
  stroke: var(--lilac);
}
.metric-card:nth-child(6) .sparkline polyline {
  stroke: var(--purple2);
}
.metric-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}
.metric-foot span:last-child {
  color: var(--purple2);
  font-weight: 600;
}
.dashboard-studio {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  height: calc(100% - 185px);
  min-height: 390px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(123, 63, 242, 0.2);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.quick-editor,
.whatsapp-preview {
  min-width: 0;
  padding: 12px 14px;
}
.quick-editor {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
}
.whatsapp-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  background:
    radial-gradient(
      circle at 92% 8%,
      rgba(45, 212, 191, 0.18) 0 42px,
      transparent 43px
    ),
    linear-gradient(155deg, #f5f0ff, #f9fbff 58%, #effcf9);
  border-left: 1px solid rgba(123, 63, 242, 0.14);
}
.studio-title,
.preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.studio-save-actions {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 3px;
}
.studio-save-actions > span {
  min-height: 14px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  text-align: right;
}
.studio-save-actions > span.pending {
  color: #a16400;
}
.studio-save-actions > span.saved {
  color: #0a9561;
}
.studio-save-actions > span.error {
  color: var(--red);
}
.studio-save-actions button {
  min-width: 154px;
  padding-inline: 14px;
}
#saveDashboard,
#saveDashboard:hover,
#saveDashboard:focus,
#saveDashboard:active,
#saveDashboard:disabled {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  box-shadow: 0 7px 18px rgba(111, 53, 242, 0.18);
}
#saveDashboard:disabled {
  opacity: 0.72;
}
.quick-fields {
  display: grid;
  grid-template-columns: 0.42fr 1.58fr;
  gap: 7px;
}
.quick-fields label,
.quick-module-label {
  display: grid;
  gap: 3px;
  color: #555a6d;
  font-size: 8px;
}
.quick-fields .wide {
  grid-column: 1/-1;
}
.quick-fields input {
  width: 100%;
  padding: 6px 8px;
  font-size: 10px;
}
.quick-module-label {
  display: block;
  margin-top: 1px;
  color: var(--muted);
}
.quick-modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}
.quick-module {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  color: var(--text);
  background: #faf9fe;
  border: 1px solid #ece7fa;
  border-radius: 9px;
  font-size: 9px;
  cursor: pointer;
}
.quick-module input {
  width: 13px;
  height: 13px;
  min-width: 13px;
  accent-color: var(--purple);
}
.quick-module span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-skeleton {
  color: var(--muted);
  font-size: 9px;
}
.phone-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: #f7f2eb;
  border: 5px solid #25223a;
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(48, 34, 94, 0.15);
}
.phone-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple2), var(--purple));
}
.phone-head .avatar {
  width: 30px;
  height: 30px;
  background: #fff;
  color: var(--purple2);
  font-size: 10px;
}
.phone-head > div {
  display: grid;
  min-width: 0;
  gap: 1px;
  flex: 1;
}
.phone-head strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-head small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 7px;
}
.whatsapp-mark {
  color: var(--aqua);
  font-size: 17px;
}
.phone-chat {
  min-height: 0;
  padding: 11px;
  overflow: auto;
  background:
    linear-gradient(rgba(247, 242, 235, 0.91), rgba(247, 242, 235, 0.91)),
    repeating-linear-gradient(
      45deg,
      transparent 0 16px,
      rgba(76, 31, 214, 0.04) 17px 18px
    );
}
.message-bubble {
  position: relative;
  max-width: 95%;
  padding: 8px 9px 16px;
  white-space: pre-wrap;
  color: #292738;
  background: #fff;
  border-radius: 4px 11px 11px 11px;
  box-shadow: 0 2px 9px rgba(35, 27, 55, 0.08);
  font-size: 8.5px;
  line-height: 1.38;
}
.message-time {
  position: absolute;
  right: 7px;
  bottom: 4px;
  color: #8c8c98;
  font-size: 7px;
}
.preview-note {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}
.health-list {
  display: grid;
  margin-top: 5px;
}
.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 3px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f2f6;
  color: #686d7f;
  font-size: 10px;
}
.badge.on {
  background: var(--greenbg);
  color: #0a9561;
}
.badge.off {
  background: var(--redbg);
  color: var(--red);
}
.muted-pill {
  background: var(--lav);
  color: var(--purple);
}
.page-toolbar {
  margin-bottom: 8px;
  align-items: center;
}
.toolbar-actions,
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.mini-stat {
  padding: 10px 12px;
}
.mini-stat small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}
.mini-stat b {
  display: block;
  font-size: 22px;
  margin-top: 5px;
}
.custom-module-panel {
  margin-bottom: 8px;
  padding: 10px 12px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}
.template-card {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px;
  border-radius: 9px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}
.template-card b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--lav);
  color: var(--purple);
  font-size: 17px;
}
.template-card strong {
  display: block;
  font-size: 12px;
}
.template-card small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 2px;
}
.catalog-panel {
  height: calc(100% - 218px);
  padding: 10px 12px;
}
.module-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 7px;
}
.module-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.module-title strong {
  font-size: 12px;
}
.module-title small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 2px;
}
.module-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  grid-column: 1/-1;
}
.module-meta span {
  background: #f8f8fb;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 9px;
  color: var(--muted);
}
.helper-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 8px;
}
.helper-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lav);
  color: var(--purple);
  font-size: 17px;
}
.helper-card b {
  font-size: 13px;
}
.helper-card p {
  font-size: 10px;
  color: var(--muted);
  margin: 3px 0 0;
}
.icon-examples {
  display: flex;
  gap: 10px;
  font-size: 9px;
  color: #53586c;
}
.filterbar {
  display: flex;
  gap: 6px;
  margin-bottom: 7px;
}
.filterbar input {
  flex: 1;
}
.filterbar select {
  min-width: 170px;
}
.filterbar.slim {
  margin-bottom: 9px;
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}
.compact-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.compact-table th,
.compact-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  font-size: 10px;
  vertical-align: middle;
}
.compact-table th {
  background: #fafafe;
  color: #656a7d;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.03em;
}
.compact-table tr:last-child td {
  border-bottom: 0;
}
.prod-name {
  font-weight: 600;
  font-size: 11px;
}
.prod-desc {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 2px;
}
.business-glyph {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #effcf9;
  font-size: 16px;
}
.actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.actions button {
  padding: 6px 8px;
  font-size: 9px;
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.pager button {
  padding: 5px 8px;
}
.pager button.active {
  background: var(--purple);
  color: #fff;
}
.offers-layout {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 8px;
  height: calc(100% - 44px);
}
.offers-layout > .panel {
  height: 100%;
  overflow: hidden;
}
.offer-category-list,
.offer-product-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}
.offer-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 9px;
  display: grid;
  align-items: center;
  gap: 7px;
  font-size: 9px;
}
.offer-category-row {
  grid-template-columns: minmax(120px, 1fr) 70px 60px 68px 80px;
}
.offer-product-row {
  grid-template-columns: minmax(130px, 1fr) 85px 68px 95px 100px auto;
}
.offer-row label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 8px;
}
.offer-row input,
.offer-row select {
  padding: 6px 7px;
  font-size: 9px;
}
.orders-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 8px;
  height: calc(100% - 132px);
}
.orders-list-panel {
  height: 100%;
  overflow: hidden;
}
.pdf-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}
.pdf-panel label {
  display: grid;
  gap: 5px;
  font-size: 10px;
}
.pdf-panel ul {
  padding-left: 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}
.fake-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
.action-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 7px 9px;
  margin-top: 7px;
  font-size: 9px;
  color: var(--muted);
}
.action-legend b {
  color: var(--text);
}
.settings-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 8px;
}
.form-panel {
  display: grid;
  gap: 7px;
}
.form-panel h2 {
  margin: 0 0 2px;
}
.form-panel label {
  display: grid;
  gap: 4px;
  color: #555a6d;
  font-size: 9px;
}
.settings-side {
  display: grid;
  gap: 8px;
}
.compact-settings {
  height: calc(100% - 108px);
}
.compact-settings .form-panel {
  gap: 5px;
}
.notify-card {
  align-content: start;
}
.toggle-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
.chatid-inline {
  display: block;
  color: var(--purple2);
  font-size: 8px;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 1px;
}
.health-grid,
.container-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.health-card,
.container-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.health-card h3,
.container-card h3 {
  margin: 0 0 6px;
  font-size: 12px;
}
.container-actions {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}
.logs-panel {
  height: 190px;
}
.logs {
  white-space: pre-wrap;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px;
  font:
    9px/1.45 ui-monospace,
    monospace;
  height: 125px;
  overflow: auto;
}
.system-actions {
  margin-top: 9px;
}
.muted {
  color: var(--muted);
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 11px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transform: translateY(15px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 80;
  font-size: 11px;
}
.toast.show {
  transform: none;
  opacity: 1;
}
.toast.error {
  background: #fff4f6;
  color: #b91c3d;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 19, 30, 0.4);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 70;
}
.modal.hidden {
  display: none;
}
.modal-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(30, 25, 70, 0.18);
  width: min(760px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f4f4f8;
  color: #565a6c;
  font-size: 19px;
  padding: 0;
}
.modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.modal-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
}
.modal-form .full {
  grid-column: 1/-1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.order-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  margin: 7px 0;
}
.order-items {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.order-item {
  display: grid;
  grid-template-columns: 1fr 70px 100px 135px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px;
}
.order-total {
  font-size: 18px;
  font-weight: 700;
  text-align: right;
  margin-top: 10px;
}
footer {
  position: absolute;
  bottom: 7px;
  right: 28px;
  color: #a0a4b4;
  font-size: 8px;
}
@media (max-width: 1400px) {
  .action-legend {
    padding: 5px 7px;
    margin-top: 4px;
  }
  .app-header {
    margin-inline: 8px;
    padding: 7px 12px 7px 14px;
  }
  .brand img {
    width: 170px;
  }
  main {
    padding: 0 12px 8px;
  }
  .topbar {
    height: 68px;
    margin-bottom: 7px;
  }
  .page {
    height: calc(100% - 84px);
  }
  .dashboard-studio {
    height: calc(100% - 185px);
    grid-template-columns: minmax(0, 1.24fr) minmax(310px, 0.76fr);
  }
  .quick-editor,
  .whatsapp-preview {
    padding: 10px 11px;
  }
  .profile-trigger {
    width: 205px;
    min-width: 205px;
    max-width: 205px;
  }
  .template-grid {
    gap: 6px;
  }
  .template-card {
    padding: 8px;
  }
  .offer-row {
    padding: 6px;
  }
  .compact-table th,
  .compact-table td {
    padding: 7px 8px;
  }
  .orders-layout {
    grid-template-columns: minmax(0, 1fr) 285px;
  }
}
@media (max-width: 1050px) {
  html,
  body {
    overflow: auto;
  }
  .shell {
    grid-template-rows: auto auto;
    height: auto;
    min-height: 100vh;
  }
  .app-header {
    position: sticky;
    top: 0;
    height: 58px;
    margin: 0;
    border-radius: 0 0 16px 16px;
  }
  .brand img {
    width: 142px;
  }
  .top-navigation {
    gap: 2px;
  }
  .header-profile {
    margin-left: 4px;
  }
  .profile-trigger {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 2px;
  }
  .profile-trigger-copy,
  .profile-chevron {
    display: none;
  }
  .nav {
    justify-content: center;
    width: 38px;
    height: 38px;
  }
  .nav.active {
    width: 38px;
    padding: 0;
  }
  .nav-label,
  .nav.active .nav-label {
    display: none;
  }
  .navico {
    font-size: 16px;
  }
  .page {
    height: auto;
    min-height: 650px;
    overflow: visible;
  }
  .topbar {
    position: sticky;
    top: 58px;
    background: var(--bg);
    z-index: 40;
  }
  .settings-grid,
  .offers-layout,
  .orders-layout,
  .grid2,
  .dashboard-studio {
    grid-template-columns: 1fr;
  }
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-overview-head {
    height: auto;
  }
  .dashboard-studio {
    height: auto;
  }
  .whatsapp-preview {
    min-height: 420px;
    border-top: 1px solid rgba(123, 63, 242, 0.14);
    border-left: 0;
  }
  .template-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  main {
    height: auto;
    overflow: visible;
  }
  .catalog-panel,
  .offers-layout > .panel,
  .compact-settings {
    height: auto;
  }
  footer {
    display: none;
  }
}
