/* ===================== Central de Conteúdo =====================
   Identidade oxblood + ouro, inspirada no protótipo da Júlia. */
:root {
  --bg: #3B0912;
  --panel: #560F20;
  --card: #6E1329;
  --wine: #791127;
  --rose: #C75C71;
  --pink: #ECB1C0;
  --blush: #ECD8E0;
  --muted: #C99DAB;
  --gold: #C9A34E;
  --goldsoft: #E4C87E;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--blush);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--goldsoft); text-decoration: none; }
::selection { background: var(--gold); color: var(--panel); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--wine); border-radius: 8px; }
input, textarea, select { font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--wine); padding: 26px 16px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .bee { color: var(--gold); font-size: 26px; }
.brand b { font-weight: 700; font-size: 18px; line-height: 1.15; letter-spacing: .2px; }
.nav { margin-top: 34px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  color: var(--muted); border-radius: 12px; font-size: 15px; transition: all .15s;
}
.nav-item:hover { color: var(--blush); }
.nav-item.active { background: var(--card); color: var(--blush); font-weight: 500; }
.nav-item .hex {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.nav-item.active .hex { background: rgba(201,163,78,.14); color: var(--gold); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; }
.sidebar-logo { width: 88px; height: auto; display: block; opacity: .85; margin-bottom: 14px; }
.sidebar-email { font-size: 11px; color: var(--muted); margin-bottom: 6px; word-break: break-all; }
.sidebar-meta { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; opacity: .6; }
.sidebar-meta a { color: var(--muted); }
.main { flex: 1; padding: 34px 40px; max-width: 1120px; }

/* ---------- tipografia ---------- */
.title { margin: 0 0 26px; }
.title h1 { font-size: 34px; font-weight: 600; margin: 0; }
.title .sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.section-h { font-size: 19px; margin: 4px 0 12px; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--wine); border-radius: 16px; padding: 22px;
  margin-bottom: 16px;
}
.card.tight { padding: 15px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-n { font-size: 42px; font-weight: 700; margin-top: 10px; }
.stat-l { color: var(--muted); font-size: 13.5px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; border: none; cursor: pointer;
  border-radius: 12px; padding: 12px 22px; font-size: 15px; font-weight: 600;
  font-family: inherit; letter-spacing: .3px; transition: transform .1s, filter .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-gold { background: linear-gradient(150deg, var(--goldsoft), var(--gold)); color: var(--panel); }
.btn-gold:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--wine);
  border-radius: 10px; padding: 9px 15px; font-size: 13.5px; font-weight: 500;
}
.btn-ghost:hover { border-color: var(--gold); }
.btn-ghost.active { background: var(--wine); color: var(--blush); border-color: var(--gold); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.mini {
  border: 1px solid var(--gold); background: var(--gold); color: var(--panel);
  border-radius: 8px; padding: 7px 13px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.mini.ghost { background: transparent; color: var(--gold); }
.mini:disabled { opacity: .4; cursor: default; }
.mini.rose { border-color: var(--rose); background: var(--rose); color: var(--panel); }
.mini.rose.ghost { background: transparent; color: var(--rose); }
.mini.pink { border-color: var(--pink); background: transparent; color: var(--pink); }
.icon-btn {
  background: transparent; border: 1px solid var(--wine); border-radius: 9px; padding: 7px 9px;
  cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--blush); border-color: var(--gold); }

/* ---------- forms ---------- */
label.lbl { font-size: 13px; color: var(--pink); display: block; margin-bottom: 6px; }
.field {
  width: 100%; background: var(--bg); border: 1px solid var(--wine); border-radius: 10px;
  padding: 12px 14px; color: var(--blush); font-size: 14.5px; outline: none;
}
.field:focus { border-color: var(--gold); }
textarea.field { resize: vertical; height: 200px; }
.field-sm { padding: 7px 9px; font-size: 12.5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
select.field option { background: var(--panel); }

/* ---------- chips / tags ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  background: transparent; color: var(--muted); border: 1px solid var(--wine);
  border-radius: 20px; padding: 6px 13px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.chip.on { background: var(--gold); color: var(--panel); border-color: var(--gold); font-weight: 600; }
.tag {
  font-size: 11.5px; padding: 3px 10px; border-radius: 20px; font-weight: 500;
  border: 1px solid; display: inline-flex; align-items: center; gap: 5px;
}
.tag--gold { color: var(--gold); border-color: rgba(201,163,78,.4); background: rgba(201,163,78,.13); }
.tag--goldsoft { color: var(--goldsoft); border-color: rgba(228,200,126,.4); background: rgba(228,200,126,.12); }
.tag--pink { color: var(--pink); border-color: rgba(236,177,192,.4); background: rgba(236,177,192,.12); }
.tag--rose { color: var(--rose); border-color: rgba(199,92,113,.4); background: rgba(199,92,113,.12); }
.tag--muted { color: var(--muted); border-color: rgba(201,157,171,.4); background: rgba(201,157,171,.1); }

/* ---------- diversos ---------- */
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.pink { color: var(--pink); }
.rose { color: var(--rose); }
.small { font-size: 12.5px; }
.pre {
  white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.7;
  color: var(--blush); margin: 0; background: var(--bg); border: 1px solid var(--wine);
  border-radius: 10px; padding: 14px;
}
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none; }
.divider { height: 1px; background: var(--wine); flex: 1; }

/* ---------- stepper (esteira) ---------- */
.passo { display: flex; gap: 16px; }
.passo.off { opacity: .5; }
.passo-num {
  width: 34px; height: 34px; border-radius: 20px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; border: 2px solid var(--wine);
  color: var(--muted); font-weight: 600; font-size: 15px;
}
.passo.on .passo-num { border-color: var(--pink); color: var(--pink); }
.passo.done .passo-num { background: var(--gold); border-color: var(--gold); color: var(--panel); }
.passo-line { width: 2px; flex: 1; min-height: 18px; background: var(--wine); margin: 6px auto; }
.passo-body { flex: 1; padding-bottom: 22px; }
.stepper { display: flex; align-items: center; margin: 16px 0 12px; }
.stepper .node { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 74px; }
.stepper .dot {
  width: 26px; height: 26px; border-radius: 20px; display: flex; align-items: center;
  justify-content: center; border: 2px solid var(--wine); font-size: 12px;
}
.stepper .dot.done { background: var(--gold); border-color: var(--gold); color: var(--panel); }
.stepper .dot.late { border-color: var(--rose); color: var(--rose); }
.stepper .lbl-node { font-size: 10.5px; color: var(--muted); }
.stepper .bar { flex: 1; height: 2px; background: var(--wine); margin-bottom: 18px; }
.stepper .bar.done { background: var(--gold); }

.numstep { display: flex; align-items: center; gap: 10px; }
.numstep button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--wine);
  background: transparent; color: var(--gold); font-size: 18px; cursor: pointer; line-height: 1;
}
.numstep .val { font-size: 20px; min-width: 22px; text-align: center; }

