/* ==========================================================================
   Lastro — visual do painel e do portal do cliente
   Executive Fintech Theme | Light Slate + Deep Navy + Emerald Accents
   Zero external dependencies, tabular figures, mobile-first client portal
   ========================================================================== */

:root {
  --bg-page: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --navy-900: #091a2b;
  --navy-800: #0f2942;
  --navy-700: #163b5c;
  --navy-100: #e6eef5;

  --emerald-700: #095c47;
  --emerald-600: #0d7a5f;
  --emerald-100: #ecfdf5;
  --emerald-200: #a7f3d0;

  --amber-800: #92400e;
  --amber-100: #fffbeb;
  --amber-200: #fde68a;

  --crimson-800: #991b1b;
  --crimson-600: #dc2626;
  --crimson-100: #fef2f2;
  --crimson-200: #fecaca;

  --slate-700: #334155;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;

  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, Monaco, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background-color: var(--navy-800);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--navy-700);
}

.btn-emerald {
  background-color: var(--emerald-600);
  color: #ffffff;
}
.btn-emerald:hover:not(:disabled) {
  background-color: var(--emerald-700);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--slate-300);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  border-color: #94a3b8;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--crimson-600);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  background-color: var(--crimson-800);
}

.btn-sm {
  padding: 5px 10px;
  min-height: 30px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  min-height: 28px;
  font-size: 11.5px;
}

/* ---------- Status Pills & Badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-em_dia {
  background-color: var(--emerald-100);
  color: #065f46;
  border-color: var(--emerald-200);
}

.pill-vence_hoje {
  background-color: var(--amber-100);
  color: var(--amber-800);
  border-color: var(--amber-200);
}

.pill-em_atraso {
  background-color: var(--crimson-100);
  color: var(--crimson-800);
  border-color: var(--crimson-200);
}

.pill-quitado {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border-color: var(--slate-300);
}

.badge-collateral {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background-color: var(--navy-100);
  color: var(--navy-800);
}

.badge-collateral-liberada {
  background-color: var(--emerald-100);
  color: #065f46;
}

.badge-collateral-executada {
  background-color: var(--crimson-100);
  color: var(--crimson-800);
}

.badge-collateral-sem {
  background-color: #f1f5f9;
  color: var(--text-muted);
}

/* ---------- Login Screen ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(60vmax 60vmax at 12% 8%, rgba(227, 185, 96, 0.2), transparent 60%),
    radial-gradient(60vmax 60vmax at 95% 40%, rgba(52, 211, 153, 0.13), transparent 60%),
    linear-gradient(180deg, #07131f 0%, #0c2033 100%);
}

.login-screen .login-card {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  border-color: rgba(227, 185, 96, 0.35);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(140deg, #f5d896, #e3b960 55%, #b98a2f);
  color: #1b1405;
  box-shadow: 0 6px 18px rgba(227, 185, 96, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0;
  flex-shrink: 0;
}

.login-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
}

.login-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.login-hint {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.first-access-intro {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(227, 185, 96, 0.16), rgba(227, 185, 96, 0.05));
  border: 1px solid rgba(227, 185, 96, 0.45);
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate-700);
}

.first-access-intro strong {
  display: block;
  margin-bottom: 2px;
  color: var(--navy-900);
}

.first-access .form-control[readonly] {
  background-color: var(--slate-50, #f8fafc);
  color: var(--slate-700);
}

/* ---------- Forms & Inputs ---------- */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-700);
}

.form-control {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-300);
  background-color: #ffffff;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(15, 41, 66, 0.12);
}

textarea.form-control {
  min-height: 70px;
  resize: vertical;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-help {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  padding: 6px 0;
}

.checkbox-row input[type="checkbox"],
.radio-card input[type="radio"] {
  accent-color: var(--navy-800);
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

.alert-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--crimson-100);
  border: 1px solid var(--crimson-200);
  color: var(--crimson-800);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 14px;
}

.preview-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 12px 0;
}

.preview-box-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
}

.preview-box-row strong {
  color: var(--navy-900);
}

/* ---------- Rate Chips & Mode Selectors ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip-btn {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--slate-300);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn:hover {
  background-color: var(--navy-100);
  color: var(--navy-800);
}

.chip-btn.active {
  background-color: var(--navy-800);
  color: #ffffff;
  border-color: var(--navy-800);
}

.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mode-tab {
  padding: 9px 10px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.mode-tab.active {
  background-color: var(--navy-800);
  color: #ffffff;
  border-color: var(--navy-800);
}

/* ---------- Top Navigation Bar ---------- */
.topbar {
  background: linear-gradient(90deg, #07131f 0%, var(--navy-900) 60%, #0d2a3d 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title-group {
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar .btn-nav {
  background-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.16);
}
.topbar .btn-nav:hover {
  background-color: rgba(255, 255, 255, 0.18);
}

/* ---------- Main Container ---------- */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
}

