/*
 * Paula Vicente — Premium Polish 2026-08-20
 * Camada final de padronização visual: tipografia, cores, espaçamento,
 * tabelas, formulários, botões, cards e responsividade.
 */
:root{
  --pv-navy-950:#081a33;
  --pv-navy-900:#0d2547;
  --pv-navy-800:#173b68;
  --pv-blue-700:#1d4ed8;
  --pv-blue-600:#2563eb;
  --pv-blue-500:#3b82f6;
  --pv-sky-50:#eff6ff;
  --pv-ink:#10213c;
  --pv-muted:#64748b;
  --pv-line:#dbe5f1;
  --pv-surface:#ffffff;
  --pv-surface-soft:#f8fafc;
  --pv-success:#0f9f6e;
  --pv-warning:#c76b00;
  --pv-danger:#dc3545;
  --pv-radius-sm:10px;
  --pv-radius-md:14px;
  --pv-radius-lg:20px;
  --pv-shadow:0 12px 34px rgba(15,35,65,.08);
  --pv-shadow-soft:0 6px 20px rgba(15,35,65,.06);
}

/* Base tipográfica */
html{font-size:16px;-webkit-text-size-adjust:100%;text-rendering:optimizeLegibility}
body{
  font-family:Inter,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--pv-ink);
  letter-spacing:-.01em;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
