/* myMonday — Kortschak Maske · Vol. 01 */

html, body { min-height: 100vh; }
body { transition: background 0.3s ease, color 0.3s ease; }
#root { min-height: 100vh; background: var(--color-bg); color: var(--color-fg); }

/* Logos: hell/dunkel je Modus */
.logo-light, .logo-dark { height: 30px; display: block; }
#root .logo-dark { display: none; }
#root.dm .logo-dark { display: block; }
#root.dm .logo-light { display: none; }

/* ---------- Header ---------- */
#topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s ease;
}
.board-head { border-left: 1px solid var(--color-border); padding-left: 18px; }
#boardSelect {
  font-family: var(--font-display);
  font-size: 17px; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1.1;
  border: none; background: transparent; color: var(--color-fg);
  padding: 0; cursor: pointer; max-width: 260px;
  -webkit-appearance: none; appearance: none;
}
#boardSelect:focus { outline: none; }
#globalSearch {
  flex: 1; min-width: 120px;
  padding: 9px 16px;
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); font-size: 14px;
}

/* ---------- Buttons ---------- */
.btn { cursor: pointer; transition: all 0.3s ease; }
.btn.brand {
  flex: none; padding: 9px 18px;
  border: 1px solid var(--color-brand); border-radius: var(--radius-pill);
  background: var(--color-brand); color: #fff;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.btn.brand:hover { background: var(--color-brand-dark); border-color: var(--color-brand-dark); transform: translateY(-1px); }
.btn.mode {
  flex: none; padding: 9px 14px;
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--color-muted);
}
.btn.mode:hover { border-color: var(--color-fg); color: var(--color-fg); }
.btn.subtle {
  padding: 5px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-muted); font-size: 12px;
}
.btn.subtle:hover { border-color: var(--color-fg); color: var(--color-fg); }
.btn.pill {
  padding: 5px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-muted); font-size: 12px;
}
.btn.pill.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--ls-label); text-transform: uppercase; }
.btn.pill:hover { border-color: var(--color-fg); color: var(--color-fg); }
.linkbtn { border: none; background: none; color: var(--color-brand); cursor: pointer; font-size: 14px; text-decoration: underline; padding: 0; }

/* ---------- KPI-Zeile ---------- */
.kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--color-border); border-bottom: 1px solid var(--color-border);
}
.kpi { background: var(--color-bg); padding: 14px clamp(16px, 3vw, 32px); transition: background 0.3s ease; }
.kpi-num { font-weight: 900; font-size: 28px; letter-spacing: -0.02em; font-feature-settings: 'tnum' 1; }
.label.brand, .kpi-num.brand { color: var(--color-brand); }

/* ---------- Tabs ---------- */
#mainTabs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 16px clamp(16px, 3vw, 32px) 0;
}
.tab {
  padding: 7px 20px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-muted);
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: all 0.3s ease;
}
.tab:hover { border-color: var(--color-fg); }
.tab.active { border-color: var(--color-fg); background: var(--color-fg); color: var(--color-bg); }
.badge {
  display: inline-block; min-width: 17px; padding: 1px 5px; margin-left: 4px;
  border-radius: var(--radius-pill); background: var(--color-brand); color: #fff;
  font-family: var(--font-mono); font-size: 10px; text-align: center;
}
.sync-info { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-faint); }
.me-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-muted); }
#mainTabs .me-box { margin-left: 8px; }

/* ---------- Chips-Zeile (Liste) ---------- */
.chips-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 32px) 10px;
}
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-muted);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--ls-label); text-transform: uppercase;
  white-space: nowrap; cursor: pointer; transition: all 0.3s ease;
}
.chip:hover { border-color: var(--color-fg); }
.chip.active { border-color: var(--color-fg); background: var(--color-fg); color: var(--color-bg); }
.mono-select {
  padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-muted);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; max-width: 240px;
}
.chips-row .mono-select { margin-left: auto; }
.chips-row .sort-note { margin-left: 12px; }