/* ---------- KPI Strip ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.kpi-card.kpi-highlight {
  border-left: 4px solid var(--emerald-600);
}

.kpi-card.kpi-navy {
  border-left: 4px solid var(--navy-800);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 21px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.2;
  word-break: break-word;
}

.kpi-value.text-emerald {
  color: var(--emerald-700);
}

.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.kpi-card-top .kpi-label {
  margin-bottom: 0;
}

.kpi-cost-card.is-paid {
  border-left: 4px solid var(--emerald-600);
}

.kpi-cost-card.is-pending {
  border-left: 4px solid #d97706;
}

.kpi-cost-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-cost-footer .kpi-sub {
  margin-top: 0;
}

.btn-link-inline {
  background: none;
  border: none;
  padding: 0;
  color: var(--navy-700);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link-inline:hover {
  color: var(--emerald-700);
}

/* ---------- Interactive Executive Dashboard ---------- */
.dash-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.dash-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.dash-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-900);
}

.dash-metric-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dash-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate-700);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

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

.dash-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-900);
}

.dash-card-sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.segmented-sm {
  display: inline-flex;
  background-color: var(--bg-surface);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.seg-btn.active {
  background-color: var(--navy-800);
  color: #ffffff;
}

.dash-readout {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--navy-900);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-chart-wrap {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.dash-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.dash-bar-group {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.dash-bar-group:hover {
  opacity: 0.88;
}

.dash-legend-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.dash-totals-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.dash-total-item span {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.dash-total-item strong {
  font-size: 13px;
  color: var(--navy-900);
}

/* Donut Layout */
.donut-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.donut-svg-wrap {
  width: 160px;
  max-width: 100%;
  margin: 0 auto;
}

.donut-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.donut-slice {
  cursor: pointer;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.donut-legend-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.donut-legend-item:hover,
.donut-legend-item.active {
  border-color: var(--navy-700);
  background-color: var(--navy-100);
}

.donut-legend-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Radar & Client Breakdown */
.radar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
}

.radar-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radar-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.radar-client {
  font-weight: 700;
  color: var(--navy-900);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.radar-progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--slate-200);
  overflow: hidden;
}

.radar-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--navy-800), var(--emerald-600));
}

.radar-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-secondary);
}

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

/* Simulator Card */
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

.sim-range {
  width: 100%;
  accent-color: var(--emerald-600);
  cursor: pointer;
}

.sim-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sim-stat {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.sim-stat span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.sim-stat strong {
  font-size: 14px;
  color: var(--navy-900);
}

.sim-stat-highlight {
  border-left: 3px solid var(--emerald-600);
}

.sim-stat-navy {
  border-left: 3px solid var(--navy-800);
}

/* Monthly Operational Cost Modal */
.op-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.op-month-center {
  flex: 1 1 160px;
  max-width: 220px;
}

.op-status-banner {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.op-status-banner.is-paid {
  background-color: var(--emerald-100);
  border-color: var(--emerald-200);
  color: #065f46;
}

.op-status-banner.is-pending {
  background-color: var(--amber-100);
  border-color: var(--amber-200);
  color: var(--amber-800);
}

.op-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.op-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.op-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

/* ---------- Client Avatar, Nickname & Photo Dossier ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.client-identity-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--navy-100);
  flex-shrink: 0;
  background-color: var(--bg-subtle);
}

.client-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--emerald-200);
  flex-shrink: 0;
  cursor: pointer;
}

.nickname-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--navy-100);
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.photo-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background-color: var(--emerald-100);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-200);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: middle;
}

.photo-slots-box {
  background-color: var(--bg-subtle);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.photo-slots-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.photo-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.photo-upload-btn {
  position: relative;
  cursor: pointer;
}

.photo-preview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.photo-preview-strip:empty {
  display: none;
}

.photo-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.photo-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #0f172a;
  overflow: hidden;
  cursor: pointer;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.15s ease;
}

.photo-thumb-wrap:hover .photo-thumb {
  transform: scale(1.03);
}

.photo-cat-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(9, 26, 43, 0.82);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card-body {
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.photo-card-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.detail-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.detail-upload-bar {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f172a;
  padding: 12px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
  display: block;
}

/* ==========================================================================
   SaaS Fichas Vivas, Animated Cycle Bars & Joyful Cashbox Simulator
   ========================================================================== */

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.32);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24, #b45309);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 320px;
  justify-content: flex-end;
  min-width: 0;
}

