/* Promyk ☀ — warm, ruhig, groß. Für Kasia. */
:root {
  --cream: #fdf8f0;
  --card: #ffffff;
  --peach: #f7c98b;
  --peach-d: #e8a44b;
  --sun: #f0a830;
  --ink: #3d3428;
  --ink-soft: #7a6f5f;
  --line: #ece2d0;
  --ok: #6aa84f;
  --warn-bg: #fff5d6;
  --danger: #b4442c;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(120, 90, 40, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16.5px; line-height: 1.55;
  color: var(--ink); background: var(--cream);
  min-height: 100vh; display: flex; flex-direction: column;
}
h1 { font-size: 1.7rem; margin-bottom: 10px; }
h2 { font-size: 1.25rem; margin-bottom: 8px; }
h3 { font-size: 1.05rem; margin-bottom: 6px; }
a { color: var(--peach-d); }
code { background: #f4ede0; padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }

.container { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 22px 18px 40px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.86rem; }
.lead { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 18px; }

/* Topbar — innen auf Inhaltsbreite zentriert, damit Logo und Menü
   bündig mit dem Seiteninhalt stehen (nichts klebt am Bildschirmrand) */
.topbar {
  padding: 12px 0; background: var(--card);
  border-bottom: 2px solid var(--peach);
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
  max-width: var(--max-w, 1100px); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.brand { font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.mainnav { display: flex; gap: 1px; flex-wrap: wrap; align-items: center; }
.mainnav a {
  text-decoration: none; color: var(--ink); padding: 7px 9px;
  border-radius: 999px; font-weight: 500; font-size: 0.94rem; white-space: nowrap;
}
.mainnav a:hover { background: var(--cream); }
.navlabel { display: none; }
.navbtn {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 0.94rem; color: var(--ink); padding: 7px 9px;
  border-radius: 999px; font-weight: 500; white-space: nowrap;
}
.navbtn:hover { background: var(--cream); }
.doc-actions { display: flex; align-items: center; gap: 12px; }
.langbtn { border: 1.5px solid var(--line); font-size: 0.8rem; font-weight: 700; padding: 5px 10px; }

/* Dokumenten-Tabelle */
.tablewrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.doctable { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.doctable th, .doctable td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.doctable th { background: var(--cream); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.doctable tr:last-child td { border-bottom: none; }
.nowrap { white-space: nowrap; }

/* Dokument-Vorschau */
.previewbox summary { cursor: pointer; font-weight: 700; }
.doc-preview-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; background: #fff; }
.doc-preview-img { max-width: 100%; max-height: 75vh; display: block; margin: 10px auto 0; border-radius: 10px; box-shadow: var(--shadow); }

/* Foto-Session */
.sesja-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.pagegrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px; margin: 16px 0;
}
.pagecard {
  position: relative; border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow); aspect-ratio: 3/4; background: #eee;
}
.pagecard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pagefill {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 0;
  background: rgba(240, 168, 48, 0.45); transition: height 1.2s ease;
  pointer-events: none;
}
.pagefill.active { animation: pulse 1.2s ease-in-out infinite alternate; }
.pagefill.done { background: rgba(106, 168, 79, 0.4); }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 0.9; } }
.pagenum {
  position: absolute; top: 6px; left: 6px; background: rgba(255,255,255,0.92);
  border-radius: 999px; min-width: 26px; height: 26px; display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem;
}
.pagedel {
  position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,0.92);
  border: none; border-radius: 999px; width: 26px; height: 26px;
  cursor: pointer; font-weight: 700; color: var(--danger);
}

/* Sprachnotiz */
.voicebox {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--cream); border: 1.5px dashed var(--peach);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 14px;
}

