/* ==========================================================================
   FinDem Angola — Sistema de Demonstrações Financeiras
   Protótipo de alta fidelidade (HTML/CSS estático, navegável)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&display=swap");

/* ---------- Tokens ------------------------------------------------------- */
:root {
  /* Marca / cor */
  --c-primary: #1E3A8A;
  --c-primary-700: #1E40AF;
  --c-primary-600: #2747B5;
  --c-primary-100: #DDE4F5;
  --c-primary-50: #EFF3FB;

  --c-teal: #0F766E;
  --c-amber-700: #B45309;

  --c-success: #10B981;
  --c-success-bg: #ECFDF5;
  --c-warning: #F59E0B;
  --c-warning-bg: #FFFBEB;
  --c-danger: #EF4444;
  --c-danger-bg: #FEF2F2;
  --c-info: #3B82F6;
  --c-info-bg: #EFF6FF;

  --c-canvas: #F6F7F9;
  --c-card: #FFFFFF;
  --c-muted: #F1F5F9;
  --c-muted-2: #E9EEF4;

  --c-border: #E4E8EE;
  --c-border-strong: #CFD6DF;
  --c-border-soft: #EFF1F4;

  --c-text: #0B1220;
  --c-text-2: #475569;
  --c-text-3: #7B8497;
  --c-text-4: #9CA4B3;
  --c-on-primary: #FFFFFF;

  /* Tipografia — Geist em todo o sistema. Display = mesma família, peso 700 + tracking tight. */
  --f-display: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --f-sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Tamanhos */
  --t-2xs: 10.5px;
  --t-xs: 12px;
  --t-sm: 13px;
  --t-base: 14px;
  --t-md: 15px;
  --t-lg: 17px;
  --t-xl: 20px;
  --t-2xl: 24px;
  --t-3xl: 30px;
  --t-4xl: 38px;

  /* Espaçamento (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 28px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-14: 56px;
  --s-16: 64px;

  /* Cantos */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* Sombras */
  --sh-xs: 0 1px 2px rgba(11, 18, 32, 0.04);
  --sh-sm: 0 1px 2px rgba(11, 18, 32, 0.05), 0 1px 1px rgba(11, 18, 32, 0.03);
  --sh-md: 0 4px 12px rgba(11, 18, 32, 0.06), 0 1px 2px rgba(11, 18, 32, 0.04);
  --sh-lg: 0 12px 32px rgba(11, 18, 32, 0.08), 0 2px 6px rgba(11, 18, 32, 0.04);

  --ring: 0 0 0 3px rgba(30, 58, 138, 0.18);

  /* Layout */
  --sidebar-w: 248px;
  --rightpanel-w: 328px;
  --topbar-h: 56px;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--f-sans);
  font-size: var(--t-base);
  font-weight: 400;
  color: var(--c-text);
  background: var(--c-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; margin: 0; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--c-primary-100); color: var(--c-primary); }

/* ---------- Utilitários -------------------------------------------------- */
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--c-text-3); }
.muted-2 { color: var(--c-text-2); }
.uppercase-label {
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--c-text-3);
}
.text-amount {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.amount-negative { color: var(--c-danger); }

/* ---------- Layout principal -------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.app--with-rightpanel {
  grid-template-columns: var(--sidebar-w) 1fr var(--rightpanel-w);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--c-canvas);
}

/* ---------- Sidebar ------------------------------------------------------ */
.sidebar {
  background: #0B1220;
  color: #C7CCD8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #1B2230;
}

.sidebar__brand {
  padding: 22px 22px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #1B2230;
}
.sidebar__brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #3B82F6 0%, #1E3A8A 100%);
  display: grid; place-items: center;
  color: white;
  font-family: var(--f-display);
  font-weight: 700; font-size: 15px;
  letter-spacing: -0.03em;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2);
}
.sidebar__brand-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.025em;
  color: white;
}
.sidebar__brand-sub {
  font-size: var(--t-2xs);
  color: #6B7385;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
  font-weight: 500;
}

