/* Cooprativa — client reporting. Brand: black/white with magenta accent. */
:root {
	--bg: #f6f6f8;
	--surface: #ffffff;
	--ink: #111114;
	--ink-2: #212934;
	--muted: #6b6f78;
	--line: #e6e6ea;
	--accent: #ed048a;
	--accent-soft: #fde6f2;
	--google: #64aef4;
	--meta: #7244d1;
	--up: #0f8a5f;
	--up-soft: #e3f5ed;
	--down: #c2361f;
	--down-soft: #fbe9e5;
	--warn-soft: #fff4dc;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(17, 17, 20, 0.04), 0 4px 16px rgba(17, 17, 20, 0.04);
	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	background: var(--bg);
	color: var(--ink);
	font: 15px/1.45 var(--font);
	-webkit-font-smoothing: antialiased;
	font-variant-numeric: tabular-nums;
}
h1, h2 { margin: 0; letter-spacing: -0.01em; }
a { color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* top bar */
.topbar { background: var(--ink); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
/* Official logo is black on transparent with the "Design & Publicidade" line below:
   show only the wordmark (top ~68%) and turn it white for the dark bar. */
.brand { display: inline-flex; height: 22px; overflow: hidden; }
.brand img { display: block; height: 32px; width: auto; filter: invert(1); }
.topbar .x { color: #8a8d95; font-size: 18px; }
.client-mark { height: 40px; width: auto; max-width: 160px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 8px; }
.client-name-mark { font-weight: 600; }
.who { margin-left: auto; color: #a9acb3; font-size: 13px; text-decoration: none; }
.who:hover { color: #fff; }

/* headline + controls */
.headline { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0 18px; }
.headline-id { display: flex; align-items: center; gap: 16px; }
.client-logo-lg { flex: none; width: 112px; height: 84px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); display: grid; place-items: center; padding: 6px; }
.client-logo-lg img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
@media print { .client-logo-lg { box-shadow: none; border: 1px solid var(--line); } }
.headline h1 { font-size: 28px; font-weight: 700; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
select, input[type="date"], input[type="text"] {
	font: inherit; font-size: 14px; color: var(--ink);
	background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.custom-range { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { font: inherit; font-size: 13px; border: 0; background: none; padding: 6px 10px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.btn { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: var(--ink); color: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn.small { font-size: 13px; padding: 6px 10px; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.link { font: inherit; font-size: 12px; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { font: inherit; font-weight: 600; font-size: 14px; border: 0; background: none; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* alerts */
.alert { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--google); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-size: 14px; }
.alert.warn { border-left-color: var(--down); background: var(--down-soft); }
.agency-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: -6px 0 14px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 112px; }
.kpi.accent { background: var(--ink); color: #fff; }
.kpi.accent .kpi-label { color: #b9bcc4; }
.kpi-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.delta { align-self: flex-start; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; margin-top: auto; }
.delta.up { color: var(--up); background: var(--up-soft); }
.delta.down { color: var(--down); background: var(--down-soft); }
.delta.neutral { color: var(--muted); background: #f0f0f3; }
.kpi.accent .delta.neutral { background: rgba(255, 255, 255, 0.12); color: #e2e3e7; }
.empty-delta { color: var(--muted); font-weight: 500; padding-left: 0; }
.empty { grid-column: 1 / -1; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; text-align: center; }
.empty p { margin: 6px 0 0; color: var(--muted); }

/* cards */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 17px; font-weight: 700; }
.card-head small { color: var(--muted); }

/* budget pacing */
.pacing .bar { position: relative; height: 12px; background: #efeff2; border-radius: 999px; overflow: visible; }
.pacing .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.pacing .today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.pacing-row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-top: 12px; font-size: 14px; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; }
.pill.ok { background: var(--up-soft); color: var(--up); }
.pill.warn { background: var(--down-soft); color: var(--down); }
.pill.info { background: #e8f2fd; color: #1f5f9e; }

/* platform split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.split-card { font: inherit; text-align: left; cursor: pointer; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--line); }
.split-card.google { border-top-color: var(--google); }
.split-card.meta { border-top-color: var(--meta); }
.split-card strong { font-size: 22px; }
.split-name { font-weight: 600; font-size: 13px; color: var(--muted); }

/* chart */
.chart-box { position: relative; height: 300px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* table */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.cname { display: flex; gap: 10px; align-items: flex-start; min-width: 220px; }
.pbadge { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; }
.pbadge.google { background: var(--google); }
.pbadge.meta { background: var(--meta); }
.obj { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f0f0f3; color: var(--ink-2); white-space: nowrap; }
.obj.awareness { background: #efe9fb; color: #5631a8; }
.obj.traffic { background: #e8f2fd; color: #1f5f9e; }
.obj.engagement { background: #fff4dc; color: #8a5a00; }
.obj.leads, .obj.sales { background: var(--accent-soft); color: #a3035f; }

/* creatives */
.creatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.creative { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.thumb { aspect-ratio: 1 / 1; background: #f0f0f3; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.creative-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.creative dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 0; }
.creative dl div { background: #f6f6f8; border-radius: 8px; padding: 6px 8px; }
.creative dt { font-size: 11px; color: var(--muted); }
.creative dd { margin: 0; font-weight: 700; }

/* notes */
.note-form { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; margin-bottom: 14px; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.notes li:last-child { border-bottom: 0; }
.notes time { flex: none; width: 96px; font-size: 13px; color: var(--muted); }
.notes p { margin: 0; flex: 1; }

/* footer */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; padding: 8px 0 40px; }

/* agency home */
.page-title { font-size: 26px; margin: 28px 0 18px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; padding-bottom: 40px; }
.client-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; border: 1px solid transparent; }
.client-card:hover { border-color: var(--accent); }
.client-logo { width: 48px; height: 48px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.client-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.client-meta { display: flex; flex-direction: column; }
.client-meta small, .client-spend small { color: var(--muted); font-size: 12px; }
.client-spend { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.message { padding: 60px 24px; }
.login { display: grid; place-items: center; min-height: calc(100vh - 60px); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { font-size: 22px; }
.login-card p { margin: 0; }
.login-card label { font-size: 13px; font-weight: 600; margin-top: 6px; }
.login-card input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.login-card .btn { margin-top: 4px; padding: 11px 14px; }
.login-error { background: var(--down-soft); color: var(--down); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.warn-text { color: var(--down); }
.message p { color: var(--muted); }

.loading .kpis, .loading .card { opacity: 0.55; transition: opacity 0.2s; }

@media (max-width: 720px) {
	.wrap { padding: 0 16px; }
	.headline h1 { font-size: 22px; }
	.client-logo-lg { width: 80px; height: 60px; }
	.kpis { grid-template-columns: 1fr 1fr; }
	.kpi-value { font-size: 22px; }
	.split { grid-template-columns: 1fr; }
	.note-form { grid-template-columns: 1fr 1fr; }
	.note-form input[type="text"], .note-form .btn { grid-column: 1 / -1; }
	.who { display: none; }
	.table-wrap { margin: 0 -16px; padding: 0 16px; }
}

@media print {
	body { background: #fff; }
	.controls, .note-form, .agency-bar, .alert, .link, .tabs, .who { display: none !important; }
	.kpi, .card, .split-card, .empty { box-shadow: none; border: 1px solid var(--line); }
	.card, .kpi, .creative, tr { break-inside: avoid; }
	.topbar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.kpi.accent { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
