* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Paleta light */
  --bg-page: #F6F3EC;
  --bg-surface: #FFFFFF;
  --bg-surface-2: #FBF8F1;
  --bg-sidebar: #1B1F27;
  --bg-sidebar-hover: #2A2F3A;
  --bg-sidebar-active: #E8A87C;

  --text: #1E2431;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --text-on-dark: #E8ECF3;
  --text-on-dark-muted: #9CA3AF;

  --border: #E8E2D3;
  --border-strong: #D4CBB5;
  --shadow-sm: 0 1px 2px rgba(30, 36, 49, 0.04);
  --shadow-md: 0 4px 12px rgba(30, 36, 49, 0.06);
  --shadow-lg: 0 10px 30px rgba(30, 36, 49, 0.10);

  --accent: #E8A87C;
  --accent-hover: #DE9968;
  --accent-dim: #FBEEE1;
  --accent-text: #6B3A17;

  /* Cores dos empreendimentos (mantidas pra identidade) */
  --colatinna: #5DCAA5;
  --giardino: #AFA9EC;
  --alta-floresta: #E8A87C;
  --aura: #F0997B;
  --essencia: #97C459;
  --institucional: #8892A6;

  /* Fundos suaves dos empreendimentos (pra card) */
  --colatinna-bg: #E4F6EE;
  --giardino-bg: #ECEBF9;
  --alta-floresta-bg: #FBEEE1;
  --aura-bg: #FCE9DF;
  --essencia-bg: #EEF6DF;
  --institucional-bg: #ECEEF2;

  /* Status */
  --status-draft: #6B7280;
  --status-pending: #E8A87C;
  --status-approved: #5CB77A;
  --status-published: #5DCAA5;
}

html, body {
  background: var(--bg-page);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ============ LAYOUT: SIDEBAR + MAIN ============ */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 8px 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #1E2431;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.sidebar-brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 17px;
}

.sidebar-section {
  padding: 14px 12px 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  opacity: 0.7;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-on-dark);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-item:hover { background: var(--bg-sidebar-hover); }
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #1E2431;
  font-weight: 500;
}
.nav-item i { font-size: 18px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ============ MAIN ============ */
.main {
  padding: 32px 40px 48px;
  min-width: 0;
}

.main-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.main-head h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: capitalize;
}
.main-head h1 small {
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 400;
  margin-left: 6px;
}

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

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg-surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn i { font-size: 18px; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #1E2431;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

/* ============ BUTTONS ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary.accent { background: var(--accent); color: #1E2431; }
.btn-primary.accent:hover { background: var(--accent-hover); }
.btn-primary.full { width: 100%; justify-content: center; padding: 14px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { background: var(--bg-surface-2); border-color: var(--border-strong); }
.btn-danger { color: #C0392B !important; }
.btn-danger:hover { background: #FDECEA !important; border-color: #F5B6B0 !important; }

/* ============ DENSITY (barras) ============ */
.density {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.density-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 40px; }
.density-bar .bar {
  width: 8px;
  background: var(--border-strong);
  border-radius: 4px 4px 0 0;
  min-height: 6px;
}
.density-bar .count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}
.density-bar .label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============ TOOLBAR / FILTERS ============ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-group {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  border: none;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); color: white; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip i { font-size: 14px; }

