/* Überblick-Klon – Oberfläche, nah an app.uberblick.io nachempfunden */
:root {
  --bar: #2f2f2f;
  --bar-text: #e9e9e9;
  --green: #57b24f;
  --green-d: #4a9c43;
  --blue: #2f6fb0;
  --red: #e2543f;
  --line: #e3e3e3;
  --bg: #ececec;
  --card: #ffffff;
  --muted: #8b8b8b;
  --ink: #333;
  --chip: #ededed;
  --col-open: #e57368;
  --col-prog: #4bb3a6;
  --col-done: #c9c9c9;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px;
}
a { color: var(--blue); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
#login {
  position: fixed; inset: 0; background: #2f2f2f;
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
#login .box { background: #fff; border-radius: 10px; padding: 34px 38px; width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
#login .logo { font-size: 46px; font-weight: 800; text-align: center; color: #2f2f2f; letter-spacing: -2px; }
#login h2 { text-align: center; font-weight: 500; color: #666; margin: 4px 0 22px; font-size: 15px; }
#login label { display: block; font-size: 12px; color: #888; margin: 12px 0 4px; }
#login input { width: 100%; padding: 10px; border: 1px solid #d3d3d3; border-radius: 6px; font-size: 14px; }
#login button { width: 100%; margin-top: 20px; padding: 11px; background: var(--green); color: #fff; border: 0; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; }
#login button:hover { background: var(--green-d); }
#login .hint { margin-top: 14px; font-size: 11px; color: #999; text-align: center; line-height: 1.5; }
#login .err { color: var(--red); font-size: 12px; text-align: center; margin-top: 10px; min-height: 14px; }

/* ---------- Top bar ---------- */
#topbar {
  height: 46px; background: var(--bar); color: var(--bar-text);
  display: flex; align-items: center; padding: 0 10px; position: sticky; top: 0; z-index: 40;
}
#topbar .logo { font-size: 24px; font-weight: 800; letter-spacing: -1.5px; margin: 0 14px 0 6px; color: #fff; }
#topbar nav { display: flex; gap: 2px; flex: 1; }
#topbar nav a {
  color: #cfcfcf; padding: 6px 12px; border-radius: 5px; font-size: 13px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
#topbar nav a .ic { font-size: 14px; opacity: .85; }
#topbar nav a:hover { background: #3d3d3d; color: #fff; }
#topbar nav a.active { color: #fff; border-bottom: 2px solid #fff; border-radius: 5px 5px 0 0; }
#topbar .right { display: flex; align-items: center; gap: 14px; }
#topbar .bell { font-size: 16px; cursor: pointer; position: relative; }
#topbar .bell .nbadge { position: absolute; top: -7px; right: -9px; background: var(--red);
  color: #fff; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; padding: 0 4px; font-weight: 700; }
#notifPanel { position: fixed; top: 48px; right: 56px; width: 360px; max-width: calc(100vw - 24px);
  max-height: 72vh; overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 16px 50px rgba(0,0,0,.28); z-index: 70; }
#notifPanel .nhead { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #999; padding: 12px 14px 4px; }
#notifPanel .nhead.top { font-size: 14px; font-weight: 700; color: #333; border-bottom: 1px solid var(--line);
  text-transform: none; letter-spacing: 0; padding: 12px 14px; }
#notifPanel .nitem { display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  border-bottom: 1px solid #f2f2f2; cursor: pointer; font-size: 13px; }
#notifPanel .nitem:hover { background: #f7f7f7; }
#notifPanel .nitem .nic { flex: none; }
#notifPanel .nitem .ntx { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#notifPanel .nitem .nmeta { font-size: 11px; color: #9a9a9a; flex: none; }
#notifPanel .nempty { padding: 28px; text-align: center; color: #aaa; }
#topbar .me { display: flex; align-items: center; gap: 8px; cursor: pointer; }
#topbar .me .name { line-height: 1.1; text-align: right; }
#topbar .me .name b { font-size: 13px; color: #fff; font-weight: 600; }
#topbar .me .name span { font-size: 11px; color: #b5b5b5; display: block; }

