:root {
  --bg: #f9f6f2;           /* off-white quente */
  --surface: #ffffff;
  --surface2: #f6f4f1;     /* campos e áreas suaves */
  --line: #ece7e1;
  --text: #344258;         /* azul-acinzentado */
  --muted: #8a93a3;
  --grad: linear-gradient(45deg, #f58170, #f9af77);
  --accent: #f58170;
  --accent-soft: #fdebe5;
  --ok: #2fa774;
  --ok-soft: #e3f5ec;
  --warn: #d98a1c;
  --warn-soft: #fdf1dd;
  --bad: #e2574c;
  --bad-soft: #fde6e3;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(52, 66, 88, .06);
  font-family: 'Poppins', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
h3 { font-size: 12px; font-weight: 600; margin: 20px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1em; margin: 0; font-size: 13px; }
.small { font-size: 12px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Marca */
.logo { font-weight: 700; font-size: 24px; letter-spacing: -.04em; color: var(--text); line-height: 1; }
.logo .dot { color: var(--accent); }
.logo-lg { font-size: 44px; text-align: center; }

/* Login: formulário à esquerda, arte à direita */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; background: #fff; }
.login-side { display: grid; place-items: center; }
.login-form { width: 100%; max-width: 300px; display: grid; gap: 12px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 18px; }
.login-form input { border-radius: 999px; padding: 14px 18px; }
.login-art { border-radius: 24px; background: linear-gradient(160deg, #f6efe6 0%, #f9e4d3 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; overflow: hidden; position: relative; }
.blob { position: relative; width: min(56%, 300px); aspect-ratio: 1; }
.blob-a, .blob-b { position: absolute; inset: 0; border-radius: 50% 50% 50% 18%; background: linear-gradient(200deg, #ffd36b, #f9a85a); box-shadow: 0 30px 60px rgba(245, 129, 112, .25); }
.blob-b { inset: 30% 0 0 0; border-radius: 40% 60% 50% 18%; background: linear-gradient(20deg, #f58170cc, #f9af77aa); }
.blob-icon { position: absolute; inset: 28%; width: 44%; height: 44%; stroke: #fff; stroke-width: 1.3; fill: rgba(255, 255, 255, .25); }
.art-caption { text-align: center; font-size: 18px; font-weight: 500; color: #8a5a3c; margin: 0; }

/* Layout do app */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 26px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: 0 12px; }
.sidebar nav { display: grid; gap: 4px; flex: 1; align-content: start; }
.sidebar nav a, .nav-out { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 11px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; text-decoration: none; }
.sidebar nav a svg, .nav-out svg { color: var(--muted); }
.sidebar nav a:hover { background: var(--surface2); }
.sidebar nav a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(245, 129, 112, .3); }
.sidebar nav a.active svg { color: #fff; }
.nav-out { background: none; border: 0; cursor: pointer; font: inherit; color: var(--muted); }
.nav-out:hover { color: var(--accent); }
main { padding: 32px 36px; min-width: 0; max-width: 1280px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }

/* Cartões e KPIs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 18px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; }
.kpi:first-child { background: var(--grad); border: 0; color: #fff; }
.kpi:first-child .label { color: rgba(255, 255, 255, .85); }
.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Formulários */
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
input, select, textarea { background: var(--surface2); border: 1px solid transparent; color: var(--text); border-radius: 14px; padding: 11px 14px; font: inherit; font-size: 14px; width: 100%; transition: border-color .15s, background .15s; }
input::placeholder, textarea::placeholder { color: #a8abb2; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
input[type=file] { padding: 8px; }
input[type=file]::file-selector-button { border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); padding: 6px 14px; font: inherit; font-weight: 600; margin-right: 10px; cursor: pointer; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Botões em pílula */
.btn { background: #fff; color: var(--text); border: 1px solid #d9d4ce; border-radius: 999px; padding: 9px 18px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; transition: border-color .15s, color .15s, transform .1s, box-shadow .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border: 0; color: #fff; font-weight: 600; padding: 10px 22px; box-shadow: 0 6px 16px rgba(245, 129, 112, .28); }
.btn.primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(245, 129, 112, .38); }
.btn.block { width: 100%; padding: 13px; font-size: 14px; }
.btn.danger { color: var(--bad); border-color: #f2cfcb; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 13px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 8px 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fcfaf8; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface2); color: var(--muted); }
.badge.active, .badge.sent, .badge.approved { background: var(--ok-soft); color: var(--ok); }
.badge.pending, .badge.scheduled, .badge.sending { background: var(--warn-soft); color: var(--warn); }
.badge.expired, .badge.failed, .badge.cancelled { background: var(--bad-soft); color: var(--bad); }
.badge.vip { background: var(--accent-soft); color: var(--accent); }

/* Postagens */
.posts { display: grid; gap: 14px; }
.post { display: grid; grid-template-columns: 150px 1fr; gap: 18px; }
.post .thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; align-content: start; }
.post .thumbs img, .post .thumbs video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--surface2); }
.post .text { white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; line-height: 1.55; }
.post .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.media-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.media-pick .item { position: relative; width: 92px; }
.media-pick img, .media-pick video { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; background: var(--surface2); }
.media-pick .x { position: absolute; top: 4px; right: 4px; background: rgba(52, 66, 88, .75); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs .btn.on { background: var(--text); border-color: var(--text); color: #fff; }

/* Modal e toast */
.modal { position: fixed; inset: 0; background: rgba(52, 66, 88, .35); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-box { background: #fff; border-radius: 24px; width: 100%; max-width: 760px; max-height: 90vh; overflow: auto; padding: 28px; position: relative; box-shadow: 0 30px 80px rgba(52, 66, 88, .2); }
.modal-close { position: absolute; top: 14px; right: 16px; background: var(--surface2); border: 0; color: var(--muted); font-size: 20px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--accent); }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 20; max-width: 420px; box-shadow: 0 10px 30px rgba(52, 66, 88, .25); font-size: 13px; }
.toast.err { background: var(--bad); }
.list { display: grid; gap: 2px; }
.list .li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
.hint { background: #fbf7f2; border: 1px dashed #eadfd3; border-radius: 14px; padding: 12px 14px; color: #7b8494; font-size: 12px; line-height: 1.6; }
code { background: var(--accent-soft); color: #c4594a; padding: 1px 6px; border-radius: 6px; font-size: 12px; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; padding: 16px; }
  .login-art { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; gap: 12px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .sidebar nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .sidebar nav a { padding: 8px 12px; font-size: 13px; }
  main { padding: 20px 16px; }
  .post { grid-template-columns: 1fr; }
}
