/* Papaia PM — on top of the playground portal's style.css (same paper-white chrome, hairlines, Inter). */
body { min-height: 100vh; }
.topbar h1 a.home { text-decoration: none; }
.pm-nav { display: flex; gap: 4px; }
button.small, .small { padding: 3px 8px; font-size: 12px; }
.spacer { flex: 1; }
.right { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.small-note { font-size: 12px; margin: 6px 0; }

/* two-factor / login pages (server-rendered) */
.tfa-card { width: 360px; max-width: calc(100vw - 24px); }
.tfa-card p { margin: 0; }
.tfa-inline { display: contents; }
.tfa-card input[name=code] { font-size: 18px; letter-spacing: .2em; text-align: center; }
.tfa-note { color: var(--muted); font-size: 12px; }
.login-error a { color: inherit; }

/* layout: project tree left, page right */
.pm-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 46px); }
.pm-side { border-right: 1px solid var(--border); padding: 18px 10px 30px 14px; background: #fcfcfc; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
.tree { display: flex; flex-direction: column; gap: 1px; }
.tree-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px calc(8px + var(--d, 0) * 14px); border-radius: 6px; text-decoration: none; color: var(--text); }
.tree-item:hover { background: var(--panel2); }
.tree-item.active { background: var(--accent); color: #fff; }
.tree-item.active .tree-count { color: #ddd; }
.tree-item.dim .tree-name { color: var(--muted); }
.tree-item.active.dim .tree-name { color: #ddd; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { font-size: 11px; color: var(--muted); }
.pm-main { padding: 26px 30px 60px; min-width: 0; max-width: 1400px; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h2 { font-size: 20px; font-weight: 600; margin: 0; flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--muted); min-height: 16px; }
.crumbs a { color: var(--muted); }
.pdesc { white-space: pre-wrap; max-width: 820px; margin: 6px 0; }
.pmeta { font-size: 12px; margin: 4px 0 10px; }
.intro-note { max-width: 820px; }
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--text); font-size: 12px; text-decoration: none; white-space: nowrap; }
.chip.dim { color: var(--muted); }
a.chip:hover { background: #ececec; }
button.x { border: 0; background: transparent; padding: 0 2px; color: var(--muted); font-size: 14px; line-height: 1; }
button.x:hover { color: var(--err); }
.assign { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; font-size: 12px; }
.assign select { padding: 2px 6px; font-size: 12px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 16px 0 12px; }
.toolbar input[type=search] { min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; }
.seg button.on { background: var(--accent); color: #fff; }

/* badges */
.badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.badge.ps-aktiv { background: hsla(120, 60%, 30%, .1); color: var(--ok); }
.badge.ps-pausiert { background: hsla(40, 80%, 45%, .14); color: #8a5f00; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.tag.p-hoch { background: hsla(28, 90%, 50%, .14); color: #9a4d00; }
.tag.p-dringend { background: hsla(0, 70%, 50%, .14); color: var(--err); }
.tag.p-niedrig { color: #a5a5a5; }
.st { font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; background: var(--panel2); }
.st-in_arbeit { background: hsla(208, 60%, 45%, .12); color: hsl(208, 55%, 35%); }
.st-review { background: hsla(270, 50%, 50%, .12); color: hsl(270, 40%, 40%); }
.st-erledigt { background: hsla(120, 60%, 30%, .1); color: var(--ok); }
.dep { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dep.on { color: var(--err); font-weight: 500; }
.late { color: var(--err); }

/* list */
.etable td a { text-decoration: none; }
.etable td a:hover { text-decoration: underline; }
.etable tr.done td { color: var(--muted); }
.etable.audit pre { font-size: 11px; white-space: pre-wrap; margin: 4px 0 0; max-width: 700px; }
.empty { margin-top: 20px; }

/* board */
.board4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: hsla(0, 0%, 45%, .06); border-radius: 12px; padding: 10px; min-height: 140px; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col header { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 2px 4px 10px; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.ecard { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 8px; border-radius: 10px; background: #fff; border: 1px solid rgba(0,0,0,.1); text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ecard:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.ecard.drag { opacity: .4; }
.ecard.prio-dringend { border-left: 3px solid var(--err); }
.ecard.prio-hoch { border-left: 3px solid #e08a2a; }
.etitle { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.emeta { display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--muted); }

/* overview cards */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pcard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: hsla(0, 0%, 45%, .06); text-decoration: none; color: inherit; }
.pcard:hover { background: hsla(0, 0%, 45%, .1); }
.pcard .kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pcard .name { font-size: 15px; font-weight: 600; }
.pcard .bar { height: 4px; border-radius: 2px; background: rgba(0,0,0,.08); overflow: hidden; }
.pcard .bar span { display: block; height: 100%; background: var(--ok); }
.pcard .muted { font-size: 12px; }

/* dialogs */
.pm-dialog { border: 1px solid var(--border); border-radius: 6px; padding: 0; width: min(760px, calc(100vw - 20px)); max-height: calc(100vh - 30px); }
.pm-dialog::backdrop { background: rgba(0,0,0,.25); }
.dform { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.dform h3 { margin: 0 0 4px; font-size: 15px; }
.dform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.dform input, .dform select, .dform textarea { font: inherit; color: var(--text); width: 100%; }
.dform textarea { border: 1px solid var(--border); border-radius: 2px; padding: 6px 10px; resize: vertical; background: var(--panel2); }
.dform [readonly], .dform select:disabled { background: #fff; border-color: transparent; padding-left: 0; resize: none; opacity: 1; }
.row2, .row3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dactions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.entry { display: flex; flex-direction: column; }
.ehead { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 0; }
.entry > .small-note { padding: 0 20px; }
.deps, .comments { padding: 4px 20px 16px; border-top: 1px solid var(--border); }
.deps h4, .comments h4 { font-size: 12px; font-weight: 600; margin: 12px 0 6px; }
.deps ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.deps li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.deps li a { text-decoration: none; }
.hidden-dep { color: var(--muted); font-style: italic; }
.depadd { margin-top: 8px; }
.depadd input { width: 100%; }
.hits { margin-top: 4px !important; max-height: 200px; overflow: auto; }
.hits button { width: 100%; text-align: left; background: transparent; border-color: transparent; }
.hits button:hover { border-color: var(--border); background: var(--panel2); }
.comment { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.comment header { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.cbody { white-space: pre-wrap; margin-top: 4px; overflow-wrap: anywhere; }
.cform { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.cform textarea { width: 100%; font: inherit; border: 1px solid var(--border); border-radius: 2px; padding: 6px 10px; resize: vertical; }

.toast { position: fixed; right: 18px; bottom: 18px; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 13px; z-index: 50; max-width: 420px; }
.toast.bad { background: var(--err); }

@media (max-width: 1000px) { .board4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .pm-layout { grid-template-columns: 1fr; }
  .pm-side { border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 12px; }
  .tree { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .tree-item { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
  .pm-main { padding: 18px 14px 50px; }
  .board4 { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .topbar .pm-nav { order: 3; flex-basis: 100%; }
}
