/* =========================================================
   CZECH VIRUS • INFLUENCER PORTAL — MASTER STYLESHEET
   ---------------------------------------------------------
   1. Theme Variables (Dark/Light/System)
   2. Reset & Base Typography
   3. Layout & Grid System
   4. Header & Navigation
   5. UI Components (Buttons, Inputs, Cards, Alerts)
   6. Data Display (Tables, Badges, KPI)
   7. Modules (Gantt, Loaders, Effects)
   8. Utilities
   ========================================================= */

/* === 1. THEME VARIABLES ================================== */

/* Výchozí sada = DARK (platí pro :root i [data-theme="dark"]) */
:root,
[data-theme="dark"] {
  /* Brand Colors */
  --brand-red:     #e30613;
  --brand-black:   #0b0d10;
  --brand-grey:    #2b2b2b;

  /* Backgrounds & Panels */
  --bg:            #0b0f14;    /* Main page bg */
  --bg-1:          #12161c;    /* Card base */
  --bg-2:          #161c24;    /* Inputs / inner containers */
  --bg-3:          #1a222c;    /* Hovers / stripes */
  --panel:         #10151b;    /* Gradient end for cards */
  --vignette:      #11161e;    /* Radial gradient edge */
  --table-head-bg: #0e1319;

  /* Text & Borders */
  --text:          #e7eaee;
  --text-inv:      #0b0d10;
  --muted:         #9aa3af;
  --border:        #222a36;
  --border-2:      #2a3342;
  --hover:         #1c2430;

  /* Feedback Colors (Ink = text on bg, Bg = background, Br = border) */
  --success:       #7ddc9b; --success-ink: #0f3d25; --success-bg: #0f2a1c; --success-br: #1e4e31;
  --danger:        #ff6b6b; --danger-ink: #3f1010; --danger-bg: #2a1416; --danger-br: #4d1f23;
  --warn:          #f6c26b; --warn-ink: #3b2706; --warn-bg: #2a200f; --warn-br: #4a3a16;
  --info:          #86b7ff; --info-ink: #0b203f; --info-bg: #111c2b; --info-br: #1b2c46;

  /* Effects & Sizes */
  --shadow-sm:     0 10px 30px rgba(0,0,0,.35);
  --shadow-lg:     0 14px 50px rgba(0,0,0,.45);
  --r-sm: 8px; --r-md: 10px; --r-lg: 12px; --r-xl: 14px;
  --container: 1350px;
  --btn-h: 42px;

  /* Chip / Presets */
  --chip-bg:       #151b24;
  --chip-br:       #273141;
  --chip-hover-bg: #1b2430;
  --chip-text:     #e7eaee;
  --chip-focus-ring: rgba(227,6,19,.22);
}

/* LIGHT THEME OVERRIDES */
[data-theme="light"] {
  --brand-black:   #111111;

  --bg:            #ffffff;
  --bg-1:          #ffffff;
  --bg-2:          #f8f9fb;
  --bg-3:          #f3f4f7;
  --panel:         #ffffff;
  --vignette:      rgba(0,0,0,.12);
  --table-head-bg: #f6f7f9;

  --text:          #111111;
  --text-inv:      #ffffff;
  --muted:         #666666;
  --border:        #e5e7eb;
  --border-2:      #dddddd;
  --hover:         #f5f7fa;

  --success:       #1b6b3a; --success-ink: #ffffff; --success-bg: #e8f7ef; --success-br: #bfe7cd;
  --danger:        #b42318; --danger-ink: #ffffff; --danger-bg: #fdeaea; --danger-br: #f3c4c4;
  --warn:          #7a4b10; --warn-ink: #ffffff; --warn-bg: #fff4e5; --warn-br: #ffd9a8;
  --info:          #13439b; --info-ink: #ffffff; --info-bg: #eef5ff; --info-br: #cfe2ff;

  --shadow-sm:     0 6px 20px rgba(0,0,0,.08);
  --shadow-lg:     0 10px 34px rgba(0,0,0,.12);

  --chip-bg:       #f4f6fb;
  --chip-br:       #e5e7ee;
  --chip-hover-bg: #eef2f8;
  --chip-text:     #111111;
  --chip-focus-ring: rgba(227,6,19,.20);
}

/* SYSTEM THEME (Auto-switch based on OS preference) */
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --brand-black:   #111111;
    --bg:            #ffffff;
    --bg-1:          #ffffff;
    --bg-2:          #f8f9fb;
    --bg-3:          #f3f4f7;
    --panel:         #ffffff;
    --vignette:      rgba(0,0,0,.12);
    --table-head-bg: #f6f7f9;
    --text:          #111111;
    --text-inv:      #ffffff;
    --muted:         #666666;
    --border:        #e5e7eb;
    --border-2:      #dddddd;
    --hover:         #f5f7fa;
    --success:       #1b6b3a; --success-ink: #ffffff; --success-bg: #e8f7ef; --success-br: #bfe7cd;
    --danger:        #b42318; --danger-ink: #ffffff; --danger-bg: #fdeaea; --danger-br: #f3c4c4;
    --warn:          #7a4b10; --warn-ink: #ffffff; --warn-bg: #fff4e5; --warn-br: #ffd9a8;
    --info:          #13439b; --info-ink: #ffffff; --info-bg: #eef5ff; --info-br: #cfe2ff;
    --shadow-sm:     0 6px 20px rgba(0,0,0,.08);
    --shadow-lg:     0 10px 34px rgba(0,0,0,.12);
    --chip-bg:       #f4f6fb;
    --chip-br:       #e5e7ee;
    --chip-hover-bg: #eef2f8;
    --chip-text:     #111111;
    --chip-focus-ring: rgba(227,6,19,.20);
  }
}

/* === 2. RESET & BASE ===================================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 75% 60%, var(--vignette) 0%, var(--bg) 60%) no-repeat, var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 1rem 0; }
button { font-family: inherit; }

/* === 3. LAYOUT & GRID ==================================== */

.container { max-width: var(--container); margin: 24px auto; padding: 0 16px; }
.page-center { min-height: calc(100vh - 120px); display: grid; place-items: center; padding: 24px 16px; }

