:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --success: #059669;
  --danger: #dc2626;
  --warning: #b45309;
  --sidebar: #0f172a;
  --sidebar-muted: #94a3b8;
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 22px 70px rgba(15, 23, 42, 0.14);
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: 28px clamp(18px, 5vw, 72px) 56px;
  background: linear-gradient(135deg, #f7faff 0%, #eef4ff 48%, #f8fafc 100%);
}

.landing-shell {
  display: grid;
  gap: 38px;
  min-width: 0;
}

.landing-nav {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(320px, 1.08fr);
  gap: clamp(26px, 4vw, 54px);
  align-items: center;
  min-height: min(680px, calc(100vh - 120px));
}

.hero-copy {
  max-width: 670px;
}

.hero-copy h1 {
  max-width: 620px;
  font-size: clamp(42px, 5.4vw, 72px);
  line-height: 0.98;
  margin-bottom: 20px;
}

.hero-text {
  max-width: 590px;
  color: #4f5e6f;
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-actions .btn {
  min-height: 48px;
  padding-inline: 18px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4f5e6f;
  font-size: 13px;
  font-weight: 700;
}

.product-preview {
  min-height: 470px;
  border: 1px solid #d7e0ea;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.96)),
    #e9eef5;
  box-shadow: 0 24px 70px rgba(29, 43, 65, 0.18);
  overflow: hidden;
}

.preview-top {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.preview-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d0d8e2;
}

.preview-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 428px;
}

.preview-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px 14px;
  background: #101828;
}

.preview-sidebar strong {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #fff;
  color: #101828;
}

.preview-sidebar i {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.preview-main {
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.preview-metrics article,
.preview-paper {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 30px rgba(29, 43, 65, 0.08);
}

.preview-metrics article {
  padding: 14px;
}

.preview-metrics span,
.preview-paper span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.preview-metrics strong {
  font-size: 20px;
}

.preview-paper {
  display: grid;
  gap: 16px;
  min-height: 260px;
  padding: 20px;
}

.preview-paper > div:first-child,
.preview-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.preview-paper > div:first-child span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin: 0;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--success);
  background: rgba(15, 159, 110, 0.1);
  font-weight: 800;
}

.preview-paper p {
  margin: 0;
  color: #344054;
  font-weight: 700;
}

.preview-line {
  height: 54px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #edf2f7, #f8fafc);
}

.preview-line.short {
  width: 72%;
  height: 42px;
}

.preview-total {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.preview-total span {
  margin: 0;
}

.preview-total strong {
  color: var(--primary);
  font-size: 22px;
}

.landing-section {
  display: grid;
  gap: 20px;
}

.section-heading {
  max-width: 660px;
}

.section-heading h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.08;
}

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

.feature-grid article,
.pricing-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(29, 43, 65, 0.08);
}

.feature-grid article > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--primary);
  background: rgba(33, 87, 242, 0.09);
  margin-bottom: 16px;
}

.feature-grid strong,
.pricing-grid strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.feature-grid p,
.pricing-grid p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.pricing-grid article {
  display: grid;
  gap: 14px;
}

.pricing-grid strong {
  font-size: 30px;
}