/* ---------- Auftrags-Liste ---------- */
.orders-pad { padding: 0 clamp(16px, 3vw, 32px) 60px; }
.orders-head, .order-row {
  display: grid;
  grid-template-columns: 26px minmax(200px, 1fr) 118px 64px 170px 96px 76px 56px;
  gap: 10px; align-items: center;
}
.orders-head {
  padding: 8px 12px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-label-lg); text-transform: uppercase;
  color: var(--color-muted);
}
.orders { border-top: 1px solid var(--color-border); }
.order { border-bottom: 1px solid var(--color-border); }
.order-row { padding: 10px 12px; cursor: pointer; transition: background 0.3s ease; }
.order-row:hover { background: var(--color-surface); }
.order-caret { font-size: 11px; color: var(--color-muted); }
.order-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-name b { font-weight: 700; font-size: 14.5px; }
.order-name .tcount { font-family: var(--font-mono); font-size: 11px; color: var(--color-muted); }
.status-pill {
  justify-self: start; padding: 3px 12px;
  border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: transparent;
  color: var(--color-muted);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cell { font-family: var(--font-mono); font-size: 12px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.sans { font-family: var(--font-sans); font-size: 13px; }
.cell.prio { font-size: 11px; }
.cell.due { color: var(--color-brand); font-weight: 700; }

/* Aufgeklappte Zeile */
.order-x {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px;
  padding: 18px 16px 22px 48px;
  border-top: 1px dashed var(--color-border);
  background: var(--color-surface);
}
.task-list { display: flex; flex-direction: column; gap: 7px; }
.task-row { display: flex; align-items: center; gap: 10px; }
.task-box {
  width: 18px; height: 18px; flex: none;
  border: 1.5px solid var(--color-muted); border-radius: 2px; background: transparent;
  color: var(--color-bg); font-size: 11px; line-height: 1; cursor: pointer; padding: 0;
}
.task-box.done { border-color: var(--color-fg); background: var(--color-fg); }
.task-text { flex: 1; font-size: 13.5px; }
.task-text.done { color: var(--color-faint); text-decoration: line-through; }
.task-due { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); }
.task-due.hot { color: var(--color-brand); }
.task-add {
  margin-top: 4px; padding: 7px 12px;
  border: 1px dashed var(--color-border); border-radius: 2px; background: transparent; font-size: 13px;
  width: 100%; box-sizing: border-box;
}
.x-col .brand-line { margin-bottom: 10px; }
.x-updates textarea {
  width: 100%; box-sizing: border-box; padding: 8px 12px;
  border: 1px solid var(--color-border); border-radius: 2px; background: var(--color-bg);
  font-size: 13px; resize: vertical;
}
.btn.outline {
  margin-top: 6px; padding: 6px 16px;
  border: 1px solid var(--color-fg); border-radius: var(--radius-pill); background: transparent;
  color: var(--color-fg); font-size: 12px; font-weight: 700;
}
.btn.outline:hover { background: var(--color-fg); color: var(--color-bg); }
.update-item { border-left: 2px solid var(--color-border); padding-left: 10px; margin-top: 8px; }
.update-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); }
.update-text { font-size: 13px; white-space: pre-wrap; }
.x-field { display: block; margin-bottom: 8px; }
.x-field .label { letter-spacing: 0.1em; }
.x-field input {
  display: block; width: 100%; box-sizing: border-box; margin-top: 3px; padding: 6px 10px;
  border: 1px solid var(--color-border); border-radius: 2px; background: var(--color-bg); font-size: 13px;
}
.x-field input.mono { font-family: var(--font-mono); font-size: 12px; }
.x-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.x-status .status-pill { padding: 4px 12px; }
.x-files { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.x-file { font-family: var(--font-mono); font-size: 12px; color: var(--color-fg); }
.x-file a { text-decoration: none; }
.btn.dashed {
  align-self: flex-start; display: inline-block; padding: 6px 14px;
  border: 1px dashed var(--color-muted); border-radius: 2px; background: transparent;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-muted); text-decoration: none;
}
.btn.dashed:hover { border-color: var(--color-fg); color: var(--color-fg); }

