/* ==========================================================================
   HEALTH ONE CO. | PORTAL FINANCEIRO & CONTROLADORIA EXECUTIVA
   DESIGN LUXURY LIGHT / DARK • SQUAD SAKAI CORE (IFRA & BLUE)
   Regras Mandatórias: ZERO Emojis | Tipografia Impecável | Alta Elegância
   ========================================================================== */

:root {
  --bg-main: #0B0E14;
  --bg-card: #121722;
  --bg-card-subtle: #182030;
  --bg-card-hover: #1E283C;
  --border-card: rgba(212, 175, 55, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  
  --gold-primary: #D4AF37;
  --gold-light: #E7C96E;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-subtle: rgba(212, 175, 55, 0.1);

  --text-main: #F0F3F8;
  --text-muted: #8E9BAE;
  --text-light: #5A6678;

  --color-green: #2ECC71;
  --color-green-bg: rgba(46, 204, 113, 0.12);
  --color-coral: #E74C3C;
  --color-coral-bg: rgba(231, 76, 60, 0.12);
  --color-blue: #3498DB;
  --color-blue-bg: rgba(52, 152, 219, 0.12);
  --color-purple: #9B59B6;
  --color-purple-bg: rgba(155, 89, 182, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.2);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==========================================================================
   TELA DE LOGIN GLASS
   ========================================================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.08), transparent 40%),
              radial-gradient(circle at bottom left, rgba(24, 32, 48, 0.6), transparent 50%),
              var(--bg-main);
}

.login-glass-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-card), 0 0 40px rgba(212, 175, 55, 0.08);
  position: relative;
  overflow: hidden;
}

.login-glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand-logo {
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: inline-block;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.2));
}

.brand-monogram {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold-primary);
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .select-luxury {
  width: 100%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-family);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus, .form-select:focus, .select-luxury:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

.btn-primary-gold {
  width: 100%;
  background: linear-gradient(135deg, var(--gold-primary), #B38F24);
  color: #000;
  border: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-gold);
  transition: all 0.2s ease;
}

.btn-primary-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  transform: translateY(-1px);
}

.btn-primary-gold.small {
  width: auto;
  padding: 8px 16px;
  font-size: 12px;
}

.btn-secondary-luxury {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary-luxury:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
}

.login-error-msg {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--color-coral-bg);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #FF8F8F;
  border-radius: var(--radius-sm);
  font-size: 12px;
  text-align: center;
}

.login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.6;
}

.login-seal {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold-primary);
  text-transform: uppercase;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER EXECUTIVO */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-card);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.header-logo-badge {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-primary);
  background: var(--gold-subtle);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
}

.header-portal-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.competence-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.picker-label {
  font-size: 12px;
  color: var(--text-muted);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #000;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.user-role {
  font-size: 10px;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--color-coral-bg);
  border-color: rgba(231, 76, 60, 0.4);
  color: var(--color-coral);
}

/* BARRA DE NAVEGAÇÃO POR ABAS */
.app-nav {
  background: #0D121C;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 28px;
}

.nav-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.nav-tab.active {
  color: var(--gold-primary);
  border-bottom-color: var(--gold-primary);
  font-weight: 600;
}

/* ÁREA PRINCIPAL */
.app-main {
  flex: 1;
  padding: 28px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   COMPONENTES EXECUTIVOS & CARDS
   ========================================================================== */
.exec-welcome-card {
  background: linear-gradient(135deg, rgba(24, 32, 48, 0.9), rgba(18, 23, 34, 0.9));
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.welcome-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-primary);
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.welcome-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.welcome-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.welcome-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* GRID DE KPIS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card.gold-border {
  border-color: var(--border-card);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.05), var(--bg-card));
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--gold-subtle);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.kpi-pill.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-color: transparent;
}

.kpi-pill.green {
  background: var(--color-green-bg);
  color: var(--color-green);
  border-color: rgba(46, 204, 113, 0.3);
}