.featured-plan {
  border-color: rgba(33, 87, 242, 0.36) !important;
  box-shadow: 0 18px 44px rgba(33, 87, 242, 0.16) !important;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.brand strong {
  display: block;
  font-weight: 800;
}

.brand span,
.sidebar-user span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.auth-card,
.panel,
.budget-paper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-card {
  position: sticky;
  top: 28px;
  padding: 34px;
  margin-top: 72px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(16px);
}

.system-page .auth-screen {
  grid-template-columns: minmax(320px, 430px);
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.system-page .landing-shell {
  display: none;
}

.system-page .auth-card {
  position: static;
  width: min(100%, 430px);
  margin: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.02;
  margin-bottom: 14px;
}

h2 {
  font-size: 26px;
  margin: 0;
}

h3 {
  font-size: 16px;
  margin-bottom: 18px;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
  transition:
    border-color 0.16s,
    box-shadow 0.16s;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 87, 242, 0.12);
}

.btn,
.icon-btn,
.nav-item,
.link-btn,
.text-btn,
.dashed-btn {
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  background: var(--surface-2);
}

.btn {
  padding: 10px 14px;
  font-weight: 700;
  border: 1px solid var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

a.btn {
  text-decoration: none;
}

.btn.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

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

.btn.ghost {
  background: #fff;
}

.btn.danger {
  color: var(--danger);
  background: #fff5f4;
  border-color: #ffd7d2;
}

.btn.full {
  width: 100%;
}

.btn.google-btn {
  margin-top: 3%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #d0d7de;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.btn.google-btn:hover {
  background: #f8fafc;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
}

.google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.google-icon svg {
  width: 20px;
  height: 20px;
}

.btn.compact {
  min-height: 36px;
  padding: 8px 12px;
}

.link-btn,
.text-btn {
  background: transparent;
  color: var(--primary);
  padding: 8px 0;
  font-weight: 700;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.app-status {
  max-width: min(680px, 80vw);
  margin: 6px 0 0;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.public-screen {
  min-height: 100vh;
  padding: 48px clamp(18px, 6vw, 70px);
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(33, 87, 242, 0.12),
      transparent 42%
    ),
    radial-gradient(
      circle at 85% 10%,
      rgba(15, 159, 110, 0.1),
      transparent 45%
    ),
    var(--bg);
}

.public-card {
  max-width: 980px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.public-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.public-body {
  padding-top: 18px;
}

.public-budget-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.public-budget-head h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.public-doc {
  text-align: right;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.public-client {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  margin: 14px 0 18px;
}

.public-items {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}

.public-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.public-item:first-child {
  border-top: 0;
}

.public-totals {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.public-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.public-totals .final {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 16px;
}

.public-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.public-footer pre {
  margin: 8px 0 0;
  font-family: inherit;
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.55;
}

.public-decision {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 16px;
}

.public-decision-copy {
  margin-bottom: 14px;
}

.public-decision-copy strong,
.public-decision-result strong {
  display: block;
  margin-bottom: 6px;
}

.public-decision-copy p,
.public-decision-result p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

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

.public-decision-result {
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(33, 87, 242, 0.08);
}

.public-decision-result[data-status="Aprovado"] {
  background: rgba(15, 159, 110, 0.1);
  color: #067647;
}

.public-decision-result[data-status="Recusado"] {
  background: rgba(217, 45, 32, 0.1);
  color: #b42318;
}

.print-root {
  display: none;
}

.print-page {
  color: #101828;
  background: #fff;
  padding: 26px;
  max-width: 900px;
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.45;
}

.print-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 2px solid #101828;
}

.print-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.print-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.print-brand-text {
  display: grid;
  gap: 6px;
}

.print-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

.print-sub {
  margin: 0;
  color: #344054;
}

.print-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.print-meta strong {
  font-size: 13px;
}

.print-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 11px;
  border: 1px solid #d0d5dd;
  color: #344054;
  background: #f2f4f7;
}

.print-badge[data-status="Aprovado"] {
  background: rgba(15, 159, 110, 0.12);
  border-color: rgba(15, 159, 110, 0.28);
  color: #067647;
}

.print-badge[data-status="Recusado"] {
  background: rgba(217, 45, 32, 0.1);
  border-color: rgba(217, 45, 32, 0.25);
  color: #b42318;
}

.print-badge[data-status="Rascunho"] {
  background: rgba(183, 121, 31, 0.12);
  border-color: rgba(183, 121, 31, 0.28);
  color: #7a4a00;
}

.print-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.print-card {
  border: 1px solid #eaecf0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fcfcfd;
}

.print-card h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475467;
}

.print-card p {
  margin: 0;
  color: #101828;
}

.print-section {
  margin: 14px 0 16px;
  break-inside: avoid;
}

.print-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #101828;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  overflow: hidden;
}

.print-table th,
.print-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #eaecf0;
  vertical-align: top;
}

.print-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475467;
  background: #f9fafb;
}

.print-table tbody tr:nth-child(even) td {
  background: #fcfcfd;
}

.print-table .num {
  text-align: right;
  white-space: nowrap;
}

.print-table .desc {
  width: 44%;
}

.print-totals {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  break-inside: avoid;
}