/* ---------- Live Pulsing Status Beacon & Avatar Rings ---------- */
@keyframes liveBeaconPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes liveAmberPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

@keyframes liveCrimsonPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.65);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

@keyframes ledBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.42;
    transform: scale(0.86);
  }
}

@keyframes barShimmerMove {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.led-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: ledBlink 1.8s ease-in-out infinite;
}
.led-em_dia {
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}
.led-vence_hoje {
  background-color: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation-duration: 1.1s;
}
.led-em_atraso {
  background-color: #ef4444;
  box-shadow: 0 0 7px #ef4444;
  animation-duration: 0.85s;
}
.led-quitado {
  background-color: #94a3b8;
  animation: none;
}

.avatar-shell {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-shell-sm {
  width: 38px;
  height: 38px;
}
.avatar-shell-xl {
  width: 68px;
  height: 68px;
}

.avatar-ring-em_dia {
  border: 2.5px solid #10b981;
  animation: liveBeaconPulse 2.4s infinite;
}
.avatar-ring-vence_hoje {
  border: 2.5px solid #f59e0b;
  animation: liveAmberPulse 1.7s infinite;
}
.avatar-ring-em_atraso {
  border: 2.5px solid #ef4444;
  animation: liveCrimsonPulse 1.4s infinite;
}
.avatar-ring-quitado {
  border: 2px solid #cbd5e1;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #ffffff;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--navy-800), var(--emerald-600));
}
.avatar-shell-sm .avatar-initials {
  font-size: 12.5px;
}
.avatar-shell-xl .avatar-initials {
  font-size: 22px;
}

.avatar-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}
.avatar-shell-sm .avatar-status-dot {
  width: 10px;
  height: 10px;
}

/* ---------- Animated Live Cycle Progress Bar ("Barrinha andando") ---------- */
.live-bar-track {
  position: relative;
  height: 9px;
  width: 100%;
  border-radius: var(--radius-pill);
  background-color: #e2e8f0;
  overflow: hidden;
}

.live-bar-fill {
  position: relative;
  height: 100%;
  border-radius: var(--radius-pill);
  background-size: 200% 100%;
  animation: barShimmerMove 3.2s linear infinite;
  transition: width 0.35s ease;
}

.live-bar-emerald {
  background-image: linear-gradient(
    90deg,
    #095c47 0%,
    #10b981 35%,
    #6ee7b7 50%,
    #10b981 65%,
    #095c47 100%
  );
}

.live-bar-amber {
  background-image: linear-gradient(
    90deg,
    #b45309 0%,
    #f59e0b 35%,
    #fde68a 50%,
    #f59e0b 65%,
    #b45309 100%
  );
}

.live-bar-crimson {
  background-image: linear-gradient(
    90deg,
    #991b1b 0%,
    #ef4444 35%,
    #fca5a5 50%,
    #ef4444 65%,
    #991b1b 100%
  );
}

.live-bar-slate {
  background: #94a3b8;
  animation: none;
}

/* ---------- SaaS Executive Fichas Grid ---------- */
.fichas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ficha-card {
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.ficha-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-800), #10b981);
}
.ficha-card.status-vence_hoje::before {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}
.ficha-card.status-em_atraso::before {
  background: linear-gradient(90deg, #991b1b, #ef4444);
}
.ficha-card.status-quitado::before {
  background: #94a3b8;
}

.ficha-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  border-color: #cbd5e1;
}

.ficha-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ficha-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.ficha-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ficha-subline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.ficha-cycle-box {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ficha-cycle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate-700);
}

.ficha-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ficha-metric-tile {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  min-width: 0;
}

.ficha-metric-tile span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ficha-metric-tile strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy-900);
  overflow-wrap: anywhere;
}

.ficha-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px dashed var(--border-color);
}

/* ---------- Detail Modal VIP Ficha Hero Card ---------- */
.ficha-vip-hero {
  background: linear-gradient(135deg, #091a2b 0%, #0f2942 58%, #095c47 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.ficha-vip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ficha-vip-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ficha-vip-name {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  overflow-wrap: anywhere;
}

.ficha-vip-meta {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 3px;
}

.ficha-vip-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.ficha-vip-kpi {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.ficha-vip-kpi span {
  display: block;
  font-size: 10.5px;
  color: #cbd5e1;
}

.ficha-vip-kpi strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: #ffffff;
}

/* ---------- Joyful Cashbox / Pocket Simulator Stage ---------- */
.sim-card-vibrant {
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  border-color: #a7f3d0;
}

.cashbox-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #091a2b 0%, #0d4a3e 55%, #0d7a5f 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 98px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), var(--shadow-sm);
}