/* Flex Helpers */
.flex { display: flex; gap: 5px; }
.flex-wrap { flex-wrap: wrap; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.row { display: flex; gap: 8px; }
.row.between { justify-content: space-between; }
.inline { display: inline; }
.ib { display: inline-block; }
.hidden { display: none !important; }

/* Grid System */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; min-width: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; min-width: 0; }
.grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-1 { grid-template-columns: 1fr !important; }
}

/* === 4. HEADER & NAVIGATION ============================== */

/* === 4. HEADER & NAVIGATION (OPRAVENO) =================== */

.header {
  background: linear-gradient(180deg, #0e1319 0%, #0b0f14 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10002;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid #121821;
}
.header .title span { color: var(--brand-red); }

/* Základní NAV (Desktop) */
.nav { display: flex; align-items: center; }

.nav a {
  color: #fff;
  margin-left: 12px; padding: 8px 12px; border-radius: var(--r-md);
  background: transparent;
  transition: background .15s ease, box-shadow .15s ease;
}
.nav a.active, .nav a:hover {
  background: linear-gradient(180deg, #ff3845 0%, var(--brand-red) 100%);
  box-shadow: 0 6px 18px rgba(227,6,19,.35);
}

/* Dropdowny (Desktop) */
.nav .nav-group { position: relative; display: inline-block; margin-left: 12px; }
.nav .nav-parent {
  color: #fff; padding: 8px 12px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; cursor: pointer;
}
.nav .nav-parent .caret { font-size: 12px; opacity: .9; }

.nav .nav-sub {
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: #0f141b; border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 6px; display: none; flex-direction: column;
  box-shadow: var(--shadow-lg); z-index: 10001;
}
.nav .nav-sub a { color: #fff; padding: 8px 12px; border-radius: var(--r-sm); margin: 2px 0; }
.nav .nav-sub a:hover { background: var(--brand-red); }

/* Desktop Hover efekt pro dropdown */
@media (min-width: 1025px) {
  .nav .nav-group:hover .nav-sub { display: flex; animation: fadeIn .2s ease-in-out; }
}

/* === MOBILE NAVIGACE (Tohle chybělo/bylo špatně) === */
.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; margin-left: auto; cursor: pointer; z-index: 1002; }
.nav-toggle .nav-bar {
  display: block; width: 26px; height: 3px; background: #fff; border-radius: 2px; margin: 3px 0;
  transition: transform .25s ease, opacity .25s ease;
}

/* Animace hamburgeru */
.nav-toggle.open .nav-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open .nav-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 1000;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}
.nav-overlay.open { opacity: 1; visibility: visible; }

/* Styly pro mobilní menu (do 1024px) */
@media (max-width: 1024px) {
  .nav-toggle { display: block; }

  /* Transformace .nav na postranní panel */
  .nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    background: var(--bg-1);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 20px 20px; /* Místo nahoře pro křížek */
    z-index: 1001; /* Musí být nad overlayem, ale pod toggle tlačítkem (pokud je v rohu) */
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
    
    /* Výchozí stav: schováno vpravo */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }

  /* Stav OTEVŘENO */
  .nav.open {
    transform: translateX(0);
  }

  /* Úprava odkazů uvnitř panelu */
  .nav a, .nav .nav-group {
    width: 100%;
    margin: 0 0 4px 0;
    border-radius: var(--r-md);
  }
  .nav .nav-parent { width: 100%; justify-content: space-between; }
  
  /* Dropdown na mobilu - staticky v toku dokumentu */
  .nav .nav-sub {
    position: relative;
    top: 0; left: 0;
    box-shadow: none;
    border: none;
    background: rgba(0,0,0,0.2);
    margin-top: 4px;
    width: 100%;
  }
  /* JS musí přidat třídu .open i na dropdown, aby se ukázal, nebo použijeme hover workaround: */
  .nav .nav-group:hover .nav-sub, 
  .nav .nav-sub.open { display: flex; }
}

/* Footer */
.footer { text-align: center; color: var(--muted); padding: 20px; }

/* === 5. UI COMPONENTS ==================================== */

/* Buttons */
.btn {
  background: linear-gradient(180deg, #ff3845 0%, var(--brand-red) 100%);
  color: #fff;
  padding: 10px 16px;
  border: none; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  vertical-align: middle;
  height: var(--btn-h); line-height: 1; cursor: pointer; text-decoration: none;
  transition: transform .05s ease, filter .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }

/* Button Variants */
.btn.secondary {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  color: var(--text); border: 1px solid var(--border-2); box-shadow: none;
}
.btn.danger {
  background: linear-gradient(180deg, #ff7a7a 0%, #ff4d4d 100%);
  color: #fff; box-shadow: 0 8px 22px rgba(255,77,77,.28);
}
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-2); }
.btn-outline-red { background: transparent; color: var(--brand-red); border: 1px solid var(--brand-red); }
.btn-loose { height: auto; }
.btn.sm { height: 34px; padding: 8px 12px; font-size: 14px; line-height: 1; }

/* Chips / Preset Buttons */
.preset-group { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; }
.preset-group .btn.sm {
  background: var(--chip-bg); color: var(--chip-text);
  border: 1px solid var(--chip-br); border-radius: 999px;
  box-shadow: none; font-weight: 600; letter-spacing: .2px;
  transition: all .15s ease;
}
.preset-group .btn.sm:hover {
  background: var(--chip-hover-bg);
  border-color: color-mix(in oklab, var(--brand-red) 52%, var(--chip-br));
}
.preset-group .btn.sm:focus-visible {
  outline: none; border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--chip-focus-ring);
}

