/* ═══════════════════════════════════════════════════════════════════
   HANDWERKER MODULE
   ═══════════════════════════════════════════════════════════════════ */

/* Filter */
.handwerker-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
}

.hw-filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 5px 8px;
  min-height: 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--tx);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  min-width: 0;
}

.hw-filter-btn:hover {
  background: var(--bg3);
}

.hw-filter-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
  font-weight: 600;
}

/* Liste */
.handwerker-list {
  flex: 1;
  overflow-y: auto;
}

.hw-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.hw-item:hover {
  background: var(--bg2);
}

.hw-item.active {
  background: var(--bg3);
  border-left: 3px solid var(--amber);
  padding-left: 9px;
}

.hw-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.hw-item-text {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-item-addr {
  font-size: 10.5px;
  color: var(--txm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-item-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.hw-badge {
  display: inline-block;
  padding: 0px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 16px;
}

.hw-badge-warn  { background: rgba(234,88,12,0.12);  color: #c2410c; }
.hw-badge-task  { background: rgba(124,58,237,0.12); color: #6d28d9; }
.hw-badge-offen      { background: rgba(239,68,68,0.12);  color: #f87171; }
.hw-badge-inprogress { background: rgba(59,130,246,0.12); color: #60a5fa; }
.hw-badge-erledigt   { background: rgba(34,197,94,0.12);  color: #4ade80; }

/* Detail */
.hw-detail-header {
  margin-bottom: 20px;
}

.hw-detail-type {
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--txm);
  margin-bottom: 4px;
}

.hw-detail-kontakt {
  font-size: 16px;
  font-weight: 600;
  color: var(--tx);
}

.hw-detail-section {
  margin-bottom: 20px;
}

.hw-detail-section-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--tx);
}

.hw-detail-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--tx);
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.hw-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hw-meta-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txm);
  background: var(--bg3);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--bsub);
}

.hw-field {
  margin-bottom: 12px;
}

.hw-field label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txm);
  margin-bottom: 4px;
}

.hw-field select,
.hw-field input,
.hw-field textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  color: var(--tx);
}

.hw-field textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.6;
}

.hw-field select:focus,
.hw-field input:focus,
.hw-field textarea:focus {
  outline: none;
  border-color: var(--amber);
}

/* ═══════════════════════════════════════════════════════════════════
   HANDWERKER DETAIL VIEW (hwd-)
   ═══════════════════════════════════════════════════════════════════ */

.hwd-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.hwd-header-left { flex: 1; min-width: 0; }
.hwd-header-right { flex-shrink: 0; }

.hwd-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.4;
  margin-bottom: 4px;
}
.hwd-kontakt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hwd-status-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--tx);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}
.hwd-status-select:focus { outline: none; border-color: var(--amber); }

.hwd-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg1);
}
.hwd-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--txm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.hwd-tab:hover { color: var(--txs); }
.hwd-tab.active { color: var(--tx); border-bottom-color: var(--amber); }
.hwd-tab-badge {
  background: var(--bg3);
  color: var(--txm);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}
.hwd-tab.active .hwd-tab-badge { background: var(--amber); color: #fff; }

.hwd-section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txm);
  margin-bottom: 10px;
}
.hwd-text { font-size: 13px; color: var(--tx); line-height: 1.6; margin-bottom: 16px; }
.hwd-meta-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.hwd-save-btn {
  width: 100%;
  padding: 9px;
  background: var(--amber);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.hwd-save-btn:hover { background: var(--amberg); }

.hwd-empty { padding: 24px; text-align: center; color: var(--txm); font-size: 12px; }
.hwd-add-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

.hwd-entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 7px;
}
.hwd-entry-main { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.hwd-entry-date  { font-size: 11px; font-weight: 600; color: var(--tx); }
.hwd-entry-time  { font-size: 11px; color: var(--txs); font-family: var(--mono); }
.hwd-entry-dur   { font-size: 12px; font-weight: 700; color: var(--amber); margin-left: auto; }
.hwd-entry-note  { width: 100%; font-size: 11px; color: var(--txm); margin-top: 2px; }
.hwd-entry-del {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--txm);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}
.hwd-entry-del:hover { background: rgba(239,68,68,0.15); color: var(--red); }

.hwd-comment {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 3px solid var(--border);
  margin-bottom: 10px;
}
.hwd-comment-me { border-left-color: var(--amber); background: rgba(245,158,11,0.05); }
.hwd-comment-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
.hwd-comment-by  { font-size: 11px; font-weight: 700; color: var(--txs); }
.hwd-comment-ts  { font-size: 10px; color: var(--txm); font-family: var(--mono); }
.hwd-comment-text { font-size: 12px; color: var(--tx); line-height: 1.5; }

.hw-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 5px 8px;
  min-height: 28px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #6d28d9;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  min-width: 0;
}
.hw-new-btn:hover { background: rgba(124,58,237,0.2); border-color: rgba(124,58,237,0.4); }

.verlauf-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--txm);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.verlauf-comment-badge:hover { border-color: var(--amber); color: var(--amber); }

/* Handwerker detail scroll chain */
#handwerker-detail { display: flex; flex-direction: column; overflow: hidden; }
.hwd-tab-pane { display: none; }
.hwd-tab-pane.active { display: block; overflow-y: auto; flex: 1; }
.hwd-pane-inner { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }

.hwd-entry-date { font-size: 11px; font-weight: 600; color: var(--tx); white-space: nowrap; }
.hwd-entry-time { font-size: 11px; color: var(--txs); font-family: var(--mono); white-space: nowrap; }
.hwd-entry-dur  { font-size: 11px; font-weight: 700; color: var(--amber); white-space: nowrap; }
.hwd-entry-note { font-size: 10px; color: var(--txm); width: 100%; margin-top: 2px; }

#hwd-comment-list { max-height: 300px; overflow-y: auto; }
#hwd-comment-text { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--tx); font-size: 12px; padding: 8px 10px; resize: none; font-family: inherit; }
#hwd-comment-text:focus { outline: none; border-color: var(--amber); }