.cashbox-stage-lg {
  padding: 20px 22px;
  min-height: 128px;
}

.cashbox-stage-left {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.cheer-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cashbox-headline {
  font-size: 21px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.cashbox-headline-lg {
  font-size: 27px;
}

.cashbox-sub {
  font-size: 11.5px;
  color: #d1fae5;
  margin-top: 3px;
}

.cashbox-pocket {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(253, 230, 138, 0.55);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cashbox-pocket:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.04);
}

@keyframes pocketPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.16) rotate(-4deg); }
  75% { transform: scale(0.96) rotate(3deg); }
  100% { transform: scale(1); }
}

.cashbox-pocket.bouncing {
  animation: pocketPop 0.48s ease;
}

.pocket-emoji {
  font-size: 28px;
  line-height: 1;
}
.pocket-emoji-lg {
  font-size: 38px;
}

.pocket-caption {
  font-size: 10.5px;
  font-weight: 800;
  color: #fde68a;
  white-space: nowrap;
}

.coin-stream-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

@keyframes coinFallToBox {
  0% {
    opacity: 0;
    transform: translate3d(var(--start-x, 10px), -22px, 0) scale(0.7) rotate(-18deg);
  }
  20% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--end-x, 220px), 78px, 0) scale(1.05) rotate(22deg);
  }
}

.flying-coin {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 17px;
  will-change: transform, opacity;
  animation: coinFallToBox var(--dur, 1.1s) cubic-bezier(0.22, 0.68, 0.36, 1) forwards;
}

.sim-payback-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sim-payback-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--slate-700);
}

.sim-client-card {
  background-color: #ffffff;
  border: 1.5px solid #6ee7b7;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.sim-cta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Showtime Spotlight Modal */
.showtime-header {
  background: linear-gradient(135deg, #091a2b, #0d7a5f);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.showtime-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fde68a;
}

.showtime-title {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 900;
  color: #ffffff;
}

.st-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.st-highlight-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.st-highlight-card .st-emoji {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}

.st-highlight-card span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.st-highlight-card strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy-900);
}

/* ==========================================================================
   Layperson Guidance: Smart Floating Tooltip, Onboarding Strip & Plain Boxes
   ========================================================================== */

.easy-steps-banner {
  background: linear-gradient(90deg, #fffbeb 0%, #f0fdf4 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.easy-steps-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.easy-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 4px 10px 4px 5px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: help;
}

.easy-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--navy-800);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.easy-steps-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.easy-hover-hint {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--amber-800);
}

.help-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--navy-100);
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  cursor: help;
}

.has-help {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.has-help:hover {
  border-color: var(--emerald-600);
  box-shadow: 0 6px 16px rgba(13, 122, 95, 0.12);
}

.plain-guide-box {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #1e3a8a;
}

.plain-guide-list {
  margin: 6px 0 0 18px;
  padding: 0;
}

.plain-guide-list li {
  margin-bottom: 3px;
}

.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.guide-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 5px;
}

.guide-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.smart-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 140;
  max-width: min(330px, calc(100vw - 24px));
  background: linear-gradient(160deg, #091a2b 0%, #102a43 100%);
  color: #f8fafc;
  border: 1.5px solid #10b981;
  border-radius: var(--radius-md);
  padding: 11px 14px;
  box-shadow: 0 14px 32px rgba(9, 26, 43, 0.32);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.smart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.smart-tooltip-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #fde68a;
  margin-bottom: 4px;
  line-height: 1.3;
}

.smart-tooltip-body {
  font-size: 12.5px;
  line-height: 1.48;
  color: #e2e8f0;
}

.smart-tooltip-action {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px;
  font-weight: 700;
  color: #6ee7b7;
}

@media (max-width: 767px) {
  .guide-cards-grid {
    grid-template-columns: 1fr;
  }

  .easy-hover-hint {
    display: none;
  }
}

/* ---------- Digital Signature & Biometric Certificate Styles ---------- */
.badge-signed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--emerald-100);
  color: #065f46;
  border: 1px solid var(--emerald-200);
  font-size: 11px;
  font-weight: 700;
}

.badge-unsigned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--amber-100);
  color: var(--amber-800);
  border: 1px solid var(--amber-200);
  font-size: 11px;
  font-weight: 700;
}

