/* ══════════════════════════════════════════════════════════════
   CEDAKA MARKETING 360 — Sistema Interno
   Design System v2.0

   Tipografia: Montserrat (proxy Gotham) + Poppins (proxy Avenir Next Pro)
   Cores: Navy #0b1529 · Card #111f3a · Amarelo #ffc101 · Azul #2563eb
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  /* cores principais */
  --bg-body: #070e1b;
  --bg-sidebar: #0b1529;
  --bg-card: #111f3a;
  --bg-input: #0a1220;
  --bg-hover: #142035;
  --border: #1a2d52;
  --border-hover: #2a4580;
  --border-focus: #3b5cdb;

  /* texto */
  --text-primary: #ffffff;
  --text-secondary: #c0cde4;
  --text-muted: #5a7199;
  --text-dimmed: #2e4165;

  /* acentos */
  --accent-yellow: #ffc101;
  --accent-yellow-hover: #ffd540;
  --accent-blue: #2563eb;
  --accent-blue-hover: #3b7bff;
  --accent-blue-soft: #1e3a6e;

  /* status */
  --success: #22c55e;
  --success-bg: #0a3d2a;
  --warning: #fbbf24;
  --warning-bg: #3d3a0a;
  --danger: #f87171;
  --danger-bg: #3d0a0a;

  /* layout */
  --sidebar-width: 260px;
  --nav-height: 0px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* sombras */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow-yellow: 0 0 20px rgba(255,193,1,0.15);
  --shadow-glow-blue: 0 0 20px rgba(37,99,235,0.15);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-secondary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Montserrat', sans-serif;
  color: var(--text-primary);
  font-weight: 700;
}

a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════════
   SIDEBAR LAYOUT
   ══════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .brand img {
  height: 36px;
  width: auto;
}

.sidebar-logo .brand-text {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.sidebar-logo .brand-text .highlight {
  color: var(--accent-yellow);
}

.sidebar-logo .brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Navegacao */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.sidebar-link.active {
  background: rgba(255, 193, 1, 0.08);
  color: var(--accent-yellow);
  font-weight: 600;
}

.sidebar-link.active .sidebar-icon {
  color: var(--accent-yellow);
}

.sidebar-link .sidebar-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link .sidebar-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-yellow);
  color: var(--bg-body);
  letter-spacing: 0.3px;
}

.sidebar-link .sidebar-badge.new {
  background: var(--accent-blue);
  color: #fff;
}

/* Footer sidebar */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}

.sidebar-footer a:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ── Page Header ── */
.page-header {
  padding: 32px 40px 0;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.page-header .page-sub {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Page Body ── */
.page-body {
  padding: 28px 40px 40px;
}

/* ══════════════════════════════════════════════════
   COMPONENTES — Cards
   ══════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-interactive:hover {
  border-color: var(--accent-yellow);
  box-shadow: var(--shadow-glow-yellow);
  background: var(--bg-hover);
}

.card-titulo {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-yellow);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════
   COMPONENTES — Botoes
   ══════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent-yellow);
  color: var(--bg-body);
}
.btn-primary:hover { background: var(--accent-yellow-hover); box-shadow: var(--shadow-glow-yellow); }

.btn-blue {
  background: var(--accent-blue);
  color: #fff;
}
.btn-blue:hover { background: var(--accent-blue-hover); box-shadow: var(--shadow-glow-blue); }

.btn-secondary {
  background: var(--accent-blue-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border-hover); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover { background: var(--danger-bg); }

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Inputs
   ══════════════════════════════════════════════════ */

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 14px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input::placeholder, textarea::placeholder { color: var(--text-dimmed); }
select option { background: var(--bg-card); }
textarea { resize: vertical; min-height: 60px; font-family: inherit; }

.search-input {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a7199' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}

/* checkbox */
.check-group { display: flex; flex-direction: column; gap: 10px; }
.check-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.check-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-yellow); cursor: pointer; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Tags / Badges
   ══════════════════════════════════════════════════ */

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-blue-soft);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-yellow {
  background: rgba(255,193,1,0.12);
  color: var(--accent-yellow);
}

.badge-status {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.badge-ativo { background: var(--accent-yellow); color: var(--bg-body); }
.badge-novo { background: var(--accent-blue); color: #fff; }
.badge-breve { background: var(--border); color: var(--text-muted); }

.badge-funcionou { background: var(--success-bg); color: var(--success); }
.badge-oportunidade { background: var(--warning-bg); color: var(--warning); }
.badge-nao-funcionou { background: var(--danger-bg); color: var(--danger); }

/* ══════════════════════════════════════════════════
   COMPONENTES — Grid
   ══════════════════════════════════════════════════ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.row { display: grid; gap: 14px; margin-bottom: 14px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 800px) {
  .grid-2, .row-2, .row-3 { grid-template-columns: 1fr; }
}

.full-width { grid-column: 1 / -1; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Modal
   ══════════════════════════════════════════════════ */

.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-bg.ativo,
.modal-bg.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h2 {
  font-size: 20px;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.modal-actions button {
  flex: 1;
}

/* ══════════════════════════════════════════════════
   COMPONENTES — Secoes de formulario
   ══════════════════════════════════════════════════ */

.secao { margin-bottom: 28px; }
.secao-titulo {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-yellow);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════
   COMPONENTES — Split Layout (contratos, cronograma)
   ══════════════════════════════════════════════════ */

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh);
}

.split-form {
  padding: 32px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.split-preview {
  padding: 32px;
  background: rgba(11,21,41,0.5);
  overflow-y: auto;
}

.split-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dimmed);
  gap: 12px;
}

.split-placeholder .icon { font-size: 48px; }
.split-placeholder p { font-size: 14px; }

@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
  .split-preview { display: none; }
}