/* ---------- Wochenplan ---------- */
#tab-woche { padding: 16px clamp(16px, 3vw, 32px) 60px; }
.week-bar { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.week-label { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; letter-spacing: -0.01em; white-space: nowrap; }
.week-nav { margin-left: auto; display: flex; gap: 6px; }
.wk {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
  background: var(--color-border); border: 1px solid var(--color-border);
}
.day { background: var(--color-bg); min-height: 230px; padding: 10px; display: flex; flex-direction: column; gap: 7px; transition: background 0.3s ease; }
.day.today { background: var(--color-surface); }
.day-head { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-label-lg); text-transform: uppercase; white-space: nowrap; color: var(--color-muted); }
.day.today .day-head { color: var(--color-brand); }
.day-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-brand); box-shadow: 0 0 12px var(--color-brand); }
.day-card { border: 1px solid var(--color-border); background: var(--color-bg); padding: 8px 10px; cursor: pointer; transition: all 0.3s ease; }
.day-card:hover { border-color: var(--color-fg); }
.day-card.hot { border-color: var(--color-brand); }
.day-card.dim { opacity: 0.45; }
.day-card .type { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); }
.day-card .type.hot { color: var(--color-brand); }
.day-card .type.task { color: var(--color-accent-orange); }
.day-card .title { font-weight: 700; font-size: 13px; line-height: 1.3; }
.day-card .sub { font-size: 11px; color: var(--color-muted); }
.no-date { display: flex; flex-wrap: wrap; gap: 7px; }
.no-date button {
  padding: 5px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-fg); font-size: 12.5px; white-space: nowrap; cursor: pointer; transition: all 0.3s ease;
}
.no-date button:hover { border-color: var(--color-brand); color: var(--color-brand); }