.sign-invite-option {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.sign-invite-opt-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--navy-900);
}

.cert-panel {
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 8px;
}

.cert-panel-pending {
  background: var(--bg-subtle);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 8px;
}

.cert-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.cert-media-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}

.cert-media-box img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: #f8fafc;
  display: block;
}

.cert-media-cap {
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy-900);
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

.cert-audit-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 10px;
  word-break: break-word;
}

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

/* ---------- Filters & Search Toolbar ---------- */
.toolbar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-tab:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.filter-tab.active {
  background-color: var(--navy-800);
  color: #ffffff;
  border-color: var(--navy-800);
}

.filter-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background-color: rgba(15, 23, 42, 0.08);
}

.filter-tab.active .filter-count {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.search-box {
  flex: 1 1 260px;
  max-width: 360px;
  min-width: 0;
}

/* ---------- Loans Table (Desktop) ---------- */
.table-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.loans-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.loans-table th {
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 11px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.loans-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 13px;
  word-wrap: break-word;
}

.loans-table tbody tr:last-child td {
  border-bottom: none;
}

.loans-table tbody tr:hover {
  background-color: #f8fafc;
}

.cell-client-name {
  font-weight: 700;
  color: var(--navy-900);
}

.cell-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.actions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ---------- Loans Cards (Mobile) ---------- */
.loans-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loan-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.loan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.loan-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.loan-kv-label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.loan-kv-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Empty State ---------- */
.empty-state {
  background-color: var(--bg-surface);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--navy-900);
  font-size: 16px;
}

.empty-state p {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ---------- Modals & Drawers ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 26, 43, 0.55);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-panel {
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 32px);
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-panel.modal-lg {
  max-width: 760px;
}

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

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background-color: var(--slate-200);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Detail Sections & Timeline ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.detail-stat {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.section-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background-color: var(--bg-surface);
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}

.timeline-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.txt-pre {
  background-color: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 55vh;
  overflow-y: auto;
  margin: 0;
}

.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-row input {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.toast {
  background-color: var(--navy-900);
  color: #ffffff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  border-left: 4px solid var(--emerald-600);
}

.toast.toast-error {
  border-left-color: var(--crimson-600);
}

/* ---------- Isolated Client Portal ---------- */
.portal-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

.portal-header {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}

.portal-brand {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a7f3d0;
  font-weight: 700;
  margin-bottom: 4px;
}

.portal-client-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.portal-code-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.portal-hero-metric {
  text-align: center;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.portal-hero-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.portal-hero-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy-900);
  margin-top: 4px;
}

.portal-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-grid,
  .fichas-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .dash-section {
    padding: 12px;
  }

  .donut-layout,
  .dash-totals-strip,
  .sim-results-grid,
  .st-cards-grid {
    grid-template-columns: 1fr;
  }

  .ficha-metrics-grid,
  .ficha-vip-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-right {
    justify-content: stretch;
    width: 100%;
  }

  .cashbox-headline {
    font-size: 17px;
  }

  .cashbox-headline-lg {
    font-size: 21px;
  }

  .topbar-inner {
    padding: 10px 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 34px;
  }

  .container {
    padding: 14px 12px;
  }

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

  .kpi-card:last-child {
    grid-column: span 2;
  }

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

  .search-box {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .form-grid-2,
  .detail-grid,
  .mode-selector {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-body {
    padding: 14px;
  }

  .copy-row {
    flex-direction: column;
    align-items: stretch;
  }
}

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

  .kpi-card:last-child {
    grid-column: auto;
  }

  .portal-kv-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Lastro · painel 2 — telas Hoje / Clientes / Números, menu e barra do celular
   (fica no fim do arquivo de propósito: sobrepõe o visual antigo onde precisa)
   ========================================================================== */
:root {
  --gold-600: #b98a2f;
  --gold-500: #d4a73a;
  --gold-400: #e3b960;
  --gold-200: #f5d896;
  --gold-100: #fbf3df;
  --bnav-h: 64px;
}

/* ---------- Topo com as abas ---------- */
.app-shell .topbar-inner {
  flex-wrap: nowrap;
  gap: 16px;
}

.app-shell .topbar-brand {
  flex: 0 1 auto;
  min-width: 0;
}

.view-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 0 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  flex-shrink: 0;
}

.view-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.view-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.view-tab.active {
  background: #ffffff;
  color: var(--navy-900);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.view-tab:focus-visible,
.bnav-btn:focus-visible,
.menu-item:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
}