/* ══════════════════════════════════════════════════
   COMPONENTES — Upload Area
   ══════════════════════════════════════════════════ */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--text-dimmed);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 14px;
}

.upload-area:hover {
  border-color: var(--accent-yellow);
  color: var(--text-muted);
  background: rgba(255,193,1,0.03);
}

.upload-area input { display: none; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Arquivo e Geracao items
   ══════════════════════════════════════════════════ */

.arquivo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 12px;
}

.arquivo-item .nome { color: var(--text-primary); font-weight: 600; }
.arquivo-item .tipo { color: var(--text-muted); font-size: 10px; text-transform: uppercase; }
.arquivo-item .acoes { display: flex; gap: 6px; }
.arquivo-item .acoes button { padding: 4px 8px; font-size: 11px; }

.geracao-item {
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.geracao-item:hover { border-color: var(--accent-blue); background: var(--bg-hover); }
.geracao-titulo { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.geracao-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Actions Bar
   ══════════════════════════════════════════════════ */

.actions-bar {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  position: sticky;
  bottom: 0;
  background: var(--bg-body);
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.actions-bar button { flex: 1; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Preview / Contrato / Cronograma
   ══════════════════════════════════════════════════ */

.doc-preview { font-size: 13px; line-height: 1.8; color: var(--text-secondary); }
.doc-preview h1 { font-size: 16px; text-align: center; margin-bottom: 6px; }
.doc-preview h2 { font-size: 13px; font-weight: 400; color: var(--text-muted); text-align: center; margin-bottom: 24px; }
.doc-preview h3 { font-size: 12px; font-weight: 700; color: var(--accent-yellow); text-transform: uppercase; letter-spacing: 0.5px; margin: 24px 0 10px; }
.doc-preview p { margin-bottom: 12px; }
.doc-preview ul { padding-left: 20px; margin-bottom: 12px; }
.doc-preview li { margin-bottom: 4px; }
.doc-preview .assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 48px; }
.doc-preview .assinatura { text-align: center; }
.doc-preview .linha-assinatura { height: 1px; background: var(--text-dimmed); margin-bottom: 10px; }
.doc-preview .doc-header { border-bottom: 2px solid var(--accent-blue); padding-bottom: 16px; margin-bottom: 20px; }
.doc-preview hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Mic Button
   ══════════════════════════════════════════════════ */

.btn-mic {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-mic:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-mic.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse-mic 1.5s infinite; }
@keyframes pulse-mic { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ══════════════════════════════════════════════════
   COMPONENTES — Status Text
   ══════════════════════════════════════════════════ */

#status { margin-top: 12px; font-size: 13px; color: var(--text-muted); min-height: 20px; }
.erro { color: var(--danger); font-size: 13px; margin-top: 12px; }
.empty { text-align: center; padding: 60px; color: var(--text-dimmed); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Logo Upload
   ══════════════════════════════════════════════════ */

.logo-upload {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; flex-shrink: 0;
  transition: border-color 0.2s; background: var(--bg-card);
}

.logo-upload:hover { border-color: var(--accent-yellow); }
.logo-upload img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.logo-upload .placeholder-icon { color: var(--text-dimmed); font-size: 24px; }
.logo-upload input { display: none; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Etapa Card (cronograma)
   ══════════════════════════════════════════════════ */

.etapa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: grab;
  transition: all 0.2s;
}

.etapa-card:active { cursor: grabbing; }
.etapa-card.custom { border-color: var(--accent-blue-soft); }
.etapa-card.dragging { opacity: 0.4; transform: scale(0.97); }
.etapa-card.drag-over { border-color: var(--accent-yellow); box-shadow: var(--shadow-glow-yellow); }

.etapa-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.etapa-header input[type="text"] { padding: 8px 10px; font-size: 12px; }
.etapa-dias { width: 70px !important; text-align: center; flex-shrink: 0; }
.etapa-titulo-input { flex: 1; font-weight: 600; }
.etapa-actions { display: flex; gap: 4px; flex-shrink: 0; }
.etapa-actions button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-muted); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.etapa-actions button:hover { color: var(--text-primary); border-color: var(--border-hover); }
.etapa-itens { font-size: 12px; color: var(--text-muted); line-height: 1.6; padding-left: 4px; margin-bottom: 8px; }
.etapa-itens li { margin-bottom: 2px; }

.add-etapa-bar {
  display: flex; gap: 8px; margin-top: 8px; padding: 12px;
  background: var(--bg-input); border: 1px dashed var(--border); border-radius: var(--radius-md);
  align-items: center;
}
.add-etapa-bar input { margin-bottom: 0; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Conhecimento Cards
   ══════════════════════════════════════════════════ */

.knowledge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.knowledge-card:hover { border-color: var(--accent-blue); box-shadow: var(--shadow-glow-blue); }

.knowledge-thumb {
  width: 100%; height: 180px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); overflow: hidden;
}

.knowledge-thumb img { width: 100%; height: 100%; object-fit: cover; }
.knowledge-thumb .icon-placeholder { font-size: 48px; color: var(--border); }

.knowledge-body { padding: 16px; }
.knowledge-titulo { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knowledge-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.knowledge-date { font-size: 11px; color: var(--text-muted); }
.knowledge-segmento { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }

.knowledge-delete {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: var(--danger);
  font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.knowledge-card:hover .knowledge-delete { opacity: 1; }
.knowledge-delete:hover { background: var(--danger); color: #fff; }

/* ══════════════════════════════════════════════════
   COMPONENTES — Filtros
   ══════════════════════════════════════════════════ */

.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.filters-bar select {
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════
   COMPONENTES — Top Bar
   ══════════════════════════════════════════════════ */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

/* ══════════════════════════════════════════════════
   COMPONENTES — Cliente Card (lista)
   ══════════════════════════════════════════════════ */

.cliente-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  cursor: pointer;
}

.cliente-card:hover {
  border-color: var(--accent-yellow);
  background: var(--bg-hover);
  box-shadow: var(--shadow-glow-yellow);
}

.cliente-logo {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.cliente-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.cliente-logo .initials { font-size: 18px; font-weight: 700; color: var(--accent-blue); }
.cliente-info { flex: 1; min-width: 0; }
.cliente-nome { font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cliente-empresa { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.cliente-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cliente-data { font-size: 11px; color: var(--text-dimmed); }

/* ══════════════════════════════════════════════════
   COMPONENTES — Cedaka Dados Box
   ══════════════════════════════════════════════════ */

.info-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.info-box strong { color: var(--text-primary); }

/* ══════════════════════════════════════════════════
   COMPONENTES — Preview Modal (geracoes)
   ══════════════════════════════════════════════════ */

.preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.preview-modal.ativo { display: flex; }

.preview-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.preview-content h2 { color: var(--text-primary); margin-bottom: 16px; font-size: 18px; }
.preview-body { font-size: 13px; line-height: 1.8; color: var(--text-secondary); }
.preview-body h1, .preview-body h2, .preview-body h3 { color: var(--accent-yellow); margin: 16px 0 8px; }
.preview-body h1 { font-size: 16px; }
.preview-body h2 { font-size: 14px; }
.preview-body h3 { font-size: 13px; }
.preview-body ul, .preview-body ol { padding-left: 20px; margin-bottom: 10px; }
.preview-body li { margin-bottom: 4px; }
.preview-body strong { color: var(--text-primary); }
.preview-body p { margin-bottom: 10px; }
.preview-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ══════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════ */

@media print {
  html, body { background: #fff !important; color: #000 !important; margin: 0; padding: 0; }
  .sidebar, .actions-bar, #status, .split-placeholder { display: none !important; }
  .app-layout { display: block !important; }
  .main-content { margin-left: 0 !important; }
  .split-layout { display: block !important; }
  .split-form { display: none !important; }
  .split-preview {
    display: block !important; padding: 20px 40px !important;
    background: #fff !important; color: #000 !important;
    overflow: visible !important; border: none !important;
  }
  .doc-preview { color: #000 !important; font-size: 11pt; line-height: 1.7; }
  .doc-preview h1 { color: #1a2e6b !important; font-size: 14pt; }
  .doc-preview h2 { color: #555 !important; font-size: 11pt; }
  .doc-preview h3 { color: #1a2e6b !important; font-size: 10.5pt; page-break-after: avoid; }
  .doc-preview p, .doc-preview li { color: #000 !important; }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-header { padding: 24px 20px 0; }
  .page-body { padding: 20px; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
  }

  .mobile-toggle {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
}

@media (min-width: 769px) {
  .mobile-header { display: none; }
}

/* ══════════════════════════════════════════════════
   ANIMACOES
   ══════════════════════════════════════════════════ */

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

.fade-in { animation: fadeIn 0.3s ease forwards; }

/* scrollbar customizada */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