/* Inputs & Forms */
.input, select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  margin: 0;
  background: var(--bg-2); color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  vertical-align: middle;
}
.input::placeholder { color: #7c8694; }
.input:focus, select:focus { border-color: #395987; box-shadow: 0 0 0 3px rgba(134,183,255,.15); }
.input-numeric { width: 120px; text-align: right; }

.input.is-valid { border-color: var(--success); box-shadow: 0 0 0 3px rgba(125,220,155,.18); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,107,107,.16); }

.form-hint { font-size: 12px; margin-top: 4px; color: var(--muted); }
.form-narrow { max-width: 420px; }
.form-medium { max-width: 560px; margin-inline: auto; }

/* Stack Form */
.stack-form .form-group { display: block; }
.stack-form label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.stack-form .checks label { display: inline-flex; align-items: center; margin-right: 14px; color: var(--text); }

/* Inline Filter Form */
.filter-form {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filter-form .input, .filter-form select {
  margin-top: 4px;
}
.filter-form label.small {
  margin: 0; display: block; margin-bottom: 6px; color: var(--muted); font-size: 14px;
}

/* Global form labels - jednotný styl pro všechny formulářové labely */
.modal-box label:not(.checkbox-label),
.card label:not(.checkbox-label),
.stack-form > label:not(.checkbox-label),
form > label:not(.checkbox-label) {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

/* Form groups - for label + input stacking */
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block; margin-bottom: 6px; color: var(--muted); font-size: 14px;
}

/* Checkbox label (remember me, etc.) */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-red);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-label:hover {
  color: var(--text);
}
.checkbox-label span {
  line-height: 1.2;
}


/* Cards */
.card {
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--panel) 100%);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 20px; margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.card--accent-red { border-left: 4px solid var(--brand-red); }
.card--accent-green { border-left: 4px solid #2f855a; }
.card-inner { padding: 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); }
.post { padding: 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-1); margin-bottom: 12px; }

/* Alerts */
.alert {
  padding: 10px 12px; border-radius: var(--r-md); margin-bottom: 12px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
}
.alert.ok { background: var(--success-bg); border-color: var(--success-br); color: var(--success); }
.alert.err { background: var(--danger-bg); border-color: var(--danger-br); color: var(--danger); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-br); color: var(--warn); }

/* === 6. DATA DISPLAY & TABLES ============================ */

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #212a36; font-size: 12px; color: #c7cfda; }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--ok, .badge--success { background: var(--success-bg); color: var(--success); }
.badge--muted { background: #1c2430; color: #aeb6c1; }
.badge-vo { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--r-md); font-size: 12px; font-weight: 700; background: var(--info-bg); color: var(--info); border: 1px solid var(--info-br); }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); }
.table-wrap .table { min-width: 720px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; }
.table thead th { color: var(--muted); font-weight: 600; background: var(--table-head-bg); }

/* Table Hover Logic */
.table-hover > tbody > tr:hover > td:not(.detail-cell),
.table > tbody > tr:hover > td:not(.detail-cell) {
  background: var(--hover);
}
.table-hover > tbody > tr.no-row-hover:hover > td { background: transparent; }

/* Detail Rows */
.detail-cell { background: var(--bg-2); border-top: 1px solid var(--border); }
.detail-wrap { padding: 12px 8px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.detail-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }

/* KPI Components */
.kpi { padding: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-1); }
.kpi h4 { margin: 0 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi .val { font-size: 22px; font-weight: 700; }
.kpi .val.lg { font-size: 26px; font-weight: 800; }

/* KPI Variants */
.kpi--danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.kpi--danger h4 { color: #ef4444; }
.kpi--danger .val { color: #ef4444; }

.kpi--success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
.kpi--success h4 { color: #10b981; }
.kpi--success .val { color: #10b981; }

.kpi--info { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); }
.kpi--info h4 { color: #3b82f6; }
.kpi--info .val { color: #3b82f6; }

.sys-row { display: grid; grid-template-columns: 140px repeat(4, minmax(0,1fr)); gap: 12px; align-items: stretch; }
.sys-cell--label { display: flex; align-items: center; color: var(--text); font-weight: 700; padding-left: 2px; }
.sys-row .kpi { padding: 14px; }
.sys-row .kpi h4 { margin-bottom: 4px; font-size: 13px; }
.sys-row .kpi .val { font-size: 20px; font-weight: 800; }

@media (max-width: 1024px) {
  .sys-row { grid-template-columns: 120px repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .sys-row { grid-template-columns: 1fr; }
  .sys-cell--label { margin-bottom: 6px; }
}

/* B2B Stat Cards */
.stat-card { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.stat-val-lg { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* Charts & Canvas */
.chart-wrapper { position: relative; width: 100%; margin-top: 10px; overflow: hidden; height: 300px; }
.chart-canvas { width: 100%; height: 280px; display: block; }
.chart-canvas-260 { width: 100%; height: 260px; display: block; }
canvas { max-width: 100% !important; max-height: 100% !important; }

@media (max-width: 960px) {
  canvas { height: 240px; }
  .table th, .table td { padding: 8px; font-size: 14px; }
  .mono, .btn { white-space: nowrap; }
}

/* === 7. MODULES & SPECIFICS ============================== */

/* -- Loader & Spinners -- */
.loader {
  position: fixed; inset: 0; background: rgba(8,11,16,.55);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}
.loader .spin {
  width: 44px; height: 44px; border: 4px solid #2d3748;
  border-top-color: var(--brand-red); border-radius: 50%;
  animation: cv-spin 1s linear infinite;
}
.inline-loader { display: inline-flex; align-items: center; gap: 8px; }
.inline-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); border-top-color: var(--brand-red);
  animation: cv-spin .8s linear infinite;
}
@keyframes cv-spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* -- Progress Bars -- */
.progress { width: 100%; height: 10px; background: #111720; border-radius: 9999px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #ff3845, var(--brand-red)); transition: width .25s ease; }

.progress-thick {
  position: relative; height: 42px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.progress-thick .bar-fill {
  height: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px;
  font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); min-width: 40px;
}
.bar-fill.is-success { background: var(--success); box-shadow: 0 0 15px rgba(125,220,155, 0.4); }
.bar-fill.is-warn { background: var(--warn); box-shadow: 0 0 15px rgba(246,194,107, 0.4); }
.bar-fill.is-danger { background: var(--danger); box-shadow: 0 0 15px rgba(255,107,107, 0.4); }
.bar-fill.is-brand { background: var(--brand-red); }

/* -- Progress Bar (Marketing Dashboard) -- */
.progress-bar-container {
  position: relative;
  width: 100%;
  height: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--r-md) 0 0 var(--r-md);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(227,6,19,0.3);
}
.progress-bar-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--text);
  opacity: 0.7;
  transform: translateX(-50%);
  z-index: 2;
}
.progress-bar-marker::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text);
  opacity: 0.7;
}
.progress-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.progress-bar-meta strong {
  color: var(--text);
  font-weight: 600;
}

/* -- Marketing Progress Bars (Report mode) -- */
.mkt-progress-container {
  position: relative;
  width: 100%;
  height: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.mkt-progress-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transition: width 0.4s ease;
  min-width: 30px;
}
.mkt-progress-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text);
  opacity: 0.5;
  transform: translateX(-50%);
}

/* -- EPIC INTRO LOADER v4 -- */
#epic-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: radial-gradient(1200px 800px at 50% 55%, #101621 0%, var(--bg) 60%) no-repeat, linear-gradient(180deg, #0b0f14 0%, #070a0f 100%);
  overflow: hidden; opacity: 1;
}
#epic-loader.out { animation: el-out .45s ease forwards; }
@keyframes el-out { to { opacity: 0; visibility: hidden; } }