.tab-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: #ef4444;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-count {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
}

.view-tab.active .tab-count {
  background: var(--navy-100);
}

.app-shell .topbar-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* ---------- Menu ☰ ---------- */
.app-menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: transparent;
}

.app-menu-sheet {
  position: absolute;
  top: 66px;
  right: max(16px, calc((100vw - 1320px) / 2 + 20px));
  width: 330px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: lastroMenuDrop 0.16s ease-out;
}

.app-menu-head {
  display: none;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: 11px;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
}

.menu-item:hover {
  background: var(--bg-hover);
}

.menu-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.menu-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.menu-text strong {
  font-size: 14px;
  font-weight: 700;
}

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

.menu-sep {
  height: 1px;
  background: var(--border-color);
  margin: 6px 10px;
}

.menu-item-exit .menu-text strong {
  color: var(--crimson-800);
}

@keyframes lastroMenuDrop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes lastroSheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

/* ---------- Telas ---------- */
.app-view {
  animation: lastroViewIn 0.22s ease-out;
}

@keyframes lastroViewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 14px;
}

.view-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}

.view-sub {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13.5px;
}

/* ---------- Hoje: faixa de cima ---------- */
.today-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
  gap: 22px;
  align-items: center;
  padding: 24px 26px;
  margin-bottom: 16px;
  border-radius: 18px;
  color: #ffffff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(227, 185, 96, 0.22) 0%, rgba(227, 185, 96, 0) 55%),
    linear-gradient(135deg, #07131f 0%, var(--navy-900) 45%, #0f3550 100%);
  box-shadow: 0 18px 40px rgba(7, 19, 31, 0.28);
}

.today-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(227, 185, 96, 0.18);
  box-shadow: 0 0 0 28px rgba(227, 185, 96, 0.04), 0 0 0 56px rgba(227, 185, 96, 0.03);
  pointer-events: none;
}

.today-hero-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.today-date {
  font-size: 13px;
  color: var(--gold-200);
  font-weight: 600;
}

.today-headline {
  margin: 6px 0 6px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.today-hero.is-urgent .today-headline::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 12px;
  vertical-align: middle;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}

.today-subline {
  margin: 0;
  color: #cbd5e1;
  font-size: 14.5px;
}

.today-month {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
}

.today-month-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: #cbd5e1;
  font-weight: 600;
}

.today-month-top strong {
  color: var(--gold-200);
  font-size: 15px;
}

.today-month-values {
  margin: 6px 0 10px;
  font-size: 13px;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.today-month-values > strong {
  font-size: 22px;
  color: #ffffff;
}

.today-bar-track {
  background: rgba(255, 255, 255, 0.12);
  height: 10px;
}

.live-bar-gold {
  background-image: linear-gradient(90deg, #b98a2f 0%, #e3b960 35%, #f9e7b8 50%, #e3b960 65%, #b98a2f 100%);
}

/* ---------- Números do topo ---------- */
.kpi-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.kpi-grid-4 .kpi-card,
.kpi-grid-3 .kpi-card {
  border-radius: 14px;
}

.kpi-grid-4 .kpi-label,
.kpi-grid-3 .kpi-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.kpi-grid-4 .kpi-value {
  font-size: 24px;
}

/* ---------- Hoje: o que fazer agora ---------- */
.todo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 6px;
}

.todo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.todo-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-900);
}

.todo-group {
  margin: 10px 0 16px;
}

.todo-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.todo-group-head h4 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.todo-group-count {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  color: var(--text-secondary);
  letter-spacing: 0;
}

.todo-group-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.todo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--slate-300);
  flex-shrink: 0;
}

.tone-crimson .todo-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.tone-amber .todo-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.tone-navy .todo-dot {
  background: var(--navy-700);
}

.tone-gold .todo-dot {
  background: var(--gold-500);
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  border-radius: 12px;
  background: #ffffff;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.todo-item:hover {
  box-shadow: var(--shadow-md);
}

.tone-crimson .todo-item {
  background: #fff7f7;
  border-color: #fbd5d5;
  border-left-color: #ef4444;
}

.tone-amber .todo-item {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: #f59e0b;
}

.tone-navy .todo-item {
  border-left-color: var(--navy-700);
}

.tone-slate .todo-item {
  border-left-color: var(--slate-300);
}

.tone-gold .todo-item {
  background: var(--gold-100);
  border-color: #f1e2bc;
  border-left-color: var(--gold-500);
}

.todo-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.todo-person-static {
  cursor: default;
}

.todo-person .avatar-shell {
  animation: none;
}