/* ---------- Inbox / Suche / Dateien ---------- */
.pane { min-height: 40vh; }
#tab-inbox, #tab-suche, #tab-dateien { padding: 14px clamp(16px, 3vw, 32px) 60px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type="search"] {
  flex: 1; min-width: 200px; padding: 9px 16px;
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); font-size: 14px;
}
.check { font-size: 13px; color: var(--color-muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.list { display: flex; flex-direction: column; }
.day-sep { margin: 18px 0 6px; }
.day-sep, .source-note { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-label-lg); text-transform: uppercase; color: var(--color-muted); }
.card { border-bottom: 1px solid var(--color-border); padding: 12px; cursor: pointer; transition: background 0.3s ease; }
.list > .card:first-child { border-top: 1px solid var(--color-border); }
.card:hover { background: var(--color-surface); }
.card.unread { box-shadow: inset 3px 0 0 var(--color-brand); }
.crumb { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 4px; }
.crumb .sep { margin: 0 5px; color: var(--color-faint); }
.crumb .kunde { color: var(--color-accent-orange); }
.card-head { display: flex; align-items: baseline; gap: 10px; }
.tag {
  padding: 2px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted);
  white-space: nowrap;
}
.tag.comment, .tag.reply { border-color: var(--color-accent-orange); color: var(--color-accent-orange); }
.tag.assigned { border-color: var(--color-brand); color: var(--color-brand); }
.card-title { font-weight: 700; font-size: 14px; }
.card-time { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--color-faint); white-space: nowrap; }
.card-body { font-size: 13px; margin-top: 5px; }
.card-body.muted { color: var(--color-muted); }
.card-body mark { background: transparent; color: var(--color-brand); font-weight: 700; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip {
  display: inline-block; padding: 3px 10px;
  border: 1px dashed var(--color-muted); border-radius: 2px;
  font-family: var(--font-mono); font-size: 11px; color: var(--color-muted); text-decoration: none;
}
a.file-chip:hover { border-color: var(--color-fg); color: var(--color-fg); }
.empty { padding: 48px 12px; text-align: center; color: var(--color-muted); font-size: 14px; }

/* ---------- Detail-Panel ---------- */
#overlay { position: fixed; inset: 0; background: rgba(13, 13, 11, 0.5); z-index: 30; }
#detail {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 94vw); z-index: 31;
  background: var(--color-bg); border-left: 1px solid var(--color-border);
  overflow-y: auto;
}
.detail-inner { padding: 20px 24px 60px; }
.detail-inner .close { margin-bottom: 14px; }
.detail-title { font-family: var(--font-display); font-size: 24px; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.15; margin: 4px 0 8px; }
.monday-link { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); text-decoration: none; }
.monday-link:hover { color: var(--color-brand); }
.detail-section { margin-top: 22px; }
.detail-section h3 { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-label-lg); text-transform: uppercase; color: var(--color-muted); font-weight: 400; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.detail-section h3::before { content: ''; width: 24px; height: 1px; background: var(--color-brand); flex-shrink: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.field .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); }
.field .v { font-size: 13.5px; }
.status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); }
.status-select, select { border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-fg); padding: 5px 8px; border-radius: 2px; font-size: 13px; }
.subitem-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: 13.5px; }
.subitem-row .status { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--color-muted); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--color-border); }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-box textarea {
  width: 100%; box-sizing: border-box; min-height: 64px; padding: 8px 12px;
  border: 1px solid var(--color-border); border-radius: 2px; background: var(--color-bg); font-size: 13px; resize: vertical;
}
.comment-box .row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.comment-box .hint { flex: 1; font-size: 11px; color: var(--color-faint); }
.update { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.update.reply { margin-left: 22px; border-left: 2px solid var(--color-border); padding-left: 12px; }
.update-head { display: flex; gap: 10px; align-items: baseline; }
.update-head .who { font-weight: 700; font-size: 13px; }
.update-head .when, .update-head .on-sub { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--color-faint); }
.update-body { font-size: 13.5px; margin-top: 3px; white-space: pre-wrap; }
.reply-btn { border: none; background: none; color: var(--color-muted); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; padding: 4px 0; }
.reply-btn:hover { color: var(--color-brand); }

/* ---------- Login ---------- */
#loginView { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 380px; max-width: 94vw; border: 1px solid var(--color-border); padding: 32px 28px; background: var(--color-bg); }
.login-logo { height: 34px; margin-bottom: 18px; }
.login-card .label { display: block; margin: 14px 0 4px; }
.login-card select, .login-card input {
  width: 100%; box-sizing: border-box; padding: 9px 12px;
  border: 1px solid var(--color-border); border-radius: 2px; background: var(--color-bg); font-size: 14px;
}
.login-error { color: var(--color-brand); font-size: 12.5px; min-height: 18px; margin: 10px 0 4px; }
.login-card .btn.brand { width: 100%; margin-top: 4px; }

[hidden] { display: none !important; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: var(--color-fg); color: var(--color-bg);
  padding: 9px 20px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700;
}

/* ---------- Responsive (wie im Design: .hm ausblenden, Grids stapeln) ---------- */
@media (max-width: 820px) {
  .hm { display: none !important; }
  .order-x { grid-template-columns: 1fr !important; }
  .wk { grid-template-columns: 1fr 1fr !important; }
  .orders-head, .order-row { grid-template-columns: 20px minmax(120px, 1fr) 100px 70px; }
  .orders-head span:nth-child(n+4), .order-row .cell.prio, .order-row .cell.sans, .order-row .cell.re, .order-row .cell.files { display: none; }
  .orders-head span:nth-child(7) { display: block; }
}
