*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg: #f8f7f5;
  --c-surface: #ffffff;
  --c-border: rgba(0,0,0,0.1);
  --c-border-md: rgba(0,0,0,0.18);
  --c-text: #1a1a18;
  --c-text-2: #6b6b67;
  --c-text-3: #9b9b96;
  --c-accent: #2563eb;
  --c-accent-bg: #eff6ff;
  --c-success: #16a34a;
  --c-success-bg: #f0fdf4;
  --c-warn: #d97706;
  --c-warn-bg: #fffbeb;
  --c-danger: #dc2626;
  --c-danger-bg: #fef2f2;
  --c-hint: #7c3aed;
  --c-hint-bg: #f5f3ff;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --sidebar-w: 220px;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; color: var(--c-text); background: var(--c-bg); min-height: 100vh; line-height: 1.5; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); background: var(--c-surface); border-right: 0.5px solid var(--c-border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 10; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 16px 16px; border-bottom: 0.5px solid var(--c-border); }
.logo-icon { width: 28px; height: 28px; background: var(--c-text); color: white; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.logo-text { font-weight: 500; font-size: 15px; }
.sidebar-nav { list-style: none; padding: 10px 8px; flex: 1; }
.sidebar-nav li { margin-bottom: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); color: var(--c-text-2); text-decoration: none; font-size: 13.5px; transition: background .12s, color .12s; }
.nav-link:hover { background: var(--c-bg); color: var(--c-text); }
.nav-link.active { background: var(--c-accent-bg); color: var(--c-accent); }

/* ── Content ── */
.layout { display: flex; min-height: 100vh; }
.content { margin-left: var(--sidebar-w); flex: 1; padding: 28px 32px; }
.content.no-sidebar { margin-left: 0; padding: 32px; max-width: 860px; margin: 0 auto; }

/* ── Page Header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 500; }
.page-subtitle { font-size: 13px; color: var(--c-text-2); margin-top: 2px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13px; font-weight: 500; border-radius: var(--r-md); border: 0.5px solid var(--c-border-md); background: var(--c-surface); color: var(--c-text); cursor: pointer; transition: background .12s; white-space: nowrap; text-decoration: none; font-family: inherit; }
.btn:hover { background: var(--c-bg); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--c-text); color: white; border-color: var(--c-text); }
.btn-primary:hover { opacity: .85; background: var(--c-text); }
.btn-success { background: var(--c-success); color: white; border-color: var(--c-success); }
.btn-success:hover { opacity: .85; background: var(--c-success); }
.btn-danger { background: var(--c-danger); color: white; border-color: var(--c-danger); }
.btn-danger:hover { opacity: .85; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled, .btn.disabled { background: var(--c-bg); color: var(--c-text-3); border-color: var(--c-border); cursor: not-allowed; opacity: 1; }
.btn:disabled:hover, .btn.disabled:hover { background: var(--c-bg); opacity: 1; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; border-radius: var(--r-sm); color: var(--c-text-2); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--c-bg); color: var(--c-text); }

/* ── Cards ── */
.card { background: var(--c-surface); border: 0.5px solid var(--c-border); border-radius: var(--r-lg); padding: 16px 20px; }
.card-title { font-size: 12px; font-weight: 600; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }

/* ── Inputs ── */
input[type=text], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px; font-size: 13px; border: 0.5px solid var(--c-border-md); border-radius: var(--r-md); background: var(--c-surface); color: var(--c-text); outline: none; transition: border-color .12s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--c-accent); }
label { font-size: 12px; color: var(--c-text-2); display: block; margin-bottom: 4px; font-weight: 500; }
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Badges / Status ── */
.badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.badge-issue   { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-warning { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-hint    { background: var(--c-hint-bg); color: var(--c-hint); }
.badge-erstellt     { background: #f3f4f6; color: #6b7280; }
.badge-neu          { background: #dbeafe; color: #1d4ed8; }
.badge-in_bearbeitung { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-abgeschlossen  { background: var(--c-success-bg); color: var(--c-success); }

/* ── Projects Grid ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.project-card { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.project-card:hover { border-color: var(--c-border-md); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.project-customer { font-size: 15px; font-weight: 500; }
.project-date { font-size: 11px; color: var(--c-text-3); margin-top: 3px; }
.project-stats { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 0.5px solid var(--c-border); }
.stat-pill { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 4px; }
.stat-pill.issue   { background: var(--c-danger-bg); color: var(--c-danger); }
.stat-pill.warning { background: var(--c-warn-bg); color: var(--c-warn); }
.stat-pill.hint    { background: var(--c-hint-bg); color: var(--c-hint); }
.stat-spacer { flex: 1; }
.empty-state { text-align: center; padding: 64px 24px; color: var(--c-text-3); }
.empty-state-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; color: var(--c-text-2); font-weight: 500; margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Project Detail ── */
.project-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.issues-list { display: flex; flex-direction: column; gap: 4px; }
.issue-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 0.5px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); transition: border-color .12s; }
.issue-row:hover { border-color: var(--c-border-md); }
.issue-row.state-done { opacity: .65; }
.issue-row.state-skipped { opacity: .5; }
.issue-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.issue-cat-dot.issue   { background: var(--c-danger); }
.issue-cat-dot.warning { background: var(--c-warn); }
.issue-cat-dot.hint    { background: var(--c-hint); }
.issue-name { flex: 1; font-size: 13px; }
.issue-actions { display: flex; gap: 4px; flex-shrink: 0; }
.issue-state-icon { font-size: 16px; }
.issue-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-3); margin: 16px 0 6px; padding-left: 2px; }
.issue-section-label:first-child { margin-top: 0; }

/* ── Report View ── */
.report-header { margin-bottom: 28px; }
.report-title { font-size: 24px; font-weight: 500; margin-bottom: 4px; }
.report-meta { font-size: 13px; color: var(--c-text-2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-section { margin-bottom: 24px; }
.report-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.report-section-title.issue   { color: var(--c-danger); }
.report-section-title.warning { color: var(--c-warn); }
.report-section-title.hint    { color: var(--c-hint); }

/* ── 3-State Checkbox ── */
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border: 0.5px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); margin-bottom: 4px; transition: border-color .12s; }
.check-row:hover { border-color: var(--c-border-md); }
.state-btn { width: 22px; height: 22px; border-radius: var(--r-sm); border: 1.5px solid var(--c-border-md); background: var(--c-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; transition: background .12s, border-color .12s; font-size: 13px; }
.state-btn:hover { background: var(--c-bg); }
.state-btn.done { background: var(--c-success); border-color: var(--c-success); color: white; }
.state-btn.skipped { background: #e5e7eb; border-color: #9ca3af; color: #6b7280; }
.check-content { flex: 1; }
.check-name { font-size: 13px; }
.check-name.done { text-decoration: line-through; color: var(--c-text-3); }
.check-name.skipped { color: var(--c-text-3); }
.reason-input-wrap { margin-top: 6px; }
.reason-input-wrap input { font-size: 12px; padding: 5px 8px; }
.report-locked { background: var(--c-success-bg); border: 0.5px solid var(--c-success); border-radius: var(--r-md); padding: 10px 14px; font-size: 13px; color: var(--c-success); margin-bottom: 20px; font-weight: 500; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--c-text); color: white; padding: 10px 16px; border-radius: var(--r-md); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 9999; display: flex; align-items: center; gap: 8px; transform: translateY(8px); max-width: 320px; }
.toast.show    { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast.success { background: var(--c-success); }
.toast.error   { background: var(--c-danger); }
@keyframes toast-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.toast.shake { animation: toast-shake 0.42s ease; }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 13px; height: 13px; border: 1.5px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin 0.55s linear infinite; display: inline-block; flex-shrink: 0; }
.spinner.dark { border-color: rgba(0,0,0,.15); border-top-color: var(--c-text-2); }
.btn.loading { opacity: .82; pointer-events: none; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--c-surface); border-radius: var(--r-lg); border: 0.5px solid var(--c-border); width: 480px; max-width: 95vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.12); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 0.5px solid var(--c-border); }
.modal-header h3 { font-size: 15px; font-weight: 500; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── Misc ── */
.hidden { display: none !important; }
.divider { border: none; border-top: 0.5px solid var(--c-border); margin: 20px 0; }
.text-muted { color: var(--c-text-2); font-size: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; align-items: center; gap: 8px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.scan-error-banner { background: var(--c-warn-bg); border: 0.5px solid var(--c-warn); border-radius: var(--r-md); padding: 8px 12px; font-size: 12px; color: var(--c-warn); margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 0.5px solid var(--c-border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--c-text-2); font-size: 12px; }
.info-value { font-weight: 500; text-align: right; }
.info-value a { color: var(--c-accent); text-decoration: none; }
.info-value a:hover { text-decoration: underline; }
.no-issues { text-align: center; padding: 32px 16px; color: var(--c-text-3); font-size: 13px; }

/* ── Pages List ── */
.pages-list { display: flex; flex-direction: column; gap: 4px; }
.page-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 0.5px solid var(--c-border); border-radius: var(--r-md); background: var(--c-bg); }
.page-name { font-size: 13px; font-weight: 500; }
.page-url { font-size: 11px; color: var(--c-accent); text-decoration: none; word-break: break-all; }
.page-url:hover { text-decoration: underline; }

/* ── Back link ── */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--c-text-2); text-decoration: none; font-size: 13px; margin-bottom: 20px; }
.back-link:hover { color: var(--c-text); }