.todo-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.todo-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.todo-person:hover .todo-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.todo-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.tone-crimson .todo-meta {
  color: var(--crimson-800);
  font-weight: 600;
}

.tone-amber .todo-meta {
  color: var(--amber-800);
  font-weight: 600;
}

.todo-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy-900);
  white-space: nowrap;
}

.todo-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.todo-ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #f1e2bc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.todo-more {
  border: 0;
  background: transparent;
  color: var(--navy-700);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 4px;
  cursor: pointer;
}

.todo-more:hover {
  text-decoration: underline;
}

.todo-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  margin: 6px 0 14px;
}

.todo-allgood {
  background: var(--emerald-100);
  border: 1px solid var(--emerald-200);
  color: var(--emerald-700);
}

.todo-allgood span {
  color: var(--text-secondary);
  font-size: 13px;
}

.todo-allgood-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--emerald-600);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.todo-welcome {
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-subtle);
  border: 1px dashed var(--slate-300);
}

.todo-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.todo-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.todo-step > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #ffffff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.todo-step strong {
  color: var(--text-primary);
}

.todo-empty-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---------- Botão do WhatsApp ---------- */
.btn-whatsapp {
  background-color: #e9f9ef;
  color: #0b6b3a;
  border-color: #bfe8cf;
}

.btn-whatsapp:hover:not(:disabled) {
  background-color: #d6f3e1;
}

/* ---------- Clientes ---------- */
#view-carteira .toolbar-card {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  border-radius: 14px;
}

.search-box-lg {
  flex: 1 1 auto;
  max-width: none;
}

.search-box-lg .form-control {
  height: 46px;
  font-size: 15px;
  border-radius: 12px;
}

#view-carteira .filter-tabs {
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

#view-carteira .filter-tabs::-webkit-scrollbar {
  display: none;
}

#view-carteira .filter-tab {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 13px;
}

.loan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.loan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--slate-300);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

.loan-card:hover {
  box-shadow: var(--shadow-md);
}

.loan-card.tone-em_dia {
  border-top-color: #10b981;
}

.loan-card.tone-vence_hoje {
  border-top-color: #f59e0b;
}

.loan-card.tone-em_atraso {
  border-top-color: #ef4444;
}

.loan-card.tone-quitado {
  background: #fbfcfd;
}

.loan-card:has(details[open]) {
  z-index: 5;
}

.loan-card.is-new {
  animation: lastroNewCard 2.4s ease-out;
}

@keyframes lastroNewCard {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
  15% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.35);
  }
  100% {
    box-shadow: var(--shadow-sm);
  }
}

.loan-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  min-width: 0;
}

.loan-card-head .avatar-ring-em_dia {
  animation: none;
}

.loan-card-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.loan-card-name {
  font-weight: 800;
  font-size: 16px;
  color: var(--navy-900);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.loan-card-head:hover .loan-card-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.loan-card-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loan-card-head .pill {
  flex-shrink: 0;
}

.loan-card-money {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.money-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

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

.money-value {
  font-size: 19px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.2;
}

.money-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.tone-em_atraso .money-cell-due {
  background: #fff5f5;
  border-color: #fbd5d5;
}

.tone-em_atraso .money-cell-due .money-meta {
  color: var(--crimson-800);
  font-weight: 700;
}

.tone-vence_hoje .money-cell-due {
  background: #fffbeb;
  border-color: #fde68a;
}

.tone-vence_hoje .money-cell-due .money-meta {
  color: var(--amber-800);
  font-weight: 700;
}

.tone-quitado .money-value {
  color: var(--text-secondary);
}

.loan-card-bar .live-bar-track {
  height: 6px;
}

.loan-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.loan-card-tags:empty {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
  line-height: 1.5;
}

.tag-ok {
  background: var(--emerald-100);
  color: var(--emerald-700);
  border-color: var(--emerald-200);
}

.tag-warn {
  background: var(--amber-100);
  color: var(--amber-800);
  border-color: var(--amber-200);
  cursor: pointer;
}

.tag-warn:hover {
  background: #fef3c7;
}

.tag-coll {
  display: inline-block;
}

.loan-card-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: auto;
}

.loan-card-actions .btn {
  min-height: 42px;
}

.loan-card-actions .card-primary {
  flex: 1 1 170px;
  font-size: 14px;
}

.card-more {
  position: relative;
}

.card-more > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.card-more > summary::-webkit-details-marker {
  display: none;
}

.card-more[open] > summary {
  background: var(--bg-hover);
  border-color: var(--slate-300);
}

.card-more-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 280px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 40;
  animation: lastroMenuDrop 0.14s ease-out;
}