.print-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #344054;
}

.print-totals strong {
  color: #101828;
}

.print-totals .final {
  border-top: 1px solid #eaecf0;
  padding-top: 10px;
  margin-top: 4px;
  font-size: 14px;
}

.print-totals .final strong {
  font-size: 18px;
}

.print-notes {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #d0d5dd;
  color: #344054;
  white-space: pre-wrap;
}

.print-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 22px;
}

.print-line {
  border-top: 1px solid #98a2b3;
  padding-top: 6px;
  color: #475467;
  text-align: center;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  padding: 24px 18px;
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.03);
}

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

.nav-item {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  border-radius: 12px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item.active,
.nav-item:hover {
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateX(2px);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
}

.sidebar-user {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #f4f7fe 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.icon-btn {
  width: 40px;
  height: 40px;
  color: var(--muted);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -28px -28px 24px;
  padding: 22px 28px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0 0 18px 18px;
  background: rgba(248, 251, 255, 0.95);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-stack {
  min-width: 0;
}

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

.metrics article {
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  min-height: 102px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.metrics strong {
  font-size: 24px;
}

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

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

.form-grid {
  grid-template-columns: minmax(300px, 50%) minmax(0, 50%);
}

.panel {
  padding: 20px;
  box-shadow: 0 12px 34px rgba(29, 43, 65, 0.08);
  border-radius: 16px;
}

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

.panel-head h3 {
  margin: 0;
}

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

.panel-actions input,
.panel-actions select {
  min-width: min(280px, 100%);
}

.list-first-layout {
  display: grid;
  gap: 18px;
}

.entity-form {
  max-width: 860px;
  border-top: 4px solid var(--primary);
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.64);
  backdrop-filter: blur(8px);
}

.modal-backdrop.hidden {
  display: none;
}

.entity-form.modal-active {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1201;
  width: min(92vw, 760px);
  max-width: 760px;
  max-height: min(90vh, 860px);
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

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

.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(145deg, #ffffff 0%, #fafcff 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
}

.list-item strong {
  display: block;
}

.list-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

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

.panel-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.order-items {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.order-item-row {
  display: grid;
  grid-template-columns: 1.2fr 70px 80px 110px 110px 38px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.order-item-row:first-child {
  border-top: 0;
}

.order-item-sub {
  text-align: right;
  font-weight: 800;
}

.order-item-qty,
.order-item-price {
  padding: 8px 10px;
}

.order-items-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  min-height: 24px;
  padding: 3px 9px;
  color: var(--primary);
  background: rgba(33, 87, 242, 0.09);
  font-size: 12px;
  font-weight: 800;
}

.status-pill[data-status="Aprovado"] {
  color: var(--success);
  background: rgba(15, 159, 110, 0.1);
}

.status-pill[data-status="Recusado"] {
  color: var(--danger);
  background: rgba(217, 45, 32, 0.1);
}

.status-pill[data-status="Rascunho"] {
  color: var(--warning);
  background: rgba(183, 121, 31, 0.12);
}

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

.budget-paper {
  padding: clamp(18px, 3vw, 30px);
}

.budget-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.logo-zone {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.logo-upload {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  overflow: hidden;
}

.logo-upload img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

#logo-input {
  display: none;
}

.company-fields {
  display: grid;
  gap: 7px;
  min-width: 220px;
}

.company-fields input,
.doc-info input {
  border-color: transparent;
  background: transparent;
  padding: 5px 0;
}

.company-fields .company-name {
  font-size: 22px;
  font-weight: 800;
}

.company-extra {
  font-size: 12px;
}

.doc-info {
  display: grid;
  gap: 8px;
  width: 190px;
}

.doc-info input,
.doc-info select {
  text-align: right;
}

.client-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}

.svc-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.svc-header,
.svc-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 12px;
  background: #f9fbfd;
}

.svc-name-input {
  border-color: transparent;
  background: transparent;
  font-weight: 800;
}

.svc-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.col-heads,
.item-row {
  display: grid;
  grid-template-columns: 1fr 76px 86px 118px 90px 38px;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
}

.col-heads {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.item-row {
  border-bottom: 1px solid var(--line);
}

.item-row input,
.item-row select {
  padding: 8px;
}

.item-row .money {
  text-align: right;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
}

.btn-icon:hover {
  color: var(--danger);
  background: #fff0ee;
}

.dashed-btn {
  width: 100%;
  min-height: 46px;
  margin-bottom: 18px;
  border: 1px dashed var(--line-strong);
  color: var(--primary);
  background: #fff;
  font-weight: 800;
}

.margin-block,
.totals {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.margin-block {
  display: grid;
  grid-template-columns: 150px 1fr 64px;
  gap: 14px;
  align-items: center;
}

.margin-block input {
  padding: 0;
}

.totals {
  display: grid;
  gap: 10px;
  background: #f9fbfd;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.totals strong {
  color: var(--ink);
}

.totals .final {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.totals .final strong {
  color: var(--primary);
  font-size: 26px;
}

.budget-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.budget-actions {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
}

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

td:last-child,
th:last-child {
  text-align: right;
}

.search {
  max-width: 260px;
}

.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 140px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

[data-icon] svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  display: block;
}

/* Professional app refresh */
.system-page {
  background: #f6f8fb;
}

.system-page .auth-screen {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 36%),
    #f6f8fb;
}

.system-page .auth-card {
  border: 1px solid #dbe3ef;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.system-page .auth-card h1 {
  color: #0f172a;
  font-size: 34px;
}

.app-shell {
  grid-template-columns: 282px minmax(0, 1fr);
  background: #f6f8fb;
}

.sidebar {
  background: var(--sidebar);
  border-right: 0;
  color: #fff;
  padding: 22px 16px;
}

.sidebar .brand {
  min-height: 58px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar .brand-mark {
  background: #2563eb;
  color: #fff;
}

.sidebar .brand span,
.sidebar-user span {
  color: var(--sidebar-muted);
}

.nav {
  gap: 4px;
}

.nav-item {
  min-height: 44px;
  color: #cbd5e1;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  padding: 11px 12px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.12);
}

.nav-item.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.24);
  border-color: rgba(96, 165, 250, 0.28);
}

.nav-item.active::before {
  left: -5px;
  background: #60a5fa;
}

.sidebar-user {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.82);
}

.sidebar-user strong {
  display: block;
  max-width: 168px;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .icon-btn {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
}

.workspace {
  padding: 30px;
}

.topbar {
  min-height: 82px;
  margin: -30px -30px 26px;
  padding: 22px 30px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(246, 248, 251, 0.94);
}

.topbar h2 {
  color: #0f172a;
  font-size: 25px;
  letter-spacing: 0;
}

.eyebrow {
  color: #2563eb;
}

.panel,
.budget-paper,
.auth-card {
  border-color: #dbe3ef;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
}

.panel {
  padding: 22px;
}

.panel-head {
  align-items: flex-start;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 16px;
}

.panel-head h3 {
  color: #0f172a;
  font-size: 17px;
}

.panel-actions {
  align-items: center;
}

input,
select,
textarea {
  min-height: 42px;
  border-color: #dbe3ef;
  background: #fff;
  color: #0f172a;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

label {
  color: #64748b;
  font-size: 11px;
}

.btn {
  min-height: 42px;
  border-color: #dbe3ef;
  font-weight: 750;
}

.btn.primary {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.btn.ghost {
  color: #334155;
  background: #fff;
}

.icon-btn,
.btn-icon {
  border: 1px solid transparent;
  border-radius: 7px;
}

.icon-btn:hover,
.btn-icon:hover {
  border-color: #dbe3ef;
  background: #f8fafc;
}

.metrics {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.metrics article {
  position: relative;
  overflow: hidden;
  border-color: #dbe3ef;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.metrics article::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.metrics span {
  color: #64748b;
  font-weight: 650;
}

.metrics strong {
  color: #0f172a;
  font-size: 23px;
  letter-spacing: 0;
}

.list {
  gap: 8px;
}

.list-item {
  border-color: #e2e8f0;
  border-radius: 7px;
  background: #fff;
  padding: 14px;
  transition:
    border-color 0.16s,
    box-shadow 0.16s,
    transform 0.16s;
}

.list-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.list-item strong {
  color: #0f172a;
  font-size: 14px;
}

.list-item span {
  color: #64748b;
}

.item-actions {
  align-items: center;
}

.status-pill,
.pill {
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

.empty {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #fff;
}

table {
  overflow: hidden;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
}

td {
  color: #334155;
}

.list-first-layout {
  gap: 16px;
}

.entity-form {
  max-width: 100%;
  border-top: 0;
  border-left: 4px solid #2563eb;
}

.entity-form h3 {
  color: #0f172a;
  font-size: 18px;
}

.budget-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}

.budget-paper {
  border-top: 0;
  background: #fff;
}

.budget-top {
  padding-bottom: 18px;
  border-bottom: 1px solid #edf2f7;
}

.client-card {
  background: #f8fafc;
  border-color: #dbe3ef;
}

.svc-block {
  border-color: #dbe3ef;
  background: #fff;
}

.svc-header,
.svc-footer {
  background: #f8fafc;
}

.col-heads {
  background: #f8fafc;
  color: #64748b;
}

.item-row {
  background: #fff;
}

.totals {
  background: #f8fafc;
  border-color: #dbe3ef;
}

.totals .final strong {
  color: #1d4ed8;
}

.budget-actions {
  border-top: 0;
  border-left: 4px solid #22c55e;
}

.public-card {
  border-color: #dbe3ef;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
}

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

  .auth-screen {
    grid-template-columns: 1fr;
    padding-bottom: 34px;
  }

  .auth-card {
    position: static;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }

  .landing-hero,
  .feature-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .metrics,
  .grid.two,
  .form-grid,
  .budget-layout {
    grid-template-columns: 1fr;
  }

  .budget-actions {
    position: static;
  }
}

@media (max-width: 720px) {
  .auth-screen {
    padding: 18px;
  }

  .landing-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-nav-actions,
  .hero-actions {
    width: 100%;
  }

  .landing-nav-actions .btn,
  .hero-actions .btn {
    flex: 1;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 12vw, 48px);
  }

  .hero-text {
    font-size: 16px;
  }

  .product-preview {
    min-height: auto;
  }

  .preview-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .preview-sidebar {
    display: none;
  }

  .preview-metrics {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 18px;
    padding: 18px;
  }

  .topbar,
  .budget-top {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .btn {
    flex: 1;
  }

  .client-card {
    grid-template-columns: 1fr;
  }

  .doc-info {
    width: 100%;
  }

  .doc-info input,
  .doc-info select {
    text-align: left;
  }

  .col-heads {
    display: none;
  }

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

@media (max-width: 980px) {
  .app-shell {
    background: #f6f8fb;
  }

  .sidebar {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    border-right: 0;
  }

  .sidebar .brand {
    border-bottom: 0;
    padding-bottom: 0;
  }

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

  .nav-item.active::before {
    display: none;
  }

  .sidebar-user {
    margin-top: 0;
  }
}

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

  .panel-head,
  .panel-actions,
  .public-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions input,
  .panel-actions .btn,
  .panel-actions select {
    width: 100%;
  }

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

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

  .item-actions {
    justify-content: flex-start;
  }

  .budget-layout {
    grid-template-columns: 1fr;
  }

  .entity-form {
    border-left: 0;
    border-top: 4px solid #2563eb;
  }
}

@media (max-width: 520px) {
  .nav {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 16px;
    padding: 16px 14px;
  }

  .panel,
  .budget-paper,
  .auth-card {
    padding: 16px;
  }

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

@media print {
  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .public-screen,
  .public-card,
  .public-body {
    display: none !important;
  }

  .print-root {
    display: block;
  }

  .sidebar,
  .topbar,
  .budget-actions,
  .dashed-btn,
  .btn-icon,
  .auth-screen,
  .svc-footer,
  .view:not(#view-budget) {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .view.active,
  .budget-layout {
    display: block !important;
    padding: 0;
  }

  .budget-layout,
  .budget-paper {
    display: none !important;
  }

  .print-page {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .print-table thead {
    display: table-header-group;
  }

  .print-section,
  .print-card,
  .print-totals {
    page-break-inside: avoid;
  }
}
