/* premium.css — camada visual premium (carregar por último)
   Mantém a identidade preto + amarelo U3, com o amarelo como acento. */

:root {
  --primary: #FFE600;
  --primary-color: var(--primary);
  --primary-soft: rgba(255, 230, 0, 0.14);
  --ink: #0E0E10;
  --dark: #141416;
  --canvas: #F4F4F1;
  --surface: #FFFFFF;
  --hairline: rgba(15, 15, 20, 0.07);
  --hairline-strong: rgba(15, 15, 20, 0.12);
  --text-primary: #141416;
  --text-secondary: #6B6B73;
  --text-muted: #9A9AA2;
  --border: var(--hairline-strong);

  --shadow-sm: 0 1px 2px rgba(16, 16, 20, 0.04);
  --shadow-md: 0 1px 2px rgba(16, 16, 20, 0.04), 0 4px 16px -4px rgba(16, 16, 20, 0.08);
  --shadow-lg: 0 2px 4px rgba(16, 16, 20, 0.04), 0 16px 40px -12px rgba(16, 16, 20, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html body {
  background: var(--canvas);
  color: var(--text-primary);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.006em;
}

html body ::selection { background: var(--primary); color: var(--ink); }

html body ::-webkit-scrollbar-track { background: transparent; }
html body ::-webkit-scrollbar-thumb { background: rgba(15, 15, 20, 0.18); border-radius: 99px; }
html body ::-webkit-scrollbar-thumb:hover { background: rgba(15, 15, 20, 0.3); }
html body * { scrollbar-color: rgba(15, 15, 20, 0.2) transparent; }

/* ───────────── Sidebar ───────────── */
html body .sidebar {
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(255, 230, 0, 0.07), transparent 60%),
    linear-gradient(180deg, #121214 0%, #0A0A0B 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
html body .sidebar-logo { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
html body .sidebar-user {
  margin: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
html body .nav-item {
  position: relative;
  color: rgba(255, 255, 255, 0.62);
  border-radius: 10px;
  font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
}
html body .nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
html body .nav-item.active {
  background: linear-gradient(90deg, rgba(255, 230, 0, 0.16), rgba(255, 230, 0, 0.04));
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 230, 0, 0.14);
}
html body .nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(255, 230, 0, 0.6);
}
html body .nav-item.active .nav-icon,
html body .nav-item.active svg { color: var(--primary); stroke: var(--primary); }
html body .sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.06); }

/* ───────────── Topbar ───────────── */
html body .topbar {
  background: rgba(244, 244, 241, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: none;
}
html body .page-header-title,
html body .page-title { font-weight: 700; letter-spacing: -0.025em; color: var(--ink); }
html body .page-header-subtitle,
html body .page-subtitle { color: var(--text-muted); }
html body .user-avatar-sm {
  background: var(--ink);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 3px var(--hairline-strong);
}

html body h1, html body h2, html body h3, html body h4 { letter-spacing: -0.02em; color: var(--ink); }

/* ───────────── Cards e KPIs ───────────── */
html body .card,
html body .cl-card,
html body .cl-kpi,
html body .fin-dash-kpi,
html body .kpi-card,
html body .fin-table-wrap,
html body .fin-resumo-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
html body .card-header { border-bottom: 1px solid var(--hairline); background: transparent; }
html body .kpi-card::before { display: none; }

html body .cl-card { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
html body .cl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--hairline-strong); }

/* Valores: números alinhados e mais elegantes */
html body .cl-kpi-val,
html body .fin-dash-kpi-val,
html body .kpi-card .kpi-value,
html body .cl-value-highlight,
html body .fin-resumo-value,
html body .fin-table td {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
html body .cl-kpi-label,
html body .fin-dash-kpi-label,
html body .kpi-card .kpi-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
html body .cl-kpi-val { font-weight: 700; margin-bottom: 8px; }
html body .cl-kpi { padding: 18px 20px; }

/* KPI principal: cartão escuro com destaque amarelo */
html body .cl-kpi.kpi-primary,
html body .fin-dash-kpi.kpi-primary {
  background:
    radial-gradient(140% 120% at 100% 0%, rgba(255, 230, 0, 0.22), transparent 55%),
    linear-gradient(160deg, #1A1A1D 0%, #0B0B0C 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg);
}
html body .cl-kpi.kpi-primary .cl-kpi-val,
html body .fin-dash-kpi.kpi-primary .fin-dash-kpi-val { color: var(--primary); }
html body .cl-kpi.kpi-primary .cl-kpi-label,
html body .fin-dash-kpi.kpi-primary .fin-dash-kpi-label { color: rgba(255, 255, 255, 0.6); }
html body .fin-dash-kpi.kpi-primary .fin-dash-kpi-icon { background: rgba(255, 230, 0, 0.14) !important; }
html body .fin-dash-kpi.kpi-primary .fin-dash-kpi-icon svg { color: var(--primary) !important; }

/* KPIs coloridos: fundo branco, cor só no número + barra fina */
html body .cl-kpi.kpi-danger,
html body .fin-dash-kpi.kpi-success,
html body .fin-dash-kpi.kpi-warning,
html body .fin-dash-kpi.kpi-danger { background: var(--surface); border-color: var(--hairline); position: relative; overflow: hidden; }
html body .cl-kpi.kpi-danger::after,
html body .fin-dash-kpi.kpi-success::after,
html body .fin-dash-kpi.kpi-warning::after,
html body .fin-dash-kpi.kpi-danger::after {
  content: ''; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; border-radius: 0 0 2px 2px;
}
html body .cl-kpi.kpi-danger::after,
html body .fin-dash-kpi.kpi-danger::after { background: #C9353A; }
html body .fin-dash-kpi.kpi-success::after { background: #1E8A4C; }
html body .fin-dash-kpi.kpi-warning::after { background: #B38F00; }
html body .fin-dash-kpi-icon { border-radius: 10px; }

/* ───────────── Card de cliente ───────────── */
html body .cl-card-avatar { background: linear-gradient(135deg, #F2F2EF, #E6E6E1); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--hairline-strong); }
html body .cl-card-name { font-weight: 650; letter-spacing: -0.015em; }
html body .cl-card-service { color: var(--text-muted); }
html body .cl-card-divider { background: var(--hairline); }
html body .cl-card-row-label { color: var(--text-muted); font-weight: 500; }
html body .cl-value-highlight { font-weight: 700; }
html body .cl-card { display: flex; flex-direction: column; }
html body .cl-card-actions { margin-top: auto; border-top: 1px solid var(--hairline); padding-top: 14px; }

html body .cl-btn-edit,
html body .cl-btn-del,
html body .cl-btn-wpp {
  border-radius: 10px;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
html body .cl-btn-edit { background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline-strong); }
html body .cl-btn-edit:hover { background: #fff; box-shadow: inset 0 0 0 1px rgba(15, 15, 20, 0.25); }
html body .cl-btn-del { background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline-strong); color: #C9353A; }
html body .cl-btn-del:hover { background: #FDEEEE; box-shadow: inset 0 0 0 1px #F5C2C4; }
html body .cl-btn-wpp { background: #1FAF5A; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .18); }
html body .cl-btn-wpp:hover { background: #1A9C50; }
html body .cl-btn-edit:active,
html body .cl-btn-del:active,
html body .cl-btn-wpp:active { transform: scale(.97); }

/* Status em formato pílula com ponto */
html body .cl-status-badge,
html body .fin-badge,
html body .badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 99px;
  font-weight: 600;
  letter-spacing: .01em;
}
html body .cl-status-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85;
}
html body .status-ativo, html body .fin-badge-pago { background: #E9F7EF; color: #1E8A4C; box-shadow: inset 0 0 0 1px #CDEBD9; }
html body .status-inadimplente, html body .fin-badge-atrasado { background: #FDEEEE; color: #C9353A; box-shadow: inset 0 0 0 1px #F7D0D1; }
html body .status-inativo, html body .fin-badge-cancelado { background: #F2F2F0; color: #6B6B73; box-shadow: inset 0 0 0 1px #E4E4E0; }
html body .status-negociacao, html body .fin-badge-pendente { background: #FFF8DB; color: #8A6A00; box-shadow: inset 0 0 0 1px #F3E3A1; }

/* Aviso de atraso: mais sóbrio */
html body .fin-atraso-banner {
  background: linear-gradient(180deg, #FFF6F6, #FDEEEE);
  border: 1px solid #F7D0D1;
  border-left: 3px solid #C9353A;
  border-radius: 12px;
}
html body .fin-atraso-title { color: #C9353A; letter-spacing: .06em; font-size: 11px; }
html body .btn-marcar-pago {
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1), inset 0 1px 0 rgba(255, 255, 255, .08);
}
html body .btn-marcar-pago:hover { background: #26262A; }

/* ───────────── Botões ───────────── */
html body .btn {
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s;
}
html body .btn:active { transform: scale(.98); }
html body .btn-primary {
  background: var(--primary);
  color: var(--ink);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 -1px 0 rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .5);
}
html body .btn-primary:hover { background: #FFED33; box-shadow: 0 4px 14px -4px rgba(255, 210, 0, .7); }
html body .btn-secondary,
html body .btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}
html body .btn-secondary:hover,
html body .btn-outline:hover { border-color: rgba(15, 15, 20, 0.25); background: #fff; }
html body .btn-danger { background: #C9353A; border-color: transparent; color: #fff; }
html body .btn-danger:hover { background: #D63B40; }

/* Filtros em pílula */
html body .fin-filtros {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
html body .fin-filtro-chip {
  border-radius: 99px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  font-weight: 500;
  transition: all .2s var(--ease);
}
html body .fin-filtro-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .3); }

/* ───────────── Tabelas ───────────── */
html body .fin-table th,
html body .fin-historico-table th,
html body .table thead th {
  background: #FAFAF8;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--hairline);
}
html body .fin-table td,
html body .fin-historico-table td,
html body .table td { border-bottom: 1px solid var(--hairline); }
html body .fin-table tbody tr,
html body .table tbody tr { transition: background .15s; }
html body .fin-table tbody tr:hover,
html body .table tbody tr:hover { background: #FAFAF7; }
html body .fin-action-btn { border-radius: 8px; font-weight: 600; transition: transform .15s var(--ease), filter .2s; }
html body .fin-action-btn:hover { filter: brightness(.97); }
html body .fin-action-btn:active { transform: scale(.96); }

/* ───────────── Formulários ───────────── */
html body .form-control,
html body .form-select,
html body .cl-search,
html body .cl-filter-status,
html body .fin-filtros input,
html body .fin-filtros select {
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
html body .form-control:focus,
html body .form-select:focus,
html body .cl-search:focus-within,
html body .cl-filter-status:focus {
  border-color: #D9C400;
  box-shadow: 0 0 0 4px var(--primary-soft);
  outline: none;
}
html body .form-label { font-weight: 600; color: var(--ink); font-size: 12.5px; }

/* ───────────── Modais ───────────── */
html body .modal-overlay,
html body .wpp-modal-overlay {
  background: rgba(10, 10, 12, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
html body .modal,
html body .wpp-modal {
  border-radius: 20px;
  border: 1px solid var(--hairline);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.35);
}
html body .modal-header { border-bottom: 1px solid var(--hairline); }
html body .modal-footer { border-top: 1px solid var(--hairline); background: #FAFAF8; border-radius: 0 0 20px 20px; }

/* ───────────── Toasts ───────────── */
html body .toast {
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--hairline);
}

/* Entrada suave do conteúdo das páginas */
@media (prefers-reduced-motion: no-preference) {
  html body .page-content > *:not([class*="overlay"]):not([class*="modal"]):not(style) { animation: u3-rise .35s var(--ease) backwards; }
  @keyframes u3-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ───────────── Dashboard ───────────── */
html body .dash-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
html body .dash-kpi {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
}
html body .dash-kpi-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
html body .dash-kpi-icon svg { width: 18px; height: 18px; }
html body .dash-kpi-val {
  font-size: clamp(20px, 1.9vw, 28px);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html body .dash-kpi-label { color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
html body .dash-kpi-primary {
  background:
    radial-gradient(140% 120% at 100% 0%, rgba(255, 230, 0, 0.22), transparent 55%),
    linear-gradient(160deg, #1A1A1D 0%, #0B0B0C 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg);
}
html body .dash-kpi-primary .dash-kpi-icon { background: rgba(255, 230, 0, 0.14); color: var(--primary); }
html body .dash-kpi-primary .dash-kpi-val { color: var(--primary); }
html body .dash-kpi-primary .dash-kpi-label { color: rgba(255, 255, 255, 0.6); }
html body .filters-bar .form-control { min-width: 140px; }

/* Avatares: acabamento consistente */
html body img[src*="default-avatar"],
html body img[src^="data:image/svg+xml"] { background: #141416; }

/* ───────────── Janelas estilo Bootstrap (.modal.fade) ─────────────
   Ficavam soltas na página; agora abrem como janela sobreposta. */
html body .modal.fade {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  max-width: none; max-height: none; width: auto;
  background: rgba(10, 10, 12, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 0; border-radius: 0; box-shadow: none;
  transform: none;
  flex-direction: row; /* sem isso herdava "column" do .modal e o topo de janelas altas ficava fora da tela */
  align-items: flex-start; justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
}
html body .modal.fade.active { display: flex; }
html body .modal.fade .modal-dialog { width: 100%; max-width: 520px; margin: auto; }
html body .modal.fade .modal-dialog.modal-lg { max-width: 760px; }
html body .modal.fade .modal-content {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--hairline);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
html body .modal.fade .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; }
html body .modal.fade .modal-body { padding: 16px 24px 24px; }
html body .btn-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-muted); font-size: 0; position: relative;
}
html body .btn-close:empty::before { content: '×'; font-size: 24px; line-height: 32px; }
html body .btn-close:not(:empty) { font-size: inherit; display: inline-flex; align-items: center; justify-content: center; }
html body .btn-close:hover { background: #F2F2F0; color: var(--ink); }

/* ───────────── Abas de Configurações ───────────── */
html body .list-group { display: flex; flex-wrap: wrap; gap: 8px; border: 0 !important; box-shadow: none !important; margin-bottom: 16px; }
html body .list-group-item-action {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 99px; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-strong); box-shadow: var(--shadow-sm);
  font: 500 13px/1 Inter, sans-serif; transition: all .2s var(--ease);
}
html body .list-group-item-action svg { width: 16px; height: 16px; }
html body .list-group-item-action:hover { border-color: rgba(15, 15, 20, 0.25); }
html body .list-group-item-action.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ───────────── Indicador de sincronização ───────────── */
html body .sync-indicator {
  display: inline-flex; align-items: center; gap: 7px;
  margin-right: 14px; padding: 6px 12px; border-radius: 99px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  font-size: 12px; font-weight: 500; color: var(--text-secondary); white-space: nowrap;
}
html body .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #B4B4BA; }
html body .sync-indicator[data-state="ok"] .sync-dot { background: #1E8A4C; box-shadow: 0 0 0 3px rgba(48, 164, 108, .15); }
html body .sync-indicator[data-state="busy"] .sync-dot { background: #B38F00; animation: u3-pulse 1s infinite; }
html body .sync-indicator[data-state="off"] .sync-dot { background: #C9353A; }
html body .sync-indicator[data-state="off"] { color: #C9353A; border-color: #F7D0D1; }
@keyframes u3-pulse { 50% { opacity: .35; } }
@media (max-width: 640px) { html body .sync-label { display: none; } html body .sync-indicator { padding: 6px; margin-right: 8px; } }
