/* ══════════════════════════════════════════════════════════
   funnel.css — Funnel 2.0
   Port <style> z sales-funnel-calculator.html (třídy 1:1, aby
   výstup funnel.js seděl) + obal appky (obrazovky, tlačítka)
   + @media print pro čistý tisk výsledku.
   ══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px;
  color: #1a1a2e;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
  padding: 24px 32px;
  width: 100%;
  max-width: 660px;
}

h1 { font-size: 1.45rem; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; }
.subtitle { font-size: 0.88rem; color: #6b7280; margin-bottom: 14px; }

/* ── Tabs ── */
.tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-bottom: 22px;
  border-bottom: 2px solid #f3f4f6;
  flex-wrap: wrap;
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tab:hover { color: #374151; background: #f9fafb; }
.tab.active { color: #1e40af; border-bottom-color: #3b82f6; font-weight: 600; }
.tab.overview-tab { font-weight: 600; }
.tab-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  font-size: 0.78rem;
  color: #d1d5db;
  line-height: 1;
  flex-shrink: 0;
}
.tab-x:hover { color: #ef4444; background: #fef2f2; }
.tab-add {
  background: none;
  border: 1.5px dashed #d1d5db;
  color: #9ca3af;
  padding: 5px 10px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  margin-bottom: -2px;
  transition: all 0.15s;
  line-height: 1;
}
.tab-add:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }

/* ── Section headings ── */
.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 8px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.section-header .section-title { margin-bottom: 0; }

/* ── Pipeline name input ── */
.pipeline-label-input {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: block;
}
.pipeline-label-input:hover,
.pipeline-label-input:focus { background: #eff6ff; outline: 1px solid #bfdbfe; }

/* ── Financial goal inputs ── */
.input-group { margin-bottom: 16px; }
.input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 16px;
}
.input-row label { font-size: 0.92rem; color: #374151; flex: 1; }
.input-wrapper {
  display: flex;
  align-items: center;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  overflow: visible;
  background: #f9fafb;
  transition: border-color 0.15s;
}
.input-wrapper:focus-within { border-color: #3b82f6; background: #fff; }
.input-wrapper input[type="number"] {
  border: none;
  background: transparent;
  padding: 7px 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e40af;
  width: 90px;
  text-align: right;
  outline: none;
}
.input-wrapper .unit {
  padding: 7px 10px 7px 4px;
  font-size: 0.85rem;
  color: #6b7280;
  white-space: nowrap;
}

/* ── Divider ── */
.divider { border: none; border-top: 1.5px solid #f3f4f6; margin: 4px 0 16px; }

/* ── Funnel rows (fixed: hledání kontaktů, uzavřená smlouva) ── */
.funnel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 9px;
  background: #f8faff;
  border: 1.5px solid #e5eaf5;
}
.funnel-row.contract { background: #eef2ff; border-color: #c7d2fe; }
.funnel-row-label { font-size: 0.92rem; color: #374151; font-weight: 500; }
.funnel-row.contract .funnel-row-label { font-weight: 700; color: #1e40af; }
.funnel-row-right { display: flex; align-items: center; gap: 10px; }
.funnel-count { font-size: 1.1rem; font-weight: 700; color: #1e40af; min-width: 44px; text-align: right; }
.funnel-row.contract .funnel-count { color: #4f46e5; }

/* ── Compact slider+number ── */
.ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  padding: 3px 6px;
  background: #f9fafb;
  transition: border-color 0.15s;
}
.ctrl:focus-within { border-color: #3b82f6; background: #fff; }
.ctrl input[type="range"] {
  -webkit-appearance: none;
  width: 58px;
  height: 4px;
  border-radius: 2px;
  background: #d1d5db;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}
.ctrl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
}
.ctrl input[type="number"] {
  border: none;
  background: transparent;
  width: 44px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e40af;
  text-align: right;
  outline: none;
  padding: 1px 2px;
}
.ctrl .unit { font-size: 0.8rem; color: #6b7280; }

/* ── Arrow ── */
.funnel-arrow {
  text-align: center;
  color: #d1d5db;
  font-size: 0.9rem;
  margin: 4px 0;
}

/* ── Delete button ── */
.delete-btn {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.delete-btn:hover { color: #ef4444; background: #fef2f2; }
.delete-ph { width: 26px; flex-shrink: 0; }

/* ── Step blocks ── */
.step-block {
  background: #f8faff;
  border: 1.5px solid #e5eaf5;
  border-radius: 9px;
  padding: 9px 14px;
}
.step-block.has-warning { border-color: #fca5a5; background: #fff8f8; }
.step-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  gap: 8px;
}
.step-name-input {
  border: none;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 600;
  color: #374151;
  flex: 1;
  min-width: 60px;
  outline: none;
  padding: 3px 5px;
  border-radius: 4px;
}
.step-name-input:hover,
.step-name-input:focus { background: #eff6ff; outline: 1px solid #bfdbfe; }
.step-count { font-size: 1.1rem; font-weight: 700; color: #1e40af; white-space: nowrap; }
.meeting-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.sub-label { font-size: 0.82rem; color: #6b7280; flex: 1; min-width: 0; }
.sub-annotation { font-size: 0.82rem; color: #6b7280; margin-left: auto; white-space: nowrap; }
.meeting-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.info-lost { font-size: 0.78rem; color: #9ca3af; }
.warning-text { font-size: 0.78rem; color: #ef4444; font-weight: 500; }

/* ── Add step button ── */
.add-step-wrap { text-align: center; margin: 4px 0; }
.add-step-btn {
  background: none;
  border: 1.5px dashed #d1d5db;
  color: #9ca3af;
  font-size: 0.8rem;
  padding: 3px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.add-step-btn:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }

/* ── Contracts note & close rate hint ── */
.contracts-note { font-size: 0.78rem; color: #9ca3af; text-align: right; margin-top: 5px; }
.close-rate-note {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  margin-top: 8px;
  padding: 6px 12px;
  background: #f3f4f6;
  border-radius: 6px;
}

/* ── Weekly plan ── */
.weekly-box {
  margin-top: 10px;
  border: 1.5px solid #e5eaf5;
  border-radius: 9px;
  padding: 12px 16px;
  background: #f8faff;
}
.weekly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.weekly-header .section-title { margin-bottom: 0; }
.days-input {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: #6b7280;
}
.days-input input {
  border: 1.5px solid #d1d5db;
  border-radius: 5px;
  background: #f9fafb;
  padding: 3px 8px;
  width: 56px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e40af;
  text-align: center;
  outline: none;
}
.days-input input:focus { border-color: #3b82f6; background: #fff; }
.weekly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.weekly-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
}
.weekly-item .w-label { color: #6b7280; }
.weekly-item .w-val   { font-weight: 700; color: #1e40af; }
.weekly-item .w-day   { font-size: 0.75rem; color: #9ca3af; margin-left: 4px; }

/* ── Result box ── */
.result-box {
  margin-top: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
  border-radius: 10px;
  padding: 18px 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-box .result-label { font-size: 0.92rem; opacity: 0.85; }
.result-box .result-value { font-size: 1.5rem; font-weight: 800; }

/* ── Overview / Summary boxes ── */
.summary-box {
  margin-top: 10px;
  padding: 14px 16px;
  background: #f8faff;
  border: 1.5px solid #e5eaf5;
  border-radius: 9px;
}
.summary-box.clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.summary-box.clickable:hover {
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}
.summary-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.88rem;
  color: #374151;
}
.summary-row span { white-space: nowrap; }

/* ══════════════════════════════════════════════════════════
   OBAL APPKY (funnel 2.0) — obrazovky, tlačítka, admin
   ══════════════════════════════════════════════════════════ */

.screen { display: none; }
.screen.active { display: block; }

.lead { font-size: 0.95rem; color: #374151; margin-bottom: 16px; line-height: 1.5; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  padding: 10px 12px;
  font-size: 0.98rem;
  color: #1a1a2e;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: #3b82f6; background: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  font-family: inherit;
}
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1.5px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-block { width: 100%; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.actions.between { justify-content: space-between; }

.msg { font-size: 0.85rem; margin-top: 10px; min-height: 1.1em; }
.msg.error { color: #dc2626; }
.msg.ok { color: #059669; }

.identity-strip {
  font-size: 0.82rem;
  color: #6b7280;
  background: #f8faff;
  border: 1.5px solid #e5eaf5;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
}
.identity-strip strong { color: #374151; }

.notice {
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.notice.locked { background: #fff8f8; border: 1.5px solid #fca5a5; color: #b91c1c; }

.big-check {
  font-size: 2.6rem;
  text-align: center;
  margin: 8px 0 4px;
}

/* ── Admin ── */
.lock-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  border: 1.5px solid #e5eaf5;
  background: #f8faff;
}
.lock-panel.on { background: #fff8f8; border-color: #fca5a5; }
.lock-state { font-weight: 700; }
.lock-panel .lock-state { color: #059669; }
.lock-panel.on .lock-state { color: #b91c1c; }

.reveal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 3px 8px;
}

table.subs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-top: 8px;
}
table.subs th, table.subs td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
}
table.subs th { color: #9ca3af; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.subs tr.clickable { cursor: pointer; }
table.subs tr.clickable:hover td { background: #f8faff; }

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.pill.sent   { background: #ecfdf5; color: #059669; }
.pill.failed { background: #fef2f2; color: #dc2626; }
.pill.skipped{ background: #f3f4f6; color: #6b7280; }

.sub-detail {
  margin-top: 12px;
  border: 1.5px solid #e5eaf5;
  border-radius: 9px;
  padding: 14px 16px;
  background: #f8faff;
}

@media (max-width: 520px) {
  .card { padding: 24px 16px; }
  .sub-label { flex: 1; min-width: 0; }
  .ctrl input[type="range"] { width: 42px; }
  .summary-row { gap: 12px; }
}

/* ══════════════════════════════════════════════════════════
   TISK — čistý výstup výsledku (skryje chrome i ovládání)
   ══════════════════════════════════════════════════════════ */
@media print {
  body { background: #fff; padding: 0; display: block; }
  .card { box-shadow: none; border-radius: 0; max-width: 100%; padding: 0; }
  .no-print,
  .tabs,
  .actions,
  .tab-add,
  .tab-x,
  .add-step-wrap,
  .delete-btn,
  .btn { display: none !important; }
  .print-only { display: block !important; }
  .step-name-input, .pipeline-label-input, .ctrl input,
  .input-wrapper input, .days-input input {
    color: #1a1a2e !important;
  }
  .result-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .summary-box, .weekly-box, .step-block, .funnel-row { break-inside: avoid; }
}
.print-only { display: none; }
