@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --cream: #F4F0E9;
  --cream-deep: #E7E0D2;
  --surface: #ffffff;
  --ink: #17140F;
  --ink-soft: #6B6355;
  --gold: #BDAD7B;
  --gold-deep: #86713C;
  --border: #E3DDD0;
  --good: #3F6B42;
  --bad: #A5433A;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: 'Space Grotesk', -apple-system, 'Segoe UI', sans-serif; line-height: 1.5; font-size: 15px;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--ink-soft); font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.late { color: var(--bad); font-weight: 700; }
.pad { padding: 18px 20px; }

/* ── Fejléc ─────────────────────────────── */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; min-height: 58px; flex-wrap: wrap; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; font-size: 12px; letter-spacing: .12em; font-weight: 600; padding: 8px 0; }
.brand b { color: var(--gold); font-size: 15px; letter-spacing: .18em; margin-top: 3px; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 18px 12px 15px; font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent; opacity: .85; }
.nav a:hover { opacity: 1; }
.nav a.active { border-bottom-color: var(--gold); opacity: 1; }
.userbox { display: flex; align-items: center; gap: 14px; font-size: 13px; opacity: .9; }
.userbox form { margin: 0; }
.link-btn { background: none; border: 0; color: var(--gold); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 26px 20px 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; font-weight: 700; }
.page-head .muted { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-h { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 26px 0 12px; }
.card .section-h:first-child, .form .section-h:first-child { margin-top: 0; }

/* ── Gombok, űrlapok ───────────────────── */
.btn {
  display: inline-block; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #000; }
.btn-danger { color: var(--bad); border-color: #E2C3BE; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-block { width: 100%; text-align: center; }
.push-right { margin-left: auto; }
summary.btn { list-style: none; display: inline-block; }
summary.btn::-webkit-details-marker { display: none; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date],
input[type=datetime-local], input[type=month], select, textarea {
  font: inherit; font-size: 14px; width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
textarea { resize: vertical; }
.w-num { max-width: 120px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin-right: 18px; }
.check input { width: auto; }
.checks { margin: 8px 0 4px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; align-items: center; }
.proof { font-size: 14px; }

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

.filters {
  display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 2px; margin-bottom: 18px;
}
.filters .field { margin-bottom: 12px; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }
.filters .btn { margin-bottom: 12px; }

.flash { padding: 11px 15px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash-ok { background: #E4F0E1; border-color: #BFD8BA; color: #2F5A31; }
.flash-error { background: #F8E5E2; border-color: #E8BDB7; color: #8C3028; }

/* ── Kártyák, csempék ───────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.chan-card { padding: 16px 18px; }
.chan-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.chan-card h3 { font-size: 17px; }
.ext { font-size: 12px; color: var(--gold-deep); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.stats div { background: var(--cream); border-radius: 8px; padding: 8px 9px; min-width: 0; }
.stats dt { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); line-height: 1.25; min-height: 26px; }
.stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; }
.chan-card footer { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 12px; }
.chan-card footer a { margin-left: auto; font-weight: 700; color: var(--gold-deep); text-decoration: none; }
.chan { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.chan i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.tile { text-decoration: none; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; }
.tile b { font-size: 28px; line-height: 1.1; }
.tile span { font-size: 12px; font-weight: 600; }
.tile:hover { border-color: var(--ink); }
.attention { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.attention a { background: #FFF6E0; border: 1px solid #EBD79C; border-radius: 9px; padding: 9px 14px; text-decoration: none; font-size: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; align-items: start; }
.two-col .card { padding: 16px 18px; }

/* ── Státusz-színek ─────────────────────── */
.st-planned, .tk-new { background: #ECE8DF; color: #5A5345; }
.st-draft { background: #F6E7C8; color: #8A6416; }
.st-review, .tk-wait { background: #FBE0C9; color: #A4511A; }
.st-approved, .tk-prog { background: #D9E8F6; color: #1F5C99; }
.st-scheduled { background: #E3DAF2; color: #5B3D99; }
.st-published, .tk-done { background: #D8EBD6; color: #2F6B34; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ── Táblázat ───────────────────────────── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.done td { opacity: .55; }
.tbl a { text-decoration: none; font-weight: 600; }
.tbl a:hover { text-decoration: underline; }
.tbl input { min-width: 0; }
.inline-status { margin: 0; }
.sel-status { width: auto; padding: 5px 10px; border: 0; border-radius: 999px; font-weight: 600; font-size: 12px; cursor: pointer; }

/* ── Naptár ─────────────────────────────── */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 700; padding: 4px 0; }
.cal-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--gold-deep); }
.cal-day { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-decoration: none; padding: 1px 6px; border-radius: 6px; }
.cal-day:hover { background: var(--cream-deep); }
.cal-item { display: block; text-decoration: none; font-size: 11px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; border-left: 4px solid; overflow: hidden; }
.cal-item b { font-weight: 700; }

.comment { border-bottom: 1px solid var(--border); padding: 10px 0; }
.comment p { margin: 4px 0 0; font-size: 14px; }
.new-task { margin-bottom: 16px; }

/* ── Bejelentkezés ──────────────────────── */
.login-box { max-width: 400px; margin: 9vh auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 34px; }
.login-box h1 { font-size: 26px; margin-bottom: 4px; }
.login-box .muted { margin: 0 0 22px; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .cal { gap: 3px; }
  .cal-cell { min-height: 72px; padding: 3px; }
  .cal-item { font-size: 10px; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .topbar-in { gap: 6px 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Támogatók, teljesítés ──────────────── */
.sp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.sp-head h2 { font-size: 20px; }
.sp-head h2 a { text-decoration: none; }
.sp-head .muted { margin: 3px 0 0; }
.contract-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.contract-row a { text-decoration: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.facts div { background: var(--cream); border-radius: 8px; padding: 9px 12px; }
.facts dt { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.facts dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; }
.sponsor-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
.bar { height: 8px; background: var(--cream-deep); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar-txt { font-size: 12px; margin-top: 5px; color: var(--ink-soft); }
.bar-txt b { color: var(--ink); font-size: 13px; }
i.ob-ok, .badge.ob-ok { background: #3F6B42; } .badge.ob-ok { background: #D8EBD6; color: #2F6B34; }
i.ob-ontrack { background: #1F5C99; } .badge.ob-ontrack { background: #D9E8F6; color: #1F5C99; }
i.ob-behind { background: #D9822B; } .badge.ob-behind { background: #FBE0C9; color: #A4511A; }
i.ob-missed, i.ob-over { background: #A5433A; } .badge.ob-missed, .badge.ob-over { background: #F8E5E2; color: #8C3028; }
i.ob-open, i.ob-upcoming { background: #BDAD7B; } .badge.ob-open, .badge.ob-upcoming { background: #ECE8DF; color: #5A5345; }

@media print {
  .topbar, .no-print, .page-actions { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .card { break-inside: avoid; }
}

/* Digitális riport */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.kpi b { display: block; font-size: 30px; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; }
.kpi em.up { color: var(--good); }
.kpi em.down { color: var(--bad); }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-ax { fill: var(--ink-soft); font-size: 11px; }
.chart-bar { fill: var(--gold); opacity: .8; }
.chart-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.conn { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.conn li { font-size: 14px; }
.conn .badge { margin-right: 8px; }
.conn .muted { margin-top: 3px; }
