/* ===== VARIABLES ===== */
:root {
  --gold: #C4952A;
  --gold-dark: #9A7220;
  --gold-light: #E8B840;
  --dark: #1A1A1A;
  --dark-mid: #2C2C2C;
  --text: #222222;
  --text-muted: #777777;
  --border: #E2E2E2;
  --bg: #FFFFFF;
  --bg-light: #F6F5F3;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --radius: 8px;
  --radius-lg: 12px;
  --ease: 0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg-light);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== LOGIN ===== */
.login-page {
  display: flex;
  min-height: 100vh;
}
.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--dark) url('../img/bg-login.png') center/cover no-repeat;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
}
.login-branding { text-align: center; position: relative; z-index: 1; }
.login-tagline {
  color: rgba(255,255,255,0.45);
  font-size: 0.85rem;
  margin-top: 32px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}
.login-right {
  width: 460px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
}
.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 36px;
}

/* ===== LOGO ===== */
.logo-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.logo-wrap.row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.logo-text-group { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text-group .l1 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.logo-text-group .l2 {
  font-size: 0.65rem;
  color: rgba(196,149,42,0.6);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.logo-wrap.on-dark .l1 { color: var(--gold); }
.logo-wrap.on-dark .l2 { color: rgba(196,149,42,0.55); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,149,42,0.14);
}
.form-control::placeholder { color: #C0C0C0; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.input-wrap { position: relative; }
.input-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  user-select: none;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1.5px solid transparent;
  transition: all var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  box-shadow: 0 4px 14px rgba(196,149,42,0.38);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-danger {
  background: transparent;
  color: #D44;
  border-color: #D44;
}
.btn-danger:hover {
  background: #D44;
  color: white;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-light); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; box-shadow: none; }

/* ===== HEADER ===== */
.header {
  background: var(--dark);
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.header-right { display: flex; align-items: center; gap: 16px; }
.header-user {
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
}
.header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
}

/* ===== PAGE LAYOUT ===== */
.page { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.page-sm { max-width: 860px; margin: 0 auto; padding: 32px 24px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title { font-size: 1.45rem; font-weight: 800; color: var(--dark); }
.page-subtitle { font-size: 0.87rem; color: var(--text-muted); margin-top: 3px; }

/* ===== STATS ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

/* ===== SEARCH ===== */
.search-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.93rem;
  color: var(--text);
  background: transparent;
}
.search-wrap input::placeholder { color: #BABABA; }

/* ===== CLIENT GRID ===== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}
.client-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
}
.client-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cc-header {
  background: var(--dark);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cc-initial {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.cc-name { color: white; font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.cc-cnpj { color: rgba(255,255,255,0.45); font-size: 0.72rem; margin-top: 2px; }
.cc-body { padding: 14px 20px; }
.cc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}
.cc-row:last-child { border-bottom: none; }
.cc-row-lbl { color: var(--text-muted); }
.cc-row-val { font-weight: 600; }
.cc-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  grid-column: 1/-1;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.25; }
.empty p { font-size: 1rem; margin-bottom: 20px; }

/* ===== FORM PAGE (add/edit) ===== */
.section-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.section-card-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #FAFAF8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-card-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
}
.section-card-body { padding: 22px 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

/* Dynamic items */
.dyn-item {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
}
.dyn-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dyn-item-num {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
}

/* Checkboxes */
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: all var(--ease);
}
.check-item:hover { border-color: var(--gold); }
.check-item.active { border-color: var(--gold); background: rgba(196,149,42,0.06); }
.check-item input { display: none; }
.check-box {
  width: 17px;
  height: 17px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--ease);
}
.check-item.active .check-box { background: var(--gold); border-color: var(--gold); color: white; }
.check-lbl { font-size: 0.85rem; font-weight: 500; line-height: 1.3; }
.check-wrap { display: flex; flex-direction: column; }
.doc-url { margin-top: 4px; padding: 2px 6px 6px; }
.doc-url input { font-size: 0.8rem; }

/* ===== DOC UPLOAD BUTTONS ===== */
.doc-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.doc-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: all var(--ease);
  background: transparent;
}
.doc-btn:hover { border-color: var(--gold); background: rgba(196,149,42,0.04); }
.doc-btn.active { border-color: var(--gold); background: rgba(196,149,42,0.08); }
.doc-btn-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--ease);
  color: transparent;
}
.doc-btn-check.active { background: var(--gold); border-color: var(--gold); color: white; }
.doc-btn-lbl { font-size: 0.85rem; font-weight: 500; flex: 1; line-height: 1.3; }
.doc-btn-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(196,149,42,0.12);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hidden { display: none !important; }

