:root {
  --bg: #f5f6f8; --panel: #fff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --primary: #1e3a5f; --accent: #2563eb; --up: #15803d; --down: #b91c1c; --warn: #d97706;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 8px; }
h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--primary); color: #dbe4f0; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 18px; color: #fff; margin: 0 8px 18px; }
.brand span { font-weight: 400; opacity: .7; margin-left: 4px; }
.brand.big { color: var(--primary); font-size: 24px; margin: 0; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #dbe4f0; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 8px; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.nav-title { text-transform: uppercase; font-size: 11px; letter-spacing: .08em; opacity: .6; margin: 18px 10px 4px; }
.me { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; }
.me a { color: #9fc0ff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.lg { width: 14px; height: 14px; }

.content { padding: 24px 28px 48px; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
select, input { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
button { font: inherit; padding: 7px 14px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; cursor: pointer; font-weight: 500; }
button:hover { filter: brightness(1.08); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }
button.pending { background: var(--warn); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card, .panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.panel { margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.account-card { color: inherit; border-top: 4px solid var(--acc); transition: transform .1s; }
.account-card:hover { transform: translateY(-2px); }
.card-title { font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.big-number { font-size: 26px; font-weight: 700; }
.big-number small { font-size: 13px; font-weight: 400; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; }
.kpis span { display: block; font-size: 11px; color: var(--muted); }
.kpis b { font-size: 15px; }
.kpis em { font-style: normal; font-size: 11px; margin-left: 4px; }
.top-post { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.up { color: var(--up); } .down { color: var(--down); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 8px 6px; }
td { border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
.compare td.num:not(:first-child), .compare th:not(:first-child) { text-align: right; }
.strong { font-weight: 600; }
.center { text-align: center; }
.delta { font-size: 11px; margin-left: 6px; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); }
table.small td, table.small th { padding: 6px 4px; font-size: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--panel); padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.check { flex-direction: row !important; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }

.posts-table .caption { margin: 4px 0 2px; max-width: 360px; }
.posts-table tr.boosted { background: #fffbeb; }
.badge { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 2px 6px; border-radius: 6px; background: #eef2ff; color: #3730a3; margin-right: 4px; }
.badge.boost { background: #fef3c7; color: #92400e; }
form.tags { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
form.tags select { padding: 4px 6px; font-size: 12px; }
form.tags button { padding: 4px 8px; font-size: 12px; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.toplist { padding-left: 20px; margin: 0 0 10px; }
.toplist li { margin-bottom: 10px; }

.goal { margin: 10px 0; }
.goal-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar { height: 10px; background: #eef0f3; border-radius: 6px; overflow: hidden; }
.fill { height: 100%; border-radius: 6px; }
.fill.ok { background: var(--up); } .fill.late { background: var(--warn); }
details summary { cursor: pointer; margin: 8px 0; color: var(--accent); }
.report { line-height: 1.6; background: #f9fafb; padding: 12px 14px; border-radius: 8px; }

form.stack { display: flex; flex-direction: column; gap: 12px; }
form.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.demo-banner { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; padding: 8px 12px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; font-size: 13px; }
tr.inactive { opacity: .5; }
td.actions form { display: inline; margin-right: 8px; }
.alert { background: #fee2e2; color: #991b1b; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.alert.info { background: #e0f2fe; color: #075985; }

.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #1e3a5f, #2563eb); }
.login-card { background: #fff; padding: 32px; border-radius: 16px; width: min(380px, 92vw); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card p { margin: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .posts-table { display: block; overflow-x: auto; }
}
