:root {
  --bg: #f4f6f7;
  --card: #fff;
  --ink: #1d2a30;
  --muted: #64737a;
  --line: #e2e7ea;
  --brand: #0E1C31;
  --brand-2: #094FEA;
  --accent: #4F86FF;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --bad: #c0392b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 'Open Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { font-family: Montserrat, sans-serif; margin: 0 0 12px; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; }

.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.app.with-ai { grid-template-columns: 220px 1fr 420px; }
.side { background: var(--brand); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { font: 800 18px Montserrat, sans-serif; padding: 6px 10px 18px; letter-spacing: .02em; }
.side .logo small { display: block; font: 400 12px 'Open Sans'; opacity: .7; letter-spacing: 0; }
.side a { color: #fff; text-decoration: none; padding: 9px 12px; border-radius: 8px; opacity: .85; display: flex; align-items: center; gap: 10px; }
.side a:hover { background: rgba(255,255,255,.08); opacity: 1; }
.side a.active { background: rgba(255,255,255,.16); opacity: 1; font-weight: 600; }
.side .spacer { flex: 1; }
.side .ai-btn { background: var(--brand-2); color: #fff; font-weight: 700; border: 0; border-radius: 8px; padding: 10px 12px; cursor: pointer; text-align: left; }
.side .user { font-size: 12px; opacity: .75; padding: 10px 12px 0; }
.side .user button { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; padding: 0; font-size: 12px; }

main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.pad-0 { padding: 0; overflow: hidden; }
.stat { font: 800 30px Montserrat, sans-serif; }
.stat-label { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #eef2f4; color: var(--muted); }
.tag.ok { background: #e3f4ea; color: var(--ok); }
.tag.bad { background: #fbe9e7; color: var(--bad); }
.tag.warn { background: #fdf3e1; color: var(--warn); }
.tag.ai { background: #ece9fb; color: #5a45c7; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #c9d2d6; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: #eef2f4; color: var(--ink); }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%;
}
textarea { resize: vertical; min-height: 80px; }
input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }

.preview-16x9 { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 8px; overflow: hidden; }
.preview-16x9 > .inner { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.preview-16x9 img, .preview-16x9 video { width: 100%; height: 100%; object-fit: cover; display: block; }

.media-card .thumb { position: relative; padding-top: 56.25%; background: #111; }
.media-card .thumb > * { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.media-card .meta { padding: 10px 12px; }
.media-card .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #b8c2c7; }
.dot.on { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,.2); }

.modal-bg { position: fixed; inset: 0; background: rgba(15,30,36,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 980px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 60; max-width: 420px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }

.pl-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 6px; }
.pl-item .num { width: 22px; color: var(--muted); font-size: 12px; text-align: right; }
.pl-item .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item .mini { width: 72px; height: 40px; border-radius: 4px; overflow: hidden; background: #000; position: relative; flex: none; }
.pl-item .mini img, .pl-item .mini video { width: 100%; height: 100%; object-fit: cover; }

.days { display: flex; gap: 4px; }
.days button { width: 34px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 12px; }
.days button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Painel do Claude */
.ai { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; }
.ai-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.ai-head h2 { margin: 0; font-size: 16px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; min-height: 0; }
.ai-msgs > * { margin-bottom: 10px; }
.bubble { padding: 10px 12px; border-radius: 12px; max-width: 92%; width: fit-content; white-space: pre-wrap; }
.bubble.user { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bubble.bot { background: #f1f4f6; border-bottom-left-radius: 4px; }
.bubble.err { background: #fbe9e7; color: var(--bad); }
.ai-input { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; }
.ai-input textarea { min-height: 44px; height: 44px; max-height: 140px; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-suggest button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 10px; font-size: 13px; cursor: pointer; text-align: left; }
.proposal { flex: none; border: 1px solid #d9d2fa; background: #faf9ff; border-radius: 12px; padding: 12px; }
.proposal .act { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed #e2ddfb; }
.proposal .act:first-of-type { border-top: 0; }
.proposal .act .desc { flex: 1; min-width: 0; font-size: 13px; }
.proposal .post-prev { width: 100%; margin-top: 6px; }
.typing { color: var(--muted); font-size: 13px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0E1C31, #094FEA); }
.login { background: #fff; border-radius: 14px; padding: 30px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.now-playing { font-size: 13px; color: var(--muted); }
.swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0,0,0,.1); vertical-align: middle; }
.bar { height: 8px; background: #eef2f4; border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--brand-2); }
.bar.alert > div { background: var(--bad); }
