/* DG Kommission – handgeschriebenes CSS, keine externen Ressourcen (System-Schriften). */
:root {
    --bg: #f6f3f9; --card: #fff; --ink: #1f1b2e; --muted: #6b6680; --line: #ddd8e8;
    --brand: #6a2c91; --brand-ink: #fff; --brand-soft: #f1e9f7; --ok: #1b7a43; --err: #b3261e; --warn: #8a5a00;
    --radius: 6px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px; color: var(--ink);
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #15131d; --card: #1f1c2b; --ink: #ece9f6; --muted: #a29cb8; --line: #36314a; --brand: #8b7fe0; --brand-ink: #15131d; --brand-soft: #2a2542; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 1rem 0 .75rem; }
h1 small { color: var(--muted); font-weight: 400; font-size: .9rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.crumb { color: var(--muted); }


.container { max-width: 1400px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.head h1, .head h2 { margin: 1rem 0 .5rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .75rem 0; }
.actions form { margin: 0; }
.hint { color: var(--muted); }

.flash { padding: .6rem .9rem; border-radius: var(--radius); margin: 1rem 0 0; }
.flash.ok { background: #e3f4ea; color: var(--ok); border: 1px solid #b9e2c9; }
.flash.err { background: #fbe9e7; color: var(--err); border: 1px solid #f1c3be; }
.flash ul { margin: 0; padding-left: 1.1rem; }
.badge { background: #fff3cd; color: var(--warn); font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; vertical-align: middle; font-weight: 500; }

.btn, button.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .4rem .85rem; border-radius: var(--radius); font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-soft); text-decoration: none; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger, .danger { color: var(--err); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font: inherit; }
button.link.danger { color: var(--err); }

input, select, textarea { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .38rem .55rem; width: 100%; }
input[type=checkbox] { width: auto; }
input.short { width: 7rem; }
input[readonly] { background: var(--bg); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .15rem; }
label.check { display: inline-flex; gap: .4rem; align-items: center; color: var(--ink); font-size: .95rem; margin: 0; }
.req { color: var(--err); }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1rem; }
.filters input[type=search] { width: 16rem; }
.filters select { width: auto; max-width: 15rem; }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: .92rem; }
table.grid th, table.grid td { padding: .4rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid thead th, table.grid tr:first-child th { background: var(--brand-soft); font-weight: 600; white-space: nowrap; }
table.grid tbody tr:hover { background: var(--brand-soft); }
table.grid .num, table.grid th.num { text-align: left; font-variant-numeric: tabular-nums; }
table.grid td.empty, p.empty { color: var(--muted); text-align: center; padding: 1rem; }
table.grid tr.inactive td { color: var(--muted); }
table.grid tr.new td { background: var(--brand-soft); }
table.grid td input, table.grid td select { padding: .25rem .4rem; }
.rowact { white-space: nowrap; }
.pager { display: flex; justify-content: center; gap: 1.5rem; padding: 1rem; color: var(--muted); }

.grid12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: .65rem .9rem; }
.grid12 .group, .grid12 h4 { grid-column: 1 / -1; margin: 1rem 0 0; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.f { grid-column: span 12; min-width: 0; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: span 4; }
.span5 { grid-column: span 5; } .span7 { grid-column: span 7; } .span9 { grid-column: span 9; } .span10 { grid-column: span 10; }
.span6 { grid-column: span 6; } .span8 { grid-column: span 8; } .span12 { grid-column: span 12; }
@media (max-width: 800px) { .f { grid-column: span 12 !important; } }
details.zs { margin-top: 1.25rem; } details.zs summary { cursor: pointer; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; color: var(--muted); }
.stat .n { font-size: 1.8rem; font-weight: 700; color: var(--ink); }

.login { max-width: 22rem; margin: 6rem auto; display: grid; gap: .8rem; }
.login h1 { margin: 0; }
.tabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .5rem .25rem; color: var(--muted); }
.tabs a.active { color: var(--ink); border-bottom: 2px solid var(--brand); }
.picklist { max-height: 16rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; display: grid; gap: .25rem; margin-bottom: .75rem; }
.belege { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .4rem 1.5rem; }
.belege li { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); }
.filterbox { margin-bottom: .25rem; }
.login .logo { width: 100%; height: auto; margin-bottom: .25rem; }
.login .forgot { text-align: center; font-size: .9rem; }
.login { max-width: 24rem; margin-top: 3rem; }

/* ---- Shell: Kopf mit Logo, Seitenleiste, Inhalt ---- */
.ico { flex: none; vertical-align: -3px; }
body.with-shell { display: grid; grid-template-columns: 15rem 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.shell-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--card); border-bottom: 1px solid var(--line); padding: .5rem 1.5rem; position: sticky; top: 0; z-index: 20; }
.shell-head .logo-link img { height: 3.4rem; width: auto; display: block; background: #fff; }
.who { display: flex; align-items: center; gap: .9rem; color: var(--muted); font-size: .92rem; }
.who .link { color: var(--ink); }
.avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.burger { display: none; cursor: pointer; padding: .4rem; }
.sidebar { background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 1rem .75rem; position: sticky; top: 4.4rem; align-self: start; height: calc(100vh - 4.4rem); overflow-y: auto; }
.sidebar nav { display: grid; gap: .15rem; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 10px; color: var(--ink); font-size: .93rem; text-decoration: none; }
.sidebar nav a:hover { background: var(--brand-soft); }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.side-foot { color: var(--muted); font-size: .8rem; padding: .75rem .8rem; line-height: 1.3; }
body.with-shell .container { grid-column: 2; width: 100%; margin: 0; max-width: none; }
.scrim { display: none; }
@media (max-width: 900px) {
    body.with-shell { grid-template-columns: 1fr; }
    body.with-shell .container { grid-column: 1; }
    .burger { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: 16rem; z-index: 40; transform: translateX(-100%); transition: transform .2s; padding-top: 4.5rem; }
    .navtoggle:checked ~ .sidebar { transform: none; }
    .navtoggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: #0006; z-index: 30; }
    .shell-head .logo-link img { height: 2.6rem; }
    .who span:first-child { display: none; }
}
body.guest .container { display: grid; place-items: start center; }

.crumbs { color: var(--brand); font-size: .85rem; margin-top: 1.1rem; }
.crumbs a { color: var(--brand); }
.head h1 { font-size: 1.9rem; margin: .1rem 0 .1rem; }
.head h1 small { font-size: 1.1rem; }
.sub { color: var(--muted); margin: 0 0 .5rem; }
.btn { display: inline-flex; align-items: center; gap: .45rem; }
.btn.primary { background: linear-gradient(180deg, #6a58c9, #4e3fa3); border-radius: 10px; padding: .55rem 1.1rem; box-shadow: 0 2px 6px #5c4fb155; }
.btn { border-radius: 10px; }
.iconbtn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; border: 0; background: transparent; color: var(--brand); cursor: pointer; padding: 0; text-decoration: none; }
.iconbtn:hover { background: var(--brand-soft); text-decoration: none; }
.iconbtn.lg { width: 2.4rem; height: 2.4rem; border: 1px solid var(--line); background: var(--card); }
.iconbtn.danger { color: var(--err); }
.iconbtn:disabled { opacity: .4; cursor: not-allowed; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; }
.filters .grow { flex: 1; }
.searchbox { display: flex; align-items: center; gap: .5rem; flex: 1 1 18rem; max-width: 28rem; border: 1px solid var(--line); border-radius: 10px; padding: 0 .75rem; color: var(--muted); background: var(--card); }
.searchbox input { border: 0; outline: 0 !important; padding: .55rem 0; background: transparent; }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.tablewrap table.grid { border: 0; border-radius: 0; }
table.grid thead th { background: transparent; font-weight: 600; border-bottom: 1px solid var(--line); padding: .85rem .7rem; }
table.grid thead th a { color: var(--ink); display: inline-flex; align-items: center; gap: .25rem; }
table.grid thead th a .ico { color: var(--muted); }
table.grid thead th.sorted a .ico { color: var(--brand); }
table.grid tbody tr:nth-child(even) { background: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
table.grid tbody tr:hover { background: var(--brand-soft); }
table.grid td { padding: .5rem .7rem; }
table.grid th.act, table.grid td.act { text-align: right; white-space: nowrap; width: 1%; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.pager .pages { display: flex; gap: .35rem; align-items: center; }
.pager .pg { min-width: 2rem; height: 2rem; padding: 0 .5rem; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--card); text-decoration: none; }
.pager a.pg:hover { background: var(--brand-soft); }
.pager .pg.cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pager .pg.off { opacity: .4; }
.pager .gap { padding: 0 .2rem; }
.pager .pinfo { display: flex; align-items: center; gap: 1rem; }
.pager .perpage select { width: auto; }
.pager .perpage { margin: 0; }

/* ---- Profilmenü ---- */
.profile { position: relative; }
.profile summary { list-style: none; display: flex; align-items: center; gap: .7rem; cursor: pointer; color: var(--muted); font-size: .92rem; }
.profile summary::-webkit-details-marker { display: none; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 5rem; height: 5rem; flex: none; }
.profile .menu { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 15rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px #0003; padding: .4rem; z-index: 80; display: grid; }
.profile .menu a, .profile .menu button { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; width: 100%; text-decoration: none; }
.profile .menu a:hover, .profile .menu button:hover { background: var(--brand-soft); }
.profile .menu form { margin: 0; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.who-line { display: grid; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.who-line small { color: var(--muted); }
.avatar-edit { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.card.narrow { max-width: 34rem; }
.card.narrow .f { margin-bottom: .8rem; }
.side-foot .ver { display: inline-block; margin-top: .4rem; font-weight: 600; }
.card ul { margin: .3rem 0 0; padding-left: 1.2rem; } .card ul li { margin: .2rem 0; }
@media (max-width: 900px) { .profile .pname { display: none; } }

/* ---- Listen: Drag & Drop, Benutzer-Avatare ---- */
.grip-col { width: 2rem; }
.grip { cursor: grab; color: var(--muted); display: inline-grid; place-items: center; padding: .2rem; }
tr.dragging { opacity: .45; background: var(--brand-soft); }
.avcell { display: flex; align-items: center; gap: .5rem; min-width: 14rem; }
.avcell .avatar { width: 2.2rem; height: 2.2rem; flex: none; }
input.file { padding: .2rem; font-size: .8rem; }
label.check.small { font-size: .8rem; }

/* ---- Redesign: Verlaufskopf, Karten, ruhigere Formulare ---- */
:root { --head1: #3f2a7e; --head2: #7a3a9f; --shadow: 0 1px 2px #2b184010, 0 4px 14px #2b184010; }
.shell-head { background: linear-gradient(100deg, var(--head1), var(--head2)); border-bottom: 0; color: #fff; padding: .55rem 1.5rem; box-shadow: 0 2px 10px #2b184033; }
.shell-head .logo-link img { height: 3.6rem; background: transparent; }
.topsearch { display: flex; align-items: center; gap: .6rem; margin-left: auto; width: min(24rem, 32vw); background: #ffffff26; border-radius: 12px; padding: 0 .9rem; color: #ffffffcc; }
.topsearch input { background: transparent; border: 0; color: #fff; padding: .6rem 0; outline: 0 !important; }
.topsearch input::placeholder { color: #ffffffb0; }
.profile summary { color: #fff; font-weight: 500; }
.avatar { background: #ffffff33; color: #fff; font-weight: 600; font-size: .8rem; }
.profile .menu { color: var(--ink); }
.burger { color: #fff; }
.sidebar { background: var(--card); border-right: 1px solid var(--line); }
.sidebar nav a { color: #4a3d5c; border-radius: 0 12px 12px 0; margin-right: .5rem; padding: .62rem .9rem; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.sidebar nav a.active .ico { fill: color-mix(in srgb, var(--brand) 35%, transparent); }
.card { box-shadow: var(--shadow); border-radius: 14px; border-color: #e9e2f0; }
.tablewrap, .filters { box-shadow: var(--shadow); border-color: #e9e2f0; }
.btn.primary { background: linear-gradient(180deg, #7a35a3, #5c2482); box-shadow: 0 2px 8px #5c248255; }
.btn.outline { background: var(--card); border: 1px solid #cfc4da; }

.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--brand); }
.crumbs span { margin: 0 .25rem; }
.pagehead { align-items: flex-start; margin-bottom: .5rem; }
.titleblock { display: flex; gap: .9rem; align-items: center; }
.titleblock h1 { margin: 0; font-size: 1.9rem; letter-spacing: -.01em; }
.titleblock .sub { margin: .1rem 0 0; }
.tile { width: 2.8rem; height: 2.8rem; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.topactions { display: flex; gap: .6rem; align-items: center; margin-top: .4rem; }
.toolrow { margin: .2rem 0 .8rem; }
.toolrow .btn { background: var(--card); }

form.form .sec { padding: 1rem 1.4rem 1.3rem; margin: 0 0 1rem; }
.sec-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; color: var(--brand); }
.sec-head h2 { margin: 0; font-size: 1.1rem; color: var(--ink); }
.sec-head small { color: var(--muted); font-size: .78rem; margin-left: .2rem; }
.grid12 { gap: .85rem 1.1rem; }
.f > label { font-size: .8rem; color: #5b4f6b; font-weight: 500; margin-bottom: .25rem; }
label.check { font-weight: 400; }
input, select, textarea { border-color: #ddd3e7; border-radius: 8px; padding: .5rem .7rem; }
input::placeholder, textarea::placeholder { color: #a99db8; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); border-color: var(--brand); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6680' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem; }
.actions.bottom { justify-content: flex-end; margin: 1rem 0 2rem; }
details.zs summary { font-weight: 600; color: var(--brand); }
@media (max-width: 900px) { .topsearch { display: none; } .shell-head { padding: .5rem 1rem; } .shell-head .logo-link { margin-right: auto; } }
@media (prefers-color-scheme: dark) { .card, .tablewrap, .filters { border-color: var(--line); } .f > label { color: var(--muted); } .sidebar nav a { color: var(--ink); } }

/* ---- Redesign 2: weißer Kopf, größere Navigation, Zeilen-Links ---- */
.shell-head { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 8px #2b184014; position: sticky; z-index: 60; padding-top: .4rem; padding-bottom: .4rem; }
.shell-head::after { content: ""; position: absolute; right: 22rem; top: .2rem; bottom: .2rem; width: 11rem; background: url('../img/trauben.svg') no-repeat center/contain; opacity: .35; pointer-events: none; }
:root { --head-h: 6rem; }
.shell-head .logo-link img { height: 4.2rem; width: auto; display: block; mix-blend-mode: multiply; }
.shell-head > * { position: relative; z-index: 1; }
.topsearch { background: var(--card); border: 1px solid var(--line); color: var(--muted); width: min(22rem, 30vw); }
.topsearch input { color: var(--ink); }
.topsearch input::placeholder { color: var(--muted); }
.topsearch kbd { font: inherit; font-size: .7rem; background: var(--brand-soft); color: var(--muted); border-radius: 6px; padding: .1rem .4rem; white-space: nowrap; }
.profile summary { color: var(--ink); }
.avatar { background: linear-gradient(135deg, #9a66bd, #6a2c91); color: #fff; }
.burger { color: var(--ink); }
body.with-shell { grid-template-columns: 17rem 1fr; }
.sidebar { top: var(--head-h); height: calc(100vh - var(--head-h)); padding-top: .75rem; background: var(--card) url('../img/trauben.svg') no-repeat left -2.5rem bottom -1rem / 15rem auto; }
.sidebar nav a { font-size: 1rem; padding: .7rem 1rem; gap: .85rem; margin-right: 0; border-radius: 0 12px 12px 0; }
.sidebar nav a .ico { width: 21px; height: 21px; }
.side-foot { position: relative; padding-left: 4.5rem; }
.head h1 { font-size: 2.3rem; }
.sub { font-size: 1rem; }
table.grid { font-size: .98rem; }
table.grid td { padding: .62rem .8rem; }
table.grid thead th { font-size: .95rem; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover { background: var(--brand-soft) !important; }
a.idlink { font-weight: 600; color: var(--brand); }
.cellicon { display: inline-flex; align-items: center; gap: .45rem; }
.cellicon .ico { color: var(--brand); }
.filters { padding: .75rem; gap: .75rem; }
.searchbox { background: var(--card); }
.pager .pg.cur { background: linear-gradient(180deg, #7a35a3, #5c2482); }

details.colpicker, details.rowmenu { position: relative; display: inline-block; }
details.colpicker > summary, details.rowmenu > summary { list-style: none; cursor: pointer; }
details.colpicker > summary::-webkit-details-marker, details.rowmenu > summary::-webkit-details-marker { display: none; }
.colmenu { position: absolute; right: 0; top: calc(100% + .4rem); width: min(34rem, 92vw); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px #0003; padding: .9rem 1rem; z-index: 40; }
.colgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .3rem .9rem; max-height: 50vh; overflow: auto; margin: .6rem 0; }
.colactions { display: flex; gap: .5rem; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: .7rem; }
.rowmenu .menu { position: absolute; right: 0; top: 100%; min-width: 11rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px #0003; padding: .3rem; z-index: 30; display: grid; text-align: left; }
.rowmenu .menu form { margin: 0; }
.rowmenu .menu button { display: flex; width: 100%; align-items: center; gap: .55rem; background: none; border: 0; padding: .5rem .65rem; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.rowmenu .menu button:hover { background: var(--brand-soft); }
.rowmenu .menu button.danger { color: var(--err); }
@media (max-width: 900px) { .shell-head::after { display: none; } .tablewrap { overflow-x: auto; } body.with-shell { grid-template-columns: 1fr; } .sidebar { background-image: none; } .side-foot { padding-left: .8rem; } }

/* ---- Dashboard-Diagramme ---- */
:root { --series-1: #6a2c91; --grid: #e7e0ee; --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c-other: #a8a3b3; }
@media (prefers-color-scheme: dark) { :root { --series-1: #b27fd6; --grid: #3a3350; --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #008300; --c7: #9085e9; --c-other: #6f6a7d; } }
.charts2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 1rem; margin: 1rem 0; align-items: start; }
.charts2 .card { margin: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chart-head h2 { margin: 0; font-size: 1.1rem; } .chart-head .hint { margin: .1rem 0 0; font-size: .85rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: var(--card); border: 0; padding: .35rem .8rem; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
svg.bars { width: 100%; height: auto; display: block; }
.grid-line { stroke: var(--grid); stroke-width: 1; } .grid-line.base { stroke: var(--muted); stroke-opacity: .5; }
.axis-label { fill: var(--muted); font-size: 11px; }
.bar { fill: var(--series-1); } .hit { fill: transparent; } .hit:hover + .bar, .hit:hover { fill: color-mix(in srgb, var(--series-1) 10%, transparent); }
.hit:hover + .bar { fill: color-mix(in srgb, var(--series-1) 80%, #000); }
.donut-wrap { display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr; gap: 1.2rem; align-items: center; }
svg.donut { width: 100%; height: auto; }
.slice { stroke: var(--card); stroke-width: 2; } .slice:hover { opacity: .85; }
circle.slice { stroke: none; }
.donut-num { fill: var(--ink); font-size: 24px; font-weight: 700; }
table.legend { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.legend td { padding: .22rem .3rem; } table.legend td.num { text-align: right; white-space: nowrap; color: var(--muted); }
.sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .5rem; vertical-align: -1px; }
.tableview { margin-top: .4rem; font-size: .85rem; } .tableview summary { cursor: pointer; color: var(--brand); }
table.mini { margin-top: .4rem; } table.mini tr.total td { font-weight: 700; }
.ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.2rem; }
.ranks h3 { margin: 0 0 .4rem; font-size: .95rem; color: var(--muted); }
a.rank { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: 0 .5rem; padding: .3rem 0; color: var(--ink); text-decoration: none; align-items: baseline; }
a.rank:hover { background: var(--brand-soft); }
a.rank .pos { color: var(--muted); font-size: .8rem; } a.rank .rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.rank .rval { font-variant-numeric: tabular-nums; font-weight: 600; }
a.rank .track { grid-column: 2 / -1; height: 6px; background: var(--brand-soft); border-radius: 3px; overflow: hidden; }
a.rank .fill { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
#charttip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: var(--card); font-size: .8rem; padding: .35rem .6rem; border-radius: 8px; max-width: 18rem; box-shadow: 0 4px 14px #0004; }
@media (max-width: 600px) { .donut-wrap { grid-template-columns: 1fr; } }

/* ---- Kopf größer, Profilmenü oben, durchsuchbare Dropdowns, Kacheln ---- */
.profile { z-index: 70; }
.sidebar { z-index: 20; }
@media (max-width: 900px) { :root { --head-h: 4.4rem; } .shell-head .logo-link img { height: 3rem; } }
.combo { position: relative; }
.combo-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; inset: auto 0 0 0; }
.combo-btn { width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6680' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center; border: 1px solid #ddd3e7; border-radius: 8px; padding: .5rem 2rem .5rem .7rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-btn.placeholder { color: var(--muted); }
.combo-btn:focus-visible, .combo-btn[aria-expanded="true"] { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); border-color: var(--brand); }
.combo-panel { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 45; min-width: 14rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px #0003; padding: .4rem; }
.combo-panel input { margin-bottom: .35rem; }
.combo-panel ul { list-style: none; margin: 0; padding: 0; max-height: 16rem; overflow-y: auto; }
.combo-panel li { padding: .4rem .6rem; border-radius: 6px; cursor: pointer; }
.combo-panel li.active { background: var(--brand-soft); }
.combo-panel li[aria-selected="true"] { font-weight: 600; color: var(--brand); }
.filters .combo { min-width: 12rem; max-width: 16rem; }
table.grid td .combo-btn, .filters .combo-btn { padding-top: .38rem; padding-bottom: .38rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; margin: .4rem 0 1rem; }
.tile-link { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: .1rem .7rem; align-items: center; padding: .8rem 1rem; background: var(--card); border: 1px solid #e9e2f0; border-radius: 14px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.tile-link:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.tile-link .ico { grid-row: 1 / 3; color: var(--brand); width: 28px; height: 28px; }
.tile-link .tl { font-weight: 600; } .tile-link .tc { color: var(--muted); font-size: .9rem; }

/* ---- Globale Suche ---- */
.bigsearch { max-width: 44rem; } .bigsearch .searchbox { max-width: none; flex: 1; }
.result-group h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1.1rem; color: var(--ink); } .result-group h2 .ico { color: var(--brand); } .result-group h2 small { color: var(--muted); font-weight: 400; }
ul.results { list-style: none; margin: .4rem 0 0; padding: 0; }
ul.results li a { display: grid; grid-template-columns: 8.5rem 1fr auto; gap: .8rem; align-items: center; padding: .55rem .4rem; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
ul.results li a:hover { background: var(--brand-soft); }
ul.results li.inactive a { color: var(--muted); }
.rid { font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; } .rdetail { color: var(--muted); }

.phones { display: grid; gap: .1rem; }

/* ---- Einstellungen → Listen: Kacheln, 5 pro Reihe ---- */
.listtiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.listtile { display: grid; justify-items: start; gap: .35rem; padding: 1.1rem 1.1rem 1rem; background: var(--card); border: 1px solid #e9e2f0; border-radius: 14px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .12s, border-color .12s; }
.listtile:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; transform: translateY(-1px); }
.lt-icon { width: 3rem; height: 3rem; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.listtile:hover .lt-icon { background: var(--card); }
.lt-label { font-weight: 600; font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.lt-count { color: var(--muted); font-size: .85rem; }
@media (max-width: 1100px) { .listtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .listtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .listtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .listtiles { grid-template-columns: 1fr; } }

/* ---- Einstellungen: Tabs mit Icons, Stammdaten-Akkordeons ---- */
.tabs { gap: 1.8rem; padding: 0 .3rem; }
.tabs a { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem .1rem; font-weight: 500; }
.tabs a.active { font-weight: 600; color: var(--brand); border-bottom: 2px solid var(--brand); margin-bottom: -1px; }
.settings-card { padding: 0; overflow: visible; }
.sc-head { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.4rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .6rem; }
.sc-head h2 { margin: 0; font-size: 1.2rem; } .sc-head .hint { margin: .1rem 0 0; }
details.acc { margin: .55rem 1rem; }
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; background: var(--brand-soft); border-radius: 10px; padding: .6rem .9rem; font-weight: 600; color: var(--ink); }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary > .ico:first-child { color: var(--brand); }
details.acc > summary span { flex: 1; }
details.acc > summary .chev { transition: transform .15s; color: var(--muted); }
details.acc[open] > summary .chev { transform: rotate(180deg); }
details.acc > .grid12 { padding: .9rem .3rem .5rem; }
.iconfield { position: relative; display: flex; align-items: center; }
.iconfield > .ico { position: absolute; left: .7rem; color: var(--brand); pointer-events: none; }
.iconfield > input { padding-left: 2.4rem; }
.iconfield.copyfield > input { padding-left: .7rem; padding-right: 2.6rem; }
.iconfield.copyfield > .iconbtn { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); width: 1.9rem; height: 1.9rem; }
.iconbtn.copied { color: var(--ok); }
.formbar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: .7rem; padding: .8rem 1.2rem; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(4px); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
input[type=number] { appearance: auto; }

/* ---- Nummernkreise ---- */
.numinfo { display: flex; gap: .7rem; align-items: flex-start; margin: .2rem 1.2rem .9rem; padding: .7rem .9rem; background: var(--brand-soft); border-radius: 10px; color: var(--ink); }
.numinfo .ico { color: var(--brand); margin-top: .15rem; }
.tablewrap.flat { margin: 0 1.2rem 1rem; box-shadow: none; }
.nextno { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
td.muted { color: var(--muted); }
input.numinput { max-width: 15rem; font-variant-numeric: tabular-nums; }

.yearbox { display: flex; align-items: flex-end; gap: 1.2rem; margin: 0 1.2rem 1rem; flex-wrap: wrap; }
.yearbox .f { width: 11rem; } .yearbox .hint { margin: 0 0 .5rem; }

/* ---- Profil ---- */
.profile-body { padding: .6rem 1.4rem 1.2rem; }
.avatar-edit { display: flex; gap: 1.4rem; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap; }
.avatar.big { width: 8rem; height: 8rem; }
.avatar.big img { width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.avatar.drag[data-has] { cursor: grab; touch-action: none; user-select: none; }
.avatar.drag.dragging { cursor: grabbing; }
.avatar-ctl { display: grid; gap: .4rem; min-width: 16rem; flex: 1; max-width: 28rem; }
.avatar-ctl .zl { margin-top: .4rem; }
.avatar-ctl input[type=range] { padding: 0; }
.avatar-ctl label { font-size: .85rem; color: var(--muted); }
.avatar-ctl label.check { color: var(--ink); }

/* ---- Richtext-Felder ---- */
.rte.rte-on { border: 1px solid #ddd3e7; border-radius: 8px; background: var(--card); }
.rte.rte-on:focus-within { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); border-color: var(--brand); }
.rte-bar { display: flex; gap: .15rem; padding: .25rem .35rem; border-bottom: 1px solid var(--line); background: var(--brand-soft); border-radius: 8px 8px 0 0; }
.rte-bar button { min-width: 1.9rem; height: 1.9rem; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-size: .9rem; }
.rte-bar button:hover:not(:disabled) { background: var(--card); color: var(--brand); }
.rte-bar button:disabled { opacity: .4; cursor: not-allowed; }
.rte-area { min-height: 4.4rem; height: auto; padding: .55rem .75rem; line-height: 1.45; outline: 0; overflow-wrap: anywhere; }   /* wächst mit dem Inhalt */
.rte-area p { margin: 0 0 .5rem; } .rte-area p:last-child { margin-bottom: 0; }
.rte-area ul, .rte-area ol { margin: .2rem 0 .5rem; padding-left: 1.4rem; }
.rte-area:empty::before { content: attr(data-ph); color: #a99db8; }
.clip { display: inline-block; max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---- Dashboard: Jahres-Auswahl, Doppelbalken ---- */
.yearsel { margin: 0; } .yearsel select { width: auto; min-width: 8rem; }
.card.chart.wide { margin: 1rem 0; }
.legend-inline { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .9rem; }
.legend-inline .sw { margin-right: .4rem; }
.gbar { transition: opacity .1s; } .hit:hover ~ .gbar { opacity: .9; }

/* ---- Redesign 3: Kopf und Menü (großzügig, mit Rundung und Traubenmotiv) ---- */
:root { --head-h: 6.6rem; }
body.with-shell { background: linear-gradient(180deg, #f3eff8 0%, #f8f6fb 60%, #fbfafd 100%); }
.shell-head { padding: .5rem 2rem; box-shadow: 0 2px 14px #2b18401a; border-bottom: 1px solid #e3dbee; }
.shell-head .logo-link img { height: 4.8rem; }
.shell-head::after { content: ""; position: absolute; right: 21rem; top: 0; bottom: 0; width: 26rem; background: url('../img/trauben.svg') no-repeat right center / contain; opacity: .85; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%); mask-image: linear-gradient(90deg, transparent, #000 35%); }
body.with-shell { grid-template-columns: 18rem 1fr; }
.sidebar { background: #fff; border-right: 0; border-top: 1px solid #d9cbe8; border-top-right-radius: 2.6rem; box-shadow: 6px 0 28px #2b18400f; padding: 1.2rem .9rem 1rem 0; top: var(--head-h); height: calc(100vh - var(--head-h)); margin-top: .0rem; }
.sidebar nav { gap: .2rem; }
.sidebar nav a { font-size: 1.05rem; padding: .9rem 1.4rem; gap: 1.2rem; color: #4b3f5e; border-radius: 0 14px 14px 0; position: relative; }
.sidebar nav a .ico { width: 24px; height: 24px; stroke-width: 1.7; }
.sidebar nav a:hover { background: #f6f1fb; color: var(--brand); }
.sidebar nav a.active { background: #efe7fa; color: var(--brand); font-weight: 600; box-shadow: inset 5px 0 0 var(--brand); }
.sidebar nav a.active .ico { fill: color-mix(in srgb, var(--brand) 22%, transparent); }
.side-foot { padding: .8rem 1.4rem; font-size: .8rem; }
.profile summary .avatar { width: 2.7rem; height: 2.7rem; }
.topsearch { border-radius: 14px; width: min(24rem, 30vw); box-shadow: 0 1px 4px #2b184010; }
@media (max-width: 900px) { :root { --head-h: 4.6rem; } .shell-head { padding: .4rem 1rem; } .shell-head .logo-link img { height: 3.2rem; } .sidebar { border-top-right-radius: 0; padding-right: .5rem; } body.with-shell { grid-template-columns: 1fr; } }
body.with-shell .container { min-width: 0; }   /* breite Tabellen scrollen im Rahmen, die Seite wird nicht breiter */

/* ---- Auffällige Einzelbelege im Diagramm, Overlay beim Überfahren ---- */
.gbar.suspicious { opacity: .38; }
.warn-mark { font-size: 13px; font-weight: 800; fill: var(--ink); pointer-events: none; }
.barhit { cursor: default; } .barhit:hover { fill: #ffffff22; stroke: var(--ink); stroke-opacity: .25; }
.suspicious-note { margin: .6rem 0 0; padding: .55rem .8rem; border-radius: 10px; background: #fff6df; color: #6b4a00; font-size: .85rem; line-height: 1.5; }
.suspicious-note b { display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #eda100; color: #fff; margin-right: .3rem; font-size: .8rem; }
.suspicious-note a { color: #6b4a00; font-weight: 600; text-decoration: underline; }
@media (prefers-color-scheme: dark) { .suspicious-note { background: #3a2f10; color: #f2d58a; } .suspicious-note a { color: #f2d58a; } }
#charttip { white-space: pre-line; line-height: 1.4; font-size: .85rem; padding: .5rem .75rem; }

/* ---- Software-Versionen ---- */
.swhead { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; padding: .4rem 1.4rem 1rem; }
.swhead form { margin: 0; }
.swpills { display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.pill { display: inline-block; padding: .12rem .65rem; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #e9e6ee; color: #4a4458; }
.pill b { margin-left: .25rem; }
.pill.current { background: #dff3e6; color: #17653a; } .pill.update { background: #fdf0c8; color: #7a5600; }
.pill.major { background: #dce9fb; color: #1d4f9c; } .pill.security { background: #f9dcd9; color: #a3221b; } .pill.error { background: #e9e6ee; color: #5c5668; }
table.swtable td.remark { max-width: 34rem; line-height: 1.4; }
table.swtable tr.grouprow td { background: var(--brand-soft); font-weight: 700; color: var(--brand); padding: .5rem .8rem; }
table.swtable tbody tr.grouprow:hover { background: transparent; }
.tablewrap.flat { overflow-x: auto; }
@media (prefers-color-scheme: dark) { .pill.current { background: #17402a; color: #9fe0b8; } .pill.update { background: #4a3a0c; color: #f2d58a; } .pill.major { background: #1b3358; color: #a9c8f5; } .pill.security { background: #5a1d19; color: #f5b3ad; } .pill { background: #3a3350; color: #cfc8e0; } }

.dashopts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dashopt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.dashopt span { display: flex; flex-direction: column; }
.dashopt small { color: var(--muted); font-size: 12px; }
