/* Akten & Immobilien – ergänzt mm.css + kontakte.css */
.amain{display:flex;gap:16px;padding:16px 20px 16px;height:calc(100vh - 48px);min-width:0;flex:1}
.alist{width:400px;flex-shrink:0;display:flex;flex-direction:column;min-height:0}
.alist-head{display:flex;justify-content:space-between;align-items:flex-end;gap:8px;margin-bottom:10px}
.alist-head h1{font-size:24px;line-height:30px}
.alist-tools{display:flex;gap:8px;margin-bottom:8px}
.alist-tools .selectwrap select{min-width:0;width:100%}.alist-tools .selectwrap{flex:1}
.alist-scroll{flex:1;overflow-y:auto;background:var(--surface);border:1px solid var(--stroke-3);border-radius:8px;box-shadow:var(--shadow)}
.aitem{display:flex;gap:10px;align-items:center;padding:9px 12px;border-bottom:1px solid var(--stroke-3);cursor:pointer}
.aitem:hover{background:var(--surface-2)}
.aitem.sel{background:var(--brand-soft);box-shadow:inset 3px 0 0 var(--brand)}
.aitem .t{flex:1;min-width:0}
.aitem .t b{display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aitem .t small{display:block;color:var(--text-2);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aitem .r{text-align:right;font-size:12px;white-space:nowrap}
.aitem .r b{display:block;font-variant-numeric:tabular-nums}
.sdot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:1px}
.adetail{flex:1;min-width:0;overflow-y:auto;background:var(--surface);border:1px solid var(--stroke-3);border-radius:8px;box-shadow:var(--shadow)}
.ahead{display:flex;gap:16px;align-items:center;padding:20px 24px 14px;flex-wrap:wrap}
.ahead h2{margin:0;font-size:22px;line-height:28px}
.ahead p{margin:2px 0 0;color:var(--text-2)}
.ahead .grow{flex:1;min-width:220px}
.ahead .statsel select{min-width:210px}
.afig{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;padding:0 24px 16px}
.afig div{background:var(--surface-2);border:1px solid var(--stroke-3);border-radius:6px;padding:10px 12px}
.afig small{display:block;color:var(--text-2);font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.3px}
.afig b{font-size:18px;font-variant-numeric:tabular-nums}
.afig .neg b{color:var(--ok)} .afig .pos b{color:var(--warn)}
.atabs{padding:0 24px;margin-bottom:0;position:sticky;top:0;background:var(--surface);z-index:3}
.atab{padding:18px 24px 28px}
.fgrid3{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px 16px;margin-bottom:18px}
.fgrid3 .wide{grid-column:1/-1}
.fl input.saving,.fl select.saving,.fl textarea.saving{background:var(--brand-soft)}
.fl input.bad{border-color:var(--err);background:var(--err-soft)}
.telwrap{display:flex;gap:4px;align-items:center}
.telwrap input{flex:1;min-width:0}
.dialbtn{flex:none;width:32px;height:32px;display:grid;place-items:center;border-radius:4px;color:var(--brand);border:1px solid var(--stroke-2,var(--stroke-3))}
.dialbtn[hidden]{display:none}
.dialbtn:hover{background:var(--brand-soft)}
.dialbtn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round}
.fl .ro{height:32px;display:flex;align-items:center;font-weight:400;color:var(--text)}
.sect{margin:6px 0 10px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.sect h3{margin:0;font-size:15px}
table.ptab{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;margin-bottom:18px}
.ptab th{text-align:left;font-size:12px;color:var(--text-2);font-weight:600;padding:6px 8px;border-bottom:1px solid var(--stroke-2);background:var(--surface-2)}
.ptab td{padding:2px 4px;border-bottom:1px solid var(--stroke-3)}
.ptab td.num,.ptab th.num{text-align:right}
.ptab tfoot td{font-weight:600;padding:8px;background:var(--surface-2)}
.pin{font:inherit;color:var(--text);width:100%;height:30px;padding:0 6px;border:1px solid transparent;border-radius:4px;background:transparent}
.pin:hover{border-color:var(--stroke-2)}
.pin:focus{outline:none;border-color:var(--stroke);border-bottom:2px solid var(--brand);background:var(--surface)}
.pin.num{text-align:right}
.kcardx{display:flex;gap:16px;align-items:flex-start;padding:16px;border:1px solid var(--stroke-3);border-radius:8px;margin-bottom:18px;background:var(--surface-2)}
.kcardx h3{margin:0 0 4px;font-size:17px}
.kcardx .kv{flex:1}
.ocard{display:flex;gap:16px;border:1px solid var(--stroke-3);border-radius:8px;overflow:hidden;margin-bottom:18px;background:var(--surface-2)}
.ocard .img{width:260px;min-height:170px;background:var(--surface-3) center/cover no-repeat;flex-shrink:0}
.ocard .body{padding:14px 16px 14px 0;flex:1;min-width:0}
.ocard h3{margin:0 0 4px;font-size:17px}
.facts{display:flex;gap:18px;flex-wrap:wrap;margin:8px 0}
.facts div small{display:block;color:var(--text-2);font-size:11.5px}
.facts div b{font-variant-numeric:tabular-nums}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
.thumbs img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:6px;cursor:zoom-in;background:var(--surface-3)}
.folders{display:grid;grid-template-columns:220px 1fr;gap:16px}
.flist .catlink{height:34px}
.files .frow{display:flex;align-items:center;gap:10px;padding:8px 10px;border-bottom:1px solid var(--stroke-3)}
.files .frow:hover{background:var(--surface-2)}
.files .frow a{color:var(--text);text-decoration:none;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.files .frow a:hover{color:var(--brand);text-decoration:underline}
.files .ext{width:34px;height:34px;border-radius:6px;display:grid;place-items:center;font-size:10px;font-weight:700;color:#fff;flex-shrink:0}
.drop{border:2px dashed var(--stroke);border-radius:8px;padding:14px;text-align:center;color:var(--text-2);margin-bottom:10px}
.drop.over{border-color:var(--brand);background:var(--brand-soft)}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:60;display:flex;align-items:center;justify-content:center}
.lightbox img{max-width:92vw;max-height:86vh;border-radius:4px;box-shadow:0 10px 40px rgba(0,0,0,.5)}
.lightbox button{position:absolute;all:unset;cursor:pointer;color:#fff;font-size:42px;width:64px;height:64px;display:grid;place-items:center;border-radius:50%}
.lightbox button:hover{background:rgba(255,255,255,.12)}
.lightbox .lb-prev{left:16px;top:50%;transform:translateY(-50%);position:absolute}
.lightbox .lb-next{right:16px;top:50%;transform:translateY(-50%);position:absolute}
.lightbox .lb-close{right:16px;top:16px;position:absolute;font-size:30px}
.lightbox .lb-cap{position:absolute;bottom:18px;left:0;right:0;text-align:center;color:#ddd;font-size:13px}
.back2{display:none}
/* Akte im Cika-Aufbau */
.cikahead{padding:12px 20px 8px;border-bottom:1px solid var(--stroke-3)}
.nav4{display:flex;gap:4px;align-items:center;margin-bottom:10px}
.nav4 .btn{height:28px;padding:0 10px;font-size:12px}
.hblocks{display:grid;grid-template-columns:1.2fr .9fr 1.5fr 1fr;gap:12px}
.hb{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;background:var(--surface-2);border:1px solid var(--stroke-3);border-radius:6px;min-width:0;line-height:1.5}
.hb b{display:block}
.hb.small{flex-direction:column;gap:2px;font-size:12.5px}
.hb .statsel select{min-width:0;width:100%;margin-top:2px}
.hb.hstat{gap:8px}
.hstat .hsrow{display:flex;flex-direction:column;align-items:flex-start;gap:3px;width:100%;min-width:0}
.hstat .hsrow .statsel{width:100%}
.oimg{width:76px;height:57px;border-radius:4px;background:var(--surface-3) center/cover no-repeat;flex-shrink:0}
.cikatabs{padding:0 20px;margin-top:6px}
.cikatabs button.t-objekte.active::after{background:#5BA829}.cikatabs button.t-vertraege.active::after{background:#E3B505}
.cikatabs button.t-dokumente.active::after{background:#E8912D}
.subtabs{margin:6px 0 14px;gap:0;flex-wrap:wrap}
.subtabs button{padding:8px 12px;font-size:13px}
.cols3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
.fgrid1{display:flex;flex-direction:column;gap:8px}
.checkgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:4px 12px;margin-bottom:10px;font-size:13.5px}
.checkgrid label{display:flex;gap:6px;align-items:center;cursor:pointer}
.two{display:grid;grid-template-columns:1fr 1fr;gap:20px}
h4.blue,h3.blue{color:var(--brand);margin:16px 0 8px;font-size:14px}
.sect h3.blue{margin:0}
.vrow{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px 12px;margin-bottom:12px}
.vgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:14px}
.vgrid .ptab input[type=date]{min-width:128px}
.chkline input{width:auto!important;height:auto!important;min-width:0!important;flex:none}
.vgrid .ptab{margin-bottom:6px}
.pscroll{max-height:300px;overflow-y:auto;border:1px solid var(--stroke-3);border-radius:6px}
.tf{margin:0;position:relative}
.tf.main img{outline:3px solid var(--brand)}
.tf figcaption{display:flex;justify-content:space-between;align-items:center;font-size:12px;padding-top:2px}
.noteform{border:1px solid var(--stroke-3);border-radius:6px;padding:10px;margin-bottom:12px;background:var(--surface-2)}
.noteform textarea{width:100%;font:inherit;padding:8px;border:1px solid var(--stroke);border-radius:4px;background:var(--surface);color:var(--text);resize:vertical}
.nf2{display:flex;gap:12px;align-items:center;margin-top:8px;flex-wrap:wrap}
.chkline{display:flex;gap:6px;align-items:center;flex-direction:row!important;font-weight:400!important;color:var(--text)!important;font-size:13.5px!important}
.kfoto{margin-bottom:6px}
.notes2 td{padding:6px 8px;vertical-align:top}
.notes2 .ntext{white-space:pre-wrap;cursor:text}
/* Interne Bemerkungen in Weinrot (Wunsch Nutzer) */
:root{--weinrot:#8E1B3A}
:root[data-theme=dark]{--weinrot:#E8849E}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--weinrot:#E8849E}}
.notes2 tr.nintern .ntext,.notes2 tr.nintern td:nth-child(4){color:var(--weinrot)}
.notes2 .nacts{white-space:nowrap}
.notes2 .nacts .iconbtn{display:inline-grid;vertical-align:top}
.notes2 .nbearb{margin-top:6px;font-size:11.5px;color:var(--text-3);white-space:normal}
/* Bemerkung nachträglich bearbeiten (Zeile im Bearbeiten-Modus) */
.notes2 tr.editing > td{background:var(--brand-soft)}
.notes2 tr.editing textarea{width:100%;font:inherit;line-height:1.45;padding:6px 8px;border:1px solid var(--brand);border-radius:4px;background:var(--surface);color:var(--text);resize:vertical}
.notes2 tr.editing input[type=date],.notes2 tr.editing select{font:inherit;font-size:13px;height:30px;padding:0 4px;border:1px solid var(--stroke);border-radius:4px;background:var(--surface);color:var(--text);max-width:100%}
.notes2 tr.editing input[type=date]{width:128px}
.nedit-btns{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px}
@media (max-width:700px){
  /* Handy: jede Bemerkung als kleine Karte statt Tabellenzeile */
  .notes2,.notes2 tbody{display:block}
  .notes2 thead{display:none}
  .notes2 tr{display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:"d b a" "t t t" "i y o";gap:2px 10px;padding:8px 0;border-bottom:1px solid var(--stroke-3)}
  .notes2 td{border:0;padding:2px 2px;font-size:13px}
  .notes2 td:nth-child(1){grid-area:d;font-weight:600}.notes2 td:nth-child(2){grid-area:b;color:var(--text-2)}
  .notes2 td:nth-child(3){grid-area:t;font-size:14px}.notes2 td:nth-child(4){grid-area:i;color:var(--text-2)}
  .notes2 td:nth-child(5){grid-area:y;color:var(--text-2)}.notes2 td:nth-child(6){grid-area:o;display:flex;align-items:center;gap:4px;color:var(--text-2)}
  .notes2 td:nth-child(7){grid-area:a}
  .notes2 tr:not(.editing) td:nth-child(4)::before{content:'intern: '}
  .notes2 td:nth-child(6)::before{content:'ToDo'}
  .notes2 tr.editing td:nth-child(4)::before{content:'intern '}
  .notes2 tr.editing td:nth-child(4){display:flex;align-items:center;gap:4px}
}
@media (max-width:1400px){.hblocks{grid-template-columns:1fr 1fr}}
@media (max-width:1100px){.cols3{grid-template-columns:1fr 1fr}}
@media (max-width:900px){.cols3,.two,.vgrid,.hblocks{grid-template-columns:1fr}}
@media (max-width:1100px){.alist{width:330px}}
@media (max-width:900px){
  .amain{padding:10px}
  .alist{width:100%}
  .adetail{position:fixed;inset:48px 0 0 0;border-radius:0;z-index:25;display:none}
  .adetail.open{display:block}
  .back2{display:inline-flex}
  .ocard{flex-direction:column}.ocard .img{width:100%;min-height:200px}.ocard .body{padding:0 14px 14px}
  .folders{grid-template-columns:1fr}
}
