:root { --c: #1f4e79; --bg: #f5f7fa; --line: #e3e8ee; --muted: #6b7280; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: #202124; font-size: 15px; }
.hide { display: none !important; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.narrow { width: 100%; max-width: 380px; }
.narrow input { width: 100%; margin-bottom: 10px; }
.brand-c { color: var(--c); margin-top: 0; }
header { background: var(--c); color: #fff; padding: 8px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { font-weight: bold; font-size: 18px; }
nav { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
nav button { background: none; border: 0; color: #fff; opacity: .75; padding: 8px 10px; cursor: pointer; font-size: 15px; }
nav button.on { opacity: 1; border-bottom: 2px solid #fff; }
.who { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
main { padding: 14px; max-width: 1200px; margin: 0 auto; }
input, select { padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 15px; max-width: 100%; font-family: inherit; }
.btn { background: var(--c); color: #fff; border: 0; padding: 9px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn.s { background: #eef3f7; color: var(--c); border: 1px solid #cbd5e1; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.msg { margin: 8px 0; font-weight: bold; min-height: 1em; }
.err { color: #b00020; } .ok { color: #0a7d33; } .muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
th { background: #f0f4f8; white-space: nowrap; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: bold; background: #e3edf7; color: var(--c); }
.chip.off { background: #e0e0e0; color: #555; } .chip.warn { background: #ffe0b2; color: #8d4b00; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #f9fbfd; }
dialog { border: 1px solid #cbd5e1; border-radius: 10px; padding: 16px; width: 94%; max-width: 480px; }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
dialog label input, dialog label select { display: block; width: 100%; margin-top: 3px; color: #202124; }
dialog label.inline { display: flex; gap: 6px; align-items: center; color: #202124; font-size: 15px; }
dialog label.inline input { width: auto; display: inline; margin: 0; }
.ov { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 6px 0; font-size: 14px; }
.pw { font-family: monospace; font-size: 18px; background: #fff3c4; padding: 4px 8px; border-radius: 6px; user-select: all; }
@media (max-width: 760px) {
  thead { display: none; }
  tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 4px; }
  td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 6px; text-align: right; }
  td::before { content: attr(data-l); font-weight: bold; color: var(--muted); text-align: left; }
}

/* ---------- Γενικά ---------- */
.click { cursor: pointer; } .tile.click:hover { border-color: var(--c); }
.badge { background: #e5484d; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 5px; }
.pad { padding: 12px 16px; } .small { font-size: 12px; } .center-row { text-align: center; padding: 8px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #202124; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90%; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; margin: 4px 0 10px; }
.checks.tall { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
body.in-chat main { max-width: none; padding: 0; }

/* ---------- Chat ---------- */
.chat { display: flex; height: calc(100dvh - 54px); background: #fff; overflow: hidden; }
.cside { width: 250px; flex-shrink: 0; background: var(--c); color: #fff; overflow: auto; display: flex; flex-direction: column; }
.cs-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 4px; font-size: 12px; text-transform: uppercase; opacity: .8; font-weight: bold; }
.cs-h button { background: rgba(255,255,255,.18); border: 0; color: #fff; border-radius: 4px; cursor: pointer; width: 24px; height: 24px; font-size: 16px; line-height: 1; }
.cs-foot { margin-top: auto; padding: 12px; }
.cs-foot .btn.on { background: rgba(255,255,255,.15); color: #fff; border-color: transparent; }
.ci { display: flex; align-items: center; gap: 6px; padding: 6px 14px; cursor: pointer; opacity: .85; }
.ci span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci:hover { background: rgba(255,255,255,.1); } .ci.on { background: rgba(255,255,255,.25); opacity: 1; } .ci.un { opacity: 1; font-weight: bold; } .ci.ar { font-style: italic; opacity: .55; }
.ci .cnt { margin-left: auto; background: #e5484d; border-radius: 9px; padding: 0 7px; font-size: 12px; }
.cmain, .cthread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cthread { display: none; flex: 0 0 380px; border-left: 1px solid var(--line); }
.chat.thread .cthread { display: flex; }
.chead { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 50px; }
.cdesc { color: var(--muted); font-size: 13px; flex: 1; min-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq { width: 180px; }
.cmsgs { flex: 1; overflow: auto; padding: 6px 0; }
.cm { display: flex; gap: 10px; padding: 4px 16px; position: relative; }
.cm:hover { background: #f6f8fa; } .cm.hl { background: #fff8dc; }
.av { width: 36px; height: 36px; border-radius: 8px; color: #fff; font-weight: bold; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cm.cont .av { visibility: hidden; height: 0; }
.mbody { min-width: 0; flex: 1; }
.mh b { margin-right: 4px; } .tm { color: var(--muted); font-size: 11px; font-weight: normal; }
.mb { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.mb code { background: #f0f2f4; border-radius: 3px; padding: 0 4px; font-family: monospace; color: #c0341d; }
.mb a { color: var(--c); }
.mention { background: #e8f0fe; color: #1a56b0; border-radius: 3px; padding: 0 2px; font-weight: bold; } .mention.me { background: #fff3c4; color: #8a5a00; }
.cdel { color: #9aa0a6; font-style: italic; }
.ma { position: absolute; right: 12px; top: -10px; display: none; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.cm:hover .ma { display: flex; } .ma button { border: 0; background: none; cursor: pointer; padding: 4px 8px; font-size: 15px; }
.thr { color: var(--c); font-weight: bold; font-size: 13px; cursor: pointer; margin-top: 3px; }
.cday { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: bold; margin: 10px 16px; }
.cday::before, .cday::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.aimg { max-width: min(320px, 100%); max-height: 260px; border-radius: 8px; border: 1px solid var(--line); display: block; object-fit: cover; background: #f0f2f4; }
.afile { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; text-decoration: none; color: #202124; background: #f9fbfd; }
.composer { border-top: 1px solid var(--line); padding: 8px 12px; }
.crow { display: flex; gap: 6px; align-items: flex-end; }
.crow textarea { flex: 1; resize: none; padding: 9px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; max-height: 180px; }
.pfiles { display: flex; flex-wrap: wrap; gap: 6px; } .pfiles:not(:empty) { margin-bottom: 6px; }
.pf { background: #eef3f7; border-radius: 6px; padding: 3px 6px; font-size: 13px; } .pf.err { background: #fde2e1; color: #b00020; }
.pf button { border: 0; background: none; cursor: pointer; }
.etext { width: 100%; font: inherit; padding: 6px; border: 1px solid #cbd5e1; border-radius: 6px; }
.cback { display: none; }
@media (max-width: 760px) {
  .chat { height: calc(100dvh - 96px); }
  .cside { width: 100%; }
  .chat.open .cside { display: none; }
  .chat:not(.open) .cmain { display: none; }
  .chat.thread .cmain { display: none; }
  .chat.thread .cthread { flex: 1; border: 0; }
  .cback { display: inline-block; }
  .cq { width: 110px; }
  .ma { display: flex; position: static; border: 0; box-shadow: none; background: none; opacity: .6; }
  .cm { flex-wrap: wrap; } .cm .ma { width: 100%; justify-content: flex-end; margin-top: -4px; }
}