#epic-loader .el-field { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
#epic-loader .el-core { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; }
#epic-loader .el-panel {
  width: min(720px, 90vw); background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 18px;
  padding: 22px 22px 18px; box-shadow: var(--shadow-lg);
}

.field-word {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  color: #e7eaee; font-weight: 900; text-transform: uppercase; font-size: var(--fs, 28px);
  white-space: nowrap; opacity: var(--op, .22); mix-blend-mode: screen; letter-spacing: .04em;
  text-shadow: 0 0 8px rgba(227,6,19,.18), 0 0 18px rgba(227,6,19,.28);
  animation-name: field-move, field-breathe;
  animation-timing-function: cubic-bezier(.18,.6,.12,1), ease-in-out;
  animation-fill-mode: forwards; animation-iteration-count: 1, infinite;
  animation-duration: 3.4s, 1.4s;
}
@keyframes field-move { from { transform: translate(-50%,-50%) scale(.85); } to { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.15); opacity: 0; } }
@keyframes field-breathe { 0%,100% { filter: brightness(1); letter-spacing: .04em; } 50% { filter: brightness(1.15); letter-spacing: .09em; } }

.el-logo { height: 42px; width: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.45)); margin-bottom: 12px; }
.el-brandline { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.el-bar-wrap { position: relative; height: 56px; border-radius: 999px; background: #0f141b; border: 1px solid var(--border-2); overflow: hidden; }
.el-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, #ff3a45, var(--brand-red)); box-shadow: 0 0 34px rgba(227,6,19,.45); animation: el-pulse 800ms ease-in-out infinite alternate; }
.el-bar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 1000; letter-spacing: .06em; text-transform: uppercase; font-size: clamp(16px, 3.8vw, 26px); color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
@keyframes el-pulse { to { filter: brightness(1.15) saturate(1.2); } }
.el-phase { text-align: center; margin-top: 14px; color: var(--muted); min-height: 26px; font-size: 15px; letter-spacing: .5px; }

/* -- Hell Banner & Effects -- */
#hell-banner {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 9990;
  font-weight: 1000; font-size: clamp(36px, 9vw, 120px); letter-spacing: .02em; text-transform: uppercase;
  color: #fff; text-shadow: 0 0 24px rgba(227,6,19,.35), 0 0 8px rgba(227,6,19,.85);
  opacity: 0; pointer-events: none; transform: translateX(-3vw) scale(.9);
  transition: opacity .32s ease, transform .32s ease;
  animation: banner-drift 6s ease-in-out infinite alternate;
}
#hell-banner.show { opacity: 1; transform: translateX(-1.2vw) scale(1.0); }
#hell-banner.bye { opacity: 0; transform: translateX(-1vw) scale(1.02); }
@keyframes banner-drift { 0% { transform: translateX(-3vw) scale(1.0); } 100% { transform: translateX(-1.2vw) scale(1.0); } }

.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; display: grid; place-items: center;
  mix-blend-mode: screen; opacity: .25; pointer-events: none;
}
.glitch::before { color: #ff5252; transform: translate(6px,0); animation: gch 2.8s ease-in-out infinite alternate; }
.glitch::after { color: #b3b3ff; transform: translate(-4px,0); animation: gch 3.2s ease-in-out infinite alternate; }
@keyframes gch { 0% { filter: blur(0.5px); transform: translateX(4px); } 100% { filter: blur(0.8px); transform: translateX(7px); } }

/* -- BG Words Animation -- */
#bg-words { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: radial-gradient(1200px 800px at 58% 52%, var(--vignette) 0%, var(--bg) 60%) no-repeat, var(--bg); }
#bg-words .bg-red-smear {
  position: absolute; inset: 0; background: radial-gradient(65vmax 40vmax at 58% 52%, rgba(227,6,19,.14), transparent 62%);
  animation: smear-drift 25s ease-in-out infinite alternate; filter: blur(0.3px);
}
@keyframes smear-drift { 0% { transform: translateX(-2vw); opacity: .9; } 100% { transform: translateX(2.5vw); opacity: .9; } }

/* -- Submit Overlay -- */
#cv-submit-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 9999;
}
#cv-submit-overlay .box { background: #111; color: #fff; padding: 18px 22px; border-radius: 12px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-lg); }
#cv-submit-overlay .spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: cv-spin 1s linear infinite; }
button[disabled] { opacity: .6; cursor: not-allowed; }

/* -- FAQ Accordion -- */
.faq-acc { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); margin-bottom: 10px; overflow: hidden; }
.faq-acc__q { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; user-select: none; font-weight: 600; color: var(--text); }
.faq-acc__q::-webkit-details-marker { display: none; }
.faq-acc .chev { transition: transform .18s ease; opacity: .9; }
.faq-acc[open] .chev { transform: rotate(180deg); }
.faq-acc__q:hover { background: var(--hover); }
.faq-acc__a { border-top: 1px solid var(--border); padding: 0 14px; max-height: 0; overflow: hidden; transition: max-height .22s ease, padding .22s ease; }
.faq-acc[open] .faq-acc__a { padding: 12px 14px; max-height: 1200px; }