.sidebar__section {
  padding: 18px 14px 8px;
}
.sidebar__section-title {
  font-size: var(--t-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6B7385;
  font-weight: 600;
  padding: 0 8px 8px;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #A8B0C0;
  font-size: var(--t-base);
  font-weight: 500;
  position: relative;
  transition: background .15s, color .15s;
}
.nav__item:hover { background: rgba(255,255,255,0.04); color: white; }
.nav__item--active {
  background: rgba(59, 130, 246, 0.12);
  color: white;
}
.nav__item--active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: #3B82F6;
}
.nav__icon {
  width: 18px; height: 18px;
  flex: 0 0 18px;
  opacity: 0.85;
}
.nav__badge {
  margin-left: auto;
  font-size: var(--t-2xs);
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-weight: 600;
}

.sidebar__footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid #1B2230;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}
.user-chip__avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #B45309, #F59E0B);
  display: grid; place-items: center;
  color: white;
  font-weight: 600;
  font-size: var(--t-sm);
}
.user-chip__meta { display: flex; flex-direction: column; min-width: 0; }
.user-chip__name { font-size: var(--t-sm); color: white; font-weight: 600; }
.user-chip__role { font-size: var(--t-xs); color: #6B7385; }

/* ---------- Top bar ------------------------------------------------------ */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 20;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--t-sm);
  color: var(--c-text-3);
}
.breadcrumb__sep { opacity: 0.5; }
.breadcrumb__link:hover { color: var(--c-text); }
.breadcrumb__current { color: var(--c-text); font-weight: 500; }

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

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--c-text-2);
  border: 1px solid transparent;
  position: relative;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--c-muted); }
.icon-btn__dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--c-danger);
  border-radius: 50%;
  border: 2px solid var(--c-card);
}
.icon-btn__badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: var(--c-danger); color: white;
  font-size: 10px; font-weight: 700;
  border-radius: var(--r-full);
  padding: 0 4px;
  display: grid; place-items: center;
  border: 2px solid var(--c-card);
}

.topbar__divider { width: 1px; height: 22px; background: var(--c-border); }

.user-chip--top {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-full);
  background: var(--c-muted);
}
.user-chip--top .user-chip__avatar {
  width: 28px; height: 28px;
  font-size: var(--t-xs);
}
.user-chip--top .user-chip__name { color: var(--c-text); font-size: var(--t-sm); }
.user-chip--top .user-chip__role { color: var(--c-text-3); }

/* ---------- Page header -------------------------------------------------- */
.page {
  padding: 32px 32px 80px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}
.page--wide {
  max-width: none;
}

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-4xl);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--c-text);
  margin: 0 0 6px;
}
.page-header__sub {
  font-size: var(--t-md);
  color: var(--c-text-2);
  max-width: 64ch;
}
.page-header__eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-primary);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- Stepper ------------------------------------------------------ */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }

.step {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  position: relative;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s;
}
.step__num {
  width: 22px; height: 22px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  font-size: var(--t-xs);
  font-weight: 600;
  font-family: var(--f-mono);
  flex-shrink: 0;
  background: var(--c-muted);
  color: var(--c-text-3);
  border: 1px solid var(--c-border);
}
.step__label {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--c-text-3);
  white-space: nowrap;
}
.step__connector {
  flex: 1;
  height: 1px;
  min-width: 14px;
  background: var(--c-border);
}
.step--done .step__num {
  background: var(--c-success);
  color: white;
  border-color: var(--c-success);
}
.step--done .step__label { color: var(--c-text-2); }
.step--active {
  background: var(--c-primary-50);
}
.step--active .step__num {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
  box-shadow: var(--ring);
}
.step--active .step__label { color: var(--c-primary); font-weight: 600; }