.card-more-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
}

.card-more-menu button:hover,
.card-more-menu button:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.card-more-menu button > span:first-child {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-more-menu button > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.card-more-menu strong {
  font-size: 13.5px;
}

.card-more-menu small {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---------- Barra de baixo (só no celular) ---------- */
.bottom-nav {
  display: none;
}

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

  .kpi-grid-4 .kpi-card:last-child {
    grid-column: auto;
  }

  .today-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .view-tab {
    padding: 8px 12px;
  }

  .app-shell .topbar-title-group {
    display: none;
  }
}

@media (max-width: 767px) {
  .app-shell .view-tabs,
  .app-shell .topbar-actions {
    display: none;
  }

  .app-shell .topbar-title-group {
    display: block;
  }

  .app-shell {
    padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #07131f;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -8px 24px rgba(7, 19, 31, 0.25);
  }

  .bnav-btn {
    position: relative;
    appearance: none;
    border: 0;
    background: transparent;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    min-width: 0;
  }

  .bnav-ico {
    font-size: 20px;
    line-height: 1;
    filter: grayscale(0.7);
    opacity: 0.8;
  }

  .bnav-btn.active {
    color: #ffffff;
  }

  .bnav-btn.active .bnav-ico {
    filter: none;
    opacity: 1;
  }

  .bnav-btn.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 26%;
    right: 26%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--gold-400);
  }

  .bnav-new {
    color: var(--gold-200);
  }

  .bnav-plus {
    width: 48px;
    height: 48px;
    margin-top: -24px;
    border-radius: 16px;
    background: linear-gradient(140deg, #f5d896, #e3b960 55%, #b98a2f);
    color: #1b1405;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(227, 185, 96, 0.4);
    border: 3px solid #07131f;
  }

  .bnav-badge {
    position: absolute;
    top: 5px;
    left: 50%;
    margin-left: 5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: #ef4444;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #07131f;
  }

  .app-menu {
    background: rgba(7, 19, 31, 0.45);
  }

  .app-menu-sheet {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-height: 84vh;
    border-radius: 20px 20px 0 0;
    padding: 8px 10px calc(14px + env(safe-area-inset-bottom, 0px));
    animation: lastroSheetUp 0.2s ease-out;
  }

  .app-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 8px;
    font-size: 16px;
  }

  .today-hero {
    padding: 18px 16px;
    border-radius: 16px;
    gap: 14px;
  }

  .today-headline {
    font-size: 22px;
  }

  .kpi-grid-4 .kpi-value {
    font-size: 19px;
  }

  .todo-card {
    padding: 14px 12px 4px;
    border-radius: 14px;
  }

  .todo-head .btn {
    padding: 6px 10px;
  }

  .todo-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "person amount"
      "actions actions";
    gap: 10px;
  }

  .todo-person {
    grid-area: person;
  }

  .todo-amount {
    grid-area: amount;
  }

  .todo-actions {
    grid-area: actions;
  }

  .todo-actions .btn {
    flex: 1;
    min-height: 40px;
  }

  .todo-steps {
    grid-template-columns: 1fr;
  }

  .view-title {
    font-size: 20px;
  }

  .loan-cards {
    grid-template-columns: 1fr;
  }

  .kpi-grid-3 {
    grid-template-columns: 1fr;
  }

  .kpi-grid-3 .kpi-card:last-child {
    grid-column: auto;
  }

  .loan-card-head {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .loan-card-head .loan-card-who {
    flex: 1 1 calc(100% - 66px);
  }

  .loan-card-head .pill {
    order: 3;
    margin-left: 64px;
  }

  .loan-card-actions .card-primary {
    flex: 1 1 100%;
  }

  .loan-card-actions .btn-whatsapp,
  .card-more {
    flex: 1 1 0;
  }

  .card-more > summary {
    width: 100%;
  }

  .card-more[open] {
    flex-basis: 100%;
  }

  .card-more-menu {
    position: static;
    width: auto;
    margin-top: 8px;
    box-shadow: none;
    animation: none;
  }

  .money-value {
    font-size: 17px;
  }
}

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

  .kpi-grid-4 .kpi-value {
    font-size: 17px;
  }

  .loan-card {
    padding: 12px 12px 10px;
  }

  .money-cell {
    padding: 8px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-view,
  .app-menu-sheet,
  .card-more-menu,
  .loan-card.is-new,
  .live-bar-fill,
  .avatar-shell {
    animation: none !important;
  }
}
