:root {
  --ink: #0b1220; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --line-2: #cbd5e1;
  --bg: #f4f6fa; --panel: #ffffff; --soft: #f8fafc;
  --navy: #0b1630; --navy-2: #13224a;
  --em: #059669; --em-2: #10b981; --em-soft: #ecfdf5; --em-line: #a7f3d0;
  --amber: #b45309; --amber-soft: #fffbeb; --amber-line: #fde68a;
  --red: #b91c1c; --red-soft: #fef2f2; --red-line: #fecaca;
  --blue: #1d4ed8; --blue-soft: #eff6ff;
  --li: #0a66c2; --ig: #d62976; --yt: #e11d2e; --mail: #7c3aed; --web: #0f766e;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -16px rgba(15, 23, 42, .25);
  --font: 'Segoe UI', Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; color: var(--ink-2); }
small, .small { font-size: 12px; } .muted { color: var(--muted); } .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
code { word-break: break-all; background: var(--soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

/* layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #cbd5e1; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand .tile { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #a7f3d0, #10b981); display: grid; place-items: center; color: #04120c; font-weight: 900; }
.brand b { color: #fff; font-size: 16px; } .brand b span { color: #34d399; }
.brand small { display: block; color: #94a3b8; font-size: 11px; margin-top: -2px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #cbd5e1; padding: 8px 10px; border-radius: 8px; margin: 1px 0; font-size: 13.5px; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(16,185,129,.16); color: #fff; box-shadow: inset 3px 0 0 #10b981; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 14px 10px 4px; }
.nav .count { margin-left: auto; background: #10b981; color: #04120c; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 26px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.top .title { font-weight: 700; font-size: 16px; }
.top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { padding: 22px 26px 80px; max-width: 1360px; }
.btn.menu-btn { display: none; }

/* components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 460px; margin: 10vh auto; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sp { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.btn { font: inherit; font-weight: 600; font-size: 13px; border-radius: 9px; padding: 8px 14px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn.primary { background: var(--em); border-color: var(--em); color: #fff; }
.btn.primary:hover { background: #047857; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 13.5px; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 260px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(16,185,129,.35); border-color: var(--em-2); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 13px; color: var(--ink); }
.check input { margin-top: 3px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.dot.on { background: var(--em-2); } .dot.warn { background: #f59e0b; } .dot.off { background: #ef4444; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: capitalize; background: var(--soft); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.s-idea { background: #f1f5f9; } .s-draft { background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe; }
.s-approved { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; } .s-scheduled { background: var(--em-soft); color: var(--em); border-color: var(--em-line); }
.s-published { background: var(--em); color: #fff; border-color: var(--em); } .s-manual_required { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.s-failed { background: var(--red-soft); color: var(--red); border-color: var(--red-line); } .s-rejected { color: var(--muted); text-decoration: line-through; }
.s-publishing { background: #fef9c3; }
.pf { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; font-size: 10.5px; font-weight: 800; flex: none; }
.pf-linkedin { background: var(--li); } .pf-instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); } .pf-youtube { background: var(--yt); } .pf-email { background: var(--mail); } .pf-landing { background: var(--web); }

.alert { border-radius: 10px; padding: 10px 14px; border: 1px solid var(--line); background: var(--soft); font-size: 13px; margin-bottom: 12px; }
.alert.warn { background: var(--amber-soft); border-color: var(--amber-line); color: #78350f; }
.alert.bad { background: var(--red-soft); border-color: var(--red-line); color: #7f1d1d; }
.alert.good { background: var(--em-soft); border-color: var(--em-line); color: #064e3b; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.hero { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border: 0; }
.kpi.hero .l, .kpi.hero .s { color: #a7f3d0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--muted); font-weight: 600; cursor: pointer; }
.tabs button.on { color: var(--ink); border-color: var(--em-2); }
.tabs .n { font-size: 11px; background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; margin-left: 4px; }

.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.empty b { color: var(--ink); display: block; font-size: 15px; margin-bottom: 4px; }

.list-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; } .list-item .m { color: var(--muted); font-size: 12px; }

/* editor & previews */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs .th { position: relative; width: 92px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #0b1630; }
.thumbs .th img, .thumbs .th video { width: 100%; display: block; aspect-ratio: 4/5; object-fit: cover; }
.thumbs .th span { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 5px; border-radius: 4px; }
.preview { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.preview .ph { display: flex; gap: 10px; align-items: center; padding: 12px 14px; }
.preview .av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #a7f3d0, #10b981); display: grid; place-items: center; font-weight: 900; color: #04120c; }
.preview .pt { padding: 0 14px 12px; white-space: pre-wrap; font-size: 13.5px; word-wrap: break-word; }
.preview .media { background: #0b1630; position: relative; }
.preview .media img, .preview .media video { width: 100%; display: block; max-height: 560px; object-fit: contain; }
.preview .media .count { position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 99px; font-size: 12px; }
.preview .bar { padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: flex; gap: 18px; }
.carousel-nav { display: flex; justify-content: center; gap: 6px; padding: 8px; }
.carousel-nav i { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; display: block; cursor: pointer; }
.carousel-nav i.on { background: var(--blue); }
.issue { border-left: 3px solid #f59e0b; padding: 6px 10px; background: var(--amber-soft); border-radius: 6px; margin-bottom: 6px; font-size: 12.5px; }
.issue.block { border-color: #ef4444; background: var(--red-soft); }
.slide-ed { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: var(--soft); }
.counter { font-size: 12px; color: var(--muted); text-align: right; }
.counter.over { color: var(--red); font-weight: 700; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dh { padding: 6px 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.cal .day { min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.cal .day.other { background: var(--soft); } .cal .day.today { box-shadow: inset 0 0 0 2px var(--em-2); }
.cal .dn { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal .ev { display: flex; gap: 5px; align-items: center; font-size: 11.5px; padding: 3px 5px; border-radius: 6px; margin-bottom: 3px; cursor: pointer; background: var(--soft); border: 1px solid var(--line); overflow: hidden; }
.cal .ev:hover { border-color: var(--ink-2); }
.cal .ev .pf { width: 16px; height: 16px; font-size: 8px; border-radius: 4px; }
.cal .ev .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.st-idea { border-style: dashed; } .cal .ev.st-scheduled { background: var(--em-soft); border-color: var(--em-line); } .cal .ev.st-published { background: #d1fae5; } .cal .ev.st-failed { background: var(--red-soft); }

/* charts */
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.funnel { display: grid; gap: 8px; }
.funnel .st { display: grid; grid-template-columns: 170px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.funnel .bar { height: 26px; border-radius: 6px; background: linear-gradient(90deg, #10b981, #34d399); min-width: 4px; }
.funnel .bar.b2 { background: linear-gradient(90deg, #0ea5e9, #38bdf8); } .funnel .bar.b3 { background: linear-gradient(90deg, #0b1630, #13224a); }

.json-view h4 { margin: 14px 0 6px; text-transform: capitalize; }
.json-view ul { margin: 0; padding-left: 18px; }
.json-view .obj { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--soft); }
.json-view .k { font-weight: 700; color: var(--ink-2); text-transform: capitalize; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } .toast.bad { background: var(--red); }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: #fff; border-radius: 14px; max-width: 560px; width: 100%; padding: 18px 20px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 30px; justify-content: center; }
.loading .spin { width: 18px; height: 18px; border: 2px solid var(--em-2); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.center-page { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at 80% 0%, rgba(16,185,129,.25), transparent 40%), var(--navy); }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; width: 250px; transform: translateX(-100%); transition: .2s; }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 70px; } .top { padding: 12px 14px; }
  .cal .day { min-height: 80px; } .cal .ev .tt { display: none; }
  .funnel .st { grid-template-columns: 110px 1fr 50px; }
}