.kpi-pill.coral {
  background: var(--color-coral-bg);
  color: var(--color-coral);
  border-color: rgba(231, 76, 60, 0.3);
}

.kpi-pill.royal {
  background: var(--color-purple-bg);
  color: #C39BD3;
  border-color: rgba(155, 89, 182, 0.3);
}

.kpi-value {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.kpi-footer {
  font-size: 12px;
  color: var(--text-light);
}

.kpi-sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-mini-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.kpi-mini-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.kpi-mini-val {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-mini-sub {
  font-size: 11px;
  color: var(--text-light);
}

/* ==========================================================================
   RÉGUA DE COBRANÇA & TOOLBARS
   ========================================================================== */
.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-group-filter {
  display: flex;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.filter-btn, .filter-despesa-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active, .filter-despesa-btn.active {
  background: var(--gold-primary);
  color: #000;
  font-weight: 600;
}

.select-luxury.small {
  padding: 6px 12px;
  font-size: 12px;
  height: 32px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper svg {
  position: absolute;
  left: 10px;
  color: var(--text-light);
  pointer-events: none;
}

.input-search {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px 6px 32px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  width: 240px;
  transition: border-color 0.2s ease;
}

.input-search:focus {
  border-color: var(--gold-primary);
}

/* RÉGUA DE COBRANÇA */
.regua-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.regua-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  border: 1px solid transparent;
  user-select: none;
}

.regua-item:hover {
  background: var(--bg-card-subtle);
  border-color: rgba(255, 255, 255, 0.08);
}

.regua-item.active {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.12);
}

.regua-icon-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.regua-icon-circle.gold { background: var(--gold-primary); box-shadow: 0 0 10px var(--gold-primary); }
.regua-icon-circle.blue { background: var(--color-blue); box-shadow: 0 0 10px var(--color-blue); }
.regua-icon-circle.red { background: var(--color-coral); box-shadow: 0 0 10px var(--color-coral); }
.regua-icon-circle.purple { background: var(--color-purple); box-shadow: 0 0 10px var(--color-purple); }

.regua-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.regua-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.regua-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

/* ==========================================================================
   TABELAS DE DADOS LUXURY
   ========================================================================== */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 24px;
}

.section-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-card-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.section-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.header-summary-capsule {
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--gold-light);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-luxury {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-luxury th {
  background: #0F141E;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table-luxury td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--text-main);
  vertical-align: middle;
}

.table-luxury tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* BADGES & PÍLULAS */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.badge-status.pago {
  background: var(--color-green-bg);
  color: var(--color-green);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.badge-status.pendente {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge-status.atrasado {
  background: var(--color-coral-bg);
  color: var(--color-coral);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.badge-nf {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.badge-nf.pendente {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.badge-nf.emitida {
  background: var(--color-purple-bg);
  color: #C39BD3;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.badge-nf.enviada {
  background: var(--color-blue-bg);
  color: var(--color-blue);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.badge-carteira {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-carteira.nova {
  background: rgba(46, 204, 113, 0.1);
  color: #7DCEA0;
}

.badge-carteira.antiga {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.btn-action-icon {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-icon:hover {
  background: var(--gold-subtle);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.btn-copy-pix {
  background: var(--gold-subtle);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.btn-copy-pix:hover {
  background: var(--gold-primary);
  color: #000;
}

/* ==========================================================================
   MODAIS & FORMULÁRIOS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: var(--color-coral);
}

.modal-tabs-luxury {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.modal-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-subtle);
}

.modal-tab-btn.active {
  color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.modal-form {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-divider {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--gold-light);
  text-transform: uppercase;
  margin: 20px 0 14px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.calc-display-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-primary);
}

.modal-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* TOAST */
.toast-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--gold-primary);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  animation: slideIn 0.3s ease;
}

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

/* UTILITÁRIOS DE TEXTO */
.text-green { color: var(--color-green) !important; }
.text-coral { color: var(--color-coral) !important; }
.text-gold { color: var(--gold-primary) !important; }
.text-purple { color: #C39BD3 !important; }
.cursor-pointer { cursor: pointer; }

/* RESPONSIVIDADE */
@media (max-width: 900px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .header-controls {
    justify-content: space-between;
  }
  .exec-welcome-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .welcome-actions {
    width: 100%;
    flex-direction: column;
  }
  .welcome-actions button {
    width: 100%;
    justify-content: center;
  }
  .toolbar-card {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }
  .input-search {
    width: 100%;
  }
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
}

/* DOSSIÊ EXECUTIVO DO MENTORADO */
.mentorado-link {
  color: var(--gold, #d4af37);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mentorado-link:hover {
  color: #f3d77d;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}
.dossie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.dossie-card {
  background: var(--bg-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 16px;
}
.dossie-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold, #d4af37);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dossie-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.dossie-info-row:last-child {
  border-bottom: none;
}
.dossie-info-label {
  color: var(--text-muted, #71717a);
}
.dossie-info-value {
  color: var(--text-main, #f4f4f5);
  font-weight: 500;
  text-align: right;
}

/* BOTOES WHATSAPP LUXURY */
.btn-whatsapp-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-whatsapp-action:hover {
  background: #25d366;
  color: #0b0f17;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
}

.btn-whatsapp-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.35);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-whatsapp-icon-only:hover {
  background: #25d366;
  color: #0b0f17;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
}

.btn-whatsapp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.4);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-whatsapp-pill:hover {
  background: #25d366;
  color: #0b0f17;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
}

/* REGUA DE COBRANCA WHATSAPP */
.whatsapp-regua-bar {
  margin: 14px 0 18px 0;
  padding: 12px 16px;
  background: rgba(37, 211, 102, 0.05);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.whatsapp-regua-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #25d366;
  letter-spacing: 0.3px;
}

.whatsapp-regua-botoes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   IMPLEMENTAÇÃO #175: BLINDAGEM MOBILE-FIRST & TOPO EXECUTIVO PREMIUM
   Squad Sakai Core • Ifra (Design & Fullstack) • Tolerância Zero a Overflow
   ========================================================================== */

@media (max-width: 900px) {
  .app-header {
    padding: 12px 18px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-brand-group {
    gap: 12px;
  }

  .header-controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  .app-main {
    padding: 20px 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .kpi-sub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .exec-welcome-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 20px;
  }

  .welcome-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .welcome-actions button {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Topo Executivo Premium Compacto & Simétrico */
  .app-header {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-brand-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .header-brand-logo {
    height: 30px;
  }

  .header-divider {
    display: none;
  }

  .header-portal-name {
    font-size: 10px;
    letter-spacing: 1px;
    text-align: right;
  }

  .header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .competence-picker {
    flex: 1;
    min-width: 0;
  }

  .picker-label {
    display: none;
  }

  .select-luxury {
    width: 100%;
    padding: 7px 10px;
    font-size: 11px;
    height: 36px;
  }

  .user-profile-badge {
    padding: 4px 8px;
    gap: 6px;
    height: 36px;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .user-meta .user-role {
    display: none;
  }

  .user-meta .user-name {
    font-size: 11px;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-logout {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  /* Abas de Navegação em Carrossel Tátil Suave */
  .app-nav {
    padding: 0 10px;
    overflow: hidden;
  }

  .nav-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .nav-container::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    padding: 10px 12px;
    font-size: 11px;
    gap: 6px;
    flex-shrink: 0;
  }

  .nav-tab svg {
    width: 15px;
    height: 15px;
  }

  /* Área Principal Contida Sem Margens Excessivas */
  .app-main {
    padding: 14px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Card de Boas-Vindas */
  .exec-welcome-card {
    padding: 16px 14px;
    gap: 14px;
    border-radius: var(--radius-sm);
  }

  .welcome-title {
    font-size: 16px;
    line-height: 1.3;
  }

  .welcome-sub {
    font-size: 12px;
  }

  .welcome-actions {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .welcome-actions button {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    justify-content: center;
  }

  /* Grid de KPIs */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-sub-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kpi-mini-card {
    padding: 12px;
  }

  /* Barra de Ferramentas e Filtros */
  .toolbar-card {
    padding: 12px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar-left {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .btn-group-filter {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .btn-group-filter::-webkit-scrollbar {
    display: none;
  }

  .filter-btn, .filter-despesa-btn {
    flex: 1;
    text-align: center;
    padding: 7px 6px;
    font-size: 11px;
    white-space: nowrap;
  }

  .search-input-wrapper {
    width: 100%;
  }

  .input-search {
    width: 100%;
    font-size: 12px;
    padding: 8px 10px 8px 32px;
  }

  .toolbar-card .btn-primary-gold {
    width: 100%;
    justify-content: center;
  }

  /* Régua de Cobrança */
  .regua-card {
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .regua-divider {
    display: none;
  }

  .regua-item {
    width: 100%;
    justify-content: space-between;
    padding: 8px 10px;
  }

  /* Régua de Cobrança WhatsApp */
  .whatsapp-regua-bar {
    padding: 12px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .whatsapp-regua-botoes {
    flex-direction: column;
    width: 100%;
    gap: 6px;
  }

  .whatsapp-regua-botoes .btn-whatsapp-pill {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
  }

  /* Seções e Tabelas Luxury com Rolagem Interna Suave */
  .section-card {
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
  }

  .section-card-header {
    padding: 14px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .section-card-title {
    font-size: 14px;
  }

  .header-summary-capsule {
    align-self: flex-start;
    font-size: 11px;
    padding: 4px 10px;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
  }

  .table-luxury {
    min-width: 650px;
    width: 100%;
  }

  .table-luxury th {
    padding: 10px 10px;
    font-size: 10px;
  }

  .table-luxury td {
    padding: 10px 10px;
    font-size: 11px;
  }

  /* Modais de Lançamento e Edição */
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: 0;
  }

  .modal-header {
    padding: 14px 14px;
  }

  .modal-title {
    font-size: 15px;
  }

  .modal-tabs-luxury {
    padding: 8px 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }

  .modal-tabs-luxury::-webkit-scrollbar {
    display: none;
  }

  .modal-tab-btn {
    padding: 6px 12px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .modal-form {
    padding: 14px;
  }

  .form-row {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .modal-footer {
    padding: 12px 14px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer button {
    width: 100%;
    justify-content: center;
  }

  /* Tela de Login */
  .login-wrapper {
    padding: 14px;
  }

  .login-glass-card {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }

  .login-brand-logo {
    height: 42px;
  }

  .login-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .header-brand-logo {
    height: 26px;
  }

  .header-portal-name {
    font-size: 9px;
  }

  .user-meta .user-name {
    max-width: 70px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .btn-primary-gold, .btn-secondary-luxury {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ======================================================== */
/* ETAPA #169: ESTILOS DE ACRÉSCIMO POR ATRASO E LIQUIDAÇÃO */
/* ======================================================== */
.taxa-atraso-panel {
  background: rgba(245, 158, 11, 0.04);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.taxa-atraso-header {
  margin-bottom: 10px;
}

.taxa-atraso-title {
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
  display: block;
}

.taxa-atraso-sub {
  font-size: 11px;
  color: var(--text-muted, #71717a);
}

.taxa-atraso-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-taxa-quick {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main, #f4f4f5);
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-taxa-quick:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
  color: #fbbf24;
}

.taxa-atraso-resumo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.taxa-resumo-item {
  display: flex;
  flex-direction: column;
}

.taxa-resumo-label {
  font-size: 10px;
  color: var(--text-muted, #71717a);
  text-transform: uppercase;
}

.taxa-resumo-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main, #f4f4f5);
}

.taxa-resumo-item.total .taxa-resumo-val {
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
}

.badge-status.pago-encargos {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(212, 175, 55, 0.15));
  color: #34d399;
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.tag-atraso-valor {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-pago-extra {
  display: block;
  font-size: 10px;
  color: #34d399;
  font-weight: 500;
  margin-top: 2px;
}
