/* ============================================================================
   WOXO Insights Hub — brand styl (STRIKTNĚ dle woxo-brand.css)
   Font: Poppins (jediný firemní font). Barvy: teal #00AB8E, lime #BDDC04.
   Pozn.: zadání §6.2 zmiňovalo Syne/DM Sans, ale WOXO brand je striktně Poppins.
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --teal: #00AB8E;
  --teal-light: #D1E0D7;
  --teal-dark: #3E5D58;
  --lime: #BDDC04;
  --dark: #041C2C;
  --slate: #425563;
  --bg: #F2F1F0;
  --white: #FFFFFF;
  --border: #E3E6E4;
  --danger: #C0392B;

  --font-head: 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;
  /* WOXO brand nemá samostatný mono font — čísla zůstávají Poppins
     s tabular-nums pro zarovnání v tabulkách. */
  --font-mono: 'Poppins', sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(4, 28, 44, 0.08);
  --shadow-md: 0 4px 12px rgba(4, 28, 44, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }

a { color: var(--teal-dark); }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.muted { color: var(--slate); }
.small { font-size: .85rem; }

/* ── Layout ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem; background: var(--dark); color: var(--white);
}
.topbar .brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 700; }
.topbar .brand .dot { width: 12px; height: 12px; border-radius: 999px; background: var(--teal); transform: rotate(-8deg); }
.topbar .right { display: flex; align-items: center; gap: 1rem; font-size: .85rem; }
.container { max-width: 1080px; margin: 0 auto; padding: 1.5rem; }

/* ── Karty ── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ── Tlačítka ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  font-family: var(--font-body); font-size: .9rem; font-weight: 500;
  padding: .5rem 1.1rem; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; text-decoration: none; transition: all .15s;
}
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-outline { background: transparent; color: var(--dark); border-color: var(--dark); }
.btn-outline:hover { background: var(--dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal-dark); border-color: var(--border); }
.btn-ghost:hover { background: var(--teal-light); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }

/* ── Badge ── */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 500; }
.badge-teal { background: var(--teal-light); color: var(--teal-dark); }
.badge-lime { background: var(--lime); color: #3A4A00; }
.badge-muted { background: #ECEFEE; color: var(--slate); }

/* ── Formuláře ── */
label { display: block; font-size: .8rem; font-weight: 500; margin: .6rem 0 .2rem; color: var(--slate); }
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: .9rem;
  padding: .5rem .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--dark);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-light); border-color: var(--teal); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* ── Tabulka cílů ── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--slate); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

/* ── Modál ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 28, 44, .45);
  display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 480px; box-shadow: var(--shadow-md); }
.modal h2 { margin-bottom: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }

/* ── Utility ── */
.flex { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: .6rem; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--dark); color: #fff; padding: .6rem 1.2rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); font-size: .88rem; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }
.empty { text-align: center; color: var(--slate); padding: 2rem; }

/* ── Info „ⓘ" tooltip ── */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--teal-light); color: var(--teal-dark);
  font-size: 10px; font-style: italic; font-weight: 700; font-family: var(--font-body);
  cursor: help; position: relative; vertical-align: middle; user-select: none;
}
.info:hover, .info:focus { background: var(--teal); color: #fff; outline: none; }
.info-pop {
  display: none; position: absolute; z-index: 60; bottom: 135%; left: 50%; transform: translateX(-50%);
  width: 230px; max-width: 60vw; background: var(--dark); color: #fff;
  font-size: .75rem; font-style: normal; font-weight: 400; line-height: 1.45;
  padding: .5rem .65rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); text-align: left;
}
.info:hover .info-pop, .info:focus .info-pop { display: block; }
.info-pop b { color: var(--lime); }

/* ── Dashboard ── */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.kpi { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.kpi .k-label { font-size: .72rem; color: var(--slate); text-transform: uppercase; letter-spacing: .03em; }
.kpi .k-val { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .1rem 0; }
.kpi .k-delta { font-size: .78rem; }
.kpi .k-delta.up { color: #1a7f5a; } .kpi .k-delta.down { color: var(--danger); }
.dash-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 1rem; }
.dash-chart { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem; min-height: 220px; position: relative; }
.dash-chart canvas { max-height: 240px; }

/* ── Report (web + tisk) ── */
.report-page { background: #fff; }
.report-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; padding: .75rem 1.5rem; background: var(--bg); border-bottom: 1px solid var(--border); }
.report-wrap { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.report-head { display: flex; align-items: center; gap: 1rem; border-bottom: 3px solid var(--teal); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.report-head .brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; color: var(--dark); }
.report-head .brand .dot { width: 14px; height: 14px; border-radius: 999px; background: var(--teal); transform: rotate(-8deg); }
.report-head .report-meta h1 { font-size: 1.5rem; margin: 0; }
.report-block { margin-bottom: 1.75rem; }
.report-block h3 { border-left: 4px solid var(--teal); padding-left: .6rem; margin-bottom: .6rem; }
.report-block.internal { background: #FFF6F5; border: 1px solid var(--danger); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.report-block h4 { margin: .8rem 0 .3rem; color: var(--slate); }
.report-block ul { margin: .4rem 0; padding-left: 1.2rem; }
.report-block li { margin-bottom: .5rem; }
.report-block .num { font-variant-numeric: tabular-nums; text-align: right; }
.badge-internal { font-size: .65rem; background: var(--danger); color: #fff; padding: .1rem .5rem; border-radius: 999px; vertical-align: middle; }
.delta.up { color: #1a7f5a; } .delta.down { color: var(--danger); }
.report-foot { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: .75rem; text-align: center; }

@media print {
  .no-print, .report-toolbar { display: none !important; }
  .report-wrap { max-width: none; padding: 0; }
  .report-block { break-inside: avoid; }
  body { background: #fff; }
}
