/* ─── Custom Properties ─────────────────────────────────────────────────── */
:root {
  --color-bg:        #f1f5f9;
  --color-surface:   #ffffff;
  --color-border:    #e2e8f0;
  --color-text:      #0f172a;
  --color-muted:     #64748b;
  --color-primary:   #3b82f6;
  --color-primary-h: #2563eb;
  --color-success:   #22c55e;
  --color-success-h: #16a34a;
  --color-danger:    #ef4444;
  --color-danger-h:  #dc2626;
  --color-warning:   #f59e0b;
  --color-info:      #0ea5e9;
  --sidebar-w:       240px;
  --radius:          8px;
  --shadow:          0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:       0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-w);
}

.content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-primary);
  text-decoration: none;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-muted);
  padding: 4px;
}

.sidebar-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-label {
  display: block;
  padding: 0 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  color: var(--color-text);
  font-size: 14px;
  border-radius: 0;
  text-decoration: none;
  transition: background .15s;
}

.sidebar-nav a:hover { background: var(--color-bg); }
.sidebar-nav a.active { background: #eff6ff; color: var(--color-primary); font-weight: 600; }
.sidebar-nav .nav-add     { color: var(--color-primary); font-size: 13px; }
.sidebar-nav .nav-archive { color: var(--color-muted); font-size: 13px; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

.sidebar-user span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logout {
  color: var(--color-muted);
  font-size: 18px;
  padding: 4px;
  text-decoration: none;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 150;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title { font-weight: 600; font-size: 15px; }

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
}

/* ─── Auth Pages ─────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-bg);
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { color: var(--color-muted); margin-bottom: 20px; font-size: 14px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--color-muted); }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.card-danger { border-color: #fca5a5; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--color-border); }
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
  font-family: inherit;
}

.btn:hover { text-decoration: none; opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary   { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-h); }
.btn-secondary { background: #e2e8f0; color: var(--color-text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-success   { background: var(--color-success); color: #fff; }
.btn-success:hover { background: var(--color-success-h); }
.btn-danger    { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-h); }
.btn-ghost     { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #f0f9ff; border: 1px solid #bae6fd; color: #0369a1; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-muted   { background: #f1f5f9; color: var(--color-muted); }
.badge-info    { background: #e0f2fe; color: #0369a1; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 16px; font-weight: 600; font-size: 12px;
  color: var(--color-muted); background: var(--color-bg); border-bottom: 1px solid var(--color-border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--color-bg); }

/* ─── Page Header ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }

.breadcrumb { font-size: 13px; color: var(--color-muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-primary); }

/* ─── Dashboard ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value { font-size: 32px; font-weight: 700; color: var(--color-primary); }
.stat-label { font-size: 13px; color: var(--color-muted); margin-top: 4px; }

.section { }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-header h2 { font-size: 16px; font-weight: 600; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.project-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.project-card-archived { opacity: .65; }
.project-card-name { font-weight: 600; margin-bottom: 8px; font-size: 15px; }
.project-card-meta { display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--color-muted); }

/* ─── Project Tabs ───────────────────────────────────────────────────────── */
.project-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}

.tab {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
}
.tab:hover { color: var(--color-primary); text-decoration: none; }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ─── Filter Bar ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-label { font-size: 13px; color: var(--color-muted); }
.filter-btn {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.filter-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ─── Task List ──────────────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 12px; }

.task-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity .2s;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.task-item--done { opacity: .6; }
.task-item--done .task-item-header { background: var(--color-bg); }

/* ─── Linke Spalte: Screenshot-Vorschau ──────────────────────────────────── */
.task-thumb-col {
  display: block;
  border-right: 1px solid var(--color-border);
  background: #0f172a;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.task-thumb-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 120px;
}

.task-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
  transition: opacity .2s;
}
.task-thumb-col:hover .task-thumb-img { opacity: .85; }

.task-thumb-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
  opacity: .35;
  pointer-events: none;
  line-height: 1;
}
.task-thumb-col:hover .task-thumb-pin { opacity: 1; }
.task-thumb-pin--done { background: var(--color-success); }

/* ─── Rechte Spalte: Infos & Kommentare ──────────────────────────────────── */
.task-info-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.task-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.task-pin-info { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }

.task-pin-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform .15s;
}
.task-pin-badge:hover { transform: scale(1.1); }

.task-screenshot-name { font-weight: 500; font-size: 14px; }
.task-screenshot-name a { color: var(--color-text); }
.task-screenshot-name a:hover { color: var(--color-primary); }
.task-meta { font-size: 12px; color: var(--color-muted); margin-top: 2px; }
.task-actions { flex-shrink: 0; }

.task-comments {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.task-comment-form { padding: 12px 16px 16px; border-top: 1px solid var(--color-border); }

/* ─── Comments ───────────────────────────────────────────────────────────── */
.comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.comment:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-header strong { font-size: 13px; }
.comment-date { font-size: 12px; color: var(--color-muted); }
.comment-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }

.comment-form { display: flex; flex-direction: column; gap: 8px; }

/* ─── Page Header Actions ────────────────────────────────────────────────── */
.page-header-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 1;
  min-width: 0;
  margin-left: 16px;
}

