:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #172026;
  --muted: #65727d;
  --line: #dbe2e6;
  --brand: #176b87;
  --brand-dark: #0f4d61;
  --accent: #d88c35;
  --ok-bg: #e8f5ee;
  --ok: #267348;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.login-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(23, 107, 135, 0.22), transparent 30%),
    radial-gradient(circle at 80% 22%, rgba(124, 58, 237, 0.24), transparent 32%),
    linear-gradient(145deg, #eef6f9 0%, #ffffff 46%, #ede8ff 100%);
}

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

.login-intro,
.login-card {
  width: min(720px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 30px 90px rgba(21, 38, 71, 0.18);
  backdrop-filter: blur(18px);
}

.login-intro {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 34px 28px;
  text-align: center;
  animation: loginIntroIn 620ms ease both;
}

.login-logo-orbit {
  width: min(310px, 62vw);
  padding: 0;
  border-radius: 26px;
  background: transparent;
  box-shadow: none;
  animation: logoFloat 3.2s ease-in-out infinite;
}

.login-logo {
  width: 100%;
  display: block;
  border-radius: 0;
  filter: drop-shadow(0 16px 18px rgba(16, 35, 72, 0.28));
  animation: logoPulse 5s ease-in-out infinite;
}

.login-kicker {
  margin: 0;
  color: #0b6d8a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-intro h1,
.login-card h2 {
  margin: 0;
  color: #122236;
  line-height: 1.12;
}

.login-intro h1 {
  max-width: 520px;
  font-size: clamp(22px, 3vw, 34px);
}

.login-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.login-social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(11, 109, 138, .22);
  border-radius: 999px;
  color: #06465c;
  background: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.login-social-link.whatsapp {
  border-color: rgba(37, 211, 102, .28);
  color: #075e54;
}

.login-social-link.instagram {
  border-color: rgba(193, 53, 132, .28);
  color: #7a1d72;
}

.social-icon-img {
  display: inline-block;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  max-width: 18px !important;
  max-height: 18px !important;
  object-fit: contain;
  flex: 0 0 auto;
}

.login-loading {
  width: min(260px, 58vw);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(14, 76, 107, .14);
}

.login-loading span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b7898, #6d2ee8);
  animation: loginLoad 5s linear both;
}

.login-card {
  padding: 34px;
  max-width: 430px;
  animation: loginCardIn 520ms ease both;
}

.login-card-logo {
  width: min(210px, 62vw);
  display: block;
  margin: 0 auto 18px;
  border-radius: 0;
  filter: drop-shadow(0 12px 16px rgba(13, 38, 79, 0.18));
}

.login-card h2 {
  margin-top: 8px;
  margin-bottom: 20px;
  font-size: 26px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #324255;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  min-height: 48px;
  border: 1px solid #c8d6e3;
  border-radius: 12px;
  padding: 0 14px;
  color: #101b2d;
  background: rgba(255,255,255,.92);
  font-size: 16px;
  font-weight: 700;
}

.login-message {
  min-height: 22px;
  color: #526275;
  font-size: 14px;
  font-weight: 700;
}

.forgot-password-link {
  width: fit-content;
  justify-self: center;
  color: #0b6d8a;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.login-social.compact {
  margin-top: 18px;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  50% { transform: translateY(-10px) rotateX(3deg); }
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

@keyframes loginLoad {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes loginIntroIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  overflow-y: auto;
  width: 280px;
  height: 100vh;
  background: #10252e;
  color: #eef7f8;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 22px;
}

.brand-logo {
  display: block;
  width: 112px;
  height: 48px;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #b8c8ce;
  font-size: 13px;
  margin-top: 2px;
}

.brand .brand-version {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.process-consult {
  display: grid;
  gap: 12px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid #d6e2ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(15, 37, 46, 0.06);
  color: #1f2937;
}

.process-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.process-search label {
  display: grid;
  gap: 5px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
}

.process-search input {
  min-height: 34px;
  border: 1px solid #9fb6c3;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.process-search input::placeholder {
  color: #536575;
  opacity: 1;
}

.primary-button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #176b87;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 18px rgba(23, 107, 135, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-button:hover {
  background: #0f4d61;
  box-shadow: 0 12px 22px rgba(15, 77, 97, 0.28);
  transform: translateY(-1px);
}

.process-result {
  display: grid;
  gap: 8px;
}

.process-empty {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px dashed #93aebd;
  border-radius: 8px;
  background: rgba(246, 251, 253, 0.72);
  color: #273746;
}

.assistant-panel {
  display: grid;
  gap: 14px;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid #d6e2ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #1f2937;
  box-shadow: 0 10px 22px rgba(15, 37, 46, 0.06);
}

.assistant-intro {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(245, 243, 255, 0.84));
}

.assistant-intro span {
  color: #176b87;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.assistant-intro h3,
.assistant-intro p {
  margin: 0;
}

.assistant-intro h3 {
  color: #0f172a;
  font-size: 18px;
}

.assistant-intro p {
  color: #475569;
  font-weight: 700;
  line-height: 1.35;
}

.assistant-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.assistant-search input {
  min-height: 38px;
  border: 1px solid #9fb6c3;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.assistant-result,
.assistant-topic-grid {
  display: grid;
  gap: 10px;
}

.assistant-topic-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.assistant-topic-button {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #0f4d61;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.assistant-answer-card {
  display: grid;
  gap: 5px;
  border: 1px solid #dbe2e6;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.assistant-answer-card.is-best {
  border-color: #86efac;
  background: #f0fdf4;
}

.assistant-answer-card.is-fallback {
  border-color: #fcd34d;
  background: #fffbeb;
}

.assistant-answer-card span {
  color: #176b87;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.assistant-answer-card strong {
  color: #0f172a;
  font-size: 15px;
}

.assistant-answer-card p,
.assistant-answer-card small {
  margin: 0;
  color: #475569;
  font-weight: 700;
  line-height: 1.35;
}

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

.process-summary > div {
  display: grid;
  gap: 4px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #d6e2ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.process-summary span,
.process-step small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.process-summary strong {
  color: #0f172a;
  font-size: 14px;
}

.process-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebef;
}

.process-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #4f46e5);
}

.process-notes {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #d6e2ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #1f2937;
}

.process-notes p {
  margin: 0;
}

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

.process-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #d6e2ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.process-step.is-done {
  border-color: #b8dfc9;
  background: rgba(243, 251, 246, 0.78);
}

.process-step.is-pending {
  border-color: #ead0a8;
  background: rgba(255, 249, 239, 0.78);
}

.process-step-detail {
  display: grid;
  gap: 5px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.process-step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #176b87;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.process-step.is-pending .process-step-number {
  background: #d88c35;
}

.process-step h4,
.process-step p {
  margin: 0;
}

.process-step h4 {
  color: #10252e;
  font-size: 15px;
  text-align: left;
}

.process-step p {
  color: #314250;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.process-step small {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.15;
  text-align: left;
}

.process-step-action {
  justify-self: center;
  align-self: start;
  min-height: 30px;
  border: 1px solid rgba(23, 107, 135, 0.38);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f4d61;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.process-step-items {
  display: grid;
  gap: 5px;
  margin-top: 4px;
}

.process-step-item {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.process-step-item strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-step-item span {
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.process-step-item.is-empty {
  border-style: dashed;
  background: rgba(248, 250, 252, 0.55);
}

.process-app-status {
  width: fit-content;
  margin-top: 2px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.process-app-status.is-visible {
  background: #dcfce7;
  color: #166534;
}

.process-app-status.is-system {
  background: #e0f2fe;
  color: #075985;
}

.process-app-status.is-missing {
  background: #fff7ed;
  color: #9a3412;
}

.menu {
  display: grid;
  gap: 6px;
}

.menu-item,
.menu-group summary,
.submenu-item {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.menu-item,
.menu-group summary {
  display: grid;
  grid-template-columns: 1fr 18px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: transparent;
  list-style: none;
}

.menu-group summary::-webkit-details-marker {
  display: none;
}

.menu-item:hover,
.menu-group summary:hover,
.submenu-item:hover,
.menu-item.active,
.submenu-item.active {
  border-color: #ffc76a;
  background: linear-gradient(90deg, rgba(255, 199, 106, 0.12), rgba(42, 129, 174, 0.34));
  box-shadow:
    0 0 0 1px rgba(255, 199, 106, 0.42),
    0 0 12px rgba(255, 199, 106, 0.38),
    inset 0 0 18px rgba(91, 173, 218, 0.16);
  color: #ffffff;
}

.menu-item:disabled,
.submenu-item:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.menu-group[open] > summary {
  border-color: rgba(255, 199, 106, 0.55);
  background: rgba(27, 58, 69, 0.62);
  box-shadow: inset 0 0 14px rgba(91, 173, 218, 0.14);
}

.chevron {
  color: #adc0c7;
}

.submenu-item {
  display: block;
  margin: 4px 0 4px 36px;
  width: calc(100% - 36px);
  padding: 9px 12px;
  background: transparent;
  color: #d8e5e9;
}

.submenu-label {
  margin: 12px 0 4px 36px;
  color: #8fa8b3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content {
  min-width: 0;
  grid-column: 2;
}

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

.topbar-network {
  display: grid;
  grid-template-columns: repeat(2, 150px);
  gap: 8px;
  margin-left: auto;
}

.topbar-network[hidden] {
  display: none;
}

.topbar-network-card {
  min-height: 38px;
  border: 1px solid #dbe2e6;
  border-radius: 7px;
  padding: 6px 9px;
  background: rgba(248, 250, 252, 0.92);
  color: #172026;
}

.topbar-network-card span {
  display: block;
  color: #6b7882;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.topbar-network-card strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.primary-action,
.secondary-action {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}

.primary-action {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.primary-action:hover {
  background: var(--brand-dark);
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-action:hover {
  background: #eef4f6;
}

.whatsapp-action {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.whatsapp-action[hidden] {
  display: none;
}

.global-search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: 72px 20px 20px;
  background: rgba(10, 22, 28, 0.42);
  backdrop-filter: blur(4px);
}

.global-search-box {
  display: grid;
  gap: 12px;
  width: min(860px, 100%);
  max-height: min(680px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid #d6e2ea;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(10, 22, 28, 0.28);
  color: #10252e;
}

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

.global-search-header strong {
  display: block;
  font-size: 18px;
}

.global-search-header span {
  display: block;
  color: #65727d;
  font-size: 12px;
  font-weight: 700;
}

.global-search-row input {
  min-height: 42px;
  border-color: #9fb6c3;
  color: #0f172a;
  font-weight: 700;
}

.global-search-results {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.global-search-results p {
  margin: 0;
  padding: 14px;
  border: 1px dashed #cbd5df;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.global-search-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(160px, 0.6fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px solid #d6e2ea;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #10252e;
  cursor: pointer;
  text-align: left;
}

.global-search-item:hover {
  border-color: #176b87;
  background: #f1f8fb;
}

.global-search-item span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e8f5ee;
  color: #267348;
  font-size: 12px;
  font-weight: 900;
}

.global-search-item strong {
  overflow: hidden;
  color: #10252e;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-item small {
  overflow: hidden;
  color: #65727d;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[hidden],
.form-actions[hidden],
.panel[hidden],
.table-card[hidden] {
  display: none !important;
}

.inline-action {
  justify-self: start;
  min-height: 30px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 4px 10px;
  background: #ede9fe;
  color: #3b0764;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.inline-action:hover {
  background: #ddd6fe;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.backup-file-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 0 12px;
  background: #f4f0ff;
  color: #3b0764;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.backup-file-action input {
  max-width: 260px;
  min-height: auto;
  padding: 0;
  background: transparent;
}

.danger-zone {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff5f5;
  color: #7f1d1d;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.danger-zone strong {
  font-size: 1rem;
}

.danger-zone small {
  color: #991b1b;
  font-weight: 700;
}

.clear-module-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.clear-module-option {
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #7f1d1d;
  padding: 8px 10px;
}

.danger-action {
  justify-self: start;
  min-height: 38px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 14px;
}

.danger-action:hover {
  background: #b91c1c;
}

.import-result {
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  line-height: 1.45;
}

.import-result ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.portal-sync-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

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

.portal-sync-card small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
}

.portal-sync-link {
  white-space: nowrap;
}

.home-dashboard {
  display: grid;
  gap: 18px;
}

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

.home-kpi {
  min-height: 88px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.home-kpi span,
.home-card small {
  display: block;
}

.home-kpi span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

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

.home-card {
  min-height: 142px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.home-card:hover {
  border-color: #ffc76a;
  box-shadow: 0 14px 28px rgba(15, 37, 46, 0.18);
  transform: translateY(-2px);
}

.home-card span {
  display: block;
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 800;
}

.home-card small {
  min-height: 48px;
  margin: 8px 0 12px;
  color: var(--muted);
  line-height: 1.35;
}

.home-card strong {
  color: var(--accent);
  font-size: 13px;
}

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

.permission-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.permission-card strong {
  font-size: 16px;
}

.permission-card span,
.permission-card small {
  line-height: 1.35;
}

.permission-card small {
  color: #f3e8ff;
}

.portal-gestor {
  display: grid;
  gap: 18px;
}

.portal-gestor-hero {
  background: linear-gradient(135deg, rgba(13, 111, 139, 0.96), rgba(126, 55, 233, 0.92));
  border-radius: 8px;
  color: #fff;
  padding: 24px;
}

.portal-gestor-hero span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.portal-gestor-hero h3 {
  font-size: 1.7rem;
  margin: 0 0 8px;
}

.portal-gestor-hero p {
  margin: 0;
  max-width: 720px;
}

.portal-gestor-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.portal-gestor-kpis div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.portal-gestor-kpis span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.portal-gestor-kpis strong {
  color: var(--ink);
  display: block;
  font-size: 1.05rem;
}

.portal-photo-list {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.portal-photo-list img {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.portal-photo-preview-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.portal-photo-preview-button span {
  background: rgba(13, 45, 54, 0.86);
  border-radius: 999px;
  bottom: 4px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  left: 50%;
  padding: 2px 8px;
  position: absolute;
  transform: translateX(-50%);
}

.portal-photo-modal {
  align-items: center;
  background: rgba(3, 18, 24, 0.78);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 9999;
}

.portal-photo-modal-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 44px 110px rgba(0, 0, 0, 0.46),
    0 18px 42px rgba(15, 23, 42, 0.30),
    0 0 0 6px rgba(255, 255, 255, 0.16),
    0 0 36px rgba(216, 140, 53, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -18px 42px rgba(15, 23, 42, 0.08);
  max-height: 92vh;
  max-width: 920px;
  overflow: hidden;
  position: relative;
  width: min(100%, 920px);
}

.portal-photo-modal-card::before,
.price-picker-card::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(216, 140, 53, 0.58), rgba(23, 107, 135, 0.54), rgba(255, 255, 255, 0.78));
  content: "";
  height: 5px;
  inset: 0 0 auto;
  position: absolute;
}

.portal-photo-modal-card::after,
.price-picker-card::after {
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    inset 0 24px 40px rgba(255, 255, 255, 0.18);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.portal-photo-modal-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.portal-photo-modal-header strong,
.portal-photo-modal-header small {
  display: block;
}

.portal-photo-modal-header small {
  color: #65727d;
  margin-top: 3px;
}

.portal-photo-modal-close {
  align-items: center;
  background: #eef4f7;
  border: 0;
  border-radius: 999px;
  color: #0d2d36;
  cursor: pointer;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.portal-photo-modal-image {
  background: #0d2d36;
  display: block;
  max-height: 68vh;
  object-fit: contain;
  width: 100%;
}

.portal-photo-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 16px 16px;
}

.invoice-preview-card {
  max-width: min(1180px, 96vw);
  width: min(1180px, 96vw);
}

.invoice-open-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.invoice-preview-document {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 76, 100, 0.16);
  border-radius: 14px;
  color: #102033;
  display: grid;
  gap: 16px;
  margin: 0 16px;
  padding: 20px;
}

.invoice-preview-print-header {
  align-items: center;
  border-bottom: 2px solid rgba(16, 87, 117, 0.18);
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
}

.invoice-preview-print-header span {
  color: #0f6a86;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-preview-print-header strong {
  font-size: 1.6rem;
}

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

.invoice-preview-info {
  background: rgba(242, 247, 250, 0.9);
  border: 1px solid rgba(15, 76, 100, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
}

.invoice-preview-info span,
.invoice-preview-service span {
  color: #5f7184;
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.invoice-preview-info strong,
.invoice-preview-service p {
  color: #102033;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.invoice-preview-service {
  background: #fff;
  border: 1px solid rgba(15, 76, 100, 0.16);
  border-radius: 10px;
  min-height: 90px;
  padding: 12px;
}

.invoice-file-viewer {
  display: grid;
  gap: 8px;
}

.invoice-file-viewer span {
  color: #5f7184;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-file-viewer iframe {
  background: #f7fafc;
  border: 1px solid rgba(15, 76, 100, 0.2);
  border-radius: 12px;
  height: min(68vh, 720px);
  width: 100%;
}

.invoice-pdf-document {
  background: #f7fafc;
  border: 1px solid rgba(15, 76, 100, 0.18);
  border-radius: 14px;
  margin: 0 16px;
  overflow: hidden;
}

.invoice-pdf-document iframe {
  border: 0;
  display: block;
  height: min(78vh, 840px);
  width: 100%;
}

.invoice-missing-pdf-warning {
  margin: 0 16px 14px;
}

.invoice-missing-pdf-panel {
  background: #fff8e8;
  border: 1px solid rgba(190, 123, 16, 0.28);
  border-radius: 14px;
  color: #432b05;
  display: grid;
  gap: 8px;
  margin: 0 16px;
  padding: 18px;
}

.invoice-missing-pdf-panel strong {
  font-size: 1.05rem;
}

.invoice-missing-pdf-panel p {
  line-height: 1.5;
  margin: 0;
}

.portal-photo-upload-card {
  max-width: 520px;
}

.portal-photo-upload-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 4px;
}

.portal-photo-upload-body label {
  color: #0d2d36;
  display: grid;
  font-weight: 800;
  gap: 7px;
}

.portal-photo-upload-body input,
.portal-photo-upload-body select {
  border: 1px solid #cad8df;
  border-radius: 12px;
  color: #1f2d35;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.portal-photo-upload-body small {
  color: #65727d;
}

.simulation-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(222, 235, 242, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.simulation-box label {
  font-size: 0.88rem;
  font-weight: 800;
}

.simulation-box input {
  font-size: 1rem;
  min-height: 42px;
}

.simulation-rates {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.simulation-rates div,
.simulation-line {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(13, 45, 54, 0.12);
  border-radius: 9px;
  color: #0d2d36;
  padding: 9px 10px;
}

.simulation-rates span,
.simulation-line span {
  color: #596872;
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.simulation-rates strong,
.simulation-line strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0;
  margin-top: 4px;
}

.simulation-result {
  display: grid;
  gap: 6px;
}

.simulation-line {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.simulation-line span small {
  color: #176b87;
  font-size: 0.7rem;
  margin-left: 4px;
}

.simulation-line.is-total {
  background: #176b87;
  color: #fff;
}

.simulation-line.is-total span,
.simulation-line.is-net span,
.simulation-line.is-lastro span,
.simulation-line.is-available span {
  color: rgba(255, 255, 255, 0.82);
}

.simulation-line.is-lastro {
  background: #0d2d36;
  color: #fff;
}

.simulation-line.is-net {
  background: #4b148c;
  color: #fff;
}

.simulation-line.is-available {
  background: #1d7c6f;
  color: #fff;
}

@media (max-width: 860px) {
  .simulation-rates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-app-mode {
  background:
    radial-gradient(circle at 15% 0%, rgba(126, 55, 233, 0.24), transparent 18rem),
    radial-gradient(circle at 100% 12%, rgba(23, 107, 135, 0.22), transparent 16rem),
    linear-gradient(180deg, #edf4f8 0%, #f8fafc 48%, #e8eef4 100%);
}

.portal-app-mode .app-shell {
  display: block;
  min-height: 100vh;
}

.portal-app-mode .sidebar {
  display: none;
}

.portal-app-mode .content {
  grid-column: auto;
  margin: 0 auto;
  max-width: 430px;
  min-height: 100vh;
  background: #f8fafc;
  box-shadow: 0 28px 90px rgba(15, 37, 49, 0.22);
}

.portal-app-mode .topbar {
  align-items: flex-start;
  border: 0;
  border-radius: 0 0 34px 34px;
  background:
    linear-gradient(160deg, rgba(16, 37, 46, 0.96) 0%, rgba(23, 107, 135, 0.95) 54%, rgba(126, 55, 233, 0.95) 100%);
  color: #fff;
  padding: 26px 22px 92px;
}

.portal-app-mode .eyebrow {
  color: #bee8f5;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.portal-app-mode h1,
.portal-app-mode h2 {
  color: #fff;
}

.portal-app-mode h1 {
  font-size: 1.9rem;
}

.portal-app-mode .new-record {
  display: none;
}

.portal-app-mode .workspace {
  margin-top: -58px;
  padding: 0 14px 24px;
}

.portal-app-mode .panel,
.portal-app-mode .table-card {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 37, 49, 0.12);
  overflow: hidden;
}

.portal-app-mode .panel {
  background: transparent;
}

.portal-app-mode .panel-header {
  display: none;
}

.portal-app-mode .form-grid,
.portal-app-mode .form-fields {
  padding: 0;
}

.portal-app-mode .portal-gestor {
  gap: 12px;
}

.portal-app-mode .portal-gestor-hero {
  position: relative;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 255, 255, 0.22), transparent 8rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, #176b87, #7e37e9);
  box-shadow:
    0 18px 44px rgba(23, 107, 135, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  padding: 20px;
  overflow: hidden;
}

.portal-logout {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  padding: 6px 13px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.portal-logout:hover {
  background: rgba(255, 255, 255, 0.24);
}

.logout-menu-item {
  margin-top: 14px;
  border-color: rgba(248, 113, 113, 0.42);
  color: #fee2e2;
}

.logout-menu-item:hover,
.logout-menu-item:focus-visible {
  border-color: rgba(248, 113, 113, 0.8);
  background: rgba(127, 29, 29, 0.28);
  color: #fff;
}

.portal-app-mode .portal-gestor-hero h3 {
  font-size: 1.35rem;
  line-height: 1.18;
}

.portal-app-mode .portal-gestor-hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
}

.portal-app-mode .portal-gestor-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-app-mode .portal-gestor-kpis div {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f5f8fb);
  min-height: 86px;
  padding: 14px;
  box-shadow: 0 14px 30px rgba(15, 37, 49, 0.1);
}

.portal-app-mode .portal-gestor-kpis div:first-child {
  grid-column: 1 / -1;
}

.portal-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px;
  box-shadow: 0 14px 34px rgba(15, 37, 49, 0.1);
}

.portal-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #51626d;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 8px 10px;
}

.portal-tab.is-active {
  background: linear-gradient(135deg, #176b87, #7e37e9);
  color: #fff;
  box-shadow: 0 10px 22px rgba(23, 107, 135, 0.24);
}

.portal-paf-form {
  background: linear-gradient(180deg, #fff, #f6f8fc);
  border: 1px solid rgba(126, 55, 233, 0.16);
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(15, 37, 49, 0.12);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.portal-paf-title {
  display: grid;
  gap: 4px;
}

.portal-paf-title strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.portal-paf-title small,
.portal-paf-help {
  color: var(--muted);
  font-weight: 700;
}

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

.portal-paf-grid label {
  color: var(--muted);
  display: grid;
  font-size: 0.76rem;
  font-weight: 800;
  gap: 6px;
  text-transform: uppercase;
}

.portal-paf-grid input,
.portal-paf-grid select,
.portal-paf-grid textarea {
  border: 1px solid #dbe4ea;
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  min-height: 46px;
  padding: 10px 12px;
  text-transform: none;
}

.portal-paf-grid textarea {
  resize: vertical;
}

.portal-paf-wide {
  grid-column: 1 / -1;
}

.portal-paf-save {
  border-radius: 16px;
  min-height: 46px;
}

.portal-paf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.portal-paf-cancel {
  border-radius: 16px;
  min-height: 46px;
}

.portal-app-mode .table-card {
  margin-top: 16px;
}

.portal-app-mode .table-header {
  border-bottom: 0;
  padding: 18px;
}

.portal-app-mode .record-count {
  border-radius: 999px;
  background: #e7f3f7;
  color: #176b87;
  padding: 6px 10px;
}

.portal-app-mode .table-header input {
  border-radius: 999px;
}

.portal-app-mode table,
.portal-app-mode thead,
.portal-app-mode tbody,
.portal-app-mode tr,
.portal-app-mode th,
.portal-app-mode td {
  display: block;
  width: 100%;
}

.portal-app-mode thead {
  display: none;
}

.portal-app-mode tbody {
  display: grid;
  gap: 12px;
  padding: 0 14px 16px;
}

.portal-app-mode tr {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f9fbfc);
  box-shadow: 0 14px 30px rgba(15, 37, 49, 0.08);
  overflow: hidden;
}

.portal-app-mode td {
  border-bottom: 0;
  padding: 8px 14px;
}

.portal-app-mode td:first-child {
  padding-top: 14px;
}

.portal-app-mode td:first-child strong {
  display: block;
  color: #10252e;
  font-size: 1rem;
  line-height: 1.25;
}

.portal-app-mode td:first-child small {
  display: block;
  color: #65727d;
  margin-top: 4px;
}

.portal-app-mode td:last-child {
  padding-bottom: 14px;
}

.portal-app-mode .table-action {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  font-weight: 800;
}

.portal-app-mode .portal-photo-list img {
  border-radius: 12px;
  height: 60px;
  width: 60px;
}

.portal-before-after {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.portal-photo-group {
  border-radius: 14px;
  background: #f7fafc;
  padding: 10px;
}

.portal-photo-group > span {
  display: block;
  color: #176b87;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.portal-photo-group > small {
  color: #65727d;
}

.import-warning {
  color: #fff7ed;
}

.import-warning strong {
  color: #fed7aa;
}

.import-warning span {
  display: inline-block;
  margin-top: 6px;
  font-weight: 800;
}

.invoice-adjust-warning {
  margin: 8px 0;
}

.invoice-adjust-marker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.import-preview-table-wrap {
  max-height: 260px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #d8e2e7;
  border-radius: 8px;
  background: #fff;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.import-preview-table th,
.import-preview-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e5edf1;
  text-align: left;
  vertical-align: top;
}

.import-preview-table small {
  display: block;
  margin-top: 3px;
  color: #667784;
}

.import-preview-ready td {
  background: #ecfdf3;
}

.import-preview-duplicate td {
  background: #f8fafc;
}

.import-preview-review td,
.import-preview-error td {
  background: #fff7ed;
}
.import-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.import-fields[hidden] {
  display: none;
}

.import-fields-title,
.detected-columns,
.import-sync-button {
  grid-column: 1 / -1;
}

.import-fields-title {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.import-field-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.import-field-option input {
  width: auto;
  min-height: auto;
  accent-color: #5b21b6;
}

.import-field-all {
  background: #ede9fe;
  color: #3b0764;
}

.detected-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
}

.detected-columns strong {
  width: 100%;
}

.detected-columns span {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
}

.import-sync-button {
  justify-self: start;
}

.import-progress {
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.import-progress[hidden] {
  display: none;
}

.import-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.import-progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.import-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #ede9fe;
  transition: width 0.18s ease;
}

.layout-param-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.layout-param-grid strong {
  grid-column: 1 / -1;
}

.layout-preview {
  overflow: auto;
  max-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.16);
}

.layout-preview > strong {
  display: block;
  margin-bottom: 10px;
}

.layout-preview-sheet {
  width: 210mm;
  transform: scale(0.58);
  transform-origin: top left;
}

.layout-preview-sheet .price-model-page {
  margin: 0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 24px 30px;
}

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

.panel {
  padding: 20px;
  background: #7c3aed;
  border-color: #6d28d9;
  color: #ffffff;
}

.panel label,
.panel .field-help {
  color: #f3e8ff;
}

.panel input,
.panel select,
.panel textarea {
  border-color: #c4b5fd;
}

.panel .primary-action {
  background: #4c1d95;
}

.panel .primary-action:hover {
  background: #3b0764;
}

.panel .secondary-action {
  border-color: #c4b5fd;
  background: #ede9fe;
  color: #3b0764;
}

.panel .secondary-action:hover {
  background: #ddd6fe;
}

.company-data-mode .panel {
  background: #ffffff;
  border-color: #d7dde5;
  color: #0f172a;
}

.company-data-mode .panel label,
.company-data-mode .panel .field-help {
  color: #0f172a;
}

.company-data-mode .panel input,
.company-data-mode .panel select,
.company-data-mode .panel textarea {
  border-color: #cbd5e1;
}

.company-data-mode .panel .primary-action {
  background: #4f46e5;
}

.company-data-mode .panel .secondary-action {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.process-mode .panel {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(247, 251, 253, 0.8) 0%, rgba(238, 247, 251, 0.72) 100%);
  backdrop-filter: blur(8px);
  border-color: #d6e2ea;
  color: #10252e;
}

.process-mode .panel-header {
  margin-bottom: 10px;
}

.process-mode .panel label,
.process-mode .panel .field-help {
  color: #1f2937;
}

.process-mode .panel input,
.process-mode .panel select,
.process-mode .panel textarea {
  border-color: #9fb6c3;
  color: #0f172a;
  background: #ffffff;
}

.process-mode .panel input::placeholder,
.process-mode .panel textarea::placeholder {
  color: #536575;
  opacity: 1;
}

.process-mode .table-card {
  border-color: #d6e2ea;
  box-shadow: 0 12px 28px rgba(15, 37, 46, 0.05);
}

.company-register-mode .panel {
  padding: 16px 18px;
  background: #ffffff;
  border-color: #d7dde5;
  color: #0f172a;
}

.company-register-mode .panel-header {
  margin-bottom: 12px;
}

.company-register-mode .panel label,
.company-register-mode .panel .field-help {
  color: #0f172a;
}

.company-register-mode .form-grid,
.company-register-mode .form-fields {
  gap: 8px 10px;
}

.company-register-mode .panel input,
.company-register-mode .panel select,
.company-register-mode .panel textarea {
  min-height: 32px;
  border-color: #cbd5e1;
  border-radius: 4px;
  padding: 6px 9px;
  font-size: 13px;
}

.company-register-mode .panel textarea {
  min-height: 58px;
}

.company-register-mode .panel label {
  gap: 4px;
  font-size: 12px;
}

.company-register-mode .field-help {
  font-size: 11px;
  line-height: 1.25;
}

.company-register-mode .company-code-field {
  width: 88px;
  max-width: 88px;
}

.company-register-mode .company-cnpj-register-field {
  max-width: 185px;
}

.company-register-mode .company-ie-register-field {
  max-width: 175px;
}

.company-register-mode .company-cep-register-field {
  max-width: 135px;
}

.company-register-mode .inline-action {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.company-register-mode .import-result {
  border-color: #d7dde5;
  background: #f8fafc;
  color: #334155;
  padding: 9px 10px;
}

.company-register-mode .panel .primary-action {
  background: #4f46e5;
}

.company-register-mode .panel .secondary-action {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.panel-header,
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

#section-tag {
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
}

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

.form-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

textarea.large-textbox {
  min-height: 220px;
  line-height: 1.45;
}

.service-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  min-height: 82px;
  border: 1px dashed #c4b5fd;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.service-photo-item {
  overflow: hidden;
  margin: 0;
  border: 1px solid #d8d3f0;
  border-radius: 8px;
  background: #fff;
}

.service-photo-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.service-photo-item figcaption,
.service-photo-empty {
  padding: 8px;
  color: #425466;
  font-size: 12px;
}

.service-message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inline-action.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.service-message-actions .field-help {
  flex-basis: 100%;
}

.receipt-preview {
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 14px;
  background: #ede9fe;
  color: var(--ink);
}

.receipt-paper {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  border-radius: 4px;
  padding: 200px 70px 96px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(40, 15, 80, 0.18);
}

.receipt-paper::before {
  content: "Z";
  position: absolute;
  top: 330px;
  left: 86px;
  color: rgba(18, 63, 128, 0.08);
  font-size: 280px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-12deg);
  pointer-events: none;
}

.receipt-top-brand {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  min-height: 112px;
  padding: 26px 36px;
  background: #123f80;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.receipt-logo {
  display: block;
  width: auto;
  max-width: 380px;
  max-height: 76px;
  object-fit: contain;
}

.receipt-top-brand::after {
  content: "";
  position: absolute;
  right: -4%;
  bottom: -42px;
  left: 8%;
  height: 78px;
  border-radius: 50%;
  background: #fff;
}

.receipt-preview h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 175px;
  color: #000;
  font-size: 24px;
  text-align: center;
}

.receipt-preview p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

#receipt-preview-text {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  text-align: justify;
  text-indent: 54px;
  font-size: 17px;
}

.receipt-date-line {
  position: relative;
  z-index: 1;
  margin-top: 175px !important;
  text-align: center;
  font-size: 17px;
}

.receipt-signature {
  position: relative;
  z-index: 1;
  margin-top: 108px !important;
  text-align: center;
  font-size: 17px;
}

.receipt-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 12px 20px;
  background: #123f80;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.paf-sheet {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(147, 86, 235, 0.92), rgba(126, 55, 218, 0.94));
  color: #fff;
  box-shadow: 0 18px 42px rgba(91, 33, 182, 0.18);
}

.paf-sheet-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(71, 24, 139, 0.16);
}

.paf-labels {
  display: none;
}

.paf-header-fields {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(240px, 0.85fr);
  gap: 16px;
}

.paf-header-fields label {
  color: #f7f0ff;
  letter-spacing: 0.01em;
  font-size: 12px;
  font-weight: 800;
}

.paf-header-fields select,
.paf-header-fields input {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(49, 18, 92, 0.08);
}

.paf-sheet-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0;
}

.paf-add,
.paf-delete {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0 18px;
  box-shadow: 0 10px 18px rgba(43, 18, 84, 0.16);
}

.paf-add {
  background: #0f766e;
}

.paf-delete {
  background: #c92a1f;
}

.paf-grid {
  display: grid;
  grid-template-columns: 156px minmax(210px, 0.9fr) minmax(360px, 1.4fr) 100px 160px;
  gap: 0 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.11);
}

.paf-grid-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
  padding: 10px 8px 12px;
  color: #f8f4ff;
  letter-spacing: 0.01em;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.paf-lines {
  display: contents;
}

.paf-line {
  display: contents;
}

.paf-line input {
  min-height: 44px;
  border: 1px solid rgba(216, 203, 255, 0.8);
  border-radius: 0;
  margin-top: 10px;
  padding: 8px 10px;
  background: #fbf9ff;
  color: #101828;
  font-size: 14px;
}

.paf-line.is-selected input {
  border-color: #fbbf24;
  background: #fffdf5;
}

.paf-line input:nth-child(4),
.paf-line input:nth-child(5) {
  text-align: right;
}

.paf-total-row {
  grid-column: 4 / 6;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  align-items: center;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: #157f84;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(43, 18, 84, 0.14);
}

.paf-total-row span,
.paf-total-row strong {
  padding: 9px;
}

.paf-total-row strong {
  text-align: right;
}

input.is-invalid {
  border-color: #b73535;
  outline-color: #b73535;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

input.is-invalid + .field-help {
  color: #ffd7d7;
  font-weight: 700;
}

.form-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.field-short {
  grid-column: span 1;
}

.field-code {
  width: 110px;
  max-width: 110px;
}

.field-code input {
  text-align: center;
}

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

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

.field-full {
  grid-column: 1 / -1;
}

.company-data-layout {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 0;
  color: #0f172a;
}

.company-data-layout .field-help {
  color: #64748b;
}

.company-step {
  position: absolute;
  top: 6px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #6699c9;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(37, 99, 160, 0.28);
}

.company-data-group {
  min-width: 0;
  border: 1px solid #d7dde5;
  border-radius: 0;
  padding: 16px 24px 18px;
  background: #ffffff;
}

.company-data-group legend {
  padding: 0 8px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
}

.company-search-group {
  padding-top: 16px;
}

.company-search-row {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(150px, 210px) auto;
  align-items: end;
  gap: 8px;
  max-width: 590px;
}

.company-cnpj-field {
  max-width: 240px;
}

.company-ie-field {
  max-width: 210px;
}

.company-data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 10px;
  margin-top: 12px;
}

.company-data-grid label,
.company-search-row label {
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
}

.company-data-grid input,
.company-search-row input {
  min-height: 32px;
  border-color: #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  font-weight: 400;
  padding: 6px 9px;
}

.company-data-grid input::placeholder,
.company-search-row input::placeholder {
  color: #9ca3af;
}

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

.company-search-button {
  min-height: 32px;
  border: 0;
  border-radius: 3px;
  padding: 0 13px;
  background: #999999;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.company-search-button:hover {
  background: #787878;
}

.company-search-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.company-data-note {
  display: block;
  padding-left: 2px;
}

.table-card {
  overflow: hidden;
}

.table-header {
  padding: 18px 20px 0;
}

.record-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 10px;
  border-radius: 999px;
  padding: 2px 10px;
  background: #eef4f6;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.table-header input {
  max-width: 260px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.column-filter-row th {
  padding-top: 8px;
  padding-bottom: 10px;
  background: #f8fafc;
}

.column-filter-input {
  width: 100%;
  min-width: 110px;
  min-height: 30px;
  border: 1px solid #d6e1ea;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px;
}

.column-filter-input::placeholder {
  color: #8a99a8;
  font-weight: 500;
}

.column-filter-input:focus {
  outline: 2px solid rgba(20, 112, 139, 0.18);
  border-color: #14708b;
}

.column-filter-cell-empty {
  background: #f8fafc;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
}

.sort-header:hover,
.sort-header:focus-visible,
.sort-header.is-active {
  color: #7c3aed;
}

.sort-header.is-static {
  cursor: default;
}

.sort-arrow {
  color: #7c3aed;
  font-size: 12px;
  line-height: 1;
}

td {
  color: #2f3a41;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4f6;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.online-status {
  background: #e8f5ee;
  color: #267348;
}

.danger-status {
  background: #fff1f2;
  color: #b42318;
}

.invoice-canceled-row {
  background: #fff5f5;
}

.invoice-canceled-row td {
  border-bottom-color: #fecaca;
}

.invoice-canceled-status {
  border: 1px solid #ef4444;
  background: #dc2626;
  color: #fff;
  letter-spacing: 0.02em;
}

.note-number-column {
  width: 120px;
  white-space: nowrap;
}

.note-school-column {
  min-width: 420px;
}

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

.record-open {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.record-open:hover,
.record-open:focus-visible {
  color: #7c3aed;
  text-decoration: underline;
}

.table-action {
  min-height: 32px;
  border: 1px solid #b8c8ce;
  border-radius: 8px;
  padding: 4px 10px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.table-action:hover {
  background: #eef4f6;
}

.table-action.danger {
  border-color: #e4b0b0;
  color: #9c2f2f;
}

.table-action.danger:hover {
  background: #fff1f1;
}

.table-action.warning {
  border-color: #f59e0b;
  color: #92400e;
}

.table-action.warning:hover {
  background: #fffbeb;
}

.table-action.print {
  border-color: #b7d2ef;
  color: #174d7c;
}

.table-action.print:hover {
  background: #eef6ff;
}

.price-box {
  display: grid;
  gap: 10px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.price-box-title {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.price-company-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.8fr) 120px;
  align-items: end;
  gap: 10px;
}

.price-row-total {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  font-weight: 800;
  text-align: right;
}

.price-company-picker {
  display: grid;
  gap: 8px;
}

.price-company-picker-headline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.price-company-picker-label {
  color: #ede9fe;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.price-selected-companies {
  min-height: 40px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
}

.price-picker-modal[hidden] {
  display: none;
}

.price-picker-modal {
  position: fixed;
  inset: 0 0 0 280px;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.30);
}

.price-picker-card {
  width: min(620px, 100%);
  max-height: 80vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(12px);
  color: var(--ink);
  box-shadow:
    0 46px 120px rgba(15, 23, 42, 0.46),
    0 18px 44px rgba(15, 23, 42, 0.30),
    0 0 0 6px rgba(255, 255, 255, 0.14),
    0 0 40px rgba(23, 107, 135, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -20px 46px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px) saturate(1.15);
  position: relative;
}

.price-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.price-choice {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 130px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
}

.price-choice-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.price-choice-name {
  color: #0f172a;
  font-weight: 800;
}

.price-choice input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: #176b87;
}

.price-percent-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.price-percent-field input {
  width: 58px;
  min-height: 32px;
  padding: 4px 6px;
  text-align: center;
}

.price-cnae-card {
  width: min(1040px, 100%);
}

.price-picker-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.price-cnae-table-wrap {
  overflow: auto;
  max-height: 48vh;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-cnae-options {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.price-cnae-options-title {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.price-cnae-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #d8b4fe;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.74);
  color: #334155;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 8px 18px rgba(88, 28, 135, 0.08);
}

.price-cnae-option.is-selected {
  border-color: #16a34a;
  background: #dcfce7;
  box-shadow: inset 4px 0 0 #16a34a, 0 10px 22px rgba(22, 163, 74, 0.14);
}

.price-cnae-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
}

.price-cnae-option-label {
  min-width: 0;
  font-weight: 900;
}

.price-cnae-option-meta {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.price-cnae-option-percent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #14532d;
  font-size: 12px;
  font-weight: 900;
}

.price-cnae-option-percent input {
  width: 58px;
  min-height: 30px;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 4px 7px;
  text-align: center;
  font-weight: 900;
}

.price-cnae-option-empty {
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 800;
}

.price-cnae-flow-note {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.82), rgba(245, 243, 255, 0.76));
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 12px 28px rgba(79, 70, 229, 0.12);
}

.price-cnae-flow-note strong {
  font-size: 14px;
}

.price-cnae-flow-note span,
.price-cnae-flow-note small {
  color: #475569;
  font-weight: 800;
}

.price-cnae-manual {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1.2fr);
  align-items: start;
  gap: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #d8b4fe;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.74);
}

.price-cnae-manual[hidden] {
  display: none;
}

.price-cnae-manual label {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.price-cnae-manual > label,
.price-cnae-manual > .inline-action,
.price-cnae-manual > .price-cnae-activity-preview {
  grid-column: 1;
}

.price-cnae-manual input {
  margin-top: 6px;
  min-height: 36px;
  font-weight: 900;
  letter-spacing: 0;
}

.price-cnae-activity-preview {
  align-self: center;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.price-cnae-side-list {
  grid-column: 2;
  grid-row: 1 / span 4;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.46);
  border-radius: 12px;
  padding: 8px;
  background: rgba(248, 250, 252, 0.74);
}

.price-cnae-side-title {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 2px 7px;
  background: rgba(248, 250, 252, 0.92);
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.price-cnae-side-company {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.74);
}

.price-cnae-side-company strong,
.price-cnae-side-company small {
  color: #0f172a;
}

.price-cnae-side-company > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.price-cnae-side-cnae {
  border: 1px solid #c4b5fd;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f5f3ff;
  color: #3b0764;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.price-cnae-side-cnae:hover {
  border-color: #f7c948;
  background: #fffbeb;
}

.price-cnae-side-empty {
  grid-column: 1 / -1;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  color: #475569;
  font-weight: 800;
}

#cnae-company-cnaes-preview {
  min-height: 96px;
  resize: vertical;
  white-space: pre-wrap;
  font-weight: 800;
  line-height: 1.45;
}

.cnae-filter-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(196, 181, 253, 0.8);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.16);
}

.cnae-filter-panel > strong {
  color: #fff;
  font-size: 16px;
}

.cnae-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 260px);
  gap: 12px;
}

.cnae-company-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.cnae-company-list-item {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}

.cnae-company-list-item:hover {
  border-color: #f7c948;
  box-shadow: 0 0 0 2px rgba(247, 201, 72, 0.22);
}

.cnae-company-list-item span,
.cnae-company-list-item em {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cnae-company-list-item small,
.cnae-company-list-item em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.price-cnae-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 13px;
}

.price-cnae-table th,
.price-cnae-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.price-cnae-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

.price-cnae-table tr.is-compatible {
  background: #dcfce7;
}

.price-cnae-table tr.has-cnae {
  background: rgba(255, 255, 255, 0.72);
}

.price-cnae-table tr.is-preferred {
  background: #bbf7d0;
  box-shadow: inset 4px 0 0 #16a34a;
}

.price-cnae-table tr.is-compatible td:first-child {
  color: #14532d;
  font-weight: 900;
}

.cnae-preferred-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #166534;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.cnae-percent-input {
  width: 64px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #86efac;
  border-radius: 999px;
  background: #fff;
  color: #14532d;
  text-align: center;
  font-weight: 900;
  box-shadow: inset 0 1px 2px rgba(20, 83, 45, 0.16), 0 5px 12px rgba(22, 163, 74, 0.16);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cnae-percent-input.is-pending {
  background: #ecfdf5;
  color: #14532d;
  cursor: pointer;
}

.cnae-percent-input:not(.is-pending):focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.24), inset 0 1px 2px rgba(20, 83, 45, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.cnae-percent-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #14532d;
  font-size: 12px;
  font-weight: 900;
}

.price-picker-card input[type="number"],
.portal-photo-modal-card input[type="number"],
.supplier-info-card input[type="number"] {
  text-align: center;
}

.cnae-select-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f0fdf4;
  color: #14532d;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.cnae-select-choice input {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
  cursor: pointer;
}

.cnae-not-compatible {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.supplier-info-card {
  width: min(760px, 100%);
}

.supplier-info-help {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

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

.supplier-info-row {
  display: grid;
  grid-template-columns: 140px minmax(220px, 1fr) minmax(160px, 0.75fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.supplier-info-row legend {
  padding: 0 6px;
  color: #0f172a;
  font-weight: 900;
}

.supplier-info-row label {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.supplier-info-row input {
  margin-top: 5px;
}

.supplier-info-result {
  margin-top: 14px;
}

.supplier-info-actions {
  margin-top: 14px;
  justify-content: flex-end;
}

.price-item-value.is-calculated {
  background: #eef4f6;
  color: #29434f;
  font-weight: 700;
}

.price-items-head,
.price-item-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) 78px 78px repeat(3, minmax(132px, 1fr)) 88px;
  gap: 10px;
  align-items: center;
}

.price-item-row input {
  min-height: 44px;
}

.price-items-head {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.price-items {
  display: grid;
  gap: 8px;
}

#print-area {
  display: none;
}

.print-document {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  max-height: 297mm;
  padding: 68mm 30mm 22mm;
  page-break-after: avoid;
  page-break-inside: avoid;
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
}

.receipt-print-document::before {
  content: "ZzipNET Soluções";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  min-height: 26mm;
  padding: 8mm 14mm;
  background: #123f80;
  color: #fff;
  font-size: 24pt;
  line-height: 1;
}

.receipt-print-document::after {
  content: "Z";
  position: absolute;
  top: 116mm;
  left: 28mm;
  color: rgba(18, 63, 128, 0.08);
  font-size: 150pt;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-12deg);
}

.receipt-print-document .receipt-top-brand {
  display: none;
}

.receipt-print-document::before {
  content: "";
}

.receipt-print-document .receipt-top-brand {
  display: flex;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  min-height: 26mm;
  padding: 8mm 14mm;
  background: transparent;
  color: #fff;
  font-size: 24pt;
  line-height: 1;
  z-index: 2;
}

.receipt-print-document .receipt-top-brand::after {
  display: none;
}

.receipt-print-document .receipt-logo {
  max-width: 92mm;
  max-height: 20mm;
}

.print-document h1 {
  margin: 0 0 42mm;
  font-size: 18pt;
  text-align: center;
}

.print-document p {
  position: relative;
  z-index: 1;
  margin: 3mm 0;
  font-size: 12pt;
  line-height: 1.36;
  text-align: justify;
}

.receipt-print-document p:nth-of-type(2),
.receipt-print-document .receipt-signature {
  text-align: center;
}

.receipt-print-document p:nth-of-type(2) {
  margin-top: 34mm;
}

.receipt-print-document .receipt-signature {
  margin-top: 28mm;
}

.receipt-print-document .receipt-footer {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 3mm 8mm;
  background: #123f80;
  color: #fff;
  font-size: 8.5pt;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.print-document table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.print-document th,
.print-document td {
  border: 1px solid #111;
  padding: 8px;
  text-align: left;
}

.print-document th {
  background: #dbe8f4;
}

.print-total {
  margin-top: 14px;
  text-align: right;
  font-weight: 700;
}

.price-print-document {
  padding: 24mm 22mm;
}

.price-print-document h1 {
  margin-bottom: 16mm;
}

.price-print-document .best-price td {
  background: #e8f5ee;
  font-weight: 800;
}

.service-print-document {
  padding: 24mm 24mm;
  max-height: none;
}

.service-print-document h1 {
  margin-bottom: 14mm;
}

.service-print-gallery {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8mm;
  margin-top: 10mm;
}

.service-print-gallery figure {
  margin: 0;
  break-inside: avoid;
}

.service-print-gallery img {
  display: block;
  width: 100%;
  height: 58mm;
  border: 1px solid #333;
  object-fit: cover;
}

.service-print-gallery figcaption {
  margin-top: 2mm;
  font-size: 8pt;
  text-align: center;
}

.price-model-page {
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  max-height: 297mm;
  padding: 14mm 7mm 4mm;
  page-break-after: always;
  page-break-inside: avoid;
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  background: #fff;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.price-model-page:last-child {
  page-break-after: auto;
}

.price-model-border {
  border: 2px solid #000;
  transform: translateY(var(--layout-offset-y, 0mm));
}

.price-model-logo-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 11mm;
  margin: 0 0 1mm;
  transform: translateY(var(--layout-offset-y, 0mm));
}

.price-model-gov-logo {
  display: block;
  width: auto;
  max-width: 40mm;
  max-height: 11mm;
  object-fit: contain;
}

.price-model-investe-logo {
  display: block;
  width: auto;
  max-width: 43mm;
  max-height: 11mm;
  object-fit: contain;
}

.price-model-title-row {
  background: #f2f2f2 !important;
  border-bottom: 2px solid #000;
  padding: 0.6mm 0 0.8mm;
  font-size: 10.5pt;
  font-weight: 800;
  text-align: center;
}

.price-model-table,
.price-model-items {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 6.4pt;
}

.price-col-number {
  width: var(--price-col-number, 3.4%);
}

.price-col-label {
  width: var(--price-col-label, 9.4%);
}

.price-col-value {
  width: var(--price-col-value, 10.4%);
}

.price-col-value-wide {
  width: var(--price-col-value-wide, 13.4%);
}

.price-item-col-number {
  width: var(--price-item-col-number, 7%);
}

.price-item-col-description {
  width: var(--price-item-col-description, 45%);
}

.price-item-col-unit {
  width: var(--price-item-col-unit, 8%);
}

.price-item-col-quantity {
  width: var(--price-item-col-quantity, 8%);
}

.price-item-col-money {
  width: var(--price-item-col-money, 16%);
}

.price-model-table th,
.price-model-table td,
.price-model-items th,
.price-model-items td {
  border: 1px solid #000;
  padding: 0.38mm 0.65mm;
  text-align: var(--price-field-align, center);
  vertical-align: var(--price-field-valign, middle);
  word-break: break-word;
}

.price-model-table th,
.price-model-items th {
  background: #d0d0d0 !important;
  font-size: 6.8pt;
  font-weight: 800;
  text-align: center;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.price-model-table .price-number-cell {
  background: #a6a6a6 !important;
  font-weight: 800;
  text-align: center;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.price-model-table .price-label-cell {
  background: #e2e2e2 !important;
  font-weight: 800;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.price-model-table strong,
.price-model-items strong,
.price-model-footer strong {
  font-size: 6.9pt;
}

.price-model-items td:first-child,
.price-model-items td:nth-child(3),
.price-model-items td:nth-child(4) {
  text-align: center;
}

.price-model-items tbody td {
  height: var(--price-row-height, 6mm);
  font-size: 6.9pt;
}

.price-model-items tbody td:nth-child(2) {
  text-align: left;
}

.price-model-items td:nth-child(5),
.price-model-items td:nth-child(6),
.price-model-items tfoot td {
  text-align: right;
}

.price-model-items tfoot td {
  font-weight: 800;
  font-size: 7.2pt;
}

.price-model-conditions {
  padding: 0.65mm 1.3mm;
  font-size: 6.05pt;
  line-height: 1.02;
}

.price-model-footer {
  margin-top: 0.8mm;
}

.price-model-footer td,
.price-model-footer th {
  text-align: center;
}

.price-model-footer td:nth-child(2),
.price-model-footer td:nth-child(3),
.price-model-footer td:nth-child(4),
.price-model-footer td:nth-child(5) {
  text-align: center;
}

.signature-line {
  display: inline-block;
  width: 86%;
  border-bottom: 1px solid #000;
  min-height: 3.8mm;
}

.date-line {
  display: block;
  border-bottom: 1px solid #000;
  min-height: 3.8mm;
  padding-top: 0.4mm;
  text-align: center;
  width: 92%;
  margin: 0 auto;
}

.date-label {
  display: block;
  text-align: center;
  width: 92%;
  margin: 0.3mm auto 0;
}

.price-model-date-cell {
  text-align: center;
}

@media print {
  html,
  body {
    width: 210mm;
    min-height: 297mm;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
  }

  body > :not(#print-area) {
    display: none !important;
  }

  #print-area {
    display: block;
    width: 210mm;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
  }

  .price-model-page {
    height: 297mm;
    page-break-after: always;
    page-break-inside: avoid;
    break-after: page;
    break-inside: avoid;
    overflow: hidden;
  }

  .price-model-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}

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

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
  }

  .content {
    grid-column: auto;
  }

  .price-picker-modal {
    inset: 0;
  }

  .topbar,
  .panel-header,
  .table-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .global-search-header,
  .global-search-row,
  .global-search-item,
  .assistant-search,
  .assistant-topic-grid,
  .topbar-network {
    grid-template-columns: 1fr;
  }

  .global-search-modal {
    padding: 18px 12px;
  }

  .import-fields {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .field-short,
  .field-code,
  .field-double {
    grid-column: auto;
  }

  .field-code {
    width: auto;
    max-width: none;
  }

  .field-full {
    grid-column: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-kpis,
  .home-shortcuts,
  .permissions-grid,
  .process-search,
  .process-summary,
  .process-step,
  .portal-gestor-kpis {
    grid-template-columns: 1fr;
  }

  .paf-sheet {
    overflow-x: auto;
  }

  .paf-sheet-top,
  .paf-grid {
    min-width: 980px;
  }

  .paf-header-fields {
    grid-template-columns: 1fr;
  }

  .supplier-info-row {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 12px;
  }
}
