:root{
  --bg:#f3f7f4;
  --bg2:#eaf3ed;
  --panel:#ffffffea;
  --panel2:#f8fbf9;
  --line:#d7e5dc;
  --text:#17231d;
  --muted:#64756b;
  --green:#1f9d4a;
  --green2:#48b96b;
  --greenSoft:#e8f7ed;
  --red:#c94b4b;
  --yellow:#a86f00;
  --shadow:0 18px 45px #16332218;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;line-height:1.45}
.bg{position:fixed;inset:0;z-index:-1;background:radial-gradient(circle at 12% 5%,#7adf9b40,transparent 30%),radial-gradient(circle at 88% 10%,#b7ecc740,transparent 28%),linear-gradient(145deg,#f9fbfa 0%,#eef6f1 50%,#e6eee9 100%)}
.topbar{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;gap:22px;padding:14px 28px;background:#fffffff2;border-bottom:1px solid var(--line);backdrop-filter:blur(16px);box-shadow:0 8px 24px #1633220d}
.brand{display:flex;align-items:center;color:var(--text);text-decoration:none;font-weight:850}
.brand img{height:54px;width:auto;display:block}
.topbar nav{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:flex-end}
.topbar nav a,.btn,button{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:auto;min-height:38px;border:1px solid #b8d8c2;background:#ffffff;color:#1d3327;padding:8px 13px;border-radius:12px;text-decoration:none;font-weight:750;font-size:14px;cursor:pointer;transition:.18s;line-height:1.2;white-space:nowrap}
.topbar nav a:hover,.btn:hover,button:hover{transform:translateY(-1px);border-color:#5ebf7b;box-shadow:0 10px 26px #1f9d4a24;background:#f6fff8}
button,.btn{align-self:flex-start}
button.danger,.danger{border-color:#efb3b3!important;background:#fff5f5!important;color:#9d2929!important}
.wrap{max-width:1380px;margin:0 auto;padding:26px}
.hero{padding:28px}
.card{background:var(--panel);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);margin-bottom:22px}
.card .card{box-shadow:none;background:#fbfdfb}
.card h1,.card h2,.card h3{margin:0 0 12px;color:#14231b;letter-spacing:-.02em}.card p{margin-top:0}.muted{color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px}.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;align-items:end}
form.grid2 button{justify-self:start}.stat{padding:22px}.stat b{display:block;font-size:30px;color:var(--green)}
input,select,textarea{width:100%;padding:11px 13px;border-radius:12px;border:1px solid #cdded3;background:#fff;color:var(--text);outline:none;margin-top:6px;transition:.15s;font:inherit}input:focus,select:focus,textarea:focus{border-color:#43b867;box-shadow:0 0 0 4px #43b86718}textarea{min-height:96px;resize:vertical}label{font-weight:720;color:#24382d;font-size:14px}::placeholder{color:#8a9b91}.flash{padding:14px 18px;border-radius:16px;background:#e8f7ed;border:1px solid #9ad7ac;margin-bottom:18px;color:#173d24}.flash.bad{background:#fff1f1;border-color:#efb3b3;color:#8d2626}
.tablewrap{overflow:auto;max-height:70vh;border-radius:18px;border:1px solid var(--line);background:#fff}table{width:100%;border-collapse:separate;border-spacing:0;min-width:850px}th,td{padding:11px 12px;border-bottom:1px solid #e6eee9;background:#fff;text-align:left;vertical-align:middle}th{position:sticky;top:0;z-index:2;background:#f1f8f3;color:#234031;font-weight:850}tr:hover td{background:#fbfefc}.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.actions form{display:inline-flex}.pill{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;background:#edf8f1;border:1px solid #bee0c8;color:#226238;font-weight:750}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}.tabs a{padding:9px 13px;border-radius:12px;background:#fff;border:1px solid var(--line);color:var(--text);text-decoration:none;font-weight:750}.tabs a.active{background:#e8f7ed;border-color:#62bf7c;color:#16592c}.grade-cell{font-weight:900;border-radius:10px;text-align:center}.small{font-size:12px}.subject-card{border-left:7px solid var(--green);padding:18px}.grade-input{min-width:80px;text-align:center}.sticky-left{position:sticky;left:0;z-index:3;box-shadow:8px 0 12px #16332208}.shop-card{display:flex;flex-direction:column;gap:12px}.kpi{font-size:34px;font-weight:900;color:var(--green)}
.page-intro{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.form-note{font-size:13px;color:var(--muted);margin-top:6px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
@media(max-width:760px){.topbar{align-items:flex-start;gap:14px;flex-direction:column}.brand img{height:46px}.wrap{padding:16px}.hero{padding:20px}.topbar nav{justify-content:flex-start}.topbar nav a,.btn,button{white-space:normal}.grid2{grid-template-columns:1fr}}

/* NoteGear UX-Feinschliff: Gewichtungen, Farben, Archiv, kleinere Aktionsbuttons */
.mt{margin-top:18px}.subcard{background:#fbfefc;border:1px solid var(--line);border-radius:18px;padding:18px;box-shadow:0 10px 28px #1633220a}.subcard h3{margin-top:0}.tablewrap.mini{max-height:360px}.subject-list{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}.subject-chip,.subject-badge{display:inline-flex;align-items:center;gap:9px;border:1px solid #d5e6da;background:#fff;border-radius:999px;padding:8px 12px;color:#1f3228;text-decoration:none;font-weight:800}.subject-chip i,.subject-badge i{width:18px;height:18px;border-radius:50%;background:var(--subject-color);box-shadow:0 0 0 4px color-mix(in srgb,var(--subject-color) 18%,transparent)}.subject-chip.active{border-color:var(--subject-color);background:color-mix(in srgb,var(--subject-color) 12%,#fff)}input[type="color"]{height:46px;padding:5px;max-width:120px;cursor:pointer}.inline-form{display:inline;margin-top:6px}.inline-form button{margin-top:6px}.tiny{min-height:28px;padding:5px 8px;border-radius:9px;font-size:12px}.card .btn,.card button{margin-top:8px}.grade-input{max-width:92px}.tablewrap th{text-align:center}.tablewrap td{text-align:center}.tablewrap td:first-child,.tablewrap th:first-child{text-align:left}.section-title h2{margin:0}.subject-badge{background:#fafffb}.topbar .brand img{max-width:260px;object-fit:contain}


/* Professionelles Spacing-Update */
.card.hero{padding:24px 26px;}
.card h2{font-size:1.35rem;margin-bottom:16px;}
form{margin:0;}
form:not(.inline-form){display:block;}
form label{display:block;margin-bottom:14px;}
form button,.form-actions .btn,.form-actions button{margin-top:12px;}
.grid2 > label{margin-bottom:0;}
.grid2 > button,.grid2 > .btn{align-self:end;margin-top:0;}
.actions,.form-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:14px;}
.btn,button,.topbar nav a{min-height:36px;padding:8px 14px;border-radius:11px;}
.btn.primary,button.primary{background:var(--green);border-color:var(--green);color:#fff;}
.btn.secondary,button.secondary{background:#f8fbf9;}
.inline-form{display:inline-flex!important;align-items:center;justify-content:center;margin:0;}
.inline-form button{margin:0!important;}
.grade-set-head{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:112px;line-height:1.25;}
.grade-set-title{font-weight:850;color:#173224;}
.grade-set-meta{font-size:11px;color:var(--muted);font-weight:700;}
.grade-set-actions{display:flex;gap:6px;align-items:center;justify-content:center;margin-top:2px;}
button.tiny,.btn.tiny{min-height:28px;padding:5px 9px;border-radius:8px;font-size:12px;line-height:1;}
.tablewrap table input{margin-top:0;}
.grade-input{height:38px;min-width:84px;border-radius:10px;font-weight:800;}
.tablewrap td,.tablewrap th{padding:12px 14px;}
.tablewrap th{vertical-align:middle;}
.subject-chip,.subject-badge{min-height:38px;}
.subject-chip i,.subject-badge i{flex:0 0 auto;}
.color-preview{display:inline-flex;align-items:center;gap:9px;margin-top:8px;font-size:13px;color:var(--muted);}
.color-preview i{display:inline-block;width:24px;height:24px;border-radius:8px;background:var(--subject-color);border:1px solid #c8dacd;box-shadow:0 0 0 4px color-mix(in srgb,var(--subject-color) 16%,transparent);}
.help-row{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:14px;}
.help-row p{margin:0;}
@media(max-width:760px){.section-title,.page-intro,.help-row{flex-direction:column;align-items:flex-start}.grid2 > button,.grid2 > .btn{align-self:flex-start;margin-top:8px}}

/* Klare UI-Struktur: Formulare, Registrierung und Gewichtungen */
.wrap{max-width:1240px;}
.card.hero{padding:28px;border-radius:24px;}
.card h1{font-size:clamp(2rem,4vw,3.1rem);}
.card h2{font-size:1.45rem;}
.grid{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:22px;align-items:start;}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;align-items:end;}
.form-grid.compact{grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto;}
.stack-form{display:flex!important;flex-direction:column;gap:14px;align-items:stretch;}
.stack-form label{margin:0;}
.stack-form button{align-self:flex-start;}
.auth-card{max-width:860px;margin:0 auto 24px;}
.auth-card .grid2{grid-template-columns:repeat(2,minmax(240px,1fr));align-items:end;}
.auth-card textarea{min-height:120px;}
.section-title.stacked{align-items:flex-start;}
.section-title.stacked p{margin:4px 0 0;max-width:760px;}
.weight-manager{background:linear-gradient(180deg,#ffffff,#fbfdfb);}
.weight-layout{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(420px,1.4fr);gap:20px;align-items:start;}
.weight-step{padding:22px;border-radius:20px;background:#fff;border:1px solid #dcebe1;}
.weight-step.wide{min-width:0;}
.step-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid #e5efe8;}
.step-head > span{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:12px;background:#e8f7ed;color:#126b31;font-weight:900;flex:0 0 auto;}
.step-head h3{margin:0 0 4px;font-size:1.15rem;}
.step-head p{margin:0;color:var(--muted);font-size:14px;}
.weight-overview{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:16px;border-top:1px solid #edf3ef;}
.weight-overview span{display:inline-flex;padding:7px 10px;border-radius:999px;background:#f1f8f3;border:1px solid #cae5d2;color:#204c30;font-weight:800;font-size:13px;}
.empty-note{padding:14px 16px;border-radius:14px;background:#f7fbf8;border:1px dashed #bed7c6;color:var(--muted);margin:0;}
.weight-edit-list{display:flex;flex-direction:column;gap:12px;}
.weight-edit-row{display:grid;grid-template-columns:minmax(210px,1.4fr) minmax(150px,.75fr) auto;gap:12px;align-items:end;padding:14px;border:1px solid #e2eee6;border-radius:16px;background:#fbfefc;}
.weight-edit-row label{margin:0;}
.weight-edit-row input{margin-top:7px;background:#fff;}
.weight-edit-row .delete-weight{align-self:end;margin:0!important;}
.weight-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 16px;border-radius:16px;background:#f4faf6;border:1px solid #d8eadf;margin-top:2px;}
.weight-summary span{color:var(--muted);font-weight:800;}
.weight-summary strong{font-size:1.15rem;}
.weight-summary strong.ok{color:#147a34;}.weight-summary strong.warn{color:#a86f00;}
.subject-list.clean{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:18px;}
.subject-chip-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #dcebe1;border-radius:16px;background:#fff;box-shadow:0 8px 22px #1633220a;}
.subject-chip-card.active{border-color:var(--subject-color);background:color-mix(in srgb,var(--subject-color) 10%,#fff);}
.subject-chip-card a{display:flex;align-items:center;gap:10px;min-width:0;color:var(--text);text-decoration:none;font-weight:850;}
.subject-chip-card a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.subject-chip-card i{width:20px;height:20px;border-radius:7px;background:var(--subject-color);box-shadow:0 0 0 4px color-mix(in srgb,var(--subject-color) 18%,transparent);flex:0 0 auto;}
button.danger.tiny,.tiny.danger{background:#fff7f7!important;border-color:#efc0c0!important;color:#9d2929!important;}
@media(max-width:900px){.weight-layout{grid-template-columns:1fr}.form-grid.compact{grid-template-columns:1fr}.auth-card .grid2{grid-template-columns:1fr}.weight-edit-row{grid-template-columns:1fr}.weight-edit-row .delete-weight{justify-self:start}.wrap{padding:18px}}


/* Lizenzstatus und Verwaltungsbereiche */
.pill.status.ok{background:#e8f7ed;border-color:#aad8b8;color:#126b31}
.pill.status.neutral{background:#eef2f4;border-color:#cfd8de;color:#41505a}
.pill.status.warn{background:#fff7e6;border-color:#f0d290;color:#8a5d00}
.pill.status.bad{background:#fff1f1;border-color:#efc0c0;color:#9d2929}
.actions.no-margin{margin-top:0;justify-content:center}
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#f4f7f5;border:1px solid #dce7df;border-radius:8px;padding:4px 7px;color:#1f3b2a}
.tablewrap.mini input,.tablewrap.mini select{min-width:180px}


/* Postfach und Ticketsystem */
.message-list{display:flex;flex-direction:column;gap:14px}.message-card{display:grid;grid-template-columns:1fr auto;gap:18px;align-items:start;padding:18px;border:1px solid #dcebe1;border-radius:18px;background:#fff}.message-card.unread{border-color:#f0d290;background:#fffdf7}.message-head{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:8px}.message-card p{margin:8px 0 10px}.message-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.message-list.admin .message-card{grid-template-columns:1fr}.ticket-layout{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(520px,1.6fr);gap:22px;align-items:start}.ticket-list{display:flex;flex-direction:column;gap:10px}.ticket-row{display:flex;justify-content:space-between;gap:12px;padding:14px;border:1px solid #dcebe1;border-radius:16px;background:#fff;color:var(--text);text-decoration:none}.ticket-row:hover,.ticket-row.active{border-color:#7ccf94;background:#f6fff8}.ticket-row span{display:flex;flex-direction:column;gap:3px;min-width:0}.ticket-row em{font-style:normal;color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ticket-row small,.ticket-status{display:inline-flex;align-items:center;align-self:flex-start;padding:6px 10px;border-radius:999px;background:color-mix(in srgb,var(--status-color) 14%,#fff);border:1px solid color-mix(in srgb,var(--status-color) 42%,#fff);color:#173224;font-weight:850;white-space:nowrap}.ticket-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid #e6eee9}.ticket-message{padding:16px 18px;border:1px solid #dcebe1;border-radius:18px;background:#fff;margin-top:14px}.ticket-message.staff{background:#f4faf6;border-color:#bfe3c9}.ticket-message.internal{background:#fff9e8;border-color:#f0d290}.ticket-message p{margin:8px 0}.ticket-message small{color:var(--muted)}
@media(max-width:900px){.ticket-layout{grid-template-columns:1fr}.message-card{grid-template-columns:1fr}.message-actions{justify-content:flex-start}.ticket-detail-head{flex-direction:column}}