/* ─── Upload Widget (kompakt, immer sichtbar) ────────────────────────────── */
.upload-widget {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 60px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 10px 16px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.upload-widget:hover { border-color: var(--color-primary); background: #f8faff; }
.upload-widget.drag-over { border-color: var(--color-primary); background: #eff6ff; }

.upload-widget .upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-widget-prompt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.upload-widget-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.upload-widget-text { font-size: 11px; color: var(--color-muted); line-height: 1.4; }
.upload-widget-text .upload-label { color: var(--color-primary); pointer-events: all; cursor: pointer; }

/* ─── Upload Zone (legacy – nicht mehr genutzt) ──────────────────────────── */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  background: var(--color-surface);
  margin-bottom: 24px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  position: relative;
}

.upload-zone.drag-over {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-prompt p { font-size: 14px; color: var(--color-muted); margin-bottom: 4px; }
.upload-label { color: var(--color-primary); cursor: pointer; }
.upload-hint { font-size: 12px !important; }

.progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  width: 0%;
  transition: width .3s;
}

/* ─── Screenshots Layout ─────────────────────────────────────────────────── */
.screenshots-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
}

.sc-list {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.sc-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  transition: background .15s;
  position: relative;
}
.sc-list-item:last-child { border-bottom: none; }
.sc-list-item:hover { background: var(--color-bg); }
.sc-list-item.active { background: #eff6ff; border-left: 3px solid var(--color-primary); }

.sc-thumb-wrap {
  width: 44px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg);
}
.sc-thumb { width: 100%; height: 100%; object-fit: cover; }
.sc-list-meta { flex: 1; min-width: 0; }
.sc-list-name { font-size: 12px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sc-list-info { margin-top: 2px; }

.sc-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .15s, color .15s;
  flex-shrink: 0;
}
.sc-list-item:hover .sc-delete-btn { opacity: 1; }
.sc-delete-btn:hover { color: var(--color-danger); background: #fee2e2; }

/* ─── Pin Editor ─────────────────────────────────────────────────────────── */
.pin-editor {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto 1fr;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 500px;
}

.pin-editor-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.pin-editor-title { font-size: 13px; font-weight: 500; color: var(--color-muted); }

.pin-image-wrap {
  position: relative;
  overflow: auto;
  background: #1e293b;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.pin-image-wrap.add-pin-mode { cursor: crosshair; }
.pin-image-wrap.add-pin-mode .pin-image-inner { cursor: crosshair; }

/* Innerer Wrapper: passt sich exakt ans Bild an – Pins beziehen sich auf diesen */
.pin-image-inner {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
}

.pin-image {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.pin-marker {
  position: absolute;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  opacity: .35;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  z-index: 10;
  line-height: 1;
}
.pin-marker:hover, .pin-marker.active {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  opacity: 1;
  z-index: 20;
}
.pin-marker--done { background: var(--color-success); }

/* ─── Pin Panel ──────────────────────────────────────────────────────────── */
.pin-panel {
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 600px;
}

.pin-panel-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-muted);
  font-size: 13px;
}
.pin-panel-empty p { margin-bottom: 8px; }

.pin-panel-detail { display: flex; flex-direction: column; height: 100%; }

.pin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.pin-panel-num { font-weight: 700; font-size: 15px; }
.pin-panel-meta { padding: 10px 14px; font-size: 12px; color: var(--color-muted); border-bottom: 1px solid var(--color-border); }

.pin-comments { flex: 1; padding: 0 14px; overflow-y: auto; }
#panelCommentForm { padding: 12px 14px; border-top: 1px solid var(--color-border); }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-muted);
}
.empty-state p { margin-bottom: 16px; font-size: 15px; }

/* ─── Confirm Token ──────────────────────────────────────────────────────── */
.confirm-token {
  font-family: monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 20px;
  text-align: center;
  color: var(--color-danger);
  margin: 16px 0;
}

/* ─── Misc ───────────────────────────────────────────────────────────────── */
.text-muted { color: var(--color-muted); }

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-wrap { margin-left: 0; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }

  .sidebar-overlay.open { display: block; }

  .topbar { display: flex; }

  .content { padding: 16px; }

  .stats-grid { grid-template-columns: 1fr; }
  .card-grid-2 { grid-template-columns: 1fr; }
  .card-grid-2 > * { grid-column: auto !important; }

  .screenshots-layout {
    grid-template-columns: 1fr;
  }

  .sc-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    position: static;
    max-height: none;
  }

  .sc-list-item {
    flex-direction: column;
    flex-shrink: 0;
    width: 120px;
    border-bottom: none;
    border-right: 1px solid var(--color-border);
    align-items: center;
    text-align: center;
  }
  .sc-list-item.active { border-left: none; border-top: 3px solid var(--color-primary); }
  .sc-thumb-wrap { width: 80px; height: 60px; }

  .pin-editor {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .pin-editor-toolbar { grid-column: 1; }
  .pin-image-wrap { grid-column: 1; }

  .pin-panel {
    border-left: none;
    border-top: 1px solid var(--color-border);
    max-height: 400px;
  }

  .task-item { grid-template-columns: 1fr; }
  .task-thumb-col { border-right: none; border-bottom: 1px solid var(--color-border); max-height: 200px; }
  .task-thumb-wrap { min-height: 160px; }

  .task-item-header { flex-direction: column; }
  .task-actions { width: 100%; }
  .task-actions .btn { width: 100%; }

  .filter-bar { gap: 6px; }

  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
}

/* ─── Upload Widget mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .upload-zone { padding: 24px 16px; }

  .page-header-actions { margin-left: 0; flex: none; width: 100%; }

  .upload-widget {
    flex: 1;
    min-height: unset;
    border: none;
    background: var(--color-primary);
    border-radius: var(--radius);
    padding: 10px 14px;
    gap: 8px;
    justify-content: center;
  }
  .upload-widget:hover  { background: var(--color-primary-h); border: none; }
  .upload-widget.drag-over { background: var(--color-primary-h); border: none; }

  .upload-widget-icon { font-size: 16px; }
  .upload-widget-text { font-size: 13px; font-weight: 500; color: #fff; }
  .upload-widget-text .upload-label { color: #fff; }
}
