/* Inter Medien Cockpit – Farben aus dem Logo: Dunkel #2B333B, Akzent #FA4C3C */
:root {
  --accent: #FA4C3C;
  --dark: #2B333B;
  --dark-2: #39424c;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #2B333B;
  --muted: #6b7280;
  --line: #e3e6ea;
  --ok: #157f3d;
  --err: #b3261e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 20px 0 10px; }
h3 { font-size: 14px; margin: 0 0 10px; }

/* App-Gerüst */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: 230px; flex: 0 0 auto; background: var(--dark); color: #cdd2da;
  display: flex; flex-direction: column; padding: 16px 0;
}
.brand-chip {
  display: block; background: #fff; border-radius: 10px; margin: 4px 16px 16px;
  padding: 10px 14px; line-height: 0;
}
.brand-chip img { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }
.sidebar nav { display: flex; flex-direction: column; margin-top: 4px; }
.sidebar nav a { color: #cdd2da; padding: 10px 20px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: var(--dark-2); text-decoration: none; }
.sidebar nav a.on { background: var(--dark-2); border-left-color: var(--accent); color: #fff; }
.sidebar-foot {
  margin-top: auto; padding: 16px 20px 0; border-top: 1px solid #454f5a;
  font-size: 13px; display: flex; flex-direction: column; gap: 6px;
}
.sidebar-foot a { color: #8b93a1; }
.main { flex: 1; padding: 28px 32px; min-width: 0; }

/* Kopf, KPIs, Karten */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs { margin: 0 0 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.kpis { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; min-width: 140px; flex: 1 1 140px; max-width: 240px; }
.kpi-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 22px; font-weight: 700; }
.kpi-value.small { font-size: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; margin-bottom: 18px; }
.card h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }

/* Badges, Buttons, Flash */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.badge.zeit { background: #e7f4ec; color: var(--ok); }
.badge.off { background: #fdebea; color: var(--err); }
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(.94); text-decoration: none; }
.flash { padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; background: #e7f4ec; color: var(--ok); }
.flash.error { background: #fdebea; color: var(--err); }
.hint { font-size: 13px; color: var(--muted); }

/* Formulare */
form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
form label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
input[type=text], input[type=email], input[type=password], textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

/* Login-Seiten */
.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; background: var(--bg); padding: 16px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: 100%; max-width: 400px; }
.auth-logo { text-align: center; padding: 4px 0 20px; }
.auth-logo img { width: 150px; height: auto; }
.auth-card h1 { font-size: 20px; }
.auth-card button { width: 100%; margin-top: 6px; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }

/* Projektkacheln & Board */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.col { background: #eceef1; border-radius: 10px; padding: 12px; flex: 0 0 260px; scroll-snap-align: start; }
.col .count { color: var(--muted); font-weight: 400; }
.task-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; color: var(--text); }
.task-card:hover { border-color: var(--accent); text-decoration: none; }
.task-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.task-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Aufgaben-Detail / Chat */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.rich { overflow-wrap: anywhere; }
.rich img { max-width: 100%; height: auto; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.files li a { overflow-wrap: anywhere; }
.chat .messages { max-height: 480px; overflow-y: auto; margin-bottom: 14px; }
.msg { background: #f1f2f5; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.msg.own { background: #feeae8; }
.msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 2px; flex-wrap: wrap; }
.msg-body { overflow-wrap: anywhere; }
.msg-body p { margin: 4px 0; }
.chat-form textarea { resize: vertical; }
.chat-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.chat-actions input[type=file] { max-width: 100%; font-size: 13px; }

/* Responsiv: Tablet & Smartphone */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; align-items: center; gap: 4px;
    padding: 8px 10px; position: sticky; top: 0; z-index: 10;
  }
  .brand-chip { margin: 0; padding: 6px 10px; }
  .brand-chip img { width: 96px; }
  .sidebar nav { flex-direction: row; margin: 0 0 0 6px; }
  .sidebar nav a { padding: 10px 10px; border-left: 0; border-bottom: 3px solid transparent; font-size: 14px; }
  .sidebar nav a.on { border-bottom-color: var(--accent); background: transparent; }
  .sidebar-foot {
    margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; align-items: center; gap: 10px;
  }
  .sidebar-foot span { display: none; }  /* Name/Firma auf kleinen Screens ausblenden */
  .main { padding: 16px 14px; }
  h1 { font-size: 20px; }
  .page-head { align-items: flex-start; }
  .kpi { padding: 10px 14px; min-width: 120px; }
  .kpi-value { font-size: 18px; }
  .card { padding: 14px 16px; }
  .board { gap: 10px; margin: 0 -14px; padding: 0 14px 10px; }
  .col { flex: 0 0 82vw; max-width: 320px; }
  .chat .messages { max-height: 55vh; }
}