/* ---------- calendário ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { font-size: 11px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: 1px; }
.cal-cell {
  min-height: 96px; padding: 7px; border-radius: 10px; background: var(--bg);
  border: 1px solid var(--wine); display: flex; flex-direction: column; gap: 3px;
  overflow: hidden; cursor: pointer; color: inherit;
}
.cal-cell.sel { background: var(--card); border-color: var(--gold); }
.cal-daynum {
  font-size: 12px; align-self: flex-start; color: var(--muted);
  width: 20px; height: 20px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
}
.cal-cell.hoje .cal-daynum { background: var(--gold); color: var(--panel); font-weight: 700; }
.cal-ev {
  font-size: 10px; border-radius: 3px; padding: 2px 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; border-left: 2px solid var(--muted); background: rgba(255,255,255,.06);
}
.cal-ev.gold { border-color: var(--gold); }
.cal-ev.goldsoft { border-color: var(--goldsoft); }
.cal-ev.pink { border-color: var(--pink); }
.cal-ev.rose { border-color: var(--rose); }
.cal-ev.done { text-decoration: line-through; opacity: .55; }

/* ---------- métricas ---------- */
.kpi { padding: 16px; }
.kpi .k-l { font-size: 12px; color: var(--muted); }
.kpi .k-v { font-size: 30px; margin-top: 4px; }
.kpi.accent { border-color: var(--gold); }
.kpi.accent .k-v { color: var(--gold); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { max-width: 420px; width: 100%; text-align: center; }
.login-card .bee { color: var(--gold); font-size: 44px; }

/* ---------- flash ---------- */
.flashes { position: fixed; top: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash {
  background: var(--card); border-left: 3px solid var(--gold); border-radius: 8px;
  padding: 12px 16px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  animation: flash-in .25s ease;
}
.flash.danger { border-color: var(--rose); }
.flash.success { border-color: var(--goldsoft); }
.flash.warning { border-color: var(--pink); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- editor em tela cheia ---------- */
.ta-wrap { position: relative; }
.ta-expand {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--wine); background: var(--card); color: var(--muted);
  border-radius: 8px; cursor: pointer; font-size: 12px; opacity: .8;
}
.ta-expand:hover { color: var(--gold); border-color: var(--gold); opacity: 1; }
.ta-wrap textarea { padding-right: 42px; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(20,3,8,.72); padding: 24px; animation: flash-in .18s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--panel); border: 1px solid var(--wine); border-radius: 16px;
  width: 100%; max-width: 1100px; height: 82vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--wine); }