/* -- Gantt & Planner -- */
.gantt-container { display: grid; grid-template-columns: 60px 1fr; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-1); overflow: hidden; margin-bottom: 20px; height: auto; }
.gantt-sidebar { background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding-top: 60px; align-items: center; }
.gs-row { height: 50px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; width: 100%; }
.gs-dot { width: 18px; height: 18px; border-radius: 50%; display: block; border: 2px solid rgba(255,255,255,0.1); }

/* Section labels v sidebaru */
.gs-section-label {
    height: 24px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
}

/* Section label v timeline body */
.gb-section-label {
    height: 24px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
}

.gantt-timeline-scroll { overflow-x: auto; position: relative; background: var(--bg-1); }
.gantt-grid { position: relative; height: 100%; min-height: 482px; } /* 3 sekce * 24px label + 7 tracků * 50px + 60px headers */
.gantt-header-months { display: flex; height: 30px; border-bottom: 1px solid var(--border); background: var(--table-head-bg); position: sticky; top: 0; z-index: 20; }
.gantt-header-days { display: flex; height: 30px; border-bottom: 1px solid var(--border); background: var(--bg-2); position: sticky; top: 30px; z-index: 20; font-size: 11px; color: var(--muted); }
.gh-month { border-right: 1px solid var(--border); text-align: center; line-height: 30px; font-weight: 700; font-size: 12px; }
.gh-day { border-right: 1px dashed var(--border-2); text-align: center; line-height: 30px; flex-shrink: 0; position: relative; cursor: help; }
.gb-track { height: 50px; border-bottom: 1px solid var(--border-2); position: relative; width: 100%; }
.gb-col { position: absolute; top: 0; bottom: 0; border-right: 1px dashed var(--border-2); height: 100%; pointer-events: none; }
.gb-col.is-today { background: rgba(227, 6, 19, 0.15); border-right: 2px solid var(--brand-red); }