/* File upload */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease);
  position: relative;
  overflow: hidden;
}
.file-drop:hover { border-color: var(--gold); }
.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-drop-icon { font-size: 1.5rem; margin-bottom: 4px; opacity: 0.4; }
.file-drop-text { font-size: 0.8rem; color: var(--text-muted); }
.img-preview {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* Gerais list */
.gerais-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.gerais-item input { flex: 1; }

/* ===== CLIENT VIEW PAGE ===== */
.cv-page {
  background: white;
  min-height: 100vh;
}

/* Admin toolbar */
.cv-admin-bar {
  background: var(--dark);
  padding: 10px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cv-admin-bar-left {
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
}
.cv-admin-bar-right { display: flex; gap: 8px; }

/* Header */
.cv-header {
  padding: 22px 48px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.cv-header-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Name row */
.cv-name-row {
  padding: 8px 48px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.cv-company-name {
  font-size: 1.55rem;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.02em;
  color: var(--dark);
}

/* Meta bar */
.cv-meta {
  padding: 10px 48px;
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cv-meta-item span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.cv-meta-item strong { font-weight: 700; color: var(--dark); font-size: 0.82rem; }

/* Gold timeline */
.cv-timeline {
  height: 44px;
  background: linear-gradient(90deg, #7A5A10 0%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, #7A5A10 100%);
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 0;
  position: relative;
  overflow: hidden;
}
.cv-timeline::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg, transparent, transparent 58px,
    rgba(255,255,255,0.07) 58px, rgba(255,255,255,0.07) 59px
  );
}
.cv-chevron {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.18);
  clip-path: polygon(0 0, 68% 0, 100% 50%, 68% 100%, 0 100%, 32% 50%);
  margin-right: -6px;
  position: relative;
  z-index: 1;
}
.cv-chevron:first-child { clip-path: polygon(0 0, 68% 0, 100% 50%, 68% 100%, 0 100%); }

/* Main content */
.cv-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 40px 48px;
  gap: 0;
}
.cv-col-left {
  padding-right: 44px;
  border-right: 1px solid var(--border);
}
.cv-col-right {
  padding-left: 44px;
}

.cv-section-title {
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  color: var(--dark);
}

.cv-faturamento-val {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

/* Socios */
.cv-socio {
  margin-bottom: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}
.cv-socio-name {
  font-weight: 700;
  text-decoration: underline;
  text-transform: uppercase;
  text-underline-offset: 2px;
}
.cv-socio-since { color: var(--text-muted); font-size: 0.82rem; }

/* Limites Financeiros */
.cv-limites-table {
  margin-bottom: 16px;
}
.cv-limites-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.cv-limites-table tr:first-child td {
  padding-top: 0;
}
.cv-limites-table tr:last-child td {
  border-bottom: none;
}

/* Documents */
.cv-docs-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  margin-bottom: 28px;
}
.cv-doc-link {
  font-size: 0.84rem;
  color: var(--text);
  text-decoration: none;
  display: block;
  padding: 3px 0;
  transition: color var(--ease);
}
.cv-doc-link[href] { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cv-doc-link:hover { color: var(--gold); opacity: 0.8; }

.cv-doc-indicator {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: block;
  padding: 3px 0;
}

/* File list (Documentos Adicionais) */
.cv-files-list { display: flex; flex-direction: column; gap: 6px; }
.cv-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 7px;
  text-decoration: none;
  color: var(--dark);
  transition: border-color 0.15s, background 0.15s;
}
.cv-file-row:hover { border-color: var(--gold); background: #fdf8ee; }
.cv-file-row-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #FAFAF9;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--gold) !important;
  font-size: 0.8rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
  margin-top: 4px;
}
.cv-file-row-compact:hover {
  border-color: var(--gold);
  background: #fdf8ee;
}
.cv-file-icon { font-size: 1.45rem; flex-shrink: 0; line-height: 1; }
.cv-file-info { flex: 1; min-width: 0; }
.cv-file-name {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dark);
}
.cv-file-meta { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.cv-file-open {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Enderecos — redesigned */
.cv-enderecos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.cv-endereco-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: box-shadow var(--ease), transform var(--ease);
}
.cv-endereco-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.cv-map-link {
  display: block;
  position: relative;
  text-decoration: none;
  overflow: hidden;
}
.cv-map-frame {
  overflow: hidden;
  line-height: 0;
}
.cv-map-frame iframe {
  display: block;
  pointer-events: none;
  border: none;
}
.cv-map-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  padding: 18px 10px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cv-endereco-card:hover .cv-map-overlay {
  opacity: 1;
}
.cv-map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: var(--bg-light);
  gap: 6px;
  text-decoration: none;
}
.cv-map-placeholder span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
}
.cv-endereco-label {
  padding: 8px 12px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cv-endereco-addr {
  padding: 0 12px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== STATUS FILTER ===== */
.status-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.status-filter::-webkit-scrollbar { height: 3px; }
.status-filter::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1.5px solid;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s ease;
  font-family: inherit;
  outline: none;
}
.status-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}
.status-pill.active {
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-count {
  background: rgba(0,0,0,0.1);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
.status-pill.active .status-count {
  background: rgba(255,255,255,0.25);
}

/* ===== STATUS FILTER TABS ===== */
.status-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.sf-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.sf-tab:hover { border-color: var(--gold); color: var(--text); }
.sf-tab.active { border-color: var(--gold); color: var(--gold); background: rgba(196,149,42,0.06); }
.sf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sf-count {
  background: var(--bg-light);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.sf-tab.active .sf-count { background: rgba(196,149,42,0.15); color: var(--gold); }

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ===== GERAIS ITEM BLOCK ===== */
.gerais-item-block {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color var(--ease);
}
.gerais-item-block:hover {
  border-color: var(--gold);
}
.gerais-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ===== TOAST ===== */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--dark);
  color: white;
  padding: 13px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.87rem;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.28s ease;
}
.toast.success { border-left: 4px solid #52C98A; }
.toast.error { border-left: 4px solid #F87171; }
.toast.info { border-left: 4px solid var(--gold); }
@keyframes toastIn { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-out { animation: toastOut 0.28s ease forwards; }
@keyframes toastOut { to { transform: translateX(110%); opacity: 0; } }

/* ===== MODAL ===== */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.modal-text { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 22px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== LIMITES MODAL ===== */
.limites-modal-box {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 900px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: slideUp 0.3s ease;
}

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

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

.limites-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease);
}

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

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

.limites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.limite-section {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.limite-section-full {
  grid-column: 1 / -1;
}

.limite-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-dark);
  margin-bottom: 12px;
  display: block;
}

.limites-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-light);
}