body.app-body{background:#f4f7fb}
h1,h2,h3,h4,h5,h6,strong,b{letter-spacing:-.025em}
p,span,small,label,input,select,textarea,button,a,td,th{font-kerning:normal}
p{line-height:1.55}
small{line-height:1.4}

/* Evita palavras partidas letra por letra */
th,td,label,.fin-status,.fin-type,.fin-mini-badge,.badge,.chip,.tag,.btn-primary,.btn-secondary,.btn-ghost,.page-nav-bar a{
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
}

/* Cabeçalhos e shells */
.fin-company-page,.rh-page,.director-page,.orc-real-shell,.page-shell{max-width:1600px;margin-left:auto;margin-right:auto}
.fin-company-header,.premium.inner,.page-header,.rh-page-header{
  border-radius:var(--pv-radius-lg)!important;
}
.fin-company-header h1,.page-header h1,.rh-page-header h1{
  line-height:1.08!important;
  letter-spacing:-.04em!important;
}
.fin-kicker,.eyebrow,.export-eyebrow{
  letter-spacing:.12em!important;
  font-weight:800!important;
}

/* Cards */
.premium-card,.fin-table-card,.fin-company-kpis article,.premium-kpis article,
.dashboard-card,.stat-card,.card,.panel,.work-card,.rh-card{
  border-color:var(--pv-line)!important;
  box-shadow:var(--pv-shadow-soft);
}
.fin-company-kpis article,.premium-kpis article{
  border-radius:18px!important;
  min-width:0;
}
.fin-company-kpis article span,.premium-kpis article span{color:#66748b;line-height:1.25}
.fin-company-kpis article strong,.premium-kpis article strong{line-height:1.08;white-space:nowrap}

/* Botões */
.btn-primary,.btn-secondary,.btn-ghost,button,input[type="submit"]{
  min-height:42px;
  border-radius:12px;
  font-weight:750;
  letter-spacing:-.01em;
  transition:transform .15s ease,box-shadow .15s ease,background-color .15s ease,border-color .15s ease;
}
.btn-primary:hover,.btn-secondary:hover,.btn-ghost:hover,button:hover{transform:translateY(-1px)}
.btn-primary{box-shadow:0 7px 18px rgba(37,99,235,.18)}

/* Formulários */
input,select,textarea{
  font-family:inherit;
  border-radius:11px!important;
}
input:not([type="checkbox"]):not([type="radio"]),select,textarea{
  min-height:44px;
  border-color:#cfdae8!important;
  color:var(--pv-ink);
  background:#fff;
}
textarea{min-height:96px;line-height:1.5}
input:focus,select:focus,textarea:focus{
  outline:none!important;
  border-color:var(--pv-blue-500)!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.12)!important;
}
label{line-height:1.35;font-weight:650}

/* Tabelas: leitura corporativa */
.table-responsive,.table-wrap,.fin-table-card{max-width:100%}
.table-responsive,.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
table{border-collapse:separate;border-spacing:0}
.fin-table{width:100%!important;table-layout:auto!important}
.fin-table thead th{
  white-space:nowrap!important;
  font-size:.76rem!important;
  line-height:1.15!important;
  letter-spacing:.045em!important;
  text-transform:uppercase;
  color:#5c6b82!important;
  padding:14px 15px!important;
  vertical-align:middle;
}
.fin-table tbody td{
  padding:15px!important;
  line-height:1.35!important;
  vertical-align:middle!important;
  overflow-wrap:break-word!important;
  word-break:normal!important;
}
.fin-table tbody td small{display:block;margin-top:4px;color:#718096;line-height:1.35}
.fin-table tbody tr{transition:background-color .15s ease}
.fin-table tbody tr:hover{background:#f8fbff}
.fin-table a{font-weight:700}
.fin-actions{white-space:nowrap!important;min-width:104px}
.fin-actions form{display:inline-flex!important;margin:0 0 0 8px!important}
.fin-status,.fin-type,.fin-mini-badge{display:inline-flex!important;align-items:center;white-space:nowrap!important;max-width:100%}
.empty-state{padding:34px 18px!important;text-align:center!important;color:var(--pv-muted)!important}

/* Recorrências: impede cortes e mantém hierarquia visual */
.fin-recurring-table-wrap{width:100%;overflow-x:auto;padding-bottom:4px}
.fin-recurring-table{min-width:1220px!important}
.fin-recurring-table th:nth-child(1),.fin-recurring-table td:nth-child(1){min-width:88px}
.fin-recurring-table th:nth-child(2),.fin-recurring-table td:nth-child(2){min-width:170px;max-width:260px}
.fin-recurring-table th:nth-child(3),.fin-recurring-table td:nth-child(3){min-width:145px}
.fin-recurring-table th:nth-child(4),.fin-recurring-table td:nth-child(4){min-width:140px}
.fin-recurring-table th:nth-child(5),.fin-recurring-table td:nth-child(5){min-width:112px;white-space:nowrap}
.fin-recurring-table th:nth-child(6),.fin-recurring-table td:nth-child(6){min-width:105px;white-space:nowrap}
.fin-recurring-table th:nth-child(7),.fin-recurring-table td:nth-child(7){min-width:150px}
.fin-recurring-table th:nth-child(8),.fin-recurring-table td:nth-child(8){min-width:155px}
.fin-recurring-table th:nth-child(9),.fin-recurring-table td:nth-child(9){min-width:78px;text-align:center}
.fin-recurring-table th:nth-child(10),.fin-recurring-table td:nth-child(10){min-width:95px}
.fin-recurring-table th:nth-child(11),.fin-recurring-table td:nth-child(11){min-width:120px}
.fin-recurring-table td:nth-child(2) strong{display:block;white-space:normal;overflow-wrap:break-word!important}
.fin-recurring-help{box-shadow:0 5px 16px rgba(37,99,235,.06)}

/* Seções e filtros */
.fin-section-head{gap:18px!important;align-items:center!important}
.fin-section-head h2{line-height:1.15!important;margin-top:4px!important}
.fin-section-head p{max-width:780px;line-height:1.5}
.fin-section-badge{white-space:nowrap!important}
.fin-filters,.filter-card,.filters-panel{gap:12px!important}

/* Navegação */
.page-nav-bar{gap:8px!important;align-items:center!important}
.page-nav-bar a{white-space:nowrap!important}
.finance-main{min-width:0}

/* Feedback e mensagens */
.flash,.alert,.notice,.fin-scope-note,.fin-recurring-help{
  border-radius:14px!important;
  line-height:1.5!important;
}

/* Acentuação e legibilidade de números */
.fin-company-kpis strong,.premium-kpis strong,.money,.amount,.total-chip{
  font-variant-numeric:tabular-nums;
}

/* Desktop médio: preserva tabela, sem esmagar conteúdo */
@media (max-width:1280px){
  .fin-company-page{padding-left:18px!important;padding-right:18px!important}
  .fin-company-kpis,.premium-kpis{gap:12px!important}
  .fin-table thead th{padding:12px!important;font-size:.73rem!important}
  .fin-table tbody td{padding:13px 12px!important}
}

/* Tablet/mobile */
@media (max-width:900px){
  body{letter-spacing:0}
  .fin-company-page,.rh-page,.director-page,.orc-real-shell,.page-shell{padding-left:12px!important;padding-right:12px!important}
  .fin-company-header,.premium.inner,.page-header,.rh-page-header{border-radius:16px!important}
  .fin-company-header h1,.page-header h1,.rh-page-header h1{font-size:clamp(1.65rem,7vw,2.35rem)!important}
  .fin-header-actions{width:100%;display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .fin-header-actions form,.fin-header-actions a,.fin-header-actions button{width:100%!important}
  .fin-company-kpis,.premium-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .fin-section-head{align-items:flex-start!important}
  .fin-table{min-width:760px}
  .table-responsive{border-radius:12px}
}

@media (max-width:560px){
  html{font-size:15px}
  .fin-company-kpis,.premium-kpis{grid-template-columns:1fr!important}
  .fin-company-kpis article,.premium-kpis article{min-height:auto!important;padding:16px!important}
  .fin-section-head{display:block!important}
  .fin-section-badge{display:inline-flex!important;margin-top:10px}
  .page-nav-bar{overflow-x:auto;justify-content:flex-start!important;padding-bottom:4px}
  .page-nav-bar a{flex:0 0 auto}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px!important}
}

/* Impressão limpa */
@media print{
  body{background:#fff!important;color:#111827!important}
  .page-nav-bar,.finance-sidebar,.fin-header-actions,button{display:none!important}
  .premium-card,.fin-table-card,.fin-company-kpis article,.premium-kpis article{box-shadow:none!important}
}
