﻿:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #16202a;
  --muted: #687685;
  --line: #d9e0e7;
  --primary: #4f46e5;
  --primary-strong: #3730a3;
  --accent: #167c80;
  --accent-2: #b94b65;
  --good: #188557;
  --warn: #b46b16;
  --sidebar-bg: #050505;
  --login-bg: #f4f6f8;
  --login-panel-bg: #ffffff;
  --login-text: #16202a;
  --login-button-bg: #167c80;
  --login-font: Inter, Segoe UI, Arial, sans-serif;
  --app-font: Inter, Segoe UI, Arial, sans-serif;
  --base-font-size: 16px;
  --shadow: 0 16px 40px rgba(22, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--bg);
  color: var(--text);
  font-family: var(--app-font);
  font-size: var(--base-font-size);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body[data-visual-style="gradient"] {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg) 82%, #ffffff), color-mix(in srgb, var(--accent) 16%, var(--bg)) 46%, color-mix(in srgb, var(--primary) 12%, var(--bg)));
}

body[data-visual-style="glass"] {
  background:
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 34%),
    radial-gradient(circle at 86% 8%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 30%),
    var(--bg);
}

body[data-visual-style="glass"] .panel,
body[data-visual-style="glass"] .portal-shell,
body[data-visual-style="glass"] .users-shell,
body[data-visual-style="glass"] .commercial-card,
body[data-visual-style="glass"] .portal-card,
body[data-visual-style="glass"] .login-panel {
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  backdrop-filter: blur(16px);
  border-color: color-mix(in srgb, var(--line) 62%, #ffffff);
}

body[data-visual-style="soft"] .panel,
body[data-visual-style="soft"] .portal-shell,
body[data-visual-style="soft"] .users-shell,
body[data-visual-style="soft"] .portal-card,
body[data-visual-style="soft"] .commercial-card,
body[data-visual-style="soft"] .login-panel {
  border-color: transparent;
  box-shadow: 10px 10px 28px rgba(15, 23, 42, 0.12), -10px -10px 28px rgba(255, 255, 255, 0.76);
}

body[data-visual-style="minimal"] .panel,
body[data-visual-style="minimal"] .portal-card,
body[data-visual-style="minimal"] .commercial-card {
  box-shadow: none;
}

body[data-visual-style="aurora"]::before,
body[data-visual-style="animated"]::before {
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 36%, transparent), transparent 26%),
    radial-gradient(circle at 80% 12%, rgba(79, 70, 229, 0.22), transparent 28%),
    radial-gradient(circle at 52% 82%, rgba(245, 158, 11, 0.18), transparent 30%);
  filter: blur(6px);
}

body[data-visual-style="aurora"] .top-action,
body[data-visual-style="aurora"] .portal-card,
body[data-visual-style="aurora"] .commercial-card {
  box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 22%, transparent);
}

body[data-visual-style="animated"] {
  background: linear-gradient(120deg, var(--bg), color-mix(in srgb, var(--accent) 18%, var(--bg)), color-mix(in srgb, var(--primary) 16%, var(--bg)), var(--bg));
  background-size: 320% 320%;
  animation: simAnimatedGradient 14s ease infinite;
}

@keyframes simAnimatedGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.sidebar,
.shell,
.login-screen {
  position: relative;
}

body.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

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

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fbfcfd;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(color-mix(in srgb, var(--login-bg) 92%, transparent), color-mix(in srgb, var(--login-bg) 92%, transparent)),
    url("data:image/svg+xml,%3Csvg width='1200' height='700' viewBox='0 0 1200 700' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d9e0e7' stroke-width='2'%3E%3Cpath d='M80 570 C270 360 420 420 550 250 S850 170 1120 90'/%3E%3Cpath d='M120 620 C330 500 450 520 610 370 S890 330 1060 210'/%3E%3C/g%3E%3Cg fill='%23167c80'%3E%3Ccircle cx='550' cy='250' r='7'/%3E%3Ccircle cx='860' cy='170' r='7'/%3E%3Ccircle cx='1060' cy='210' r='7'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.unauthenticated .login-screen {
  display: grid;
}

.unauthenticated .sidebar,
.unauthenticated .shell {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.unauthenticated .sidebar-toggle {
  display: none;
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 17px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--login-panel-bg);
  color: var(--login-text);
  font-family: var(--login-font);
  box-shadow: var(--shadow);
}

.login-brand {
  justify-content: center;
  color: var(--login-text);
  margin-bottom: 18px;
  text-align: center;
}

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