.hidden {
  display: none !important;
}

/* ===== ADMINS MODAL ===== */
.admins-modal-box {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: slideUp 0.3s ease;
}

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

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

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

.admins-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.admin-item-info {
  flex: 1;
}

.admin-item-user {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.admin-item-nome {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-item-actions {
  display: flex;
  gap: 6px;
}

.admin-item-actions button {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all var(--ease);
}

.admin-item-actions button:hover {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

.admin-item-actions button.btn-danger:hover {
  background: #e74c3c;
  border-color: #e74c3c;
}

/* ===== BADGE / TAG ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-gold { background: rgba(196,149,42,0.12); color: var(--gold-dark); }

/* ===== UTILS ===== */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.fw-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-sm { font-size: 0.82rem; }
.hidden { display: none !important; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 32px; }
  .cv-main { grid-template-columns: 1fr; }
  .cv-col-left { padding-right: 0; border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 28px; margin-bottom: 28px; }
  .cv-col-right { padding-left: 0; }
  .cv-header, .cv-name-row, .cv-meta { padding-left: 20px; padding-right: 20px; }
  .cv-main { padding: 28px 20px; }
  .cv-admin-bar { padding-left: 20px; padding-right: 20px; }
  .cv-timeline { padding: 0 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .span-2, .span-3, .span-4 { grid-column: span 2; }
  .clients-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
  .cv-docs-cols { grid-template-columns: 1fr; }
  .cv-enderecos-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .doc-btn-grid { grid-template-columns: 1fr; }
}

/* ===== ADDRESS AUTOCOMPLETE ===== */
.ac-wrap { position: relative; }
.ac-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--gold);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--bg-light); }
.ac-main { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.ac-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.ac-loading, .ac-empty { color: var(--text-muted); font-size: 0.84rem; cursor: default; }
.ac-loading:hover, .ac-empty:hover { background: transparent; }

/* Map preview in form */
.map-prev {
  margin-top: 14px;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ===== UNIFIED UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.2s, background-color 0.2s;
  margin-top: 8px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold);
  background-color: rgba(196, 149, 42, 0.02);
}
.upload-zone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.upload-zone-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.upload-zone-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 4px;
}
.doc-upload-item {
  margin-bottom: 24px;
}

/* ===== PRINT ===== */
@media print {
  .cv-admin-bar { display: none; }
  .cv-timeline { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .cv-page { background: white; }
}
