/* NAD Management Board */
:root {
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --navy-3: #1c3f70;
  --accent: #0f5bd8;
  --accent-soft: #e6efff;
  --sky: #38bdf8;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e2e7ef;
  --line-2: #cfd7e3;
  --text: #13213a;
  --muted: #5b6b82;
  --faint: #8a98ac;
  --red: #dc2626;
  --red-soft: #fde8e8;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --green: #059669;
  --green-soft: #dcfce7;
  --violet: #6d28d9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 33, 58, .06), 0 2px 8px rgba(16, 33, 58, .05);
  --shadow-lg: 0 10px 40px rgba(11, 31, 58, .22);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { -webkit-font-smoothing: antialiased; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #dbe6f6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.logo { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, #1d6cf2, #38bdf8); color: #fff; font-weight: 800; display: grid; place-items: center; letter-spacing: .02em; font-size: .95rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.brand b { display: block; color: #fff; font-size: .98rem; }
.brand small { color: #93a8c6; font-size: .78rem; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #c7d5ea; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--sky); }
.nav .sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 6px; }
.nav .lbl { flex: 1; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: #93a8c6; font-size: .75rem; }
.icon-btn { background: transparent; border: 0; color: inherit; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(127,127,127,.14); }
.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(243,245,249,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 24px; min-height: 60px; }
.top-title { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; width: min(320px, 38vw); }
.search input[type=search] { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.hamb { display: none; }
.back-btn { display: none; }
main { padding: 22px 24px 60px; max-width: 1500px; width: 100%; }

/* ---------- Elements ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; white-space: nowrap; font-size: .92rem; text-decoration: none; }
.btn:hover { border-color: #aebbd0; background: #f8fafd; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0b4fc0; border-color: #0b4fc0; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #f5b5b5; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
.btn .i { width: 16px; height: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card-h h2 { font-size: 1rem; flex: 1; display: flex; align-items: center; gap: 8px; }
.card-b { padding: 4px 16px 16px; }
.empty { color: var(--faint); padding: 14px 4px; font-size: .92rem; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .74rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.badge.soft { background: var(--accent-soft); color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef2f7; color: #334155; white-space: nowrap; }
.chip.cat { background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 85%, black); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #94a3b8); flex: none; display: inline-block; }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: .76rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.flag.imp { background: #ede9fe; color: var(--violet); }
.flag.urg { background: var(--amber-soft); color: #b45309; }
.due { font-size: .78rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.due.over { color: var(--red); }
.due.soon { color: #b45309; }
.due .i { width: 13px; height: 13px; }
.av { width: 26px; height: 26px; border-radius: 50%; background: var(--c, #64748b); color: #fff; font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center; flex: none; border: 2px solid #fff; letter-spacing: .02em; }
.av.lg { width: 44px; height: 44px; font-size: .95rem; }
.av.md { width: 32px; height: 32px; font-size: .78rem; }
.avs { display: inline-flex; }
.avs .av + .av { margin-left: -8px; }
.seg { display: inline-flex; background: #e8edf4; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--muted); font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.tag-toggle { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: .84rem; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tag-toggle.on { background: var(--accent-soft); border-color: #b6cdfa; color: var(--accent); }
.tag-toggle.on.imp { background: #ede9fe; border-color: #c4b5fd; color: var(--violet); }
.tag-toggle.on.urg { background: var(--amber-soft); border-color: #fcd34d; color: #b45309; }
select, input:not([type]), input[type=text], input[type=date], input[type=password], input[type=email], input[type=number], input[type=search], textarea {
  border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; background: #fff; min-width: 0; }
select:focus, input:focus, textarea:focus { outline: 2px solid #9ec1fb; outline-offset: 0; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; width: 100%; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; font-weight: 600; color: var(--muted); }
label.f > input, label.f > select, label.f > textarea { font-weight: 400; color: var(--text); font-size: .95rem; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: .92rem; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.progress { height: 7px; background: #e8edf4; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--c, var(--green)); border-radius: 4px; }
.note { background: var(--accent-soft); border: 1px solid #c6d8fb; color: #1e3a8a; border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
.note.warn { background: var(--amber-soft); border-color: #fcd34d; color: #78350f; }
.page-h { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h .t { flex: 1; min-width: 220px; }
.page-h p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; cursor: pointer; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.kpi:hover { border-color: #b6c3d6; }
.kpi .n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi .l { font-size: .84rem; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kpi.red .n { color: var(--red); }
.kpi.amber .n { color: #b45309; }
.kpi.blue .n { color: var(--accent); }
.kpi.violet .n { color: var(--violet); }
.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tline { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px; cursor: pointer; }
.tline:hover { background: #f4f7fb; }
.tline .tt { flex: 1; min-width: 0; }
.tline .tt b { display: block; font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tline .tt small { display: flex; gap: 8px; align-items: center; font-size: .78rem; flex-wrap: wrap; }
.chline { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer; }
.chline:hover { background: #f4f7fb; }
.chline .tt { flex: 1; min-width: 0; }
.chline .tt b { display: block; font-size: .92rem; }
.chline .tt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
.catrow { display: grid; grid-template-columns: 1fr 110px 54px; gap: 12px; align-items: center; padding: 7px 4px; cursor: pointer; border-radius: 8px; font-size: .9rem; }
.catrow:hover { background: #f4f7fb; }
.catrow .nm { display: flex; gap: 8px; align-items: center; min-width: 0; }
.catrow .nm span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catrow small { text-align: right; }
.evt { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 9px; }
.evt .dbox { width: 46px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); text-align: center; padding: 4px 0; flex: none; }
.evt .dbox b { display: block; font-size: 1.15rem; line-height: 1.1; }
.evt .dbox small { font-size: .7rem; color: var(--accent); font-weight: 700; text-transform: uppercase; }

/* ---------- Tasks ---------- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { padding: 7px 10px; font-size: .9rem; }
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: #e9eef5; border-radius: 12px; padding: 10px; min-height: 140px; }
.col.drop { outline: 2px dashed var(--accent); background: #e2ebfa; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: .92rem; }
.col-h .n { color: var(--muted); font-weight: 600; }
.col-list { display: flex; flex-direction: column; gap: 9px; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.tcard:hover { border-color: #a9b8ce; }
.tcard.dragging { opacity: .4; }
.tcard.done .tc-title { text-decoration: line-through; color: var(--muted); }
.tc-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tc-title { font-weight: 600; font-size: .93rem; line-height: 1.35; }
.tc-meta { display: flex; gap: 10px; align-items: center; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.tc-meta .avs { margin-left: auto; }
.mini { display: inline-flex; gap: 4px; align-items: center; }
.mini .i { width: 14px; height: 14px; }
.mini.unread { color: var(--red); font-weight: 700; }
.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quad { border-radius: 12px; padding: 12px; min-height: 220px; border: 1px solid var(--line); }
.quad.drop { outline: 2px dashed var(--accent); }
.quad-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.quad-h b { font-size: .98rem; }
.quad-h small { font-size: .8rem; }
.q1 { background: #fff1f1; } .q2 { background: #f3f0ff; } .q3 { background: #fff8e8; } .q4 { background: #f1f4f8; }
.quad .col-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 9px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f7f9fc; }
.status { font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.st-offen { background: #eef2f7; color: #475569; }
.st-arbeit { background: var(--accent-soft); color: var(--accent); }
.st-warten { background: var(--amber-soft); color: #b45309; }
.st-erledigt { background: var(--green-soft); color: var(--green); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 31, 58, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; animation: fade .12s ease; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(620px, 100%); position: relative; }
.modal.wide { width: min(1080px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.tm { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.tm-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); }
.tm-title { font-size: 1.2rem; font-weight: 700; border: 1px solid transparent !important; padding: 6px 8px !important; margin: -6px -8px; width: calc(100% + 16px); }
.tm-title:hover { border-color: var(--line-2) !important; }
.tm-side { display: flex; flex-direction: column; min-height: 420px; max-height: 80vh; background: #fafbfd; border-radius: 0 0 14px 0; }
.tm-side .chat-msgs { flex: 1; }
.usel { display: flex; flex-wrap: wrap; gap: 6px; }
.usel button { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 3px 11px 3px 3px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--muted); }
.usel button .av { width: 24px; height: 24px; border: 0; font-size: .64rem; }
.usel button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.clist { display: flex; flex-direction: column; gap: 4px; }
.citem { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 7px; }
.citem:hover { background: #f4f7fb; }
.citem input[type=text] { flex: 1; border-color: transparent; padding: 4px 6px; }
.citem input[type=text]:hover { border-color: var(--line-2); }
.citem.done input[type=text] { text-decoration: line-through; color: var(--muted); }
.saved { font-size: .8rem; color: var(--green); font-weight: 600; }
.meta-line { font-size: .8rem; color: var(--faint); }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - 150px); min-height: 480px; overflow: hidden; }
.chat-side { border-right: 1px solid var(--line); overflow-y: auto; padding: 10px; background: #fbfcfe; border-radius: var(--radius) 0 0 var(--radius); }
.chat-side h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 12px 8px 6px; display: flex; align-items: center; }
.chat-side h4 span { flex: 1; }
.chi { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.chi:hover { background: #eef2f8; }
.chi.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chi .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chi .hash { width: 26px; height: 26px; border-radius: 7px; background: #e3e9f2; display: grid; place-items: center; color: var(--muted); flex: none; font-weight: 700; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head b { font-size: 1rem; }
.chat-main .chat-msgs, .tm-side .chat-msgs { flex: 1; }
.chat-msgs { overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.dayline { text-align: center; font-size: .75rem; color: var(--faint); margin: 12px 0 6px; font-weight: 600; }
.msg { display: flex; gap: 10px; padding: 6px 8px; border-radius: 9px; position: relative; }
.msg:hover { background: #f4f7fb; }
.msg .av { margin-top: 2px; }
.msg .mb { flex: 1; min-width: 0; }
.msg .mh { display: flex; gap: 8px; align-items: baseline; }
.msg .mh b { font-size: .9rem; }
.msg .mh small { font-size: .74rem; color: var(--faint); }
.msg .mt { white-space: pre-wrap; word-wrap: break-word; font-size: .93rem; }
.msg .mact { position: absolute; right: 8px; top: 4px; display: none; gap: 4px; }
.msg:hover .mact { display: flex; }
.msg.cont { padding-top: 1px; }
.msg.cont .mh { display: none; }
.msg.cont .av { visibility: hidden; height: 0; }
.tasklink { display: inline-flex; gap: 6px; align-items: center; margin-top: 5px; font-size: .8rem; font-weight: 600; background: var(--green-soft); color: #065f46; padding: 3px 9px; border-radius: 7px; cursor: pointer; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 42px; max-height: 160px; height: 42px; resize: none; }
.unread-line { border-top: 1px solid #fca5a5; margin: 8px 0; position: relative; }
.unread-line span { position: absolute; right: 0; top: -9px; background: #fff; color: var(--red); font-size: .7rem; font-weight: 700; padding: 0 6px; }

/* ---------- Termine ---------- */
.polls { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.poll-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.poll-card:hover { border-color: #b6c3d6; }
.pgrid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; max-height: 70vh; }
.pgrid { border-collapse: separate; border-spacing: 0; user-select: none; -webkit-user-select: none; }
.pgrid th { position: sticky; top: 0; background: #f8fafc; z-index: 2; font-size: .78rem; padding: 8px 6px; border-bottom: 1px solid var(--line); min-width: 92px; font-weight: 700; }
.pgrid th small { display: block; font-weight: 500; color: var(--muted); }
.pgrid td.tm-l { position: sticky; left: 0; background: #f8fafc; z-index: 1; font-size: .74rem; color: var(--muted); padding: 0 8px; text-align: right; border-right: 1px solid var(--line); white-space: nowrap; }
.pgrid th:first-child { left: 0; z-index: 3; min-width: 56px; }
.pgrid td.s { height: 26px; border-bottom: 1px solid #eef1f6; border-right: 1px solid #eef1f6; cursor: pointer; position: relative; font-size: .7rem; text-align: center; color: #065f46; font-weight: 700; }
.pgrid tr.hour td.s { border-top: 1px solid #dde3ec; }
.pgrid td.s:hover { outline: 2px solid #93c5fd; outline-offset: -2px; }
.pgrid td.s.me-yes::after, .pgrid td.s.me-maybe::after { content: ""; position: absolute; inset: 3px; border-radius: 5px; border: 2px solid var(--green); }
.pgrid td.s.me-maybe::after { border-color: #d97706; border-style: dashed; }
.pgrid td.s.all { box-shadow: inset 0 0 0 2px #047857; }
.pgrid td.s.best { box-shadow: inset 0 0 0 3px #0f5bd8; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 16px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.poll-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.best-slot { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.best-slot .tt { flex: 1; min-width: 0; }
.best-slot b { display: block; font-size: .92rem; }
.best-slot small { font-size: .78rem; }
.fixed-banner { background: var(--green-soft); border: 1px solid #86efac; border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: #065f46; margin-bottom: 14px; }

/* ---------- Besprechungen ---------- */
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: #fafbfd; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sugg { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: 26px 1fr; gap: 10px; background: #fff; }
.sugg.off { opacity: .5; background: #f8fafc; }
.sugg .sg-b { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sugg .sg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sugg input.sg-title { font-weight: 600; width: 100%; }
.sugg textarea { min-height: 54px; font-size: .88rem; }
.sugg .quote { font-size: .8rem; color: var(--muted); border-left: 3px solid var(--line-2); padding-left: 8px; font-style: italic; }
.spinner { width: 22px; height: 22px; border: 3px solid #cfdcf3; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg) } }
.dec { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dec:last-child { border-bottom: 0; }
.dec .tt { flex: 1; min-width: 0; }
.ds { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.ds-beschlossen { background: var(--green-soft); color: var(--green); }
.ds-vorschlag { background: #ede9fe; color: var(--violet); }
.ds-offen { background: var(--amber-soft); color: #b45309; }

/* ---------- Bereiche / Team ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cat-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--c); cursor: pointer; }
.cat-card:hover { border-color: #b6c3d6; border-top-color: var(--c); }
.cat-card p { margin: 0; font-size: .87rem; color: var(--muted); }
.stats { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.stats b { color: var(--text); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person { padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.person .pb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.colors { display: flex; gap: 6px; flex-wrap: wrap; }
.colors button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); background: var(--c); cursor: pointer; }
.colors button.on { box-shadow: 0 0 0 2px var(--text); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #1d4f9a 0%, transparent 60%), var(--navy); }
.auth-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: min(420px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .brand { padding: 0; border: 0; }
.auth-card .brand b { color: var(--text); font-size: 1.1rem; }
.auth-card .brand small { color: var(--muted); }
.err { color: var(--red); font-size: .88rem; font-weight: 600; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 500; animation: fade .15s ease; pointer-events: auto; }
.toast.err { background: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .poll-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .hamb { display: grid; }
  .top { padding: 10px 16px; }
  main { padding: 16px 16px 60px; }
  .tm { grid-template-columns: minmax(0, 1fr); }
  .tm-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .tm-side { min-height: 360px; border-radius: 0 0 14px 14px; }
  .matrix { grid-template-columns: minmax(0, 1fr); }
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 130px); }
  .chat.has-ch .chat-side { display: none; }
  .chat:not(.has-ch) .chat-main { display: none; }
  .chat-side { border-right: 0; border-radius: var(--radius); }
  .back-btn { display: grid; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .n { font-size: 1.5rem; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .search { display: none; }
  .top .btn-primary .lbl { display: none; }
  h1 { font-size: 1.3rem; }
  .board { grid-template-columns: repeat(4, 84vw); }
  .modal-bg { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .tbl .hide-s { display: none; }
}
.side-scrim { display: none; }
@media (max-width: 900px) { .side.open + .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; } }