.is-weekend { background: rgba(255,255,255, 0.03); }
.is-today { background: rgba(227, 6, 19, 0.2); color: var(--brand-red); font-weight: bold; }
.is-holiday { background: rgba(246, 194, 107, 0.15); color: var(--warn); font-weight: bold; }
.is-event { background: rgba(134, 183, 255, 0.08); }
.gh-day[data-title]:hover::after { content: attr(data-title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; z-index: 30; pointer-events: none; border: 1px solid var(--border); }

.action-bar { position: absolute; height: 34px; top: 8px; border-radius: 6px; color: #fff; font-size: 11px; display: flex; align-items: center; padding: 0 10px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.3); white-space: nowrap; overflow: hidden; z-index: 10; transition: transform 0.1s, box-shadow 0.1s; opacity: 0.9; }
.action-bar:hover { transform: scale(1.02); z-index: 15; box-shadow: 0 5px 12px rgba(0,0,0,0.5); opacity: 1; }

.edit-panel, .report-panel { background: var(--bg-2); border: 1px solid var(--border); padding: 20px; margin-bottom: 20px; border-radius: var(--r-md); display: none; border-left: 4px solid var(--brand-red); animation: fadeIn 0.2s ease-in-out; }
.edit-panel.active, .report-panel.active { display: block; }
.sku-loader { display: none; font-size: 12px; color: var(--info); margin-left: 10px; }
.sku-loader.loading { display: inline-block; }
.calc-box { background: var(--bg-1); border: 1px solid var(--border); padding: 12px; border-radius: 8px; margin-top: 5px; }
.calc-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.calc-row.highlight { color: var(--text); font-weight: 600; margin-bottom: 8px; }
.calc-row.total { border-top: 1px solid var(--border-2); margin-top: 10px; padding-top: 10px; font-weight: bold; font-size: 16px; color: var(--text); }
.calc-label { width: 50%; }
.edit-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-top: 20px; }

/* Link Manager & View Switcher */
.links-container { background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.link-row { display: grid; grid-template-columns: 1fr 1fr 30px; gap: 8px; margin-bottom: 8px; align-items: center; }
.link-row input { margin: 0 !important; }

.view-switcher { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 6px; border: 1px solid var(--border); }
.view-switcher label { cursor: pointer; position: relative; }
.view-switcher span { display: block; padding: 6px 14px; border-radius: 4px; font-size: 13px; color: var(--muted); transition: all 0.2s; user-select: none; }
.view-switcher input { position: absolute; opacity: 0; }
.view-switcher input:checked + span { background: var(--brand-red); color: #fff; font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }

/* Quill & CKEditor */
.wysi-wrap { width: 100%; }

/* CKEditor 5 - Dark Mode Support */
.ck.ck-editor__main>.ck-editor__editable { min-height: 220px; }

/* Dark theme (default) */
:root .ck.ck-editor,
[data-theme="dark"] .ck.ck-editor {
  --ck-color-base-background: var(--bg-2);
  --ck-color-base-foreground: var(--bg-3);
  --ck-color-base-border: var(--border);
  --ck-color-base-text: var(--text);
  --ck-color-toolbar-background: var(--bg-1);
  --ck-color-toolbar-border: var(--border);
  --ck-color-button-default-background: transparent;
  --ck-color-button-default-hover-background: var(--bg-3);
  --ck-color-button-on-background: var(--bg-3);
  --ck-color-button-on-hover-background: var(--hover);
  --ck-color-dropdown-panel-background: var(--bg-2);
  --ck-color-dropdown-panel-border: var(--border);
  --ck-color-input-background: var(--bg-2);
  --ck-color-input-border: var(--border);
  --ck-color-input-text: var(--text);
  --ck-focus-ring: 1px solid var(--brand-red);
}

:root .ck.ck-toolbar,
[data-theme="dark"] .ck.ck-toolbar {
  background: var(--bg-1) !important;
  border-color: var(--border) !important;
}

:root .ck.ck-toolbar .ck-button,
[data-theme="dark"] .ck.ck-toolbar .ck-button {
  color: var(--text) !important;
}

:root .ck.ck-toolbar .ck-button:hover,
[data-theme="dark"] .ck.ck-toolbar .ck-button:hover {
  background: var(--bg-3) !important;
}

:root .ck.ck-toolbar .ck-button.ck-on,
[data-theme="dark"] .ck.ck-toolbar .ck-button.ck-on {
  background: var(--bg-3) !important;
  color: var(--brand-red) !important;
}

:root .ck.ck-editor__editable,
[data-theme="dark"] .ck.ck-editor__editable {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

:root .ck.ck-editor__editable.ck-focused,
[data-theme="dark"] .ck.ck-editor__editable.ck-focused {
  border-color: var(--brand-red) !important;
  box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.2) !important;
}

:root .ck.ck-dropdown__panel,
[data-theme="dark"] .ck.ck-dropdown__panel {
  background: var(--bg-2) !important;
  border-color: var(--border) !important;
}

:root .ck.ck-list__item .ck-button,
[data-theme="dark"] .ck.ck-list__item .ck-button {
  color: var(--text) !important;
}

:root .ck.ck-list__item .ck-button:hover,
[data-theme="dark"] .ck.ck-list__item .ck-button:hover {
  background: var(--bg-3) !important;
}

/* Light theme overrides */
[data-theme="light"] .ck.ck-editor {
  --ck-color-base-background: #ffffff;
  --ck-color-base-foreground: #f8f9fb;
  --ck-color-base-border: #e5e7eb;
  --ck-color-base-text: #111111;
  --ck-color-toolbar-background: #ffffff;
  --ck-color-toolbar-border: #e5e7eb;
  --ck-color-dropdown-panel-background: #ffffff;
}

[data-theme="light"] .ck.ck-toolbar {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

[data-theme="light"] .ck.ck-toolbar .ck-button {
  color: #111111 !important;
}

[data-theme="light"] .ck.ck-toolbar .ck-button:hover {
  background: #f3f4f7 !important;
}

[data-theme="light"] .ck.ck-toolbar .ck-button.ck-on {
  background: #f3f4f7 !important;
  color: var(--brand-red) !important;
}

[data-theme="light"] .ck.ck-editor__editable {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #e5e7eb !important;
}

[data-theme="light"] .ck.ck-editor__editable.ck-focused {
  border-color: var(--brand-red) !important;
  box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.15) !important;
}

[data-theme="light"] .ck.ck-dropdown__panel {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

[data-theme="light"] .ck.ck-list__item .ck-button {
  color: #111111 !important;
}

[data-theme="light"] .ck.ck-list__item .ck-button:hover {
  background: #f3f4f7 !important;
}

/* System theme - inherit from dark by default, media query handles light */
@media (prefers-color-scheme: light) {
  [data-theme="system"] .ck.ck-toolbar {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
  }
  [data-theme="system"] .ck.ck-toolbar .ck-button {
    color: #111111 !important;
  }
  [data-theme="system"] .ck.ck-toolbar .ck-button:hover {
    background: #f3f4f7 !important;
  }
  [data-theme="system"] .ck.ck-toolbar .ck-button.ck-on {
    background: #f3f4f7 !important;
    color: var(--brand-red) !important;
  }
  [data-theme="system"] .ck.ck-editor__editable {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #e5e7eb !important;
  }
  [data-theme="system"] .ck.ck-editor__editable.ck-focused {
    border-color: var(--brand-red) !important;
  }
  [data-theme="system"] .ck.ck-dropdown__panel {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
  }
  [data-theme="system"] .ck.ck-list__item .ck-button {
    color: #111111 !important;
  }
}

/* Quill editor styles */
.ql-toolbar.ql-snow { border-color: var(--border); background: var(--bg-1); }
.ql-container.ql-snow { border-color: var(--border); background: var(--bg-2); color: var(--text); min-height: 150px; font-size: 14px; }
.ql-picker { color: var(--text); }
.ql-stroke { stroke: var(--text) !important; }
.ql-fill { fill: var(--text) !important; }

/* -- GM Products Specifics -- */
#gm-products-box { min-height: 90px; }
.gm-products-empty { padding: 8px 4px; }
.gm-products-list .list-item-row { border-bottom: 1px dashed var(--border); }
.gm-products-list .list-item-row:last-child { border-bottom: 0; }
#gm-bottom h4 { margin-top: 0; }

/* === 8. UTILITIES ======================================== */

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.w-36 { width: 36px; }
.w-160 { width: 160px; }
.ml-8 { margin-left: 8px; }
.mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; }
.my-6 { margin: 6px 0; } .my-8 { margin: 8px 0; } .my-12 { margin: 12px 0; }
.mb-10 { margin-bottom: 10px; }
.minw-120 { min-width: 120px; }
.h-auto { height: auto; }
.status-sent { color: var(--success); font-weight: 600; }
.status-error { color: var(--danger); font-weight: 600; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-item-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
pre.log { white-space: pre-wrap; background: #0f141b; padding: 12px; border-radius: var(--r-lg); border: 1px solid var(--border); min-height: 120px; color: #d2d7df; }
.info-note { background: #221a10; border: 1px solid #3a2c18; color: #f4d9a5; border-radius: var(--r-md); padding: 8px 10px; display: inline-block; }
.meta { display: flex; gap: 10px; flex-wrap: wrap; color: #c2c9d2; }
.meta .item { display: flex; gap: 6px; align-items: center; }
.kv { display: inline-block; min-width: 120px; color: var(--muted); }
.hr { height: 1px; background: var(--border); margin: 10px 0; }
.small { font-size: 13px; color: var(--muted); margin-top: 10px; }
/* Login page */
.login-wrap {
  width: 100%;
  max-width: 400px;
  margin: 8vh auto;
  padding: 28px;
}
.login-wrap h2 {
  margin-bottom: 20px;
  text-align: center;
}
.login-wrap .form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}
.login-wrap .input {
  width: 100%;
  margin-bottom: 16px;
}
.login-wrap .checkbox-label {
  margin: 8px 0 20px;
}
.login-wrap .btn {
  width: 100%;
}
.collapsible-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.collapsible-toggle { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 8px 12px; cursor: pointer; color: var(--text); }
.fade { transition: opacity .25s ease; }
#app { position: relative; z-index: 10; }

/* === CONTENT PLAN / EDITORIAL CALENDAR =================== */
.cp-header-month { background: var(--bg-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 5px; text-align: center; font-weight: 800; text-transform: uppercase; font-size: 11px; color: var(--muted); position: sticky; top: 0; z-index: 12; }
.cp-header-cell { background: var(--table-head-bg); border-bottom: 1px solid var(--border); border-right: 1px dashed var(--border-2); padding: 8px; text-align: center; font-weight: 700; position: sticky; top: 26px; z-index: 11; }
.cp-header-cat { background: var(--bg-2); border-right: 1px solid var(--border); position: sticky; left: 0; top: 26px; z-index: 30; display: flex; align-items: center; padding-left: 10px; font-weight: 700; }
.cp-row-header { background: var(--bg-2); border-bottom: 1px solid var(--border-2); border-right: 1px solid var(--border); padding: 10px; font-weight: 600; font-size: 13px; position: sticky; left: 0; z-index: 5; color: var(--muted); min-height: 100px; display: flex; align-items: flex-start; padding-top: 12px; }
.cp-cell { border-bottom: 1px solid var(--border-2); border-right: 1px dashed var(--border-2); padding: 6px; min-height: 100px; position: relative; transition: background 0.1s; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.cp-cell:hover { background: var(--hover); }
.cp-card { background: var(--bg-3); border: 1px solid var(--border); border-left: 3px solid #555; border-radius: 6px; padding: 6px 8px; font-size: 12px; cursor: pointer; transition: transform 0.1s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.cp-card:hover { transform: translateY(-2px); z-index: 2; box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.cp-promo-tag { display: block; font-size: 9px; text-transform: uppercase; font-weight: 800; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-card-user { float: right; opacity: 0.7; font-size: 9px; background: rgba(255,255,255,0.1); padding: 1px 3px; border-radius: 3px; margin-left: 4px; }
.cp-add-btn { opacity: 0; width: 100%; padding: 2px; text-align: center; font-size: 16px; color: var(--muted); cursor: pointer; border: 1px dashed var(--border); border-radius: 4px; margin-top: auto; }
.cp-cell:hover .cp-add-btn { opacity: 1; }
.cp-add-btn:hover { background: var(--bg-2); color: var(--text); }
.cp-card.bd-brand { border-left-color: var(--brand-red); }
.cp-card.bd-success { border-left-color: var(--success); }
.cp-card.bd-warn { border-left-color: var(--warn); }
.cp-card.bd-info { border-left-color: var(--info); }
.cp-card.bd-purple { border-left-color: #8b5cf6; }
.cp-card.bd-orange { border-left-color: #f97316; }
.cp-card.bd-pink { border-left-color: #ec4899; }
.cp-card.bd-gray { border-left-color: #64748b; }
.cp-cell.is-today { background: rgba(227, 6, 19, 0.05); }

/* Detail modal styles */
.detail-label { text-transform: uppercase; font-size: 10px; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
.detail-value { font-size: 14px; color: var(--text); margin-bottom: 16px; display: block; }
.detail-desc { background: var(--bg-2); padding: 15px; border-radius: 8px; border: 1px solid var(--border-2); white-space: pre-wrap; font-size: 14px; line-height: 1.5; color: var(--text); margin-bottom: 16px; }
.detail-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

/* Category table editable inputs */
.cat-table input { border:none; background:transparent; color:inherit; width:100%; padding:4px 0; }
.cat-table input:focus { border-bottom:1px solid var(--info); outline:none; }

/* Link row for forms */
.link-row { display: grid; grid-template-columns: 1fr 1fr 30px; gap: 5px; margin-bottom: 5px; }

/* Modal overlay */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9999; display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.active { display: flex; animation: fadeIn 0.2s; }
.modal-box { background: var(--bg-1); width: 600px; max-width: 90vw; padding: 20px; border-radius: var(--r-xl); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

/* Context menu */
.context-menu { position: absolute; z-index: 1000; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-lg); display: none; min-width: 180px; overflow: hidden; animation: fadeIn 0.1s ease-in-out; }
.context-menu.active { display: block; }
.context-item { padding: 10px 15px; cursor: pointer; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-2); transition: background 0.1s; }
.context-item:last-child { border-bottom: none; }
.context-item:hover { background: var(--hover); }

/* =========================================================
   FILTER TOOLBAR (Marketing Planner)
   ========================================================= */
.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.filter-toolbar .filter-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.filter-toolbar .filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    color: var(--muted);
}
.filter-toggle:hover {
    border-color: var(--border-2);
    background: var(--bg-3);
}
.filter-toggle.active {
    background: var(--bg-3);
    border-color: var(--text);
    color: var(--text);
}
.filter-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--brand-red);
}

/* =========================================================
   EVENT BAR (Striped pattern for events in Gantt)
   ========================================================= */
.action-bar.event-bar {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.12) 4px,
        rgba(255,255,255,0.12) 8px
    ) !important;
    border: 2px dashed rgba(255,255,255,0.4) !important;
    box-sizing: border-box;
}
.action-bar.event-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
}

/* Gamification bar - tečkovaný vzor */
.action-bar.gamification-bar {
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(255,255,255,0.2) 3px,
        rgba(255,255,255,0.2) 6px
    ) !important;
    border: 2px dotted rgba(255,255,255,0.5) !important;
    box-sizing: border-box;
}
.action-bar.gamification-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
}

/* Event type badges */
.event-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.event-type-badge.race { background: #8b5cf6; color: white; }
.event-type-badge.collab { background: #f97316; color: white; }
.event-type-badge.company { background: var(--info); color: white; }
.event-type-badge.other { background: #64748b; color: white; }

/* Gamification status badges */
.event-type-badge.warn { background: var(--warn); color: #111; }
.event-type-badge.success { background: var(--success); color: #111; }
.event-type-badge.orange { background: #f97316; color: white; }
.event-type-badge.gray { background: #64748b; color: white; }

/* Deprecated - keeping for compatibility */
.event-type-badge.type-influencer_race { background: #8b5cf6; color: white; }
.event-type-badge.type-influencer_collab { background: #f97316; color: white; }
.event-type-badge.type-company { background: var(--info); color: white; }
.event-type-badge.type-other { background: #64748b; color: white; }

/* =========================================================
   EVENT EDIT PANEL (Simplified version)
   ========================================================= */
.event-edit-panel {
    position: fixed;
    right: -500px;
    top: 0;
    width: 450px;
    height: 100vh;
    background: var(--bg-1);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 25px;
}
.event-edit-panel.active {
    right: 0;
}
.event-edit-panel h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.event-edit-panel .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.event-edit-panel .close-btn:hover {
    color: var(--danger);
}
.event-form-group {
    margin-bottom: 18px;
}
.event-form-group label {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
}
.event-form-group input,
.event-form-group select,
.event-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
}
.event-form-group textarea {
    min-height: 100px;
    resize: vertical;
}
.event-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Event Detail Popup */
.event-detail-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.event-detail-popup.active {
    display: flex;
}
.event-detail-content {
    background: var(--bg-1);
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 100%;
    position: relative;
}
.event-detail-content .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-3);
    cursor: pointer;
}
.event-detail-content .close-btn:hover {
    color: var(--text-1);
}
.event-detail-content h3 {
    margin: 0 0 15px 0;
    padding-right: 30px;
    font-size: 20px;
}
.event-detail-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.event-detail-meta .event-type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.event-detail-meta .event-type-badge.race {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}
.event-detail-meta .event-type-badge.collab {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}
.event-detail-meta .event-type-badge.company {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.event-detail-meta .event-type-badge.other {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}
.event-detail-row {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 8px;
}
.event-detail-row:empty {
    display: none;
}
.event-detail-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
}
.event-detail-description:empty {
    display: none;
}

/* =========================================================
   GAMIFICATION DETAIL PAGE
   ========================================================= */
.gm-head {
    margin-bottom: 20px;
}
.gm-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.gm-meta {
    color: var(--muted);
    font-size: 14px;
    margin: 6px 0;
}

/* Akce - flex layout */
.gm-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.gm-actions .block {
    display: inline-flex;
    align-items: center;
}

/* Cancel reason form - speciální layout */
.gm-actions .gm-cancel-reason {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.gm-actions .gm-cancel-reason .input {
    width: 200px;
    margin: 0;
}
.gm-actions .gm-cancel-reason .row {
    display: flex;
    gap: 8px;
}

/* Confirm inline checkbox */
.confirm-inline-center {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin-right: 8px;
}
.confirm-inline-center input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-red);
}

@media (max-width: 900px) {
    .gm-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .gm-actions .gm-cancel-reason {
        margin-left: 0;
        width: 100%;
    }
    .gm-actions .gm-cancel-reason .input {
        width: 100%;
        flex: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHALLENGE CARDS - Influencer challenge list
   ═══════════════════════════════════════════════════════════════════════════ */

.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.challenge-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.challenge-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--brand-red);
}

.challenge-card--invite {
    border-left: 4px solid var(--clr-warn);
}

.challenge-card--running {
    border-left: 4px solid var(--clr-ok);
}

.challenge-card--finished {
    border-left: 4px solid var(--clr-info);
}

.challenge-card--inviting {
    border-left: 4px solid var(--clr-warn);
}

.challenge-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.challenge-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.challenge-card__stats {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.challenge-card__stat {
    text-align: center;
    flex: 1;
}

.challenge-card__stat--main {
    flex: none;
    min-width: 80px;
}

.challenge-card__stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brand-red);
    line-height: 1.2;
}

.challenge-card__stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.challenge-card__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.challenge-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.challenge-card__label {
    font-size: 0.9rem;
    color: var(--muted);
}

.challenge-card__value {
    font-size: 0.9rem;
    color: var(--text);
    font-family: var(--mono);
}

.challenge-card__desc {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.challenge-card__footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.challenge-card__footer .btn {
    width: 100%;
    text-align: center;
}

/* Responsive - single column on mobile */
@media (max-width: 600px) {
    .challenge-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .challenge-card {
        padding: 16px;
    }

    .challenge-card__stat-value {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   HISTORY TABLE - Responsive card layout for mobile
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 700px) {
    .history-table {
        border: none;
    }
    .history-table thead {
        display: none;
    }
    .history-table tbody tr {
        display: block;
        background: var(--bg-1);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
        margin-bottom: 12px;
        padding: 14px;
    }
    .history-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        text-align: right;
    }
    .history-table tbody td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--muted);
        text-align: left;
        margin-right: 12px;
    }
    .history-table tbody td.right {
        text-align: right;
    }
    .history-table tbody td:last-child {
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid var(--border);
        justify-content: center;
    }
    .history-table tbody td:last-child::before {
        display: none;
    }
    .history-table tbody td:last-child .btn {
        width: 100%;
        text-align: center;
    }
}

/* === INFLUENCER EXTENDED FIELDS ========================== */

/* Section Divider */
.section-divider {
  border-top: 1px solid var(--border);
  margin: 20px 0 16px 0;
  padding-top: 16px;
}
.section-divider h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

/* Social Links - Dynamic rows */
.social-links-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.social-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.social-link-row input:first-child {
  flex: 0 0 140px;
}
.social-link-row input:nth-child(2) {
  flex: 1;
}
.social-link-row .btn {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .social-link-row {
    flex-wrap: wrap;
  }
  .social-link-row input:first-child {
    flex: 1 1 100px;
  }
}

/* Row-edit no hover */
.row-edit td {
  background: var(--bg-1) !important;
}

/* Contract Status Badges */
.contract-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.contract-badge.valid {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-br);
}
.contract-badge.expired {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-br);
}
.contract-badge.warning {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-br);
}
.contract-badge.none {
  background: var(--bg-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Contracts List */
.contracts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.contract-item {
  background: var(--bg-2);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.contract-item a {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}