/* ============ CALENDÁRIO ============ */
.calendar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.weekday {
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 6px 0;
  font-weight: 500;
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cell {
  background: var(--bg-surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s;
  cursor: pointer;
}
.cell:hover {
  background: white;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.cell.outside { opacity: 0.4; }
.cell.today {
  background: var(--text);
  color: white;
}
.cell.today .cell-num {
  background: var(--accent);
  color: #1E2431;
}
.cell-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* Post card */
.post {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  background: white;
  border-left: 3px solid var(--institucional);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.15s;
  color: var(--text);
}
.post:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.post .type-icon { font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.post .post-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post .post-thumb {
  width: 22px; height: 22px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}
.post.dragging { opacity: 0.4; cursor: grabbing; }

.post.institucional { border-left-color: var(--institucional); background: var(--institucional-bg); }
.post.colatinna     { border-left-color: var(--colatinna);     background: var(--colatinna-bg); }
.post.giardino      { border-left-color: var(--giardino);      background: var(--giardino-bg); }
.post.alta_floresta { border-left-color: var(--alta-floresta); background: var(--alta-floresta-bg); }
.post.aura          { border-left-color: var(--aura);          background: var(--aura-bg); }
.post.essencia      { border-left-color: var(--essencia);      background: var(--essencia-bg); }

.cell.today .post { background: rgba(255,255,255,0.95); }

.cell.drop-target {
  background: var(--accent-dim);
  border: 2px dashed var(--accent);
}

/* ============ PAINÉIS INFERIORES ============ */
.footer-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 500;
}

.today-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.today-item:first-of-type { border-top: none; padding-top: 0; }
.today-item .thumb {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--bg-surface-2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
}
.today-item .thumb i { font-size: 18px; }
.today-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.today-item .meta { flex: 1; min-width: 0; }
.today-item .title-txt { font-size: 14px; color: var(--text); margin-bottom: 3px; font-weight: 500; }
.today-item .sub { font-size: 12px; color: var(--text-muted); }
.today-item .status {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 5px 10px;
  background: var(--bg-surface-2);
  border-radius: 8px;
  font-weight: 500;
}
.today-item .status.ok   { color: white; background: var(--status-approved); }
.today-item .status.wait { color: white; background: var(--status-pending); }

/* Share panel */
.share-box .code {
  font-family: 'Space Grotesk', monospace;
  font-size: 12px;
  background: var(--bg-surface-2);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  margin-bottom: 12px;
  word-break: break-all;
  border: 1px solid var(--border);
}
.share-actions { display: flex; gap: 8px; }
.share-actions .btn-ghost { flex: 1; }

/* ============ LOGIN / INSTALL (centered) ============ */
.centered {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.card.wide { max-width: 560px; }
.card-logo {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #1E2431;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text);
}
.card p.lead { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.field input, .field select, .field textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field .hint { font-size: 12px; color: var(--text-faint); }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert.error { background: #FDECEA; border-color: #F5B6B0; color: #B0392B; }
.alert.ok    { background: #EAF6EF; border-color: #B7DFC5; color: #2C6B44; }
.alert .code {
  font-family: 'Space Grotesk', monospace;
  font-size: 16px;
  color: var(--text);
  background: white;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
  word-break: break-all;
  border: 1px solid var(--border);
}

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 36, 49, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}
.modal-body .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-body .row .field { margin-bottom: 16px; }
.modal-body textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface-2);
}
.modal-foot .spacer { flex: 1; }

/* ============ MEDIA PICKER ============ */
.media-picker { display: flex; flex-direction: column; gap: 10px; }
.media-drop {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  transition: all 0.15s;
}
.media-drop i { font-size: 28px; display: block; margin-bottom: 8px; color: var(--accent); }
.media-drop .hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.media-drop.dragging { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }
.media-drop.uploading { opacity: 0.5; }
.linklike {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font: inherit; padding: 0; text-decoration: underline;
}
.media-preview {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface-2);
  max-height: 280px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.media-preview img { max-width: 100%; max-height: 280px; display: block; }
.media-preview .video-icon {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
}
.media-preview .video-icon i { font-size: 32px; display: block; margin-bottom: 6px; color: var(--accent); }
.media-preview .video-icon span { font-size: 12px; word-break: break-all; }
.media-actions { display: flex; gap: 8px; }
.media-actions .btn-ghost { flex: 1; }

/* ============ BIBLIOTECA (grid) ============ */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.library-item {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface-2);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.library-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.library-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.library-item .video-icon i { font-size: 36px; color: var(--text-muted); }

/* ============ SHARE (public) ============ */
.cell.readonly, .cell.readonly .post { cursor: default; }
.cell.readonly:hover { background: var(--bg-surface-2); border-color: transparent; box-shadow: none; }

/* ============ RESPONSIVO ============ */
@media (max-width: 1100px) {
  .footer-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 20px 8px; }
  .sidebar-brand-name, .sidebar-section, .nav-item span:not(.sidebar-brand-logo) { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .main { padding: 24px 20px; }
  .main-head h1 { font-size: 24px; }
  .cell { min-height: 90px; padding: 6px; }
  .post { font-size: 10px; padding: 5px 7px; }
  .modal-body .row { grid-template-columns: 1fr; }
}
