/* planner — visual inspirado no Planner do Painel Profissional do Facebook */
:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #050505;
  --text-2: #65676b;
  --text-3: #8a8d91;
  --divider: #ced0d4;
  --line: #e4e6eb;
  --hover: #f2f2f2;
  --press: #e4e6eb;
  --blue: #0866ff;
  --blue-hover: #0957d6;
  --blue-soft: #ebf5ff;
  --blue-text: #0064d1;
  --red: #e41e3f;
  --red-soft: #ffebe9;
  --green: #31a24c;
  --green-soft: #e3f5e7;
  --orange: #e8800c;
  --orange-soft: #fff3e0;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .1);
  --shadow-2: 0 12px 28px rgba(0, 0, 0, .2), 0 2px 4px rgba(0, 0, 0, .1);
  --radius: 8px;
  --top: 56px;
  --side: 320px;
  --hour: 84px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Historic", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.34 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2, .clamp-3, .clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; } .clamp-3 { -webkit-line-clamp: 3; } .clamp-4 { -webkit-line-clamp: 4; }
svg.i { width: 20px; height: 20px; flex: none; fill: currentColor; vertical-align: middle; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- topo ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 40; background: var(--card);
  box-shadow: var(--shadow-1); display: flex; align-items: center; gap: 8px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 20px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 22px; height: 22px; }
.top-tabs { position: absolute; left: 50%; transform: translateX(-50%); display: flex; height: 100%; }
.top-tabs a {
  width: 112px; display: grid; place-items: center; color: var(--text-2); border-bottom: 3px solid transparent;
  margin-top: 3px; border-radius: 8px 8px 0 0;
}
.top-tabs a:hover { background: var(--hover); text-decoration: none; }
.top-tabs a svg { width: 26px; height: 26px; }
.top-tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }
.top-tabs a.active:hover { background: none; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.round-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--press);
  display: grid; place-items: center; color: var(--text);
}
.round-btn:hover { background: #d8dadf; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--red);
  color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; padding: 0 5px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: inline-grid;
  place-items: center; color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--hover); }
.only-drawer { display: none; }
.menu-wrap { position: relative; }

