/* public/app.css — Honeycamp Design-System (konsistent zu kostenrahmen.html / standortanalyse.html) */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --ink-4: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.12);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --fill-tertiary: #f5f5f7;
  --fill-hover: #ebebed;
  --warn: #d70015;
  --good: #1e8e3e;
  --amber: #c77700;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --radius-xs: 6px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.47059;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.003em;
  min-height: 100vh;
}
.mono { font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace; font-variant-numeric: tabular-nums; }

/* ─── Header ─── */
.hc-header {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 0.875rem 1.5rem;
  position: sticky; top: 0; z-index: 100;
}
.hc-header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 2rem;
}
.hc-brand { display: flex; align-items: baseline; gap: 0.625rem; text-decoration: none; color: inherit; }
.hc-brand-logo {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #ffc928 0%, #f3a300 100%);
  border-radius: 5px;
  position: relative;
  align-self: center;
}
.hc-brand-logo::before {
  content: ""; position: absolute; inset: 3px;
  background:
    linear-gradient(0deg, transparent 46%, rgba(255,255,255,.65) 46%, rgba(255,255,255,.65) 54%, transparent 54%),
    linear-gradient(60deg, transparent 46%, rgba(255,255,255,.65) 46%, rgba(255,255,255,.65) 54%, transparent 54%),
    linear-gradient(-60deg, transparent 46%, rgba(255,255,255,.65) 46%, rgba(255,255,255,.65) 54%, transparent 54%);
  border-radius: 3px;
}
.hc-brand-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.022em; }
.hc-brand-mark { font-size: 0.75rem; color: var(--ink-3); font-weight: 400; }

.hc-nav { display: flex; gap: 0.125rem; align-items: center; }
.hc-nav a {
  color: var(--ink-2); text-decoration: none;
  font-size: 0.8125rem; font-weight: 500;
  padding: 0.4375rem 0.75rem; border-radius: var(--radius-xs);
  transition: background 160ms ease, color 160ms ease;
}
.hc-nav a:hover { background: var(--fill-hover); color: var(--ink); }
.hc-nav a.active { background: rgba(0, 113, 227, 0.1); color: var(--accent); }

.hc-user-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem; color: var(--ink-2);
}
.hc-user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; font-weight: 600; font-size: 0.6875rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}

/* ─── Buttons ─── */
button, .btn {
  font-family: inherit; font-size: 0.8125rem; font-weight: 500;
  padding: 0.4375rem 0.875rem; border: none; background: transparent;
  color: var(--accent); cursor: pointer; border-radius: var(--radius-xs);
  transition: background 160ms ease, color 160ms ease, transform 80ms ease;
  letter-spacing: -0.01em;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.375rem;
}
button:hover, .btn:hover { background: rgba(0, 113, 227, 0.08); }
button:active, .btn:active { transform: scale(0.97); }
button.primary, .btn.primary { background: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); }
button.ghost, .btn.ghost { color: var(--ink-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--fill-hover); color: var(--ink); }
button.danger, .btn.danger { color: var(--warn); }
button.danger:hover, .btn.danger:hover { background: rgba(215, 0, 21, 0.08); }
button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ─── Layout ─── */
.hc-layout { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.hc-layout-narrow { max-width: 880px; }

.hc-page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1.5rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.hc-page-title {
  font-size: 2rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1;
}
.hc-page-subtitle {
  font-size: 0.9375rem; color: var(--ink-3); margin-top: 0.25rem;
}
.hc-page-actions { display: flex; gap: 0.5rem; }

.hc-breadcrumb {
  font-size: 0.75rem; color: var(--ink-3); margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.375rem;
  letter-spacing: -0.005em;
}
.hc-breadcrumb a { color: var(--ink-3); text-decoration: none; }
.hc-breadcrumb a:hover { color: var(--accent); }
.hc-breadcrumb-sep { color: var(--ink-4); }

/* ─── Panels & Cards ─── */
.panel {
  background: var(--surface); border-radius: var(--radius);
  margin-bottom: 1.25rem; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  padding: 1.125rem 1.375rem 0.875rem;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
}
.panel-head h2 { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.016em; }
.panel-head .sub { font-size: 0.75rem; color: var(--ink-3); font-weight: 400; }
.panel-body { padding: 0.25rem 1.375rem 1.375rem; }

/* ─── Inputs ─── */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.row.single { grid-template-columns: 1fr; }
.row.triple { grid-template-columns: 1fr 1fr 1fr; }
label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--ink-2); margin-bottom: 0.375rem; letter-spacing: -0.005em; }
label .hint { color: var(--ink-3); font-weight: 400; margin-left: 0.25rem; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], select, textarea {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 0.875rem; border-radius: var(--radius-xs);
  transition: border-color 120ms ease, box-shadow 120ms ease;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8.5L2 4.5h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.625rem center; padding-right: 1.75rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}
input::placeholder { color: var(--ink-4); }
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }

/* ─── Project Grid ─── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: transform 200ms ease, box-shadow 200ms ease;
  display: flex; flex-direction: column;
  border: 1px solid transparent;
  position: relative;
  min-height: 160px;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line);
}
.project-card-city {
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); margin-bottom: 0.375rem;
}
.project-card-name {
  font-size: 1.0625rem; font-weight: 600;
  letter-spacing: -0.018em; margin-bottom: 0.125rem;
}
.project-card-address {
  font-size: 0.8125rem; color: var(--ink-3);
  margin-bottom: 1rem; line-height: 1.35;
}
.project-card-meta {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; font-size: 0.75rem; color: var(--ink-3);
}
.project-card-status {
  display: inline-flex; align-items: center; gap: 0.3125rem;
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem; font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.status-planung { background: rgba(0, 113, 227, 0.1); color: var(--accent); }
.status-bau { background: rgba(199, 119, 0, 0.12); color: var(--amber); }
.status-fertig { background: rgba(30, 142, 62, 0.12); color: var(--good); }
.status-pausiert { background: rgba(215, 0, 21, 0.1); color: var(--warn); }

.new-project-card {
  display: flex; align-items: center; justify-content: center;
  min-height: 160px;
  background: transparent;
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-3); font-size: 0.9375rem; font-weight: 500;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.new-project-card:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Empty State ─── */
.empty {
  text-align: center; padding: 4rem 2rem;
  color: var(--ink-3);
}
.empty-title { font-size: 1.125rem; font-weight: 600; color: var(--ink); margin-bottom: 0.375rem; }
.empty-desc { font-size: 0.875rem; margin-bottom: 1.25rem; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-head {
  padding: 1.25rem 1.5rem 0.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.016em; }
.modal-body { padding: 0.5rem 1.5rem 1rem; }
.modal-foot {
  padding: 1rem 1.5rem 1.25rem;
  display: flex; justify-content: flex-end; gap: 0.5rem;
  border-top: 1px solid var(--line);
}
.modal-close {
  color: var(--ink-3); font-size: 1.25rem; line-height: 1;
  padding: 0.25rem 0.5rem;
}

/* ─── Milestones / Timeline ─── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line-2);
}
.timeline-item {
  position: relative; margin-bottom: 1.125rem;
  padding: 0.875rem 1rem;
  background: var(--fill-tertiary);
  border-radius: var(--radius-xs);
}
.timeline-item::before {
  content: ""; position: absolute;
  left: -1.5rem; top: 1.125rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--ink-3);
}
.timeline-item.status-done::before { background: var(--good); border-color: var(--good); }
.timeline-item.status-in_progress::before { background: var(--accent); border-color: var(--accent); }
.timeline-item.status-blocked::before { background: var(--warn); border-color: var(--warn); }
.timeline-title {
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em;
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.timeline-dates { font-size: 0.75rem; color: var(--ink-3); margin-top: 0.125rem; }
.timeline-desc { font-size: 0.8125rem; color: var(--ink-2); margin-top: 0.375rem; line-height: 1.45; }
.timeline-actions {
  margin-top: 0.5rem; display: flex; gap: 0.25rem;
}

/* ─── Dokumente Liste ─── */
.doc-list { display: flex; flex-direction: column; }
.doc-item {
  display: grid;
  grid-template-columns: 32px 1fr auto auto auto;
  gap: 0.875rem; align-items: center;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--line);
  transition: background 120ms ease;
}
.doc-item:hover { background: var(--fill-tertiary); }
.doc-item:last-child { border-bottom: none; }
.doc-icon {
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(0,113,227,0.08); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.doc-name { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.doc-meta { font-size: 0.75rem; color: var(--ink-3); margin-top: 0.125rem; }
.doc-size { font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.doc-category {
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.1875rem 0.5rem; border-radius: 999px;
  background: var(--fill-hover); color: var(--ink-2);
}

/* ─── Upload dropzone ─── */
.dropzone {
  border: 2px dashed var(--line-2); border-radius: var(--radius);
  padding: 2rem; text-align: center;
  color: var(--ink-3); font-size: 0.875rem;
  cursor: pointer;
  transition: all 160ms ease;
  background: var(--fill-tertiary);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.04);
  color: var(--accent);
}

/* ─── Sub-nav (tabs pro Projekt) ─── */
.subnav {
  display: flex; gap: 0.125rem;
  background: var(--surface);
  padding: 0.25rem;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  width: fit-content;
  flex-wrap: wrap;
}
.subnav a {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none;
  border-radius: var(--radius-xs);
  letter-spacing: -0.005em;
  transition: background 140ms ease, color 140ms ease;
}
.subnav a:hover { background: var(--fill-hover); color: var(--ink); }
.subnav a.active { background: var(--ink); color: #fff; }

/* ─── Utility ─── */
.muted { color: var(--ink-3); }
.spacer { flex: 1; }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 0.625rem 1rem; border-radius: 8px;
  font-size: 0.8125rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