/* Suche */
.searchbar.big { display: flex; gap: 10px; max-width: 640px; margin: 14px 0 22px; }
.searchbar.big input { font-size: 1.05rem; padding: 12px 16px; }
.searchresults { list-style: none; }
.searchresults li {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; margin-bottom: 10px;
}
.result-title { font-weight: 700; text-decoration: none; color: var(--ink); margin-right: 8px; }
.result-title:hover { color: var(--peach-d); }
.result-snippet { font-size: 0.92rem; color: var(--ink-soft); margin-top: 5px; }
.result-snippet mark { background: #ffe9a8; color: var(--ink); border-radius: 3px; padding: 0 2px; }

/* Flash */
.flashes { max-width: 1100px; margin: 12px auto 0; padding: 0 18px; }
.flash {
  background: #eef7e6; border: 1px solid #cfe6bd; color: #3c5c28;
  border-radius: var(--radius); padding: 10px 16px; margin-bottom: 8px;
}
.flash.error { background: #fdecec; border-color: #f0c4c4; color: #7c2626; }

/* Login */
.login-wrap { display: flex; justify-content: center; padding: 7vh 10px 0; }
.login-card {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow);
  padding: 40px 36px; width: 100%; max-width: 400px; text-align: center;
}
.login-sun { font-size: 3.4rem; margin-bottom: 6px; }
.login-card form { text-align: left; margin-top: 22px; }
.login-card label { display: block; margin-bottom: 14px; font-weight: 600; }
.login-card input {
  width: 100%; margin-top: 5px; padding: 12px 14px; font-size: 1rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--cream);
}

/* Hero + Karten */
.hero-welcome { text-align: center; padding: 26px 0 8px; }
.hero-welcome h1 { font-size: 2.1rem; }
.cards3 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; margin: 24px 0 30px;
}
.bigcard {
  display: block; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 22px; text-decoration: none;
  color: var(--ink); border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
}
.bigcard:hover { transform: translateY(-3px); border-color: var(--peach); }
.bigcard-icon { font-size: 2.2rem; margin-bottom: 8px; }
.bigcard p { color: var(--ink-soft); font-size: 0.94rem; }
.bigcard-note { margin-top: 12px; font-size: 0.85rem; color: var(--peach-d); font-weight: 600; }

/* Panels & Formulare */
.panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 20px;
}
.form-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; max-width: 720px;
}
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 0.95rem; }
input, select, textarea {
  width: 100%; margin-top: 4px; padding: 10px 12px; font-size: 1rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fffdf9;
  font-family: inherit; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--peach); border-color: var(--peach); }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }
.hint {
  background: var(--warn-bg); border-radius: 10px; padding: 8px 14px;
  font-size: 0.9rem; margin: 8px 0 14px;
}
.hint.warn { border: 1px solid #eedb9a; }

/* Buttons */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--peach); }
.btn.primary { background: var(--sun); border-color: var(--sun); color: #fff; }
.btn.primary:hover { background: var(--peach-d); border-color: var(--peach-d); }
.btn.big { padding: 12px 26px; font-size: 1.05rem; }
.btn.small { padding: 5px 12px; font-size: 0.85rem; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.linkbtn {
  background: none; border: none; color: var(--peach-d); cursor: pointer;
  font-size: 0.85rem; text-decoration: underline; padding: 0; font-family: inherit;
}
.linkbtn.danger { color: var(--danger); }
.inline { display: inline; }
.inline.right { margin-left: auto; }

/* Kinder */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.searchbar { margin: 10px 0 18px; max-width: 380px; }
.childgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.childcard {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; text-decoration: none; color: var(--ink);
  border: 2px solid transparent; transition: border-color .15s;
}
.childcard:hover { border-color: var(--peach); }
.childcard-name { font-weight: 700; font-size: 1.08rem; margin-bottom: 4px; }
.badge {
  display: inline-block; background: var(--warn-bg); color: #8a6d1f;
  border-radius: 999px; font-size: 0.72rem; padding: 2px 9px; font-weight: 600;
  vertical-align: middle; font-style: normal;
}

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 16px 0 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px; text-decoration: none; color: var(--ink-soft); font-weight: 600;
  border-radius: 10px 10px 0 0; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--sun); background: #fff; }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* Eigenschaften */
.histtoggle { text-align: right; margin-bottom: 8px; }
.traitgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.traitcol { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.traitcol-h { padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.cat-mocne_strony { border-bottom-color: #9ac37c; }
.cat-slabe_strony { border-bottom-color: #dfa07e; }
.cat-cechy { border-bottom-color: #b9a7e0; }
.cat-zainteresowania { border-bottom-color: #86c5d8; }
.cat-potrzeby { border-bottom-color: #e8c15f; }
.cat-bariery { border-bottom-color: #cf8f8f; }
.traitlist { list-style: none; margin: 10px 0; }
.traitlist li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.traitlist li.ended { opacity: 0.55; }
.trait-meta { font-size: 0.78rem; color: var(--ink-soft); margin-top: 3px; }
.trait-add { display: flex; gap: 8px; margin-top: 10px; }
.trait-add input { flex: 1; margin-top: 0; }

/* Ziele / Sitzungen / Dokumente */
.goallist, .sessionlist, .doclist, .samplelist { list-style: none; }
.goallist li, .doclist li, .samplelist li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 17px; margin-bottom: 9px; flex-wrap: wrap;
}
.sessionlist li {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 17px; margin-bottom: 9px;
}
.session-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.session-notes { white-space: pre-wrap; font-size: 0.95rem; }
.chip {
  display: inline-block; background: var(--cream); border: 1px solid var(--line);
  border-radius: 999px; font-size: 0.76rem; padding: 2px 10px; color: var(--ink-soft);
}
.chip.ok { background: #eef7e6; border-color: #cfe6bd; color: #3c5c28; }
.doclist a { text-decoration: none; color: var(--ink); font-weight: 600; }
.doc-type {
  display: inline-block; background: var(--peach); color: #6b4a12;
  border-radius: 7px; padding: 2px 9px; font-size: 0.8rem; font-weight: 700; margin-right: 6px;
}
.status { border-radius: 999px; padding: 3px 12px; font-size: 0.8rem; font-weight: 700; }
.status-szkic { background: var(--warn-bg); color: #8a6d1f; }
.status-w_edycji { background: #e6f0fa; color: #2a5b8a; }
.status-zatwierdzony { background: #eef7e6; color: #3c5c28; }

/* Editor */
.section-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-text { width: 100%; margin-top: 8px; font-size: 0.98rem; line-height: 1.5; }
.section-text.has-gap { border-color: #e8c15f; background: #fffbe9; }
.editor-actions {
  display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0;
  background: var(--cream); padding: 12px 0; border-top: 1px solid var(--line);
}
.flagbox {
  background: #fdecec; border: 1px solid #f0c4c4; border-radius: 10px;
  padding: 10px 14px; margin: 8px 0; font-size: 0.9rem; color: #7c2626;
}
.flagbox ul { margin: 6px 0 0 18px; }
.gap-hint { margin-bottom: 14px; }
.finalize-panel .check { font-weight: 500; margin: 8px 0 12px; }
.finalize-panel .check input { width: auto; margin-right: 8px; }
.check { display: block; font-weight: 400; margin: 6px 0; padding: 6px 10px;
  border-radius: 8px; background: var(--cream); cursor: pointer; }
.check input { width: auto; margin-right: 8px; }
.check:has(input:not(:checked)) { opacity: 0.55; }

/* Wizard */
.wizard-step { margin-bottom: 22px; }
.choosegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.chooser {
  display: flex; align-items: center; gap: 10px; background: var(--cream);
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; font-weight: 500;
}
.chooser:has(input:checked) { border-color: var(--sun); background: #fff6e6; }
.chooser input { width: auto; margin: 0; }

/* Jobbox */
.jobbox {
  display: flex; align-items: center; gap: 12px; background: #fff6e6;
  border: 1.5px solid var(--peach); border-radius: var(--radius);
  padding: 13px 18px; margin: 14px 0; font-weight: 600;
}
.jobbox.error { background: #fdecec; border-color: #f0c4c4; }
.spinner {
  width: 20px; height: 20px; border: 3px solid var(--peach);
  border-top-color: transparent; border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.spinner.small { width: 14px; height: 14px; border-width: 2.5px; display: inline-block; }
.inline-spin { vertical-align: middle; margin-right: 6px; }

/* Schwebendes Hintergrund-Widget */
.jobwidget {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.jw-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1.5px solid var(--peach);
  border-radius: 12px; box-shadow: 0 4px 16px rgba(120,90,40,0.18);
  padding: 11px 14px; font-size: 0.9rem;
}
.jw-item.jw-done { border-color: var(--ok); background: #f2f9ec; }
.jw-item.jw-err { border-color: var(--danger); background: #fdf0ee; }
.jw-item b { font-weight: 700; }
.jw-item a { text-decoration: none; color: var(--peach-d); font-weight: 700; }
.jw-item .jw-check { color: var(--ok); font-size: 1.2rem; font-weight: 800; }
.jw-bar { width: 100%; height: 6px; background: rgba(240,168,48,0.2); border-radius: 999px; margin-top: 5px; overflow: hidden; }
.jw-fill { height: 100%; background: linear-gradient(90deg, var(--peach), var(--sun)); border-radius: 999px; transition: width 0.8s ease; }
.jw-x { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 0.9rem; align-self: flex-start; }
.jw-item > div { flex: 1; min-width: 0; }
@media (max-width: 640px) { .jobwidget { left: 12px; right: 12px; max-width: none; bottom: 12px; } }

/* Fortschrittsbalken (Dokument-Generierung) */
.jobbox-col { flex-direction: column; align-items: stretch; gap: 10px; }
.jobbox-row { display: flex; align-items: center; gap: 12px; }
.jobeta { margin-left: auto; font-weight: 700; color: var(--peach-d); white-space: nowrap; }
.progressbar { width: 100%; height: 10px; background: rgba(240,168,48,0.18); border-radius: 999px; overflow: hidden; }
.progressbar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--peach), var(--sun)); border-radius: 999px; transition: width 0.8s ease; }
.sec-state { display: inline-block; }
.sec-state.done { color: var(--ok); }
.mini-spin {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px;
  border: 2px solid var(--peach); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Stil-Seite */
.uploadform { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.uploadform input[type=file] { width: auto; flex: 1; min-width: 220px; }
.sample-actions { display: flex; gap: 12px; align-items: center; }
.profileform { margin-top: 14px; max-width: 680px; }

/* Einstellungen */
.ailist { list-style: none; }
.ailist li { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }
.pwform { max-width: 380px; }

/* Danger zone */
.dangerzone { margin-top: 26px; border: 1.5px solid #f0c4c4; border-radius: var(--radius); padding: 12px 16px; background: #fff9f9; }
.dangerzone summary { cursor: pointer; color: var(--danger); font-weight: 700; }
.danger-text { color: var(--danger); margin: 10px 0; font-size: 0.92rem; }
.dangerzone form { max-width: 340px; }

/* Footer */
.footer { text-align: center; padding: 18px; color: var(--ink-soft); font-size: 0.88rem; }

/* Tour */
.tour-overlay {
  position: fixed; inset: 0; background: rgba(40, 30, 10, 0.45); z-index: 90;
}
.tour-box {
  position: fixed; z-index: 95; background: var(--card); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25); padding: 20px 22px; max-width: 340px;
}
.tour-box h3 { margin-bottom: 6px; }
.tour-box p { font-size: 0.94rem; color: var(--ink-soft); margin-bottom: 14px; }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tour-highlight { position: relative; z-index: 92; box-shadow: 0 0 0 4px var(--sun); border-radius: var(--radius); }

/* Mobil */
.burger {
  display: none; background: none; border: 1.5px solid var(--line);
  border-radius: 10px; font-size: 1.3rem; padding: 4px 12px; cursor: pointer;
  color: var(--ink); font-family: inherit;
}
@media (max-width: 740px) {
  .burger { display: block; }
  .mainnav {
    display: none; width: 100%; flex-direction: column; gap: 2px;
    padding-top: 8px; border-top: 1px solid var(--line); margin-top: 8px;
  }
  .mainnav.open { display: flex; }
  .mainnav a, .mainnav .navbtn { padding: 12px 14px; font-size: 1.02rem; width: 100%; text-align: left; }
  .mainnav .inline { display: block; }
  .navlabel { display: inline; }
}
@media (max-width: 640px) {
  .form-row2, .form-row3 { grid-template-columns: 1fr; }
  .hero-welcome h1 { font-size: 1.6rem; }
  .editor-actions { position: static; }
}