.modal-head b { font-size: 15px; }
.modal-body { flex: 1; padding: 16px 20px; overflow: hidden; display: flex; gap: 16px; }
.modal-editor { flex: 1; min-width: 0; height: 100%; }
.modal-editor textarea {
  width: 100%; height: 100%; resize: none; background: var(--bg); border: 1px solid var(--wine);
  border-radius: 10px; padding: 16px; color: var(--blush); font-size: 15px; line-height: 1.7; outline: none;
}
.modal-editor textarea:focus { border-color: var(--gold); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--wine); }

/* chat de revisão dentro do modal */
.modal-chat {
  width: 340px; flex-shrink: 0; display: flex; flex-direction: column;
  border-left: 1px solid var(--wine); padding-left: 16px;
}
.modal-chat.hidden { display: none; }
.chat-head { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.chat-msg { display: flex; flex-direction: column; gap: 4px; }
.chat-msg.user { align-items: flex-end; }
.chat-bubble {
  max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user .chat-bubble { background: var(--wine); color: var(--blush); }
.chat-msg.ia .chat-bubble { background: var(--bg); border: 1px solid var(--wine); }
.chat-msg.pensando .chat-bubble { opacity: .6; }
.chat-usar { align-self: flex-start; }
.chat-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-form textarea {
  width: 100%; resize: none; background: var(--bg); border: 1px solid var(--wine);
  border-radius: 10px; padding: 10px; color: var(--blush); font-size: 13px; outline: none;
}
.chat-form textarea:focus { border-color: var(--gold); }

/* editor de markdown (EasyMDE) tematizado */
.modal-editor .EasyMDEContainer { height: 100%; display: flex; flex-direction: column; }
.modal-editor .editor-toolbar {
  background: var(--panel); border: 1px solid var(--wine);
  border-radius: 10px 10px 0 0; opacity: 1; padding: 6px 8px; flex-shrink: 0;
}
.modal-editor .editor-toolbar button {
  color: var(--muted) !important; border: 1px solid transparent; border-radius: 6px;
}
.modal-editor .editor-toolbar button:hover,
.modal-editor .editor-toolbar button.active {
  background: var(--card); border-color: var(--wine); color: var(--gold) !important;
}
.modal-editor .editor-toolbar i.separator { border-left: 1px solid var(--wine); border-right: 0; }
.modal-editor .CodeMirror {
  flex: 1; min-height: 0; background: var(--bg); color: var(--blush);
  border: 1px solid var(--wine); border-top: none; border-radius: 0 0 10px 10px;
  font-family: inherit; font-size: 15px; line-height: 1.7;
}
.modal-editor .CodeMirror-scroll { min-height: 0; }
.modal-editor .CodeMirror-cursor { border-left-color: var(--blush); }
.modal-editor .CodeMirror-selected { background: var(--wine) !important; }
.modal-editor .editor-preview, .modal-editor .editor-preview-side {
  background: var(--bg); color: var(--blush); padding: 16px; line-height: 1.7;
}
.cm-s-easymde .cm-header { color: var(--goldsoft); }
.cm-s-easymde .cm-strong { color: var(--blush); font-weight: 700; }
.cm-s-easymde .cm-em { color: var(--pink); }
.cm-s-easymde .cm-link, .cm-s-easymde .cm-url { color: var(--gold); }
.cm-s-easymde .cm-quote, .cm-s-easymde .cm-comment { color: var(--muted); }

@media (max-width: 820px) {
  .sidebar { display: none; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main { padding: 20px; }
  .modal { height: 90vh; }
}