/* ---------- Card --------------------------------------------------------- */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.card + .card { margin-top: 20px; }
.card__header {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--c-border-soft);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.card__title {
  font-family: var(--f-display);
  font-size: var(--t-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin: 0 0 4px;
}
.card__sub { font-size: var(--t-sm); color: var(--c-text-2); }
.card__body { padding: 24px 26px; }
.card__footer {
  padding: 16px 26px;
  border-top: 1px solid var(--c-border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #FCFCFD;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.section {
  padding: 22px 26px;
  border-top: 1px solid var(--c-border-soft);
}
.section:first-child { border-top: 0; }
.section__title {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.section__num {
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  background: var(--c-primary-50);
  color: var(--c-primary);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 600;
}
.section__sub { font-size: var(--t-sm); color: var(--c-text-2); margin: 0 0 16px; }

/* ---------- Form --------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--c-text);
  display: flex; align-items: center; gap: 4px;
}
.field__required { color: var(--c-danger); font-weight: 600; }
.field__hint { font-size: var(--t-xs); color: var(--c-text-3); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-strong);
  background: var(--c-card);
  color: var(--c-text);
  font-size: var(--t-base);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-4); }
.input:hover, .select:hover { border-color: #B5BEC9; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-primary);
  box-shadow: var(--ring);
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.55;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237B8497' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.input-group {
  position: relative;
}
.input-group__prefix, .input-group__suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--t-sm);
  color: var(--c-text-3);
  font-family: var(--f-mono);
  pointer-events: none;
}
.input-group__prefix { left: 12px; }
.input-group__suffix { right: 12px; }
.input-group--prefix .input { padding-left: 36px; }
.input-group--suffix .input { padding-right: 56px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 20px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px 20px; }
.col-full { grid-column: 1 / -1; }

/* ---------- Radio cards / Checkboxes ------------------------------------- */
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.radio-card {
  display: flex; flex-direction: column;
  padding: 14px 16px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-card);
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s, box-shadow .15s;
  min-height: 96px;
}
.radio-card:hover { border-color: var(--c-primary-100); }
.radio-card__title {
  font-weight: 600;
  font-size: var(--t-md);
  color: var(--c-text);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.radio-card__badge {
  font-family: var(--f-mono);
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
  background: var(--c-muted);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-weight: 600;
}
.radio-card__sub { font-size: var(--t-sm); color: var(--c-text-2); line-height: 1.45; }
.radio-card__check {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--c-border-strong);
  background: var(--c-card);
}
.radio-card--selected {
  border-color: var(--c-primary);
  background: linear-gradient(180deg, var(--c-primary-50) 0%, var(--c-card) 60%);
  box-shadow: 0 0 0 1px var(--c-primary), var(--sh-xs);
}
.radio-card--selected .radio-card__check {
  background: var(--c-primary);
  border-color: var(--c-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.radio-card--selected .radio-card__badge {
  background: var(--c-primary-100);
  color: var(--c-primary);
}

.checkbox {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-card);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.checkbox:hover { border-color: var(--c-primary-100); }
.checkbox__box {
  width: 18px; height: 18px; flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid var(--c-border-strong);
  background: var(--c-card);
  margin-top: 2px;
  display: grid; place-items: center;
}
.checkbox--checked {
  background: var(--c-primary-50);
  border-color: var(--c-primary);
}
.checkbox--checked .checkbox__box {
  background: var(--c-primary);
  border-color: var(--c-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.checkbox--locked { opacity: 0.7; cursor: not-allowed; }
.checkbox__label {
  font-weight: 500;
  font-size: var(--t-base);
  color: var(--c-text);
  display: flex; align-items: center; gap: 8px;
}
.checkbox__sub { font-size: var(--t-sm); color: var(--c-text-3); margin-top: 2px; }

.radio-row {
  display: flex; gap: 0;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-card);
  padding: 3px;
}
.radio-row__opt {
  flex: 1;
  text-align: center;
  padding: 7px 12px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--c-text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.radio-row__opt--selected {
  background: var(--c-card);
  color: var(--c-text);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--c-border);
}

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: var(--t-base);
  font-weight: 500;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn--lg { height: 44px; padding: 0 20px; font-size: var(--t-md); }
.btn--sm { height: 32px; padding: 0 12px; font-size: var(--t-sm); }

.btn--primary {
  background: var(--c-primary);
  color: var(--c-on-primary);
  box-shadow: var(--sh-sm);
}
.btn--primary:hover { background: var(--c-primary-700); }
.btn--primary:focus { box-shadow: var(--ring); }

.btn--secondary {
  background: var(--c-card);
  color: var(--c-text);
  border-color: var(--c-border-strong);
}
.btn--secondary:hover { background: var(--c-muted); border-color: #B5BEC9; }

.btn--ghost {
  background: transparent;
  color: var(--c-text-2);
}
.btn--ghost:hover { background: var(--c-muted); color: var(--c-text); }

.btn--danger {
  background: var(--c-card);
  color: var(--c-danger);
  border-color: var(--c-danger);
}
.btn--danger:hover { background: var(--c-danger-bg); }

.btn--success {
  background: var(--c-success);
  color: white;
}
.btn--success:hover { filter: brightness(0.95); }

.btn:disabled, .btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Status pills ------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.005em;
  background: var(--c-muted);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}
.pill__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-text-3);
}
.pill--success { background: var(--c-success-bg); color: #047857; border-color: #A7F3D0; }
.pill--success .pill__dot { background: var(--c-success); }
.pill--warning { background: var(--c-warning-bg); color: #92400E; border-color: #FCD34D; }
.pill--warning .pill__dot { background: var(--c-warning); }
.pill--danger { background: var(--c-danger-bg); color: #991B1B; border-color: #FCA5A5; }
.pill--danger .pill__dot { background: var(--c-danger); }
.pill--info { background: var(--c-info-bg); color: #1D4ED8; border-color: #BFDBFE; }
.pill--info .pill__dot { background: var(--c-info); }
.pill--primary { background: var(--c-primary-50); color: var(--c-primary); border-color: var(--c-primary-100); }
.pill--primary .pill__dot { background: var(--c-primary); }

/* ---------- Right panel -------------------------------------------------- */
.rightpanel {
  background: var(--c-card);
  border-left: 1px solid var(--c-border);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 22px;
}
.summary { display: flex; flex-direction: column; gap: 18px; }
.summary__title {
  font-family: var(--f-display);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--c-text);
  display: flex; align-items: center; justify-content: space-between;
}
.summary__rows { display: flex; flex-direction: column; gap: 12px; }
.summary__row {
  display: flex; flex-direction: column; gap: 2px;
}
.summary__label {
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
  font-weight: 600;
}
.summary__value {
  font-size: var(--t-sm);
  color: var(--c-text);
  font-weight: 500;
}
.summary__divider { height: 1px; background: var(--c-border-soft); margin: 4px 0; }

.progress { display: flex; flex-direction: column; gap: 8px; }
.progress__top { display: flex; align-items: center; justify-content: space-between; font-size: var(--t-sm); }
.progress__pct { font-family: var(--f-mono); font-weight: 600; color: var(--c-primary); }
.progress__track {
  height: 6px;
  background: var(--c-muted);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-info));
  border-radius: var(--r-full);
}

.steps-list { display: flex; flex-direction: column; gap: 2px; }
.steps-list__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: var(--t-sm);
  color: var(--c-text-3);
}
.steps-list__num {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  background: var(--c-muted); color: var(--c-text-3);
  border: 1px solid var(--c-border);
}
.steps-list__item--done .steps-list__num {
  background: var(--c-success); color: white; border-color: var(--c-success);
}
.steps-list__item--done { color: var(--c-text-2); }
.steps-list__item--active {
  background: var(--c-primary-50);
  color: var(--c-primary);
  font-weight: 600;
}
.steps-list__item--active .steps-list__num {
  background: var(--c-primary); color: white; border-color: var(--c-primary);
}

.alert {
  border: 1px solid;
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: var(--t-sm);
  display: flex; gap: 10px;
  line-height: 1.45;
}
.alert--warning { background: var(--c-warning-bg); border-color: #FDE68A; color: #92400E; }
.alert--danger { background: var(--c-danger-bg); border-color: #FECACA; color: #991B1B; }
.alert--info { background: var(--c-info-bg); border-color: #BFDBFE; color: #1E40AF; }
.alert--success { background: var(--c-success-bg); border-color: #A7F3D0; color: #047857; }
.alert__icon { flex-shrink: 0; font-weight: 700; line-height: 1.2; }

/* ---------- Tables ------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table th {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  font-weight: 600;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border);
  background: #FCFCFD;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table th.num { text-align: right; }
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border-soft);
  font-size: var(--t-sm);
  vertical-align: middle;
}
.table td.num {
  text-align: right;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.table tr:hover td { background: #FAFBFC; }
.table tr:last-child td { border-bottom: 0; }
.table--zebra tr:nth-child(even) td { background: #FBFBFC; }

.table-wrap {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-card);
}

/* ---------- Dashboard-only ---------------------------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.kpi__head { display: flex; align-items: center; justify-content: space-between; }
.kpi__label {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
  font-weight: 600;
}
.kpi__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  font-size: 16px;
}
.kpi__icon--blue { background: var(--c-primary-50); color: var(--c-primary); }
.kpi__icon--green { background: var(--c-success-bg); color: #047857; }
.kpi__icon--amber { background: var(--c-warning-bg); color: #92400E; }
.kpi__icon--red { background: var(--c-danger-bg); color: #991B1B; }
.kpi__value {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.kpi__delta { display: flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 600; }
.kpi__delta--up { color: var(--c-success); }
.kpi__delta--down { color: var(--c-danger); }
.kpi__delta-label { color: var(--c-text-3); font-weight: 400; }

.process-list { display: flex; flex-direction: column; gap: 0; }
.process-row {
  display: grid;
  grid-template-columns: 1fr 100px 200px 130px 36px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  transition: background .15s;
}
.process-row:last-child { border-bottom: 0; }
.process-row:hover { background: #FAFBFC; }
.process-row__co {
  display: flex; flex-direction: column; gap: 2px;
}
.process-row__co-name {
  font-weight: 600;
  font-size: var(--t-base);
  color: var(--c-text);
}
.process-row__co-meta {
  font-size: var(--t-xs);
  color: var(--c-text-3);
  font-family: var(--f-mono);
}
.process-row__exercise {
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  color: var(--c-text-2);
  font-weight: 500;
}
.process-row__progress { display: flex; flex-direction: column; gap: 6px; }
.process-row__progress-track {
  height: 4px;
  background: var(--c-muted);
  border-radius: var(--r-full);
  overflow: hidden;
}
.process-row__progress-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: var(--r-full);
}
.process-row__progress-label {
  font-size: var(--t-xs); color: var(--c-text-3);
}
.process-row__time {
  font-size: var(--t-xs); color: var(--c-text-3);
  text-align: right;
}
.process-row__action {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--c-muted);
  display: grid; place-items: center;
  color: var(--c-text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.process-row__action:hover { background: var(--c-primary); color: white; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border-soft);
}
.timeline__item:last-child { border-bottom: 0; }
.timeline__avatar {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  font-size: var(--t-xs);
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.timeline__content { flex: 1; }
.timeline__text { font-size: var(--t-sm); color: var(--c-text); line-height: 1.4; }
.timeline__text strong { font-weight: 600; }
.timeline__time { font-size: var(--t-xs); color: var(--c-text-3); margin-top: 2px; }

/* ---------- Importação --------------------------------------------------- */
.upload {
  border: 2px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  background: #FCFCFD;
  padding: 36px 24px;
  text-align: center;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.upload:hover { background: var(--c-primary-50); border-color: var(--c-primary); }
.upload__icon {
  width: 48px; height: 48px;
  margin: 0 auto 14px;
  background: var(--c-primary-50);
  color: var(--c-primary);
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  font-size: 22px;
}
.upload__title { font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.upload__hint { font-size: var(--t-sm); color: var(--c-text-3); }

.file-row {
  display: grid;
  grid-template-columns: 36px 1fr 100px 180px 32px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-card);
  margin-top: 12px;
}
.file-row__icon {
  width: 36px; height: 36px;
  background: var(--c-success-bg);
  color: #047857;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
}
.file-row__icon--xls { background: #F0FDF4; color: #15803D; }
.file-row__icon--err { background: var(--c-danger-bg); color: #991B1B; }
.file-row__name { font-weight: 500; font-size: var(--t-sm); }
.file-row__meta { font-size: var(--t-xs); color: var(--c-text-3); }
.file-row__size {
  font-family: var(--f-mono); font-size: var(--t-xs); color: var(--c-text-2);
}

/* ---------- Mapeamento --------------------------------------------------- */
.account-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--t-xs);
  font-weight: 500;
}
.classification-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: var(--t-xs);
  font-weight: 500;
  background: var(--c-muted);
  color: var(--c-text-2);
}
.classification-tag--asset { background: #EFF6FF; color: #1D4ED8; }
.classification-tag--liability { background: #FFF7ED; color: #C2410C; }
.classification-tag--equity { background: #F5F3FF; color: #6D28D9; }
.classification-tag--revenue { background: #ECFDF5; color: #047857; }
.classification-tag--expense { background: #FEF2F2; color: #B91C1C; }

.search-input {
  position: relative;
}
.search-input .input { padding-left: 36px; }
.search-input svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-3);
}

.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  background: #FCFCFD;
  flex-wrap: wrap;
}
.toolbar__group { display: flex; align-items: center; gap: 8px; }
.toolbar__divider { width: 1px; height: 20px; background: var(--c-border); }

/* ---------- Validações -------------------------------------------------- */
.validation-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.val-summary {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.val-summary__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 16px;
}
.val-summary__count { font-family: var(--f-display); font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.val-summary__label { font-size: var(--t-xs); color: var(--c-text-3); margin-top: 2px; }

.val-item {
  border: 1px solid var(--c-border);
  border-left-width: 3px;
  border-radius: var(--r-md);
  padding: 14px 16px;
  background: var(--c-card);
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: flex-start;
}
.val-item--ok { border-left-color: var(--c-success); }
.val-item--warn { border-left-color: var(--c-warning); background: linear-gradient(90deg, var(--c-warning-bg) 0%, var(--c-card) 8%); }
.val-item--err { border-left-color: var(--c-danger); background: linear-gradient(90deg, var(--c-danger-bg) 0%, var(--c-card) 8%); }
.val-item__icon {
  width: 24px; height: 24px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: var(--t-sm);
}
.val-item--ok .val-item__icon { background: var(--c-success); color: white; }
.val-item--warn .val-item__icon { background: var(--c-warning); color: white; }
.val-item--err .val-item__icon { background: var(--c-danger); color: white; }
.val-item__title { font-weight: 600; font-size: var(--t-md); margin-bottom: 4px; }
.val-item__desc { font-size: var(--t-sm); color: var(--c-text-2); line-height: 1.55; }
.val-item__meta {
  display: flex; gap: 14px; margin-top: 8px;
  font-size: var(--t-xs); color: var(--c-text-3);
  font-family: var(--f-mono);
}

/* ---------- Demonstrações ----------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--c-muted);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.tab {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--c-text); }
.tab--active {
  background: var(--c-card);
  color: var(--c-text);
  box-shadow: var(--sh-sm);
}

.statement {
  font-family: var(--f-mono);
  font-size: var(--t-sm);
}
.statement-row {
  display: grid;
  grid-template-columns: 1fr 140px 140px 100px;
  gap: 16px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  align-items: center;
}
.statement-row__label {
  font-family: var(--f-sans);
  color: var(--c-text);
}
.statement-row__amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.statement-row__delta {
  text-align: right;
  font-size: var(--t-xs);
  color: var(--c-text-3);
}
.statement-row--head {
  background: #FCFCFD;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--t-xs);
  color: var(--c-text-3);
  padding: 10px 20px;
  border-bottom: 1px solid var(--c-border);
  font-family: var(--f-sans);
}
.statement-row--group {
  font-family: var(--f-sans);
  font-weight: 600;
  background: #FAFBFC;
  font-size: var(--t-base);
}
.statement-row--total {
  font-weight: 700;
  border-top: 2px solid var(--c-text);
  border-bottom: 2px solid var(--c-text);
  background: #FCFCFD;
  padding: 12px 20px;
}
.statement-row--sub {
  padding-left: 36px;
  color: var(--c-text-2);
}
.statement-row--sub-2 {
  padding-left: 56px;
  color: var(--c-text-3);
}

/* ---------- Notas explicativas ------------------------------------------ */
.note-toolbar {
  display: flex; gap: 4px;
  padding: 8px;
  border: 1px solid var(--c-border);
  border-bottom: 0;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: #FCFCFD;
}
.note-toolbar__btn {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  color: var(--c-text-2);
  cursor: pointer;
  transition: background .15s;
}
.note-toolbar__btn:hover { background: var(--c-muted); color: var(--c-text); }
.note-toolbar__divider { width: 1px; background: var(--c-border); margin: 0 4px; }
.note-editor {
  border: 1px solid var(--c-border);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 20px 24px;
  background: var(--c-card);
  min-height: 220px;
  font-family: var(--f-sans);
  font-size: var(--t-md);
  font-weight: 400;
  line-height: 1.65;
  color: var(--c-text);
}
.note-editor h3 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--t-lg);
  margin: 18px 0 8px;
  letter-spacing: -0.015em;
}
.note-editor h3:first-child { margin-top: 0; }
.note-editor p { margin: 0 0 12px; }

.note-list { display: flex; flex-direction: column; gap: 8px; }
.note-list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-card);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.note-list__item:hover { border-color: var(--c-primary); background: var(--c-primary-50); }
.note-list__item--active {
  border-color: var(--c-primary);
  background: var(--c-primary-50);
}
.note-list__num {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--c-muted);
  color: var(--c-text-2);
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 600;
}
.note-list__item--active .note-list__num {
  background: var(--c-primary); color: white;
}
.note-list__title { flex: 1; font-size: var(--t-sm); font-weight: 500; }
.note-list__status { font-size: var(--t-xs); color: var(--c-text-3); }

/* ---------- Aprovação --------------------------------------------------- */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.review-tile {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.review-tile__head {
  display: flex; align-items: center; justify-content: space-between;
}
.review-tile__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--t-lg);
  letter-spacing: -0.018em;
}
.review-tile__list { display: flex; flex-direction: column; gap: 8px; }
.review-tile__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: #FCFCFD;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
}
.review-tile__item-name { font-weight: 500; }
.review-tile__item-meta { font-size: var(--t-xs); color: var(--c-text-3); }

.signature-card {
  background: linear-gradient(135deg, #0B1220 0%, #1E3A8A 100%);
  color: white;
  border-radius: var(--r-lg);
  padding: 28px 30px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
  overflow: hidden;
}
.signature-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(245,158,11,0.18), transparent 50%);
  pointer-events: none;
}
.signature-card__eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.signature-card__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.signature-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.signature-card__meta-row { display: flex; flex-direction: column; gap: 4px; }
.signature-card__meta-label {
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
.signature-card__meta-value {
  font-size: var(--t-md);
  font-weight: 500;
  color: white;
}

.approval-step {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  align-items: flex-start;
  background: var(--c-card);
}
.approval-step + .approval-step { margin-top: 10px; }
.approval-step__check {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--c-muted);
  color: var(--c-text-3);
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  border: 1px solid var(--c-border);
}
.approval-step--done { border-left: 3px solid var(--c-success); }
.approval-step--done .approval-step__check {
  background: var(--c-success); color: white; border-color: var(--c-success);
}
.approval-step--current { border-left: 3px solid var(--c-primary); background: var(--c-primary-50); }
.approval-step--current .approval-step__check {
  background: var(--c-primary); color: white; border-color: var(--c-primary);
}
.approval-step__title { font-weight: 600; font-size: var(--t-base); }
.approval-step__desc { font-size: var(--t-sm); color: var(--c-text-2); margin-top: 2px; }
.approval-step__meta { font-size: var(--t-xs); color: var(--c-text-3); margin-top: 4px; font-family: var(--f-mono); }

/* ---------- Misc helpers ------------------------------------------------ */
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex-1 { flex: 1; }

/* Responsive (light) */
@media (max-width: 1280px) {
  .app--with-rightpanel { grid-template-columns: var(--sidebar-w) 1fr; }
  .rightpanel { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .validation-summary { grid-template-columns: repeat(2, 1fr); }
  .review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .radio-cards { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 60px; }
  .topbar { padding: 0 16px; }
}