.login-panel label,
.login-message {
  color: color-mix(in srgb, var(--login-text) 72%, #64748b);
}

.login-panel label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

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

.login-panel button {
  background: var(--login-button-bg);
}

.advanced-login {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced-login summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.advanced-login label {
  margin-top: 12px;
}

.login-message {
  min-height: 20px;
  line-height: 1.35;
  text-align: center;
}

.login-version {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

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

.login-footer {
  color: color-mix(in srgb, var(--login-text) 68%, #64748b);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.login-version span {
  white-space: pre-wrap;
}

.login-message.error {
  color: var(--accent-2);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: var(--sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 28px;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.sidebar-toggle {
  position: fixed;
  left: 246px;
  top: 96px;
  z-index: 70;
  width: 34px;
  height: 64px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 14px 14px 0;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: left 0.22s ease, background 0.18s ease, transform 0.18s ease;
}

.sidebar-toggle:hover {
  background: #312e81;
  transform: translateX(2px);
}

.sidebar-toggle span,
.sidebar-toggle::before {
  display: block;
}

.sidebar-toggle span::before {
  content: "<";
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

body.sidebar-collapsed .sidebar-toggle {
  left: 0;
  border-radius: 0 14px 14px 0;
}

body.sidebar-collapsed .sidebar-toggle span::before {
  content: ">";
}

body.sidebar-collapsed .sidebar {
  pointer-events: none;
  transform: translateX(-100%);
  opacity: 0;
}

body.sidebar-collapsed .logo-oval {
  width: 48px;
  height: 48px;
  font-size: 0;
}

body.sidebar-collapsed .brand > div,
body.sidebar-collapsed .session-card div {
  display: none;
}

body.sidebar-collapsed .nav-item {
  width: 48px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  text-align: center;
}

body.sidebar-collapsed .nav-item::first-letter {
  font-size: 16px;
}

body.sidebar-collapsed .session-card {
  padding: 8px;
}

.logo-oval {
  width: 138px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #37348f;
  color: #ffffff;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 0.9;
  transform: skew(-7deg);
}

.logo-oval em {
  font-size: 19px;
}

.logo-oval.has-image {
  background: transparent;
  transform: none;
  border-radius: 0;
}

.logo-oval img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

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

.login-brand .brand-mark {
  width: 170px;
  height: 88px;
  font-size: 24px;
}

.brand-mark.has-image {
  background: transparent;
  overflow: hidden;
}

.brand-mark img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand small,
.sidebar-panel label {
  display: block;
  color: #afbdca;
  margin-top: 3px;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.nav-item,
button,
.file-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item {
  padding: 12px 14px;
  text-align: left;
  color: #dfe8ef;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-item {
  white-space: nowrap;
}

.nav-item.hidden-by-permission {
  display: none;
}

.workspace-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(22, 32, 42, 0.05);
  overflow: hidden;
}

.workspace-tab.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 10px 24px rgba(22, 32, 42, 0.09);
}

.workspace-tab button {
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-tab button:first-child {
  padding: 10px 14px;
}

.workspace-tab button:last-child {
  padding: 10px 12px;
  color: var(--muted);
}

.sidebar-panel {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.session-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.session-card span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 900;
  overflow: hidden;
  cursor: pointer;
}

.session-card span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.session-card strong,
.session-card small {
  display: block;
}

.session-card strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-card small {
  color: #afbdca;
  font-size: 12px;
  margin-top: 2px;
}

#appVersionLabel {
  font-size: 10px;
  opacity: 0.85;
}

select {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
}

.shell {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

.topbar p,
.panel-title span,
.kpi small {
  color: var(--muted);
}

.topbar p {
  margin-top: 8px;
}

.actions,
.data-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.file-btn {
  padding: 11px 14px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

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

.top-action {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.top-action.chat-action {
  border-color: transparent;
  background: #f59e0b;
  color: #fff;
}

.top-action.install-action {
  border-color: transparent;
  background: #4f46e5;
  color: #fff;
}

.danger {
  background: #7f3143;
}

.hidden,
.utility-action {
  display: none !important;
}

.file-btn input {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.kpi,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 18px;
  display: grid;
  gap: 9px;
}

.kpi span {
  color: var(--muted);
  font-size: 14px;
}

.kpi strong {
  font-size: 28px;
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 14px;
}

.users-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.users-header,
.users-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.users-header {
  padding: 10px 0 28px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #433f96;
  color: #ffffff;
  font-weight: 900;
}

.section-title h2 {
  font-size: 25px;
  text-transform: uppercase;
}

.users-toolbar {
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.users-total {
  min-width: 190px;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 22px 24px;
  border-radius: 28px;
  background: #1e5bff;
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(30, 91, 255, 0.22);
}

.users-total span,
.status-filter span,
.search-field {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.users-total strong {
  font-size: 28px;
}

.status-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: min(420px, 100%);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #ffffff;
}

.status-filter {
  flex: 1;
  display: grid;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  padding: 10px;
}

.status-filter.active {
  background: var(--surface-2);
  color: var(--text);
}

.status-filter strong {
  color: var(--accent);
  font-size: 20px;
}

.search-field {
  display: grid;
  gap: 7px;
  min-width: 230px;
  color: #8a99ad;
}

.search-field input {
  min-height: 58px;
  border-radius: 24px;
  padding-inline: 20px;
}

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

.users-table th,
.users-table td {
  padding: 18px 24px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-photo {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: #111;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.user-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag,
.profile-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 7px;
  background: #eef2ff;
  color: #433f96;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

button.tag {
  border: 0;
  cursor: pointer;
}

button.tag:hover {
  filter: brightness(0.96);
}

.tag-good {
  background: #e5f6ee;
  color: var(--good);
}

.tag-warn {
  background: #fff1db;
  color: var(--warn);
}

.tag-bad {
  background: #fae8ed;
  color: var(--accent-2);
}

.profile-chip {
  background: #e8f1ff;
  color: #1e5bff;
}

.table-action {
  background: #433f96;
  color: #fff;
  padding: 9px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

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

.icon-action {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  background: #f4f7fb;
  color: #8da0b7;
}

.icon-action:hover,
.icon-action.is-active {
  background: #eef2ff;
  color: #433f96;
}

.danger-icon {
  color: #b94b65;
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.sector-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.sector-edit-btn {
  justify-self: start;
}

.sector-card h3 {
  margin: 0;
  font-size: 17px;
  text-transform: uppercase;
}

.sector-card p {
  margin-top: 6px;
  color: var(--muted);
}

.sector-branches {
  font-size: 12px;
  line-height: 1.4;
}

.commercial-shell {
  display: grid;
  gap: 26px;
}

.commercial-shell.detail-open {
  gap: 16px;
}

.commercial-shell.detail-open .commercial-heading {
  display: none;
}

.commercial-windowbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  text-transform: uppercase;
}

.commercial-windowbar .section-icon,
.commercial-heading .section-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.commercial-heading {
  display: grid;
  gap: 8px;
  padding: 12px 4px 0;
}

.commercial-heading h2 {
  font-size: 26px;
  text-transform: uppercase;
}

.commercial-heading p {
  color: var(--muted);
}

.commercial-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 4px;
}

.commercial-tab {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(22, 32, 42, 0.05);
}

.commercial-tab.active {
  border-color: var(--tab-accent);
  background: var(--tab-accent);
  color: #fff;
  box-shadow: 0 12px 26px rgba(67, 63, 150, 0.22);
}

.commercial-tab-main,
.commercial-tab-close {
  min-height: 40px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.commercial-tab-main {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.commercial-tab.active .commercial-tab-main,
.commercial-tab.active .commercial-tab-close {
  color: #fff;
}

.commercial-tab-main span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--tab-accent);
  color: #fff;
  font-size: 10px;
}

.commercial-tab.active .commercial-tab-main span {
  background: rgba(255, 255, 255, 0.2);
}

.commercial-tab-close {
  width: 36px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
}

.commercial-tab-close:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.commercial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 20px;
}

.commercial-card {
  position: relative;
  min-height: 150px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(22, 32, 42, 0.05);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.commercial-card:hover,
.commercial-card:focus-visible {
  border-color: var(--card-accent);
  box-shadow: 0 18px 38px rgba(67, 63, 150, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.commercial-card.selected {
  border-color: var(--card-accent);
  box-shadow: 0 18px 38px rgba(67, 63, 150, 0.14);
}

.commercial-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--card-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.commercial-card-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.commercial-card h3 {
  margin: 4px 0 0;
  font-size: 17px;
  text-transform: uppercase;
}

.commercial-card p {
  max-width: 78%;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.commercial-card button {
  justify-self: start;
  padding: 0;
  background: transparent;
  color: var(--card-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.commercial-card button::after {
  content: " ->";
}

.commercial-card-watermark {
  position: absolute;
  right: 24px;
  top: 24px;
  color: var(--card-accent);
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.08;
}

.commercial-detail {
  display: grid;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.commercial-shell.detail-open .commercial-detail {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.commercial-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.commercial-detail-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commercial-detail h3 {
  margin: 6px 0;
  font-size: 22px;
}

.commercial-detail p {
  color: var(--muted);
}

.commercial-detail dl {
  display: grid;
  gap: 8px;
  min-width: min(420px, 100%);
  margin: 0;
}

.commercial-detail dl div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.commercial-detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.commercial-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.commercial-card-badge {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-accent) 12%, #fff);
  color: var(--card-accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.commercial-report {
  display: grid;
  gap: 14px;
}

.commercial-analysis-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.commercial-analysis-sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.commercial-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.commercial-back-btn {
  width: fit-content;
  min-height: 38px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.commercial-analysis-sidebar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.commercial-analysis-sidebar input,
.commercial-analysis-sidebar select {
  min-height: 48px;
  margin-top: 0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.commercial-analysis-sidebar #commercialSyncBtn {
  min-height: 50px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 26px rgba(79, 70, 229, 0.22);
}

.commercial-analysis-main {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.commercial-analysis-topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px 140px 120px auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.commercial-analysis-topbar input,
.commercial-analysis-topbar select {
  min-height: 44px;
  margin-top: 0;
  border-radius: 14px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.commercial-analysis-topbar .commercial-tool-secondary {
  min-height: 44px;
  border-radius: 14px;
  background: #eef2ff;
  color: var(--primary);
  box-shadow: none;
  white-space: nowrap;
}

.seller-occurrence-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.seller-occurrence-summary article {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.seller-occurrence-summary span {
  color: #16327f;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.seller-occurrence-summary strong {
  color: #0f172a;
  font-size: 26px;
  font-weight: 950;
}

.commercial-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: #f1f5f9;
}

.commercial-view-toggle button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.commercial-view-toggle button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.commercial-analysis-output {
  display: grid;
  gap: 18px;
}

.commercial-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
}

.commercial-kpi-card {
  min-height: 154px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 22px;
  border: 3px solid var(--metric-accent);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.commercial-kpi-card:hover,
.commercial-kpi-card.active {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.12);
  background: color-mix(in srgb, var(--metric-accent) 4%, #fff);
}

.commercial-kpi-card.bad {
  --metric-accent: #f43f5e;
}

.commercial-kpi-card.warn {
  --metric-accent: #f59e0b;
}

.commercial-kpi-card.blue {
  --metric-accent: #2563eb;
}

.commercial-kpi-card.super {
  --metric-accent: #4f46e5;
}

.commercial-kpi-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.commercial-kpi-label {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 8px;
  background: #19358d;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.commercial-kpi-tiers {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.commercial-kpi-tiers button {
  width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  box-shadow: none;
  font-size: 10px;
  font-weight: 950;
}

.commercial-kpi-tiers button:nth-child(2) {
  background: #dcfce7;
  color: #059669;
}

.commercial-kpi-tiers button:nth-child(3) {
  background: #ffe4e6;
  color: #f43f5e;
}

.commercial-kpi-tiers button.active {
  outline: 3px solid color-mix(in srgb, var(--metric-accent) 22%, #fff);
  transform: scale(1.08);
}

.commercial-kpi-tiers strong {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--metric-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.commercial-kpi-values {
  display: grid;
  gap: 8px;
  margin: 0;
}

.commercial-kpi-values div,
.seller-card-values div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.commercial-kpi-values dt,
.seller-card-values span {
  color: #16327f;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.commercial-kpi-values dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.commercial-kpi-values small {
  display: block;
  margin-top: 2px;
  color: var(--metric-accent);
  font-size: 10px;
  font-weight: 950;
}

.commercial-kpi-values .good,
.seller-card-values .good {
  color: #059669;
}

.commercial-kpi-values .bad,
.seller-card-values .bad {
  color: #f43f5e;
}

.commercial-seller-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 14px;
}

.commercial-seller-card {
  display: grid;
  gap: 14px;
  min-height: 196px;
  padding: 18px;
  border: 3px solid #4f46e5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

.commercial-seller-card.selected {
  background: #f8fafc;
  box-shadow: 0 18px 34px rgba(79, 70, 229, 0.16);
}

.commercial-seller-card.bad {
  border-color: #f43f5e;
}

.commercial-seller-card.warn {
  border-color: #f59e0b;
}

.commercial-seller-card.good {
  border-color: #10b981;
}

.commercial-seller-card.blue {
  border-color: #2563eb;
}

.seller-rank {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
}

.seller-card-main h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.seller-card-main span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.seller-card-values {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.seller-card-values strong {
  color: #312e81;
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.seller-card-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  pointer-events: auto;
}

.seller-card-actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  color: #37348f;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}

.seller-card-actions button:first-child {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.seller-card-tenure {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.seller-card-tenure strong {
  color: #4f46e5;
}

.ranking-image-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  max-height: 76vh;
  overflow: hidden;
}

.ranking-image-controls {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 6px;
}

.ranking-image-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.ranking-image-controls input,
.ranking-image-controls select,
.ranking-image-controls textarea {
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.ranking-image-segment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.ranking-image-segment button,
.ranking-emoji-row button,
.ranking-emoji-picker button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  box-shadow: none;
  font-size: 11px;
  font-weight: 900;
}

.ranking-image-segment button.active {
  background: var(--primary);
  color: #fff;
}

.ranking-image-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ranking-image-swatches button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line);
}

.ranking-image-swatches button.active {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.ranking-image-swatches .blue {
  background: linear-gradient(135deg, #4f46e5, #2563eb);
}

.ranking-image-swatches .green {
  background: linear-gradient(135deg, #059669, #10b981);
}

.ranking-image-swatches .orange {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.ranking-image-swatches .dark {
  background: linear-gradient(135deg, #111827, #4338ca);
}

.ranking-image-swatches .pink {
  background: linear-gradient(135deg, #d946ef, #ec4899);
}

.ranking-image-swatches .cyan {
  background: linear-gradient(135deg, #0891b2, #2563eb);
}

.ranking-image-swatches .violet {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.ranking-image-swatches .red {
  background: linear-gradient(135deg, #e11d48, #f97316);
}

.ranking-toggle {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ranking-toggle input {
  width: 42px;
  height: 22px;
  accent-color: var(--primary);
}

.ranking-file-control input[type="file"] {
  padding: 10px;
  cursor: pointer;
}

.ranking-file-control input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 9px;
  background: #eef2ff;
  color: var(--primary);
  font-weight: 950;
  text-transform: uppercase;
}

.ranking-emoji-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ranking-emoji-row button {
  flex: 1 1 120px;
}

.ranking-emoji-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 8px;
}

.ranking-emoji-picker button {
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

#downloadRankingImage {
  min-height: 46px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
}

.ranking-image-preview-wrap {
  min-height: 520px;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f1f5f9;
}

#sellerRankingCanvas {
  width: min(100%, 420px);
  height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
}

.commercial-category-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f8fafc;
}

.commercial-category-row,
.commercial-tenure-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.commercial-category-row > span,
.commercial-tenure-row > span {
  color: #16327f;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.commercial-category-buttons,
.commercial-tenure-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.commercial-category-buttons button,
.commercial-tenure-buttons button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  box-shadow: none;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.commercial-category-buttons button.active {
  color: #fff;
  background: #4f46e5;
  border-color: #4f46e5;
}

.commercial-category-buttons button.exp.active,
.commercial-tenure-row.experience button.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

.commercial-category-buttons button.eft.active,
.commercial-tenure-row.effective button.active {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.commercial-category-buttons button.no-meta.active {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #fff;
}

.commercial-history-item {
  background: #fff !important;
}

.commercial-action-modal textarea {
  min-height: 140px;
}

.fad-seller-select {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}

.fad-seller-select label {
  display: grid;
  gap: 8px;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.fad-seller-select select {
  min-height: 42px;
  margin: 0;
  border-radius: 12px;
  background: #fff;
  font-weight: 900;
}

.fad-active-seller {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid #dbe4f0;
  border-radius: 20px;
  background: #fff;
}

.fad-active-seller span,
.fad-active-seller small {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.fad-active-seller h4 {
  margin: 3px 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  text-transform: uppercase;
}

.fad-active-seller > strong {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

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

.fad-kpi-card {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 2px solid #4f46e5;
  border-radius: 18px;
  background: #fff;
}

.fad-kpi-card.bad { border-color: #f43f5e; }
.fad-kpi-card.warn { border-color: #f59e0b; }
.fad-kpi-card.good { border-color: #10b981; }
.fad-kpi-card.blue { border-color: #2563eb; }
.fad-kpi-card.super { border-color: #4f46e5; }

.fad-kpi-card > span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: #0f2f84;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.fad-kpi-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.fad-kpi-card strong {
  color: var(--ink);
}

.fad-kpi-card em {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-style: normal;
  font-size: 12px;
  font-weight: 950;
}

.branch-position {
  display: grid;
  gap: 22px;
}

.branch-position-hero {
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.branch-hero-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.branch-position-hero h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.branch-position-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.branch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 24px 24px 0 0;
  background: #0f172a;
  color: #fff;
}

.branch-toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.branch-toolbar-title span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.branch-toolbar-title strong {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.branch-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.branch-toolbar-actions button,
#sellerApiSyncBtn,
#statusFadSyncBtn {
  min-height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.branch-toolbar input,
.branch-toolbar select {
  min-height: 38px;
  width: auto;
  margin: 0;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.branch-toolbar input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.branch-toolbar select option {
  color: #0f172a;
}

.branch-toolbar #branchSyncBtn {
  background: #2563eb;
}

.commercial-view-toggle.dark {
  background: rgba(255, 255, 255, 0.08);
}

.commercial-view-toggle.dark button {
  color: rgba(255, 255, 255, 0.72);
}

.commercial-view-toggle.dark button.active {
  background: #2563eb;
  color: #fff;
}

.branch-output {
  display: grid;
  gap: 18px;
}

.branch-result-actions {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 14px;
}

.branch-action-card {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.branch-action-card h4 {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.branch-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.branch-action-row .commercial-tool-secondary {
  min-height: 40px;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  box-shadow: none;
}

.branch-table-wrap {
  max-height: 640px;
  overflow: auto;
  border-radius: 0 0 28px 28px;
  background: #0f172a;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  overscroll-behavior: contain;
}

.branch-table {
  min-width: 2300px;
  width: 100%;
  border-collapse: collapse;
  color: #0f172a;
  font-size: 11px;
  background: #fff;
}

.branch-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 9px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  background: #0f172a;
  color: #fff;
  text-align: center;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.branch-table thead small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 8px;
}

.branch-clickable-head {
  cursor: pointer;
}

.branch-clickable-head:hover {
  background: #1d2b49;
}

.branch-table td {
  padding: 8px 8px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.branch-table td:nth-child(2),
.branch-table td:nth-child(3),
.branch-table td:nth-child(4) {
  text-align: center;
}

.branch-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #0f172a;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.branch-table .check-col {
  width: 34px;
  text-align: center;
}

.branch-record {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.branch-period {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e0ecff;
  color: #2563eb;
  font-size: 9px;
  font-weight: 950;
}

.branch-table .green,
.branch-metric-cell .good {
  color: #047857;
  font-weight: 950;
}

.branch-table .red,
.branch-metric-cell .bad {
  color: #be123c;
  font-weight: 950;
}

.branch-table .blue {
  color: #1d4ed8;
  font-weight: 950;
}

.branch-metric-cell {
  min-width: 180px;
}

.branch-metric-cell span,
.branch-metric-cell strong,
.branch-metric-cell em {
  display: inline-block;
  min-width: 54px;
  padding: 0 3px;
  font-style: normal;
  text-align: right;
}

.branch-metric-cell em {
  min-width: 50px;
  padding: 3px 5px;
  border-radius: 6px;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  text-align: center;
}

.branch-metric-cell em.good {
  background: #059669;
}

.branch-metric-cell em.warn {
  background: #d97706;
}

.branch-table .warn,
.commercial-report-table .warn {
  color: #92400e;
  font-weight: 950;
}

.branch-metric-cell em.bad {
  background: #e11d48;
}

.branch-table-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.branch-table-actions button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
  color: #3730a3;
  font-size: 9px;
  font-weight: 950;
  box-shadow: none;
}

.branch-table-actions button:first-child {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.table-column-toggle {
  position: sticky;
  left: 10px;
  top: 10px;
  z-index: 8;
  width: max-content;
  max-width: min(92vw, 520px);
  margin: 10px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
}

.table-column-toggle summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  list-style: none;
}

.table-column-toggle summary::-webkit-details-marker {
  display: none;
}

.table-column-toggle > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.2);
}

.table-column-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 9px;
  background: #f8fafc;
  cursor: pointer;
}

.table-col-hidden {
  display: none !important;
}

.sortable-table-head {
  cursor: pointer;
  user-select: none;
}

.sortable-table-head::after {
  content: " ↕";
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
}

.sortable-table-head[data-sort-direction="asc"]::after {
  content: " ↑";
  color: #facc15;
}

.sortable-table-head[data-sort-direction="desc"]::after {
  content: " ↓";
  color: #facc15;
}

.drag-scroll-table {
  cursor: grab;
  touch-action: none;
  scrollbar-width: auto;
}

.drag-scroll-table.dragging {
  cursor: grabbing;
}

.drag-scroll-table button,
.drag-scroll-table input,
.drag-scroll-table select,
.drag-scroll-table textarea,
.drag-scroll-table a {
  cursor: pointer;
}

.branch-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 16px;
}

.branch-metric-card {
  min-height: 148px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 3px solid var(--branch-accent);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.branch-metric-card.active {
  background: color-mix(in srgb, var(--branch-accent) 5%, #fff);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.14);
}

.branch-metric-card.bad,
.branch-store-card.bad {
  --branch-accent: #f43f5e;
}

.branch-metric-card.warn,
.branch-store-card.warn {
  --branch-accent: #f59e0b;
}

.branch-metric-card.good,
.branch-store-card.good {
  --branch-accent: #10b981;
}

.branch-metric-card.blue,
.branch-store-card.blue,
.branch-metric-card.super,
.branch-store-card.super {
  --branch-accent: #4f46e5;
}

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

.branch-card-head span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef2ff;
  color: #1e3a8a;
  font-size: 9px;
  font-weight: 950;
}

.branch-card-head strong {
  flex: 1;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.branch-card-head em {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--branch-accent);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
}

.branch-metric-card dl,
.branch-store-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.branch-metric-card dl div,
.branch-store-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.branch-metric-card dt,
.branch-store-card dt {
  color: #1e3a8a;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.branch-metric-card dd,
.branch-store-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}

.branch-metric-card dd.good,
.branch-store-card dd.good {
  color: #059669;
}

.branch-metric-card dd.bad,
.branch-store-card dd.bad {
  color: #f43f5e;
}

.branch-occurrence-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.branch-occurrence-card.vendor-first {
  border-color: rgba(79, 70, 229, 0.28);
  background: #f8f7ff;
}

.branch-occurrence-card h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.branch-occurrence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.branch-occurrence-grid div {
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.branch-occurrence-grid span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.branch-occurrence-grid strong {
  color: var(--ink);
  font-weight: 950;
}

.branch-store-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 14px;
}

.branch-store-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 3px solid #4f46e5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.branch-store-card.bad {
  border-color: #f43f5e;
}

.branch-store-card.warn {
  border-color: #f59e0b;
}

.branch-store-card.good {
  border-color: #10b981;
}

.branch-store-rank {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.branch-store-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
}

.branch-store-card > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.branch-store-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  pointer-events: auto;
}

.branch-store-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  color: #37348f;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}

.branch-store-actions button:first-child {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.commercial-report-toolbar,
.commercial-report-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.commercial-report-toolbar label,
.commercial-report-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.commercial-report-toolbar select,
.commercial-report-toolbar input,
.commercial-report-filters select,
.commercial-report-filters input {
  min-height: 42px;
  margin-top: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.commercial-report-filters {
  grid-template-columns: minmax(220px, 1fr) 180px;
}

.commercial-report-result {
  min-height: 180px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.commercial-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.commercial-report-table-wrap {
  max-height: 66vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.06);
  overscroll-behavior: contain;
}

.commercial-report-table {
  min-width: 2200px;
  font-size: 12px;
}

.commercial-report-table th,
.commercial-report-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  text-align: right;
}

.commercial-report-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f172a;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  font-size: 10px;
  white-space: nowrap;
}

.commercial-report-table .seller-col {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 240px;
  max-width: 240px;
  text-align: left;
  background: #fff;
  box-shadow: 4px 0 12px rgba(22, 32, 42, 0.06);
}

.commercial-report-table thead .seller-col {
  z-index: 4;
  background: #0f172a;
  color: #fff;
}

.commercial-report-table tfoot td {
  position: sticky;
  bottom: 0;
  background: #16202a;
  color: #fff;
  font-weight: 900;
}

.commercial-report-table tfoot .seller-col {
  z-index: 4;
  background: #16202a;
}

.commercial-report-table strong,
.commercial-report-table small {
  display: block;
}

.commercial-report-table small {
  margin-top: 4px;
  color: var(--muted);
}

.commercial-report-table .strong {
  font-weight: 900;
  color: var(--text);
}

.commercial-report-table .good {
  color: #047857;
  font-weight: 950;
}

.commercial-report-table .bad {
  color: #be123c;
  font-weight: 950;
}

.commercial-report-table .tag-good,
.commercial-report-table .tag-bad {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
}

.commercial-report-table .tag-good {
  background: #d1fae5;
  color: #065f46;
}

.commercial-report-table .tag-bad {
  background: #ffe4e6;
  color: #be123c;
}

.commercial-board-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.commercial-board-summary article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.commercial-board-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commercial-board-summary strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.commercial-ranking-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.commercial-ranking-heading span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commercial-ranking-heading strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.commercial-ranking-grid,
.commercial-simulator-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
}

.commercial-ranking-card,
.commercial-simulator-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 3px solid #4f46e5;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.commercial-ranking-card.bad,
.commercial-simulator-card.bad {
  border-color: #f43f5e;
}

.commercial-ranking-card.warn {
  border-color: #f59e0b;
}

.commercial-ranking-card.good,
.commercial-simulator-card.good {
  border-color: #10b981;
}

.commercial-ranking-card.super,
.commercial-ranking-card.blue {
  border-color: #4f46e5;
}

.ranking-position {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.ranking-main h4,
.commercial-simulator-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.ranking-main span,
.commercial-simulator-card > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.commercial-ranking-card dl,
.commercial-simulator-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.commercial-ranking-card dl div,
.commercial-simulator-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: #f8fafc;
}

.commercial-ranking-card dt,
.commercial-simulator-card dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.commercial-ranking-card dd,
.commercial-simulator-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 950;
}

.commercial-ranking-card dd.good,
.commercial-simulator-card dd.good {
  color: var(--good);
}

.commercial-ranking-card dd.bad,
.commercial-simulator-card dd.bad {
  color: var(--accent-2);
}

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

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

.commercial-ranking-table th,
.commercial-ranking-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
}

.commercial-ranking-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commercial-ranking-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.tag-good,
.tag-bad {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
}

.tag-good {
  color: var(--good);
  background: rgba(0, 172, 95, 0.12);
}

.tag-bad {
  color: var(--accent-2);
  background: rgba(255, 43, 91, 0.12);
}

.commercial-tool-shell {
  display: grid;
  gap: 22px;
}

.commercial-tool-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.commercial-tool-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
}

.commercial-tool-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.commercial-tool-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.commercial-tool-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.commercial-tool-panel.compact {
  align-self: start;
}

.commercial-tool-panel h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
}

.commercial-tool-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.commercial-tool-panel input,
.commercial-tool-panel select,
.commercial-tool-panel textarea,
.commercial-tool-filters input,
.commercial-tool-filters select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.commercial-tool-panel textarea {
  min-height: 160px;
  padding: 13px;
  resize: vertical;
}

.commercial-tool-panel button,
.commercial-tool-secondary {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--tool-accent, var(--primary));
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.commercial-tool-secondary {
  background: #eef2f7;
  color: var(--ink);
}

.commercial-tool-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px auto;
  gap: 10px;
  align-items: end;
}

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

.commercial-checklist-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.commercial-checklist-list input {
  width: auto;
  min-height: auto;
}

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

.commercial-local-list article {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 12px;
  padding-right: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.commercial-item-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 14px;
  line-height: 1;
}

.commercial-local-list strong {
  color: var(--ink);
  font-weight: 950;
}

.commercial-local-list span,
.commercial-local-list small {
  color: var(--muted);
  font-size: 12px;
}

.commercial-winner-grid {
  display: grid;
  gap: 12px;
}

.commercial-winner-grid article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.commercial-winner-grid span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 950;
}

.commercial-board-summary.compact {
  grid-template-columns: repeat(3, minmax(90px, 1fr));
}

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

.raffle-prize-preview {
  min-height: 126px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.raffle-prize-preview img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #fff;
}

.raffle-list,
.raffle-winner-grid {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.raffle-person,
.raffle-winner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.raffle-person div,
.raffle-winner div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.raffle-person strong,
.raffle-winner strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.raffle-person span,
.raffle-winner small,
.raffle-winner em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.raffle-person button {
  width: 30px;
  min-height: 30px;
  margin-left: auto;
  padding: 0;
  border-radius: 11px;
  background: #fee2e2;
  color: #dc2626;
}

.raffle-winner > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.raffle-winner img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.raffle-winner-modal {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px 6px 4px;
  text-align: center;
}

.raffle-winner-modal img {
  width: min(260px, 90%);
  max-height: 220px;
  object-fit: contain;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.raffle-winner-modal span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.raffle-winner-modal h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 950;
  text-transform: uppercase;
}

.raffle-winner-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.raffle-winner-modal strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.solicitacoes-grid {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

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

.solicitacao-filters {
  grid-template-columns: minmax(180px, 1fr) 170px;
}

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

.solicitacao-card {
  display: grid;
  gap: 8px;
  position: relative;
  padding: 16px;
  padding-right: 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
  cursor: pointer;
}

.solicitacao-card:hover {
  border-color: rgba(79, 70, 229, 0.28);
  background: #fff;
}

.solicitacao-card-top,
.solicitacao-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.solicitacao-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
}

.solicitacao-card span,
.solicitacao-card small,
.solicitacao-card p,
.solicitacao-card em {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.solicitacao-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.solicitacao-status.good {
  color: #047857;
  background: #d1fae5;
}

.solicitacao-status.bad {
  color: #be123c;
  background: #ffe4e6;
}

.solicitacao-status.warn {
  color: #b45309;
  background: #fef3c7;
}

.solicitacao-status.blue {
  color: #1d4ed8;
  background: #dbeafe;
}

.solicitacao-status.neutral {
  color: #475569;
  background: #e2e8f0;
}

.solicitacao-attachments-preview,
.solicitacao-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.solicitacao-attachment {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ink);
  text-decoration: none;
}

.solicitacao-attachment img,
.solicitacao-attachment video {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 10px;
  background: #fff;
}

.solicitacao-attachment span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solicitacao-file-icon {
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

.solicitacao-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 20px;
}

.solicitacao-detail-main,
.solicitacao-detail-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.solicitacao-detail p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.solicitacao-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}

.solicitacao-detail dl div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.solicitacao-detail dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.solicitacao-detail dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.solicitacao-history {
  display: grid;
  gap: 10px;
}

.solicitacao-history-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.solicitacao-history-item strong,
.solicitacao-history-item small,
.solicitacao-history-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.solicitacao-history-item strong {
  color: var(--ink);
}

.solicitacao-detail-side label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.solicitacao-detail-side textarea {
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  resize: vertical;
}

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

.solicitacao-actions button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  cursor: pointer;
}

.commercial-tool-panel .commercial-item-delete {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 14px;
  line-height: 1;
}

.empty-table {
  padding: 48px !important;
  text-align: center;
  color: var(--muted);
}

.settings-panel {
  max-width: 1120px;
}

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

.settings-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.settings-grid input[type="color"] {
  width: 100%;
  height: 46px;
  padding: 4px;
  cursor: pointer;
}

.settings-grid input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.settings-grid input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 7px;
}

.settings-grid input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 7px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.settings-theme-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-theme-presets button {
  min-height: 34px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  box-shadow: none;
}

.settings-preview {
  display: grid;
  grid-template-columns: 240px minmax(260px, 1fr);
  gap: 18px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
}

.settings-preview-sidebar {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 220px;
  padding: 18px;
  border-radius: 18px;
  background: var(--sidebar-bg);
  color: #fff;
}

.settings-preview-sidebar span {
  font-weight: 950;
}

.settings-preview-sidebar button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.settings-preview-login {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 22px;
  border-radius: 18px;
  background: var(--login-bg);
  color: var(--login-text);
  font-family: var(--login-font);
}

.settings-preview-login input {
  background: var(--login-panel-bg);
}

.settings-preview-login button {
  background: var(--login-button-bg);
  color: #fff;
}

.backup-panel {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}

.backup-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.backup-history {
  display: grid;
  gap: 10px;
}

.backup-history article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
}

.backup-history strong,
.backup-history span,
.backup-history small {
  display: block;
}

.backup-history small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.backup-history button {
  min-height: 36px;
  border-radius: 10px;
  background: #fff7ed;
  color: #c2410c;
  box-shadow: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 14, 0.62);
}

.modal.hidden {
  display: none !important;
}

.modal-card {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 34px;
  background: #433f96;
  color: #fff;
}

.modal-header h2 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-header button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
}

.modal-body {
  display: grid;
  gap: 22px;
  padding: 32px;
}

.edit-photo {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

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

.status-toggle {
  display: flex !important;
  align-items: center;
  flex-direction: row;
  gap: 10px !important;
}

.status-toggle input {
  width: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.modal-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfd;
}

.compact-title {
  margin-bottom: 0;
}

.compact-title h2 {
  font-size: 15px;
}

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

.permission-edit-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
}

.permission-edit-row.allowed {
  border-color: #bfead4;
  background: #f3fbf7;
}

.permission-edit-row input {
  width: auto;
  margin-top: 3px;
}

.permission-edit-row strong,
.permission-edit-row small {
  display: block;
}

.permission-edit-row small {
  margin-top: 3px;
  font-size: 11px;
}

.history-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.history-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.content-shell {
  display: grid;
  gap: 18px;
}

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

.content-summary article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.content-summary span,
.content-panel h3,
.announcement-meta span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 950;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(290px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.content-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.content-panel.wide {
  min-width: 0;
}

.content-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.content-list-head {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.content-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.content-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
}

.content-tabs button.active {
  background: var(--primary);
  color: #fff;
}

.content-panel label,
.form-answer label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.content-panel input,
.content-panel select,
.content-panel textarea,
.form-answer input,
.form-answer select,
.form-answer textarea,
.viewer-list textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.content-panel textarea,
.form-answer textarea,
.viewer-list textarea {
  min-height: 120px;
  padding: 13px;
  resize: vertical;
}

.content-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.content-row .grow {
  grid-column: span 2;
}

.content-check {
  display: flex !important;
  align-items: center;
  flex-direction: row;
}

.content-check input {
  width: auto;
  min-height: auto;
}

.content-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.content-actions button,
.content-panel > button,
.option-list button,
.viewer-list button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.content-danger,
.content-actions .ghost {
  background: #eef2f7 !important;
  color: var(--ink) !important;
}

.portal-target-box {
  display: grid;
  gap: 10px;
}

.portal-sector-select,
.portal-user-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.portal-sector-select label,
.portal-user-select label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  font-size: 10px;
}

.portal-sector-select input,
.portal-user-select input {
  width: auto;
  min-height: auto;
}

.announcement-list,
.form-card-list,
.question-builder-list,
.viewer-list {
  display: grid;
  gap: 12px;
}

.announcement-card,
.form-card,
.question-builder,
.viewer-list article {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}

.announcement-card.archived,
.form-card.archived {
  opacity: 0.65;
}

.announcement-preview,
.mandatory-announcement {
  display: grid;
  justify-items: start;
  gap: 12px;
  overflow: hidden;
  padding: 22px;
  border-radius: 20px;
  background: var(--announcement-bg, var(--mandatory-bg, #5c51ff));
  color: #fff;
}

.announcement-preview > span,
.mandatory-announcement > span {
  font-size: 32px;
}

.announcement-preview h3,
.mandatory-announcement h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 950;
  text-transform: uppercase;
}

.announcement-preview p,
.mandatory-announcement p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--announcement-size, var(--mandatory-size, 28px));
  line-height: 1.25;
  white-space: pre-wrap;
}

.announcement-preview img,
.announcement-preview video,
.mandatory-announcement img,
.mandatory-announcement video {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
}

.announcement-preview a,
.mandatory-announcement a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.announcement-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.announcement-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f7;
}

.form-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.form-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
}

.form-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.original-form-shell {
  display: block;
}

.original-form-window {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.original-form-titlebar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.original-form-titlebar > div:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
}

.original-form-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #5f35d5;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.original-form-titlebar strong {
  color: #1f2937;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.original-window-controls {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #94a3b8;
  font-size: 17px;
  font-weight: 700;
}

.original-form-stage {
  min-height: 720px;
  padding: 42px min(18vw, 240px) 90px;
  background: #f0ebfb;
}

.original-form-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
}

.original-form-head h2 {
  margin: 0;
  color: #1f2937;
  font-size: 24px;
  font-weight: 950;
}

.original-create-button {
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 24px;
  background: #673ab7;
  color: #fff;
  box-shadow: 0 10px 18px rgba(103, 58, 183, 0.24);
  font-size: 15px;
  font-weight: 850;
}

.original-search {
  height: 58px;
  display: flex !important;
  align-items: center;
  gap: 12px;
  max-width: 738px;
  margin-bottom: 32px;
  padding: 0 18px;
  border: 1px solid #d8d2e7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
}

.original-search span {
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
}

.original-search input {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 15px;
  font-weight: 650;
  outline: none;
}

.original-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 356px));
  gap: 22px;
}

.original-form-card {
  overflow: hidden;
  border: 1px solid #d8d2e7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
}

.original-form-cover {
  height: 95px;
  background: #673ab7;
}

.original-form-card-body {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.original-audience-badge,
.original-type-badge {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.original-audience-badge {
  background: #e8e2ff;
  color: #33217f;
}

.original-type-badge {
  border-radius: 999px;
  background: #c7f4df;
  color: #047857;
}

.original-form-card h3 {
  margin: 4px 0 0;
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.original-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.original-card-actions button {
  width: 24px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  box-shadow: none;
  font-size: 18px;
  font-weight: 800;
}

.original-card-actions .original-status-button {
  width: auto;
  min-width: 96px;
  padding: 0 9px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
}

.original-card-actions button:hover {
  background: #f8fafc;
  color: #673ab7;
}

.original-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed #d8d2e7;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: #64748b;
  font-size: 14px;
  font-weight: 850;
}

.option-list {
  display: grid;
  gap: 8px;
}

.form-answer {
  display: grid;
  gap: 16px;
}

.form-answer header {
  padding: 20px;
  border-radius: 18px;
  background: var(--form-accent);
  color: #fff;
}

.form-answer header h3 {
  margin: 0;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
}

.form-answer header p {
  margin: 8px 0 0;
  color: rgba(255,255,255,.86);
}

.answer-question {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.answer-question h4 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.answer-question span {
  color: #dc2626;
}

.answer-options {
  display: grid;
  gap: 8px;
}

.answer-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.answer-options input {
  width: auto;
  min-height: auto;
}

.portal-modal-card {
  width: min(980px, 100%);
}

.mandatory-modal {
  z-index: 500;
}

.mandatory-card {
  width: min(820px, 100%);
}

.mandatory-card .modal-header button {
  display: none;
}

.mandatory-footnote {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.viewer-list pre {
  overflow: auto;
  max-height: 260px;
  padding: 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
}

.viewer-list strong {
  color: var(--ink);
  font-weight: 950;
}

.viewer-list span,
.viewer-list small,
.viewer-list p,
.viewer-list em {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .content-grid,
  .form-card,
  .content-list-head {
    grid-template-columns: 1fr;
  }

  .original-form-stage {
    padding: 32px 28px 70px;
  }

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

  .content-row,
  .content-summary {
    grid-template-columns: 1fr;
  }
}

.history-item span,
.history-item small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.portal-shell {
  display: grid;
  gap: 22px;
}

.portal-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portal-hero-icon,
.portal-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--portal-accent, var(--accent));
  font-weight: 900;
}

.portal-hero-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.portal-hero h2,
.portal-card h3,
.portal-person strong,
.portal-birthday strong {
  margin: 0;
  letter-spacing: 0;
}

.portal-hero h2 {
  font-size: 28px;
  text-transform: uppercase;
}

.portal-hero p,
.portal-card p,
.portal-history p {
  margin: 5px 0 0;
  color: var(--muted);
}

.portal-refresh {
  margin-left: auto;
}

.database-shell {
  display: grid;
  gap: 18px;
}

.database-hero {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.database-hero > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--portal-accent, var(--primary));
  color: #fff;
  font-weight: 950;
}

.database-hero h2,
.database-hero p {
  margin: 0;
}

.database-hero h2 {
  font-size: 22px;
  text-transform: uppercase;
}

.database-hero p {
  margin-top: 4px;
  color: var(--muted);
}

.database-hero button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--portal-accent, var(--primary));
  color: #fff;
}

.database-grid {
  display: grid;
  gap: 18px;
}

.database-connection-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid #10b981;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.database-connection-card.offline {
  border-left-color: #f43f5e;
}

.database-connection-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
}

.database-connection-head > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-weight: 950;
}

.database-connection-head h3,
.database-connection-head small {
  margin: 0;
}

.database-connection-head h3 {
  font-size: 17px;
  text-transform: uppercase;
}

.database-connection-head small {
  color: var(--muted);
  font-weight: 700;
}

.database-connection-head strong {
  padding: 8px 10px;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
}

.database-connection-card.offline .database-connection-head strong,
.database-error {
  background: #ffe4e6;
  color: #be123c;
}

.external-api-shell .portal-hero {
  margin-bottom: 22px;
}

.external-api-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.external-api-layout.viewer-only {
  grid-template-columns: 1fr;
}

.external-api-admin,
.external-api-test-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.external-api-admin.locked {
  align-content: start;
  min-height: 180px;
  background: #f8fafc;
}

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

.external-api-form label,
.external-api-testbar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.external-api-form .wide-field {
  grid-column: 1 / -1;
}

.external-api-list {
  display: grid;
  gap: 12px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.external-api-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfd;
}

.external-api-item.disabled {
  opacity: 0.62;
}

.external-api-item h3 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.external-api-item p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.external-api-item details {
  margin-top: 8px;
}

.external-api-item summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.external-api-item pre,
.external-api-result {
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
  color: #e5edf7;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.external-api-result.error {
  background: #fff1f2;
  color: #be123c;
}

.external-api-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 96px;
}

.external-api-actions button {
  min-height: 34px;
  padding: 8px 10px;
}

.external-api-actions .danger {
  background: #be123c;
  color: #fff;
}

.database-error {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.database-counter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.database-counter-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.database-counter-grid span,
.database-table th,
.database-columns-strip span {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.database-counter-grid span {
  display: block;
  color: var(--muted);
}

.database-counter-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.database-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.database-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.database-table th,
.database-table td {
  padding: 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  white-space: nowrap;
}

.database-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
}

.database-columns-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.database-columns-strip span {
  padding: 6px 8px;
  border-radius: 7px;
  background: #eef2ff;
  color: #3730a3;
}

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

.portal-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  min-height: 170px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(22, 32, 42, 0.06);
}

.portal-card::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--portal-accent, var(--accent)) 10%, transparent);
}

.portal-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.portal-card button {
  align-self: end;
  grid-column: 2;
  justify-self: start;
  padding: 10px 14px;
  color: #fff;
  background: var(--portal-accent, var(--accent));
}

.portal-data-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(22, 32, 42, 0.05);
}

.portal-people-list,
.portal-history {
  display: grid;
  gap: 10px;
}

.portal-person,
.portal-history article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfd;
}

.portal-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: #eef2f6;
  color: var(--muted);
  font-weight: 900;
  overflow: hidden;
}

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

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

.portal-birthday {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfd;
}

.portal-birthday.today {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}

.portal-birthday span {
  color: var(--accent);
  font-weight: 900;
}

.portal-birthday small,
.portal-history span {
  color: var(--muted);
  font-size: 12px;
}

.portal-empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.portal-empty.bad {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.vendedores-shell {
  display: grid;
  gap: 22px;
}

.vendedores-title {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 4px;
}

.vendedores-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #4f46e5;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 14px 24px rgba(79, 70, 229, 0.22);
}

.vendedores-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
}

.vendedores-title p {
  margin: 4px 0 0;
  color: #64748b;
  font-weight: 800;
}

.vendedores-alert {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid #c7d2fe;
  border-radius: 18px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 900;
}

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

.report-summary-grid.manager {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.report-summary-grid article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.report-summary-grid span,
.report-summary-grid small {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.report-summary-grid strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.report-summary-grid small {
  line-height: 1.35;
  text-transform: none;
}

.report-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
}

.report-band.manager {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.report-band h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.report-band p {
  max-width: 720px;
  margin: 5px 0 0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.report-band-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.report-band-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff;
  color: #4338ca;
  box-shadow: none;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.report-band.manager .report-band-actions button {
  color: #047857;
}

.gerente-icon {
  background: #047857;
  box-shadow: 0 14px 24px rgba(4, 120, 87, 0.2);
}

.manager-branch-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manager-branch-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.vendedores-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 18px;
}

.vendedor-module-card {
  position: relative;
  min-height: 172px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.vendedor-module-card.pending {
  opacity: 0.78;
}

.vendedor-card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--seller-card-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.vendedor-module-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.vendedor-module-card p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.vendedor-module-card button {
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--seller-card-accent) 12%, #fff);
  color: var(--seller-card-accent);
  box-shadow: none;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.vendedor-module-card button:not(:disabled):hover {
  background: var(--seller-card-accent);
  color: #fff;
}

.vendedor-module-card button:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.vendedor-card-watermark {
  position: absolute;
  right: 22px;
  top: 22px;
  color: var(--seller-card-accent);
  font-size: 58px;
  font-weight: 950;
  opacity: 0.07;
  pointer-events: none;
}

.rh-shell {
  display: grid;
  gap: 22px;
}

.rh-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}

.rh-back {
  min-height: 42px;
  min-width: 74px;
  padding: 0 12px;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  box-shadow: none;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fb6340;
  color: #fff;
  font-weight: 950;
  box-shadow: 0 16px 28px rgba(251, 99, 64, 0.22);
}

.rh-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-total {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 4px 8px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rh-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-toolbar select {
  min-height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 11px;
  font-weight: 950;
}

.rh-toolbar button {
  min-height: 44px;
  border-radius: 15px;
  background: #fb6340;
  color: #fff;
  box-shadow: 0 14px 24px rgba(251, 99, 64, 0.22);
}

.rh-tenure-block,
.rh-table-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.rh-tenure-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-tenure-title strong {
  padding: 4px 8px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
}

.rh-tenure-title em {
  margin-left: auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-style: normal;
}

.rh-tenure-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 2px 10px;
}

.rh-tenure-strip button {
  min-width: 104px;
  min-height: 70px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: #64748b;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.rh-tenure-strip button.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.rh-tenure-strip button span,
.rh-tenure-strip button strong,
.rh-tenure-strip button small {
  font-weight: 950;
}

.rh-table-wrap {
  overflow: auto;
  max-height: min(680px, 70vh);
}

.rh-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 11px;
}

.rh-table th,
.rh-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

.rh-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  color: #64748b;
  text-align: left;
  text-transform: uppercase;
}

.rh-table th span {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.rh-table th input {
  min-height: 32px;
  width: 100%;
  margin: 0;
  border-radius: 10px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.rh-person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rh-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  font-weight: 950;
}

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

.rh-person strong,
.rh-center strong {
  display: block;
  color: #0f172a;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-person small,
.rh-center small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.rh-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.rh-tags span {
  padding: 3px 6px;
  border-radius: 7px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 9px;
  font-weight: 950;
}

.rh-center {
  text-align: center;
}

.rh-time {
  color: #fb6340 !important;
}

.rh-empty {
  padding: 44px !important;
  color: #94a3b8;
  text-align: center;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-table tfoot td {
  position: sticky;
  bottom: 0;
  background: #f8fafc;
  color: #64748b;
  font-weight: 950;
  text-transform: uppercase;
}

.rh-table tfoot td {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sector-modal-card {
  width: min(1180px, 100%);
}

.sector-edit-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-height: calc(92vh - 100px);
  overflow: auto;
}

.sector-edit-side {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 32px 28px;
  border-right: 1px solid var(--line);
}

.sector-edit-side label,
.permission-box,
.sector-modules {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.permission-box {
  padding: 18px;
  border: 1px solid var(--text);
  border-radius: 22px;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.week-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-toggle {
  position: relative;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef2ff;
  color: #6d7a8a;
  cursor: pointer;
  font-size: 10px;
}

.day-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.day-toggle.active {
  background: #1e5bff;
  color: #fff;
}

.sector-modules {
  padding: 32px 28px;
  text-transform: none;
}

.sector-modules h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sector-modules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 10px;
}

.module-permission {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 108px 70px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--text);
  border-radius: 16px;
}

.module-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef2f5;
  color: #91a0b1;
  font-weight: 900;
}

.module-permission strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.module-checks {
  display: flex;
  gap: 14px;
  margin-top: 5px;
  color: #91a0b1;
  font-size: 10px;
  text-transform: uppercase;
}

.module-checks label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.module-checks input,
.module-toggle input {
  width: auto;
}

.module-limit {
  display: grid;
  gap: 4px;
  color: #91a0b1;
  font-size: 9px;
  text-transform: uppercase;
}

.module-limit input {
  padding: 8px;
  text-align: center;
}

.module-toggle input {
  display: none;
}

.module-toggle span {
  width: 42px;
  height: 24px;
  display: block;
  position: relative;
  border-radius: 999px;
  background: #e6edf4;
}

.module-toggle span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.module-toggle input:checked + span {
  background: var(--accent);
}

.module-toggle input:checked + span::after {
  transform: translateX(18px);
}

.module-toggle em {
  display: block;
  margin-top: 4px;
  color: #91a0b1;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.sector-actions {
  grid-column: 1 / -1;
  padding: 22px 32px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 34px;
  font-weight: 900;
}

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

.profile-hero h2 {
  margin-top: 8px;
  font-size: 26px;
}

.profile-hero p {
  margin-top: 6px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.active {
  background: #e5f6ee;
  color: var(--good);
}

.status-pill.pending {
  background: #fff1db;
  color: var(--warn);
}

.status-pill.inactive {
  background: #fae8ed;
  color: var(--accent-2);
}

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

.wide-panel {
  grid-column: 1 / -1;
}

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

.info-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.info-row span {
  color: var(--muted);
  font-size: 13px;
}

.info-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.permission-pill,
.empty-state {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.permission-pill.allowed {
  background: #e5f6ee;
  color: var(--good);
}

.permission-pill.blocked {
  background: #fae8ed;
  color: var(--accent-2);
}

.empty-state {
  background: var(--surface-2);
  color: var(--muted);
}

.registration-panel {
  max-width: 920px;
}

.registration-form {
  display: grid;
  gap: 18px;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.wide-field {
  grid-column: 1 / -1;
}

.registration-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.login-message.success {
  color: var(--good);
}

.panel {
  padding: 18px;
  min-width: 0;
}

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

canvas {
  width: 100%;
  height: 320px;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: #fbfcfd;
  line-height: 1.45;
}

.data-actions {
  margin-top: 12px;
}

#data .panel + .panel {
  margin-top: 14px;
}

.table-wrap {
  overflow: auto;
  max-height: 360px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f7f9fb;
  position: sticky;
  top: 0;
}

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

.insight {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfd;
}

.insight.warn {
  border-left-color: var(--warn);
}

.insight.good {
  border-left-color: var(--good);
}

.insight strong {
  display: block;
  margin-bottom: 5px;
}

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

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 65;
    width: min(280px, 82vw);
    height: 100vh;
    transform: translateX(0);
    transition: transform 0.2s ease;
  }

  .sidebar-toggle {
    left: min(280px, 82vw);
    top: 96px;
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-collapsed .sidebar-toggle {
    left: 0;
  }

  .chart-layout,
  .profile-grid,
  .form-grid,
  .settings-grid,
  .kpi-grid,
  .commercial-grid,
  .commercial-kpi-grid,
  .external-api-layout,
  .external-api-form,
  .external-api-testbar {
    grid-template-columns: 1fr 1fr;
  }

  .commercial-analysis-layout {
    grid-template-columns: 1fr;
  }

  .commercial-analysis-sidebar {
    position: static;
  }

  .commercial-analysis-topbar,
  .seller-occurrence-summary,
  .commercial-seller-grid,
  .vendedores-grid,
  .report-summary-grid,
  .report-summary-grid.manager,
  .fad-kpi-grid,
  .branch-card-grid,
  .branch-result-actions,
  .branch-store-grid,
  .commercial-ranking-grid,
  .commercial-simulator-grid,
  .commercial-tool-grid,
  .commercial-board-summary,
  .portal-card-grid,
  .portal-birthday-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rh-header {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .rh-toolbar {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .branch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .branch-toolbar-actions {
    justify-content: flex-start;
  }

  .users-shell {
    padding: 20px;
  }

  .users-header,
  .users-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 18px;
  }

  .topbar,
  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-layout,
  .profile-grid,
  .form-grid,
  .settings-grid,
  .kpi-grid,
  .commercial-grid,
  .commercial-detail,
  .commercial-detail-top,
  .commercial-report-toolbar,
  .commercial-report-filters,
  .commercial-analysis-layout,
  .commercial-analysis-topbar,
  .seller-occurrence-summary,
  .commercial-kpi-grid,
  .commercial-seller-grid,
  .vendedores-grid,
  .report-summary-grid,
  .report-summary-grid.manager,
  .fad-kpi-grid,
  .branch-card-grid,
  .branch-result-actions,
  .branch-store-grid,
  .commercial-ranking-grid,
  .commercial-simulator-grid,
  .commercial-tool-grid,
  .commercial-tool-filters,
  .commercial-board-summary,
  .commercial-checklist-list,
  .portal-card-grid,
  .portal-birthday-grid,
  .external-api-layout,
  .external-api-form,
  .external-api-testbar,
  .external-api-item {
    grid-template-columns: 1fr;
  }

  .external-api-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .rh-header {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 20px;
    border-radius: 20px;
  }

  .rh-back {
    grid-column: 1;
  }

  .rh-icon {
    display: none;
  }

  .rh-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .rh-toolbar label,
  .rh-toolbar button {
    width: 100%;
  }

  .original-form-titlebar,
  .original-form-stage {
    padding-left: 18px;
    padding-right: 18px;
  }

  .original-window-controls {
    display: none;
  }

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

  .original-create-button,
  .original-search {
    width: 100%;
  }

  .report-band {
    align-items: stretch;
    flex-direction: column;
  }

  .report-band-actions {
    justify-content: flex-start;
  }

  .rh-tenure-title em {
    width: 100%;
    margin-left: 0;
  }

  .portal-hero {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 20px;
    padding: 20px;
  }

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

  .portal-card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 18px;
  }

  .portal-person,
  .portal-history article {
    align-items: flex-start;
  }

  .branch-position-hero {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 22px;
  }

  .branch-toolbar input,
  .branch-toolbar select,
  .branch-toolbar #branchSyncBtn,
  .branch-toolbar .commercial-view-toggle {
    width: 100%;
  }

  .commercial-analysis-sidebar {
    padding: 16px;
    border-radius: 20px;
  }

  .commercial-kpi-card,
  .commercial-seller-card {
    border-radius: 18px;
  }

  .commercial-card {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 18px;
  }

  .commercial-card p {
    max-width: 100%;
  }

  .sidebar {
    gap: 16px;
  }

  .brand {
    justify-content: center;
  }

  .brand > div {
    display: none;
  }

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

  .nav-item {
    text-align: center;
  }

  .session-card {
    margin-top: 0;
  }

  .users-shell {
    border-radius: 18px;
    padding: 14px;
  }

  .status-summary {
    overflow-x: auto;
  }

  .status-filter {
    min-width: 110px;
  }

  .users-table-wrap {
    border-radius: 18px;
  }

  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }

  .users-table thead {
    display: none;
  }

  .users-table tr {
    border-bottom: 1px solid var(--line);
  }

  .users-table td {
    white-space: normal;
    border-bottom: 0;
  }

  .modal-card {
    border-radius: 22px;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }

  .sector-edit-layout {
    grid-template-columns: 1fr;
  }

  .sector-edit-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sector-modules-list {
    grid-template-columns: 1fr;
  }

  .module-permission {
    grid-template-columns: 36px 1fr;
  }

  .module-limit,
  .module-toggle {
    grid-column: 2;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .permission-editor {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .wide-panel {
    grid-column: auto;
  }

  .wide-field {
    grid-column: auto;
  }

  .info-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
  }
}
