/* Sellica Fibu – Design-System: Plus Jakarta Sans, Elfenbein, Grün #2c5530, Gold #c89e3c */
:root {
    --bg:        #f6f3ec;
    --bg-2:      #efebe0;
    --card:      #ffffff;
    --line:      #e4ded0;
    --line-2:    #d3cbb8;
    --ink:       #1e2a22;
    --ink-2:     #4b5a50;
    --muted:     #7d8a80;
    --green:     #2c5530;
    --green-2:   #3e7a45;
    --green-bg:  #e6f0e6;
    --gold:      #c89e3c;
    --gold-bg:   #f8efd9;
    --red:       #b84a3a;
    --red-bg:    #f8e5e1;
    --amber:     #b97d14;
    --amber-bg:  #fbf0d6;
    --grey-bg:   #ececec;
    --radius:    12px;
    --shadow:    0 6px 20px -14px rgba(30,42,34,.35);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { font-size:14px; }
body {
    font-family:'Plus Jakarta Sans', system-ui, sans-serif;
    background:var(--bg);
    color:var(--ink);
    line-height:1.45;
    min-height:100vh;
}
a { color:var(--green); text-decoration:none; }
a:hover { text-decoration:underline; }
code, .mono { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.92em; }
code { background:var(--bg-2); padding:1px 5px; border-radius:4px; }
h1 { font-size:22px; font-weight:800; letter-spacing:-.02em; }
h2 { font-size:15px; font-weight:700; margin-bottom:12px; }
h3 { font-size:13px; font-weight:700; margin:18px 0 8px; color:var(--ink-2); }
.muted { color:var(--muted); }
.small { font-size:12px; }
.center { text-align:center; }
.r { text-align:right; }
.nowrap { white-space:nowrap; }
.text-green { color:var(--green-2); }
.text-red { color:var(--red); }
.text-amber { color:var(--amber); }
.text-gold { color:var(--gold); }
.text-grey { color:var(--muted); }
.mt { margin-top:4px; }
.hidden-form { display:none; }
.inline { display:inline; }

/* ---------- Layout ---------- */
.shell { display:flex; min-height:100vh; }
.side {
    width:220px; flex:0 0 220px;
    background:var(--green);
    color:#e9efe8;
    display:flex; flex-direction:column;
    padding:22px 14px;
    position:sticky; top:0; height:100vh;
}
.logo { display:flex; align-items:center; gap:10px; color:inherit; font-size:16px; margin-bottom:26px; padding:0 8px; }
.logo:hover { text-decoration:none; }
.logo-mark {
    width:34px; height:34px; border-radius:9px;
    background:var(--gold); color:#1e2a22;
    display:inline-flex; align-items:center; justify-content:center;
    font-weight:800; font-size:16px;
}
.side nav { display:flex; flex-direction:column; gap:4px; }
.side nav a {
    display:flex; align-items:center; gap:10px;
    padding:9px 10px; border-radius:9px;
    color:#d8e2d6; font-weight:500;
}
.side nav a:hover { background:rgba(255,255,255,.07); text-decoration:none; }
.side nav a.active { background:rgba(255,255,255,.14); color:#fff; }
.side nav .ico { flex:0 0 18px; opacity:.85; }
.side nav .badge { margin-left:auto; }
.side-foot { margin-top:auto; display:flex; justify-content:space-between; padding:0 8px; font-size:12px; }
.side-foot a { color:#b7c6b5; }
.badge {
    font-style:normal; font-size:11px; font-weight:700;
    padding:1px 7px; border-radius:999px; color:#fff;
}
.badge-amber { background:var(--amber); }
.badge-red { background:var(--red); }

.main { flex:1; padding:28px 32px 48px; min-width:0; }
.page-head { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:20px; flex-wrap:wrap; }
.inline-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* ---------- Karten ---------- */
.card {
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
    padding:18px 20px; box-shadow:var(--shadow); margin-bottom:18px;
}
.card-flush { padding:0; overflow:hidden; }
.card-flush .tbl { border:0; }
.cols { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.cols .card { margin-bottom:0; }
.cols + .cols { margin-top:18px; }

/* KPI */
.kpis { display:grid; grid-template-columns:repeat(6, 1fr); gap:12px; margin-bottom:18px; }
.kpi {
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
    padding:14px 16px; display:flex; flex-direction:column; gap:2px; color:var(--ink);
    border-top:3px solid var(--line-2); box-shadow:var(--shadow);
}
.kpi:hover { text-decoration:none; border-color:var(--gold); }
.kpi-label { font-size:11px; text-transform:uppercase; letter-spacing:.12em; color:var(--muted); font-weight:600; }
.kpi-value { font-size:26px; font-weight:800; letter-spacing:-.02em; }
.kpi-sub { font-size:12px; color:var(--muted); }
.kpi-green { border-top-color:var(--green-2); }
.kpi-amber { border-top-color:var(--amber); }
.kpi-red { border-top-color:var(--red); }
.kpi-grey { border-top-color:#bbb; }

/* Tabellen */
.tbl { width:100%; border-collapse:collapse; font-size:13px; }
.tbl th {
    text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.1em;
    color:var(--muted); font-weight:600; padding:10px 12px;
    border-bottom:1px solid var(--line); background:var(--bg-2);
}
.tbl th.r { text-align:right; }
.tbl td { padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
.tbl tbody tr:last-child td { border-bottom:0; }
.tbl tbody tr:hover td { background:#fcfbf7; }
.tbl-compact td, .tbl-compact th { padding:7px 10px; }
.tbl-edit input, .tbl-edit select { width:100%; }
.tbl-edit input.w-small { width:70px; }
.row-open td.col-status { box-shadow:inset 3px 0 var(--red); }
.row-suggested td.col-status { box-shadow:inset 3px 0 var(--amber); }
.row-matched td.col-status { box-shadow:inset 3px 0 var(--green-2); }
.row-exempt td.col-status { box-shadow:inset 3px 0 #bbb; }
.col-purpose { max-width:420px; }
.col-doc { min-width:200px; }
.pager { display:flex; gap:4px; flex-wrap:wrap; margin-top:12px; }
.pager a { padding:4px 9px; border:1px solid var(--line); border-radius:6px; background:#fff; font-size:12px; }
.pager a.active { background:var(--green); color:#fff; border-color:var(--green); }

/* Pills & Chips */
.pill { display:inline-block; font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.pill-green { background:var(--green-bg); color:var(--green); }
.pill-amber { background:var(--amber-bg); color:var(--amber); }
.pill-red { background:var(--red-bg); color:var(--red); }
.pill-grey { background:var(--grey-bg); color:#666; }
.doc-chip {
    display:inline-flex; align-items:center; gap:6px;
    font-size:12px; padding:3px 6px 3px 9px; border-radius:7px; margin:2px 0;
    border:1px solid var(--line);
}
.chip-green { background:var(--green-bg); border-color:#cfe0cf; }
.chip-amber { background:var(--amber-bg); border-color:#eedcb0; }
.doc-chip small { color:var(--muted); }
.chip-btn {
    border:0; background:transparent; cursor:pointer; font-size:12px; font-weight:700;
    width:20px; height:20px; border-radius:5px; line-height:1;
}
.chip-btn.ok { color:var(--green-2); }
.chip-btn.no { color:var(--red); }
.chip-btn:hover { background:rgba(0,0,0,.08); }

/* Buttons & Inputs */
.btn {
    display:inline-flex; align-items:center; gap:6px;
    border:1px solid var(--line-2); background:#fff; color:var(--ink);
    padding:7px 13px; border-radius:8px; font:inherit; font-size:13px; font-weight:600;
    cursor:pointer; white-space:nowrap; transition:all .15s;
}
.btn:hover { border-color:var(--green); color:var(--green); text-decoration:none; }
.btn-primary { background:var(--green); color:#fff; border-color:var(--green); }
.btn-primary:hover { background:var(--green-2); color:#fff; }
.btn-sm { padding:4px 9px; font-size:12px; }
.btn-ghost { background:transparent; border-color:transparent; color:var(--ink-2); }
.btn-ghost:hover { background:var(--bg-2); border-color:var(--line); }
.btn-danger { color:var(--red); border-color:transparent; background:transparent; }
.btn-danger:hover { background:var(--red-bg); border-color:transparent; color:var(--red); }
.btn[disabled] { opacity:.5; cursor:default; }
button.link { background:none; border:0; color:var(--green); font:inherit; cursor:pointer; text-decoration:underline; }
input, select, textarea {
    font:inherit; font-size:13px; color:var(--ink);
    border:1px solid var(--line-2); border-radius:8px; background:#fff;
    padding:7px 10px; outline:none;
}
input:focus, select:focus, textarea:focus { border-color:var(--green); box-shadow:0 0 0 3px rgba(44,85,48,.12); }
input[type=checkbox] { width:16px; height:16px; accent-color:var(--green); }
input.small { font-size:12px; padding:4px 8px; }
.form label { display:block; font-size:12px; font-weight:600; color:var(--ink-2); margin:12px 0 4px; }
.form label.check { display:flex; align-items:center; gap:8px; font-weight:500; }
.form input:not([type=checkbox]), .form select, .form textarea { width:100%; }
.form .btn { margin-top:16px; }
.filters select, .filters input[type=search] { min-width:140px; }

/* Flash */
.flashes { margin-bottom:16px; }
.flash { padding:10px 14px; border-radius:9px; font-size:13px; margin-bottom:8px; border:1px solid transparent; }
.flash-success { background:var(--green-bg); color:var(--green); border-color:#cfe0cf; }
.flash-error { background:var(--red-bg); color:var(--red); border-color:#ecc9c2; }
.flash-info { background:var(--gold-bg); color:#7a5c14; border-color:#ecd9a6; }

/* Listen */
.facts { list-style:none; }
.facts li { display:flex; justify-content:space-between; gap:12px; padding:6px 0; border-bottom:1px dashed var(--line); font-size:13px; }
.facts li:last-child { border-bottom:0; }
.facts code { font-size:11px; word-break:break-all; }
.hints { padding-left:18px; font-size:13px; }
.hints li { margin-bottom:8px; }
.checklist { list-style:none; }
.checklist li { padding:5px 0 5px 24px; position:relative; font-size:13px; }
.checklist li::before { content:''; position:absolute; left:2px; top:9px; width:12px; height:12px; border:1.5px solid var(--line-2); border-radius:4px; }
.checklist li.done::before { background:var(--green-2); border-color:var(--green-2); }
.checklist li.done { color:var(--muted); text-decoration:line-through; }
.bar { height:6px; background:var(--bg-2); border-radius:3px; width:90px; display:inline-block; vertical-align:middle; margin-right:6px; overflow:hidden; }
.bar span { display:block; height:100%; background:var(--green-2); }
.group { margin-bottom:14px; }
.group-head { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; background:var(--bg-2); border-bottom:1px solid var(--line); }
.group-head h2 { margin:0; font-size:14px; }

/* Dropzone */
.dropzone {
    border:2px dashed var(--line-2); border-radius:var(--radius); background:#fbfaf6;
    padding:22px; text-align:center; margin-bottom:18px; transition:all .15s;
}
.dropzone.over { border-color:var(--gold); background:var(--gold-bg); }
.dz-inner { display:flex; flex-direction:column; align-items:center; gap:4px; color:var(--ink-2); }
.dz-inner .ico { color:var(--gold); margin-bottom:4px; }
.dz-progress { margin-top:12px; font-size:13px; color:var(--ink-2); }
.editable { cursor:text; border-bottom:1px dashed transparent; }
.editable:hover { border-bottom-color:var(--gold); }
.editable input { padding:2px 6px; font-size:13px; width:140px; }
.requested { cursor:pointer; }

/* Modal */
.modal-bg {
    position:fixed; inset:0; background:rgba(30,42,34,.45); z-index:50;
    display:flex; align-items:flex-start; justify-content:center; padding:40px 20px; overflow:auto;
}
.modal {
    background:#fff; border-radius:14px; width:100%; max-width:1180px;
    box-shadow:0 30px 60px -20px rgba(0,0,0,.4); animation:pop .15s ease-out;
}
@keyframes pop { from { transform:translateY(8px); opacity:0; } to { transform:none; opacity:1; } }
.modal-sm { max-width:460px; }
.modal-head { display:flex; justify-content:space-between; align-items:center; padding:14px 18px; border-bottom:1px solid var(--line); }
.modal-head h2 { margin:0; }
.modal-body { padding:18px; }
.modal-close { background:none; border:0; font-size:20px; cursor:pointer; color:var(--muted); }
.assign { display:grid; grid-template-columns:1fr 1fr; gap:18px; min-height:520px; }
.assign .tx-box { background:var(--bg-2); border-radius:10px; padding:12px 14px; margin-bottom:12px; font-size:13px; }
.assign .tx-box strong { font-size:15px; }
.cand-list { display:flex; flex-direction:column; gap:6px; max-height:520px; overflow:auto; }
.cand {
    display:grid; grid-template-columns:52px 1fr auto; gap:10px; align-items:center;
    border:1px solid var(--line); border-radius:9px; padding:9px 11px; cursor:pointer; background:#fff;
}
.cand:hover, .cand.active { border-color:var(--gold); background:#fffdf7; }
.cand .score { font-weight:800; font-size:15px; text-align:center; border-radius:8px; padding:4px 0; }
.score-hi { background:var(--green-bg); color:var(--green); }
.score-mid { background:var(--amber-bg); color:var(--amber); }
.score-lo { background:var(--grey-bg); color:#666; }
.cand .why { font-size:11px; color:var(--muted); }
.preview { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--bg-2); min-height:520px; }
.preview iframe { width:100%; height:100%; min-height:520px; border:0; }
.preview .empty { display:flex; align-items:center; justify-content:center; height:520px; color:var(--muted); }
.kbd-hint { font-size:11px; color:var(--muted); margin-top:8px; }
.kbd-hint kbd { border:1px solid var(--line-2); border-radius:4px; padding:0 5px; font-family:inherit; }
.toast {
    position:fixed; bottom:20px; right:20px; z-index:60;
    background:var(--ink); color:#fff; padding:10px 16px; border-radius:9px; font-size:13px;
    box-shadow:0 10px 30px -10px rgba(0,0,0,.5); animation:pop .15s ease-out;
}
.toast.err { background:var(--red); }

/* Login */
.login-body { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:20px; }
.login-card { background:#fff; border:1px solid var(--line); border-radius:16px; padding:32px; width:100%; max-width:400px; box-shadow:var(--shadow); }
.login-card .logo { color:var(--ink); margin-bottom:6px; font-size:18px; }
.login-card label { display:block; font-size:12px; font-weight:600; color:var(--ink-2); margin:14px 0 4px; }
.login-card input, .login-card textarea { width:100%; }
.login-card .btn { width:100%; justify-content:center; margin-top:18px; }
.login-card .flash { margin-top:12px; }

/* Druck */
.print-body { padding:24px; background:#fff; }
.print-body .card { box-shadow:none; }
@media print {
    .side, .btn, .inline-form, .flashes { display:none !important; }
    .main { padding:0; }
    .card { box-shadow:none; break-inside:avoid; }
    body { background:#fff; }
}

/* Responsive */
@media (max-width: 1100px) {
    .kpis { grid-template-columns:repeat(3, 1fr); }
    .cols { grid-template-columns:1fr; }
    .assign { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
    .shell { flex-direction:column; }
    .side { width:100%; flex:none; height:auto; position:static; padding:12px; }
    .side nav { flex-direction:row; flex-wrap:wrap; }
    .side nav a span { display:none; }
    .side-foot { display:none; }
    .main { padding:16px; }
    .kpis { grid-template-columns:repeat(2, 1fr); }
}