/* ---------- Avatars ---------- */
.av { border-radius: 50%; background: #b7b7b7; color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; flex: none; }
.av.s { width: 24px; height: 24px; font-size: 10px; }
.av.m { width: 30px; height: 30px; font-size: 11px; }
.av.l { width: 40px; height: 40px; font-size: 14px; }

/* ---------- Toolbar ---------- */
.toolbar { background: #fafafa; border-bottom: 1px solid var(--line); padding: 9px 14px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { background: var(--green); color: #fff; border: 0; padding: 8px 14px; border-radius: 5px;
  font-weight: 600; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-transform: uppercase; letter-spacing: .3px; }
.btn:hover { background: var(--green-d); }
.btn.blue { background: var(--blue); }
.btn.grey { background: #6b6b6b; }
.spacer { flex: 1; }
.filter { background: #fff; border: 1px solid #dcdcdc; border-radius: 5px; padding: 7px 10px; font-size: 12.5px; color: #666; min-width: 120px; }
.filter.search { min-width: 240px; }

/* ---------- Board ---------- */
.board { display: grid; gap: 14px; padding: 14px; align-items: start; }
.board.c3 { grid-template-columns: repeat(3, 1fr); }
.column { background: #f4f4f4; border-radius: 6px; min-height: 200px; }
.column > .head { text-align: center; padding: 9px; font-size: 12px; font-weight: 700;
  color: var(--muted); letter-spacing: 1px; border-top: 3px solid transparent; position: relative; }
.column.open > .head { border-color: var(--col-open); }
.column.prog > .head { border-color: var(--col-prog); }
.column.done > .head { border-color: var(--col-done); }
.column .count { position: absolute; right: 10px; top: 7px; background: var(--red); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 3px; font-weight: 700; letter-spacing: 0; }
.column .body { padding: 0 8px 8px; max-height: calc(100vh - 190px); overflow-y: auto; }

.card { background: var(--card); border: 1px solid #e6e6e6; border-radius: 5px; padding: 11px 12px;
  margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.card:hover { border-color: #cfcfcf; }
.card.urgent { background: #fdeceb; border-color: #f6cfca; }
.card .creator { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #555; margin-bottom: 7px; }
.card .creator b { font-weight: 600; }
.card .title { font-size: 14px; color: #2a2a2a; line-height: 1.35; margin-bottom: 8px; }
.card .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.chip { background: var(--chip); color: #6a6a6a; font-size: 11px; padding: 2px 8px; border-radius: 3px; display: inline-flex; align-items: center; gap: 4px; }
.chip.cat { background: #e4e4e4; }
.chip.cl { background: #eef6ee; color: #4a9c43; }
.chip.cl.part { background: #eee; color: #888; }
.chip.icon { background: transparent; padding: 2px 4px; color: #9a9a9a; }
.card .foot { display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #f0f0f0; padding-top: 7px; font-size: 11px; color: #8a8a8a; }
.card .foot b { color: #555; font-weight: 600; }

/* ---------- Info board ---------- */
.info-post { background: #fff; border-bottom: 1px solid #f0f0f0; padding: 14px; }
.info-post .creator { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; margin-bottom: 8px; }
.info-post .creator .t { color: #9a9a9a; font-size: 11px; }
.info-post h4 { margin: 0 0 6px; font-size: 15px; }
.info-post .post-thumb { width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; margin: 4px 0 8px; display: block; background: #f0f0f0; }
.info-post .txt { font-size: 13.5px; line-height: 1.5; color: #333; white-space: pre-wrap; }
.info-post .txt.clamp { max-height: 120px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); }
.info-post .actions { margin-top: 10px; display: flex; gap: 16px; font-size: 12px; color: #9a9a9a; }
.info-post .actions span { cursor: pointer; }
.confirm-bar { margin-top: 10px; background: var(--green); color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 4px; display: flex; justify-content: space-between; }
.confirm-bar.todo { background: #d8b23a; }
.chatline { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f2f2f2; cursor: pointer; }
.chatline:hover { background: #f8f8f8; }
.chatline .n { flex: 1; font-size: 13px; }
.chatline .t { font-size: 11px; color: #9a9a9a; }

/* ---------- Knowledge ---------- */
.knowledge { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 92px); }
.folders { background: #fafafa; border-right: 1px solid var(--line); padding: 8px 0; }
.folders .f { display: flex; align-items: center; gap: 9px; padding: 9px 16px; font-size: 13px; color: #555; cursor: pointer; }
.folders .f:hover, .folders .f.active { background: #ececec; color: #222; }
.folders .f .ic { color: #f0b400; }
.kmain { padding: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.fcard { background: #fff; border: 1px solid #e6e6e6; border-radius: 6px; overflow: hidden; cursor: pointer; }
.fcard .thumb { height: 78px; background: #d7d7d7 center/cover; position: relative; }
.fcard .thumb .tab { position: absolute; top: 0; left: 0; width: 34px; height: 12px; background: #fff; border-radius: 0 0 6px 0; }
.fcard .meta { padding: 9px 11px; }
.fcard .meta .nm { font-size: 12.5px; font-weight: 600; color: #333; }
.fcard .meta .ct { font-size: 11px; color: #999; margin-top: 4px; }
.recent { margin-top: 24px; }
.recent .h { color: #999; font-size: 12px; margin-bottom: 8px; }
.recent .row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.recent .row .ti { flex: 1; font-size: 13px; }
.recent .row .dt { font-size: 11px; color: #9a9a9a; }

/* ---------- Month grid ---------- */
.month { padding: 14px; }
.month table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.month th { font-size: 12px; color: #666; font-weight: 600; padding: 8px; border: 1px solid var(--line); background: #fafafa; }
.month td { border: 1px solid var(--line); vertical-align: top; height: 116px; padding: 4px 5px; background: #fff; }
.month td.other { background: #f7f7f7; color: #bbb; }
.month td.today { outline: 2px solid var(--blue); outline-offset: -2px; }
.month .dnum { font-size: 12px; font-weight: 600; color: #777; text-align: center; margin-bottom: 3px; }
.ev { font-size: 10.5px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 0; }
.ev .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }

/* ---------- Week calendar ---------- */
.week { padding: 0 14px 14px; overflow: auto; }
.week table { width: 100%; border-collapse: collapse; }
.week th { font-size: 12px; color: #555; padding: 8px; border-bottom: 1px solid var(--line); }
.week th.today { color: var(--green-d); font-weight: 700; }
.week td { border: 1px solid #f0f0f0; height: 34px; position: relative; }
.week td.hour { width: 54px; border: 0; font-size: 11px; color: #aaa; text-align: right; padding-right: 8px; vertical-align: top; }
.evblock { position: absolute; left: 2px; right: 2px; background: #d8ecf6; border-left: 3px solid var(--blue);
  border-radius: 3px; padding: 3px 5px; font-size: 11px; overflow: hidden; z-index: 2; }
.evblock .tt { font-weight: 600; }

/* ---------- Contacts ---------- */
.contacts { padding: 0 14px; }
.contacts table { width: 100%; border-collapse: collapse; background: #fff; }
.contacts th { text-align: left; font-size: 12px; color: #999; font-weight: 600; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.contacts td { padding: 10px; border-bottom: 1px solid #f2f2f2; font-size: 13px; vertical-align: middle; }
.contacts .who { display: flex; align-items: center; gap: 10px; }
.contacts .who .n b { font-weight: 600; }
.contacts .who .n .t { font-size: 11px; color: var(--green-d); }
.contacts .grp { color: #666; font-size: 12px; }
.contacts .grp .gicon { color: #9a9a9a; margin-right: 5px; }

/* ---------- Modal ---------- */
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
  align-items: flex-start; justify-content: center; z-index: 60; padding: 40px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 8px; width: 640px; max-width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.modal .mhead { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal .mhead h3 { margin: 0; font-size: 17px; }
.modal .mhead .x { cursor: pointer; font-size: 22px; color: #999; line-height: 1; }
.modal .mhead .mtools { display: flex; align-items: center; gap: 12px; }
.modal .mhead .micon { cursor: pointer; font-size: 15px; color: #9a9a9a; }
.modal .mhead .micon:hover { color: var(--ink); }
.modal .mbody { padding: 18px 20px; max-height: 62vh; overflow: auto; }
.modal .sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #777; margin-bottom: 14px; }
.modal .desc { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; color: #333; }
.status-row { display: flex; gap: 8px; margin: 16px 0; }
.status-row button { flex: 1; border: 1px solid #dcdcdc; background: #fff; padding: 8px; border-radius: 5px; cursor: pointer; font-size: 12px; color: #666; }
.status-row button.on { color: #fff; border-color: transparent; }
.status-row button.on.CREATED { background: var(--col-open); }
.status-row button.on.IN_PROGRESS { background: var(--col-prog); }
.status-row button.on.DONE { background: var(--green); }
.cl-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f2f2f2; }
.cl-item input { width: 18px; height: 18px; }
.cl-item.done label { color: #aaa; text-decoration: line-through; }
.cmt { display: flex; gap: 9px; padding: 10px 0; border-top: 1px solid #f2f2f2; }
.cmt .b { flex: 1; }
.cmt .b .meta { font-size: 11px; color: #999; margin-bottom: 3px; }
.cmt .b .txt { font-size: 13px; line-height: 1.5; }
.cmt-box { display: flex; gap: 8px; margin-top: 12px; }
.cmt-box input { flex: 1; padding: 9px; border: 1px solid #dcdcdc; border-radius: 5px; }
.section-h { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #999; margin: 18px 0 8px; }

/* ---------- Chats dock ---------- */
#dock { position: fixed; right: 18px; bottom: 0; width: 300px; background: #2f2f2f; color: #fff;
  border-radius: 8px 8px 0 0; z-index: 50; box-shadow: 0 -4px 20px rgba(0,0,0,.25); }
#dock .dhead { display: flex; align-items: center; padding: 10px 12px; cursor: pointer; }
#dock .dhead .ic { margin-right: 8px; }
#dock .dhead .t { flex: 1; font-size: 13px; font-weight: 600; }
#dock .dhead .plus { font-size: 18px; margin-right: 10px; }
#dock .dbody { background: #fff; color: #333; max-height: 340px; overflow-y: auto; display: none; }
#dock.open .dbody { display: block; }

/* ---------- Rich-Text ---------- */
.rich { line-height: 1.55; }
.rich p { margin: 0 0 8px; }
.rich h1 { font-size: 20px; margin: 12px 0 8px; }
.rich h2 { font-size: 17px; margin: 12px 0 6px; }
.rich h3 { font-size: 15px; margin: 10px 0 6px; }
.rich h4 { font-size: 14px; margin: 8px 0 4px; }
.rich ul, .rich ol { margin: 6px 0 10px; padding-left: 22px; }
.rich li { margin: 2px 0; }
.rich a { color: var(--blue); }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.rich blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--line); color: #666; }
.rich table { border-collapse: collapse; margin: 8px 0; max-width: 100%; }
.rich td, .rich th { border: 1px solid var(--line); padding: 5px 8px; font-size: 13px; }
.rich-img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; display: block; }
.rich-att { display: inline-flex; align-items: center; gap: 5px; background: var(--chip);
  color: #6a6a6a; font-size: 12px; padding: 4px 10px; border-radius: 4px; margin: 4px 6px 4px 0; }
.att-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.att-thumb { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.info-post .txt.rich.clamp { max-height: 130px; }

/* dashboard columns reuse board */
.empty { text-align: center; color: #aaa; padding: 40px; font-size: 13px; }
.pill { display:inline-block; background:#eee; color:#777; border-radius: 10px; padding: 1px 8px; font-size: 11px; }