/* ---------- barra lateral ---------- */
.sidebar {
  position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); background: var(--card); z-index: 30;
  box-shadow: 1px 0 2px rgba(0, 0, 0, .1); display: flex; flex-direction: column; padding: 12px 8px 0;
}
.sidebar-head { padding: 8px 8px 12px; }
.sidebar-head h1 { font-size: 24px; font-weight: 700; }
.side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--text);
  font-weight: 500; font-size: 16px;
}
.side-nav a:hover { background: var(--hover); text-decoration: none; }
.side-nav a.active { background: var(--bg); }
.nav-icon {
  width: 36px; height: 36px; border-radius: 50%; background: var(--press); display: grid; place-items: center; color: var(--text);
}
.side-nav a.active .nav-icon { background: var(--blue); color: #fff; }
.sidebar-status { padding: 8px; margin-top: auto; }
.sidebar-foot { padding: 12px 8px 16px; border-top: 1px solid var(--line); background: var(--card); }

.account-switch { padding: 0 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; position: relative; }
.acc-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 8px;
  background: transparent; text-align: left;
}
.acc-btn:hover { background: var(--hover); }
.acc-btn .name { font-weight: 600; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: linear-gradient(135deg, #feda75, #d62976 50%, #4f5bd5);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; overflow: hidden;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.xs { width: 20px; height: 20px; font-size: 10px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 29; }

/* ---------- conteúdo ---------- */
.main { margin-left: var(--side); padding: calc(var(--top) + 16px) 16px 24px; min-height: 100vh; }
.view { max-width: 1400px; margin: 0 auto; }
.loading { padding: 48px; text-align: center; color: var(--text-2); }
.banner-area { max-width: 1400px; margin: 0 auto; }
.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px;
  background: var(--card); box-shadow: var(--shadow-1); border-left: 4px solid var(--orange);
}
.banner.error { border-left-color: var(--red); }
.banner.info { border-left-color: var(--blue); }
.banner svg { color: var(--orange); margin-top: 1px; }
.banner.error svg { color: var(--red); }
.banner.info svg { color: var(--blue); }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { font-size: 24px; font-weight: 700; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px; }
.card-head h3 { font-size: 17px; font-weight: 700; }
.card-body { padding: 8px 16px 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.empty { padding: 32px 16px; text-align: center; color: var(--text-2); }
.empty svg { width: 40px; height: 40px; color: var(--text-3); margin-bottom: 8px; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 6px; border: 0; font-weight: 600; font-size: 15px; background: var(--press); color: var(--text);
  white-space: nowrap; text-decoration: none !important;
}
.btn:hover { background: #d8dadf; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-soft { background: var(--blue-soft); color: var(--blue-text); }
.btn-soft:hover { background: #dbe7f2; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #ffd6d3; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 14px; }
.btn-lg { height: 48px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }
.btn-group .btn + .btn { margin-left: 1px; }

.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--divider); background: #fff;
  outline: none; font-size: 15px;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(8, 102, 255, .2); }
.input-lg { height: 52px; font-size: 17px; padding: 0 16px; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
select.input { padding-right: 32px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7l5 6 5-6z' fill='%2365676b'/%3E%3C/svg%3E") no-repeat right 8px center / 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-weight: 600; font-size: 14px; }
.hint { font-size: 13px; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.counter { font-size: 12px; color: var(--text-2); text-align: right; }
.counter .over { color: var(--red); font-weight: 600; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #bcc0c4; border-radius: 24px; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: var(--shadow-1); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(20px); }

.seg { display: inline-flex; background: var(--bg); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
}
.seg button svg { width: 18px; height: 18px; }
.seg button.on { background: #fff; color: var(--blue-text); box-shadow: var(--shadow-1); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--divider); background: #fff; border-radius: 16px; padding: 4px 12px; font-size: 13px; font-weight: 600;
}
.chip:hover { background: var(--hover); }
.chip.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-text); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px;
  font-weight: 600; background: var(--press); color: var(--text-2); white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; }
.pill.published { background: var(--green-soft); color: #1d7a35; }
.pill.scheduled, .pill.preparing, .pill.ready, .pill.publishing { background: var(--blue-soft); color: var(--blue-text); }
.pill.failed { background: var(--red-soft); color: var(--red); }
.pill.missed { background: var(--orange-soft); color: #a85b00; }
.pill.draft, .pill.canceled { background: var(--press); color: var(--text-2); }

.alert { padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.alert-error { background: var(--red-soft); color: #a3001d; }
.alert-warn { background: var(--orange-soft); color: #8a4b00; }
.alert-info { background: var(--blue-soft); color: #00449e; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- menus, popovers, modais, avisos ---------- */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border-radius: 8px;
  box-shadow: var(--shadow-2); padding: 8px; z-index: 60;
}
.dropdown.left { left: 0; right: auto; }
.dropdown-title { padding: 6px 8px 10px; font-weight: 700; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 6px; border: 0;
  background: transparent; color: var(--text); text-align: left; font-weight: 500;
}
.dropdown-item:hover { background: var(--hover); text-decoration: none; }
.dropdown-item .check { margin-left: auto; color: var(--blue); }
.dropdown-sep { height: 1px; background: var(--line); margin: 6px 0; }
.radio-dot { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #8a8d91; flex: none; }
.radio-dot.on { border: 6px solid var(--blue); }
.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.checkbox-row:hover { background: var(--hover); }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--blue); }

.panel {
  position: fixed; top: calc(var(--top) + 4px); right: 16px; width: 380px; max-height: calc(100vh - var(--top) - 24px);
  background: #fff; border-radius: 8px; box-shadow: var(--shadow-2); z-index: 60; display: flex; flex-direction: column;
}
.panel-head { display: flex; align-items: center; padding: 12px 12px 4px 16px; }
.panel-head h3 { font-size: 22px; flex: 1; }
.panel-body { overflow-y: auto; padding: 4px 8px 8px; }
.notif { display: flex; gap: 10px; padding: 8px; border-radius: 8px; }
.notif:hover { background: var(--hover); }
.notif .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--blue); }
.notif.error .dot { background: var(--red); } .notif.warning .dot { background: var(--orange); }
.notif.read { opacity: .65; }
.notif .body { white-space: pre-line; font-size: 14px; color: var(--text-2); }

.popover {
  position: fixed; z-index: 70; width: 340px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-2);
  overflow: hidden; animation: pop .12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.pop-media { position: relative; background: #000; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.pop-media img { width: 100%; height: 100%; object-fit: contain; }
.pop-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.metric { background: var(--bg); border-radius: 6px; padding: 6px 8px; }
.metric b { display: block; font-size: 16px; }
.metric span { font-size: 12px; color: var(--text-2); }
.pop-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.pop-list button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 6px; border-radius: 8px; text-align: left; }
.pop-list button:hover { background: var(--hover); }
.pop-list img, .pop-list .ph { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; }

.modal-wrap {
  position: fixed; inset: 0; z-index: 80; background: rgba(244, 244, 244, .8); display: flex; align-items: center;
  justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-2); width: 100%; max-width: 520px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal.wide { max-width: 1040px; }
.modal-head { display: flex; align-items: center; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; text-align: center; font-size: 20px; padding-left: 36px; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }

.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #fff; color: var(--text); padding: 12px 14px; border-radius: 8px; box-shadow: var(--shadow-2); max-width: 380px;
  display: flex; gap: 10px; align-items: flex-start; font-size: 14px; animation: pop .15s ease-out;
}
.toast.error svg { color: var(--red); } .toast.ok svg { color: var(--green); }

/* ---------- planner ---------- */
.planner { display: flex; flex-direction: column; height: calc(100vh - var(--top) - 40px); min-height: 520px; }
.planner-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 8px; flex-wrap: wrap; }
.range-btn { border: 0; background: none; padding: 0; font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 4px; text-align: left; }
.range-btn:hover { text-decoration: underline; }
.tz-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.planner-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid transparent; }
.cal-days { display: grid; grid-template-columns: 104px repeat(var(--cols), minmax(0, 1fr)); padding: 0 12px 6px; }
.cal-days div { text-align: center; font-size: 13px; color: var(--text-2); font-weight: 600; padding: 4px 0; }
.cal-days div span { padding: 3px 10px; border-radius: 6px; display: inline-block; }
.cal-days div.today span { background: var(--blue-soft); color: var(--blue-text); }
.cal-days div.clickable { cursor: pointer; }
.cal-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 12px 12px; position: relative; }
.cal-grid { display: grid; grid-template-columns: 104px repeat(var(--cols), minmax(0, 1fr)); position: relative; }
.hour-label { height: var(--hour); position: relative; }
.hour-label span { position: absolute; top: -8px; right: 10px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.cell {
  height: var(--hour); border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 6px 4px;
  position: relative; display: flex; justify-content: center; align-items: flex-start;
}
.cell.past { background: #fafbfc; }
.cell:not(.past):hover { background: #f7f8fa; }
.cell.drop { background: var(--blue-soft); outline: 2px dashed var(--blue); outline-offset: -2px; }
.cell .add {
  position: absolute; inset: 4px; border: 0; background: transparent; border-radius: 6px; color: var(--blue); opacity: 0;
  display: grid; place-items: center;
}
.cell:not(.past):hover .add { opacity: 1; }
.now-line { position: absolute; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

.pcard {
  position: relative; width: 100%; max-width: 140px; height: 68px; border-radius: 8px; overflow: hidden; border: 0; padding: 0;
  background: #c9ccd1 center / cover no-repeat; flex: none; z-index: 1; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.pcard:hover { box-shadow: 0 0 0 2px var(--blue); }
.pcard.dim { opacity: .55; }
.pcard .type {
  position: absolute; left: 6px; top: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}
.pcard .type svg { width: 16px; height: 16px; }
.pcard .tag {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; background: #fff;
  border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 700; color: var(--text); max-width: calc(100% - 12px);
}
.pcard .tag svg { width: 13px; height: 13px; }
.pcard .tag.failed { background: var(--red); color: #fff; }
.pcard .tag.missed { background: var(--orange); color: #fff; }
.pcard .tag.draft { background: #e4e6eb; color: var(--text-2); }
.pcard .acc { position: absolute; right: 5px; top: 5px; }
.pcard.stack { overflow: visible; }
.pcard.stack::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: -5px; height: 6px; border-radius: 0 0 8px 8px;
  background: #d8dadf; z-index: -1;
}
.pcard.dragging { opacity: .4; }
.pcard .ph-ico { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 12px 12px; }
.mcell { min-height: 112px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 6px; cursor: pointer; }
.mcell:hover { background: #f7f8fa; }
.mcell.other { background: #fafbfc; color: var(--text-3); }
.mcell .d { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.mcell.today .d span { background: var(--blue); color: #fff; border-radius: 12px; padding: 1px 7px; }
.mthumbs { display: flex; gap: 3px; flex-wrap: wrap; }
.mthumbs i { width: 30px; height: 30px; border-radius: 4px; background: #c9ccd1 center / cover; display: block; position: relative; }
.mthumbs i.failed { outline: 2px solid var(--red); }
.mthumbs i.scheduled { outline: 2px solid var(--blue); outline-offset: -2px; }
.mmore { font-size: 12px; color: var(--text-2); font-weight: 600; }

.overview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; padding: 0 12px 12px; flex: 1; overflow-y: auto; }
.ocol { border-left: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 200px; }
.oitem { display: flex; gap: 6px; align-items: center; border: 0; background: #fff; border-radius: 6px; padding: 4px; text-align: left; box-shadow: var(--shadow-1); }
.oitem:hover { box-shadow: 0 0 0 2px var(--blue); }
.oitem i { width: 40px; height: 40px; border-radius: 4px; background: #c9ccd1 center / cover; flex: none; }
.oitem b { font-size: 12px; display: block; }
.oitem small { font-size: 11px; color: var(--text-2); }

.agenda { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.aday { margin-top: 12px; }
.aday h4 { font-size: 14px; color: var(--text-2); padding: 6px 4px; }
.aday h4.today { color: var(--blue-text); }
.aitem { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: #fff; padding: 8px; border-radius: 8px; text-align: left; }
.aitem:hover { background: var(--hover); }
.aitem i { width: 64px; height: 64px; border-radius: 8px; background: #c9ccd1 center / cover; flex: none; position: relative; }
.aitem i svg { position: absolute; left: 4px; top: 4px; width: 14px; height: 14px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.aitem .t { font-weight: 700; }

/* ---------- compositor ---------- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; flex: 1; overflow: hidden; }
.composer-form { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.composer-preview { background: #fff; border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.csec { background: #fff; border-radius: 8px; padding: 14px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 10px; }
.csec h4 { font-size: 16px; }
.drop-zone {
  border: 2px dashed var(--divider); border-radius: 8px; padding: 20px; text-align: center; color: var(--text-2);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-text); }
.drop-zone svg { width: 32px; height: 32px; }
.mlist { display: flex; flex-direction: column; gap: 8px; }
.mitem { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; background: var(--bg); }
.mitem .th { width: 56px; height: 56px; border-radius: 6px; background: #c9ccd1 center / cover; flex: none; display: grid; place-items: center; color: #fff; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .2s; }
.when-opts { display: flex; flex-direction: column; gap: 6px; }
.when-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.when-opt:hover { background: var(--hover); }
.when-opt.on { border-color: var(--blue); background: var(--blue-soft); }
.when-opt input { margin-top: 3px; accent-color: var(--blue); }
.phone {
  width: 270px; aspect-ratio: 9 / 16; background: #000; border-radius: 28px; border: 8px solid #1c1e21; overflow: hidden;
  position: relative; flex: none; box-shadow: var(--shadow-2); color: #fff;
}
.phone.feed { aspect-ratio: auto; height: auto; min-height: 420px; background: #fff; color: var(--text); }
.phone video, .phone img.full { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone .ov { position: absolute; left: 10px; right: 46px; bottom: 14px; font-size: 12px; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.phone .ov b { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.phone .side { position: absolute; right: 8px; bottom: 18px; display: flex; flex-direction: column; gap: 14px; }
.phone .side svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.phone .story-bar { position: absolute; top: 8px; left: 8px; right: 8px; height: 2px; background: rgba(255,255,255,.5); border-radius: 2px; }
.phone .story-head { position: absolute; top: 16px; left: 10px; display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; }
.feed-head { display: flex; align-items: center; gap: 8px; padding: 10px; font-weight: 600; font-size: 13px; }
.feed-media { position: relative; background: #efefef; }
.feed-media img, .feed-media video { width: 100%; display: block; }
.feed-dots { display: flex; gap: 4px; justify-content: center; padding: 8px; }
.feed-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c9ccd1; }
.feed-dots i.on { background: var(--blue); }
.feed-cap { padding: 0 10px 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.car-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); display: grid; place-items: center; }
.car-nav.l { left: 6px; } .car-nav.r { right: 6px; }
.preview-empty { color: var(--text-3); display: grid; place-items: center; height: 100%; text-align: center; padding: 20px; font-size: 13px; }

/* ---------- tabelas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 14px 12px 12px; font-weight: 600; color: var(--text-2); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--blue-text); border-bottom-color: var(--blue); }
.tabs .count { font-weight: 500; color: var(--text-3); margin-left: 4px; }
.toolbar { display: flex; gap: 8px; padding: 12px 16px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1; min-width: 180px; max-width: 360px; }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--text-2); }
.search input { padding-left: 38px; border-radius: 20px; background: var(--bg); border-color: transparent; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f7f8fa; }
.table .post-cell { display: flex; gap: 10px; align-items: center; min-width: 260px; max-width: 420px; }
.table .post-cell i { width: 48px; height: 48px; border-radius: 6px; background: #c9ccd1 center / cover; flex: none; position: relative; }
.table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.lib-cards { display: none; }
.load-more { padding: 12px; text-align: center; }

/* ---------- insights ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: 8px; box-shadow: var(--shadow-1); padding: 14px; }
.kpi .l { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 700; margin: 4px 0 2px; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); } .delta.flat { color: var(--text-2); }
.chart { width: 100%; height: 260px; position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-2); font-size: 11px; }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line2 { fill: none; stroke: #f5533d; stroke-width: 2; stroke-dasharray: 5 4; }
.chart .area { fill: rgba(8, 102, 255, .08); }
.chart .tip {
  position: absolute; background: #fff; box-shadow: var(--shadow-2); border-radius: 6px; padding: 6px 8px; font-size: 12px;
  pointer-events: none; white-space: nowrap; transform: translate(-50%, -110%);
}
.chart .hover-line { stroke: var(--text-3); stroke-dasharray: 3 3; }
.chart .dot { fill: var(--blue); stroke: #fff; stroke-width: 2; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 3px; background: var(--blue); vertical-align: middle; margin-right: 5px; }
.legend i.b { background: #f5533d; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--text-2); }
.heat .h { text-align: center; }
.heat .d { display: flex; align-items: center; font-weight: 600; }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: var(--bg); position: relative; }
.heat .c:hover { outline: 2px solid var(--text); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; }
.bar { height: 12px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.bar i.b { background: #f5533d; }
.rank { display: flex; flex-direction: column; }
.rank a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; color: var(--text); }
.rank a:hover { background: var(--hover); text-decoration: none; }
.rank i { width: 52px; height: 52px; border-radius: 6px; background: #c9ccd1 center / cover; flex: none; }
.rank .n { font-weight: 700; color: var(--text-2); width: 18px; text-align: center; }

/* ---------- configurações ---------- */
.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--top) + 16px); padding: 8px; }
.settings-nav button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 10px; border-radius: 8px; font-weight: 600; text-align: left; }
.settings-nav button:hover { background: var(--hover); }
.settings-nav button.on { background: var(--blue-soft); color: var(--blue-text); }
.set-section { display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; word-break: break-word; }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.acc-row:last-child { border-bottom: 0; }
.diskbar { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; display: flex; }
.diskbar i { background: var(--blue); } .diskbar i.o { background: #8ab4f8; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tl:last-child { border-bottom: 0; }

/* ---------- post ---------- */
.post-detail { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.post-media { background: #000; border-radius: 8px; overflow: hidden; display: grid; place-items: center; aspect-ratio: 9 / 16; max-height: 640px; }
.post-media img, .post-media video { width: 100%; height: 100%; object-fit: contain; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { display: flex; gap: 64px; align-items: center; max-width: 980px; width: 100%; justify-content: center; flex-wrap: wrap; }
.login-brand { max-width: 420px; }
.login-brand h1 { color: var(--blue); font-size: 56px; font-weight: 800; letter-spacing: -1px; margin: 12px 0 8px; }
.login-brand p { font-size: 22px; line-height: 1.3; margin: 0; }
.login-card { width: 396px; max-width: 100%; background: #fff; border-radius: 8px; box-shadow: var(--shadow-2); padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- responsivo ---------- */
.bottom-nav { display: none; }
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer { grid-template-columns: minmax(0, 1fr) 300px; }
  .phone { width: 230px; }
}
@media (max-width: 1100px) {
  .only-drawer { display: inline-grid; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 45; top: 0; padding-top: 16px; }
  body.drawer-open .sidebar { transform: none; box-shadow: var(--shadow-2); }
  .main { margin-left: 0; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .settings-nav button { width: auto; white-space: nowrap; }
  .post-detail { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .top-tabs a { width: 72px; }
  .composer { grid-template-columns: 1fr; overflow-y: auto; }
  .composer-form { overflow: visible; }
  .composer-preview { border-left: 0; border-top: 1px solid var(--line); }
  .grid-2 { grid-template-columns: 1fr; }
  .post-detail { grid-template-columns: 1fr; }
  .post-media { max-height: 70vh; aspect-ratio: auto; }
}
@media (max-width: 767px) {
  :root { --hour: 76px; }
  .top-tabs { display: none; }
  .brand-name { font-size: 18px; }
  .topbar { padding: 0 8px; }
  .main { padding: calc(var(--top) + 12px) 12px calc(76px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; box-shadow: 0 -1px 2px rgba(0,0,0,.1);
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); align-items: center; justify-content: space-around;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-2); font-size: 11px; flex: 1; }
  .bottom-nav a.active { color: var(--blue); }
  .bottom-nav a:hover { text-decoration: none; }
  .fab { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-2); flex: none; }
  .sidebar-foot { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 22px; }
  .page-head h2 { font-size: 20px; }
  .planner { height: calc(100vh - var(--top) - 100px); }
  .planner-head { padding: 12px 12px 8px; }
  .planner-tools { margin-left: 0; width: 100%; }
  .range-btn { font-size: 17px; }
  .cal-days, .cal-grid { grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); }
  .hour-label span { font-size: 11px; right: 6px; }
  .month { padding: 0 4px 8px; }
  .mcell { min-height: 72px; padding: 3px; }
  .mthumbs i { width: 18px; height: 18px; }
  .modal-wrap { padding: 0; align-items: stretch; }
  .modal { max-width: none !important; max-height: none; height: 100% !important; border-radius: 0; }
  .popover { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; border-radius: 14px 14px 0 0; max-height: 85vh; overflow-y: auto; }
  .panel { left: 8px; right: 8px; width: auto; }
  .table-wrap.lib { display: none; }
  .lib-cards { display: flex; flex-direction: column; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .heat { grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 1px; font-size: 8px; }
  .bar-row { grid-template-columns: 80px 1fr 56px; }
  .field-row { grid-template-columns: 1fr; }
  .login { gap: 24px; }
  .login-brand { text-align: center; }
  .login-brand h1 { font-size: 40px; }
  .login-brand p { font-size: 18px; }
  .toasts { bottom: calc(72px + env(safe-area-inset-bottom)); left: 8px; right: 8px; }
  .tl { grid-template-columns: 1fr; gap: 2px; }
}
