/* ============================================================
   Painter — Apple-Style Refined UI
   Premium, generous whitespace, warm neutrals
   ============================================================ */

:root {
  /* Warm neutral palette */
  --bg:             #f5f5f7;
  --bg-card:        #ffffff;
  --bg-elevated:    #fafafa;
  --bg-inset:       #f0f0f2;
  --text:           #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted:     #aeaeb2;
  --border:         rgba(0,0,0,0.06);
  --border-strong:  rgba(0,0,0,0.10);

  /* Accent — teal, used sparingly */
  --accent:         #0d9488;
  --accent-hover:   #0f766e;
  --accent-light:   #ccfbf1;
  --accent-soft:    rgba(13,148,136,0.08);
  --accent-medium:  rgba(13,148,136,0.15);

  --danger:         #ff3b30;
  --success:        #34c759;

  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      20px;

  --shadow-sm:      0 1px 2px rgba(0,0,0,0.04);
  --shadow:         0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg:      0 8px 30px rgba(0,0,0,0.10);
  --shadow-xl:      0 20px 60px rgba(0,0,0,0.15);

  --transition:     0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

[hidden] { display: none !important; }

/* ============================================================
   APP SHELL & LAYOUT
   ============================================================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.editor {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  overflow: hidden;
}

.main-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 1100px) {
  .main-area {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
}

@media (max-width: 800px) {
  .editor {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* ============================================================
   HEADER — Frosted glass, refined
   ============================================================ */
.header {
  height: 52px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand { display: flex; align-items: center; gap: 12px; }

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.header-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.header-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.header-nav { display: flex; align-items: center; gap: 6px; }

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all var(--transition);
}
.nav-link:hover { background: var(--bg-inset); color: var(--text); }

.user-menu { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
  font-family: inherit;
}
.user-btn:hover { background: var(--bg); border-color: var(--border-strong); }

.user-avatar {
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.user-dropdown.show { display: block; }

.dropdown-item {
  display: block;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg-inset); }

.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ============================================================
   LEFT SIDEBAR — Clean, visual, Apple-inspired
   ============================================================ */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}
.back-link:hover { opacity: 0.7; }
.back-link svg { width: 14px; height: 14px; }

/* Project Info */
.project-info {
  padding: 16px 20px 0;
}
.project-info h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}
.project-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.project-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Side section divider */
.side-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 20px;
}

/* Images Panel */
.images-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.add-btn:hover { background: var(--accent-medium); }

.images-list {
  overflow-y: auto;
  padding: 0 12px 4px;
}

.empty-text {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Image Card */
.img-thumb-wrap {
  position: relative;
}

.img-thumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  position: relative;
}
.img-thumb:hover { background: var(--bg-inset); }
.img-thumb-wrap.active .img-thumb {
  background: var(--accent-soft);
}
.img-thumb-wrap.active .img-thumb::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.img-thumb img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.img-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.img-type {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.img-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Image delete button — hover reveal */
.img-delete-form {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity var(--transition);
}
.img-thumb-wrap:hover .img-delete-form { opacity: 1; }

.img-delete-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(255,59,48,0.08);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  transition: all var(--transition);
}
.img-delete-btn:hover { background: rgba(255,59,48,0.15); }

/* Results Panel */
.results-panel {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}
.results-panel .panel-head { padding: 12px 20px 8px; }

.pill {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-inset);
  padding: 2px 8px;
  border-radius: 10px;
}

.results-list {
  overflow-y: auto;
  padding: 0 12px 12px;
}

/* Result Card */
.result-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 4px;
}

.result-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all var(--transition);
}
.result-item:hover { background: var(--bg-inset); }
.result-item.disabled { opacity: 0.45; cursor: not-allowed; }

.result-thumb {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  background: var(--bg-inset);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-thumb-fallback { color: var(--text-muted); font-weight: 700; font-size: 0.75rem; }

.result-meta { min-width: 0; flex: 1; }
.result-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}
.result-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: lowercase;
}
.status-chip.complete, .status-chip.completed {
  background: rgba(52,199,89,0.10);
  color: #15803d;
}
.status-chip.error {
  background: rgba(255,59,48,0.10);
  color: #b91c1c;
}
.status-chip.pending, .status-chip.processing {
  background: rgba(110,110,115,0.10);
  color: var(--text-secondary);
}

/* Result delete — hover reveal */
.result-delete-form { display: flex; opacity: 0; transition: opacity var(--transition); }
.result-row:hover .result-delete-form { opacity: 1; }

.result-delete-btn {
  width: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255,59,48,0.08);
  color: var(--danger);
  font-weight: 800;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
}
.result-delete-btn:hover { background: rgba(255,59,48,0.15); }

/* ============================================================
   PREVIEW AREA
   ============================================================ */
.preview {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

/* Segmented Tabs — Apple style */
.view-tabs {
  display: flex;
  background: var(--bg-inset);
  border-radius: 8px;
  padding: 2px;
}

.view-tab {
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.view-tab:hover { color: var(--text); }
.view-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}

.preview-btns { display: flex; gap: 4px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.icon-btn:hover {
  background: var(--bg-inset);
  color: var(--text);
  border-color: var(--border-strong);
}
.icon-btn.danger { color: var(--danger); border-color: rgba(255,59,48,0.15); }
.icon-btn.danger:hover { background: rgba(255,59,48,0.06); border-color: rgba(255,59,48,0.3); }

/* Canvas */
.preview-canvas {
  flex: 1;
  padding: 16px;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ============================================================
   SLIDER COMPARE VIEW
   ============================================================ */
.view-compare {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
  cursor: col-resize;
  box-shadow: var(--shadow);
}

.compare-img { display: block; width: 100%; height: auto; transition: opacity 0.3s ease; }

.compare-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 0 0 50%);
  z-index: 2;
}

.compare-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 60px 30px;
  min-height: 300px;
}
.compare-empty svg { opacity: 0.4; }
.compare-empty span { font-size: 0.8rem; }

.compare-label {
  position: absolute;
  top: 14px;
  padding: 5px 12px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 6px;
  pointer-events: none;
  z-index: 4;
}
.compare-label--left {
  left: 14px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(8px);
}
.compare-label--right {
  right: 14px;
  background: rgba(13,148,136,0.7);
  color: #fff;
  backdrop-filter: blur(8px);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  z-index: 5;
  pointer-events: none;
}

.compare-handle__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

.compare-handle__grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: auto;
  cursor: col-resize;
  transition: all var(--transition);
}
.compare-handle__grip:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transform: translate(-50%, -50%) scale(1.08);
}
.compare-handle__grip:active,
.compare-wrap.is-dragging .compare-handle__grip {
  box-shadow: 0 2px 20px rgba(13,148,136,0.35);
  transform: translate(-50%, -50%) scale(1.12);
  color: var(--accent);
}

/* Single Views */
.view-single {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.view-single img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ============================================================
   RIGHT CONTROLS PANEL — Refined, breathable
   ============================================================ */
.controls {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .controls {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 50vh;
  }
}

.controls-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.controls-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

/* Sections */
.section { margin-bottom: 24px; }
.section:last-child { margin-bottom: 0; }

.section-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* ============================================================
   BUCKETS (Paint Areas)
   ============================================================ */
.bucket {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all var(--transition);
}
.bucket:hover { border-color: var(--border-strong); }
.bucket.disabled { opacity: 0.45; }

.bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

.bucket-info { flex: 1; min-width: 0; }
.bucket-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  display: block;
  color: var(--text);
}
.bucket-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.bucket-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Colour Chip — larger, premium paint-drop feel */
.color-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
  background: var(--chip-bg, #e2e8f0);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(0,0,0,0.06);
  transition: all var(--transition);
}
.color-chip:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(0,0,0,0.08);
}

/* Toggle Switch — iOS style */
.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Bucket Children */
.bucket-children {
  border-top: 1px solid var(--border);
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bucket-children:empty { display: none; }
.bucket.collapsed .bucket-children { display: none; }
.bucket-header { cursor: pointer; }
.bucket-header::after { content: ""; display: inline-block; width: 8px; height: 8px; border-right: 2px solid var(--text-secondary); border-bottom: 2px solid var(--text-secondary); transform: rotate(45deg); transition: transform 0.2s ease; margin-left: 8px; flex-shrink: 0; }
.bucket.collapsed .bucket-header::after { transform: rotate(-45deg); }

/* Bucket collapse */
.bucket.collapsed .bucket-children { display: none; }
.bucket-header { cursor: pointer; }
.bucket-header::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 4px;
}
.bucket.collapsed .bucket-header::after {
  transform: rotate(-45deg);
}

.child-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  transition: background var(--transition);
}
.child-row:hover { background: rgba(0,0,0,0.02); }

.child-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.child-label {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  background: var(--chip-bg, transparent);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(0,0,0,0.05);
  transition: all var(--transition);
}
.child-color:hover { transform: scale(1.1); }

.no-children {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 0;
  font-style: italic;
}

.hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* ============================================================
   OPTIONS ROW
   ============================================================ */
.option-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: all var(--transition);
}
.select:hover { border-color: var(--border-strong); }
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  transition: all var(--transition);
}
.textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea::placeholder { color: var(--text-muted); }

/* ============================================================
   GENERATE BUTTON
   ============================================================ */
.generate-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(13,148,136,0.3);
  transition: all var(--transition);
  letter-spacing: -0.01em;
}
.generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(13,148,136,0.4);
}
.generate-btn:active { transform: translateY(0); }
.generate-btn svg { width: 18px; height: 18px; }
.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status {
  margin-top: 8px;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  min-height: 18px;
}

/* ============================================================
   COLOUR PICKER MODAL — Premium overlay
   ============================================================ */
.modal { z-index: 998; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 40px));
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  animation: modalIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow: hidden;
}

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -48%); } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-head h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg-inset);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 20px 24px; }

.color-input-row {
  margin-bottom: 20px;
}
.color-input-row label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.color-input-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-text-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.color-text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.color-text-input::placeholder { color: var(--text-muted); }

.color-preview-swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(0,0,0,0.06);
  background: #e2e8f0;
  flex-shrink: 0;
  transition: background var(--transition);
}

.palette-section { margin-bottom: 16px; }
.palette-section:last-child { margin-bottom: 0; }
.palette-section label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid white;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(0,0,0,0.06);
  transition: all var(--transition);
}
.swatch:hover { transform: scale(1.15); }
.swatch.selected {
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0,0,0,0.15);
  transform: scale(1.1);
}

/* Custom colour picker swatch — rainbow wheel */
.swatch-picker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid white;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(0,0,0,0.06);
  transition: all var(--transition);
  background: conic-gradient(#f44 0deg, #fc0 60deg, #4f0 120deg, #0cf 180deg, #44f 240deg, #f4f 300deg, #f44 360deg);
  position: relative;
  overflow: hidden;
  display: inline-flex;
}
.swatch-picker:hover { transform: scale(1.15); }
.swatch-picker input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
.swatch-picker.has-color {
  background: var(--picked-color);
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0,0,0,0.15);
  transform: scale(1.1);
}

/* Buttons */
.modal-foot {
  display: flex;
  gap: 10px;
  padding: 0 24px 20px;
  justify-content: flex-end;
}

.btn-secondary {
  padding: 10px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-secondary:hover { background: var(--bg); border-color: var(--border-strong); }

.btn-primary {
  padding: 10px 24px;
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-primary:hover { background: var(--accent-hover); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  padding: 40px;
}
.empty-state h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}
.empty-state p { font-size: 0.85rem; }

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  color: white;
  background: var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
}
.upload-btn:hover { background: var(--accent-hover); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* Optional: soften preview while images load */
.img-loading {
  filter: blur(0px);
  opacity: 1;
  transition: filter .15s, opacity .15s;
}

/* ========================================
   Dashboard & Auth (keep existing)
   ======================================== */
.dashboard { max-width: 900px; margin: 0 auto; padding: 30px 20px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.page-title { font-size: 1.4rem; font-weight: 700; }
.page-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.project-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.project-thumb {
  height: 100px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.project-card-info { padding: 14px; }
.project-card-name { font-weight: 600; margin-bottom: 4px; }
.project-card-meta { font-size: 0.75rem; color: var(--text-muted); }

/* Auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
}

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  margin-bottom: 16px;
}
.auth-title { font-size: 1.2rem; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.85rem; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label { font-size: 0.8rem; font-weight: 500; }
.form-input {
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.form-input:focus { outline: none; border-color: var(--accent); }

.auth-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: 6px;
  padding: 10px 18px; 
  font-size: 0.85rem; 
  font-weight: 600; 
  border-radius: var(--radius); 
  border: none; 
  cursor: pointer; 
  text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }

/* Account */
.account-page { padding: 30px 20px; }
.account-container { max-width: 550px; margin: 0 auto; }
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.settings-section h2 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.form-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* Modal for dashboard */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-form { padding: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
/* ========================================
   Trash / Delete icons (project + image)
   ======================================== */

/* Dashboard: delete project icon button */
.project-card-wrap { position: relative; }
.project-card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
}

/* unify "danger icon button" look */
.icon-btn.danger,
.project-delete-form .icon-btn.danger {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: var(--danger);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);

  cursor: pointer;
  transition: transform 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s, color 0.12s;
}

.icon-btn.danger:hover,
.project-delete-form .icon-btn.danger:hover {
  background: #fff;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.12);
  transform: translateY(-1px);
}

.icon-btn.danger:active,
.project-delete-form .icon-btn.danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.10);
}

.icon-btn.danger svg,
.project-delete-form .icon-btn.danger svg {
  width: 18px;
  height: 18px;
}

/* Keyboard accessibility */
.icon-btn.danger:focus-visible,
.project-delete-form .icon-btn.danger:focus-visible,
.img-delete-btn:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.25); /* accent */
  outline-offset: 2px;
}

/* Project page: delete image small X button */
.img-thumb-wrap { position: relative; }

.img-delete-form {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}

/* style the "✕" delete button */
.img-delete-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(255,255,255,0.90);
  color: var(--danger);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 16px;
  line-height: 1;
  cursor: pointer;

  opacity: 0;               /* hidden until hover/focus */
  transform: scale(0.96);
  transition: opacity 0.12s, transform 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

/* show on hover of the image row */
.img-thumb-wrap:hover .img-delete-btn,
.img-delete-btn:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.img-delete-btn:hover {
  background: #fff;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.12);
}

/* Always visible for the currently active image */
.img-thumb-wrap.active .img-delete-btn {
  opacity: 1;
  transform: scale(1);
}

/* Mobile: always visible (no hover) */
@media (max-width: 800px) {
  .img-delete-btn { opacity: 1; transform: scale(1); }
}

/* Match result-item width to image thumb rows */
.results-list {
  padding-left: 10px;
  padding-right: 10px;
}

.result-row {
  justify-content: flex-start;
}

/* This is the key line */
.result-item {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
}

/* Sidebar is 220px wide, minus padding */
.sidebar .result-item {
  max-width: calc(220px - 20px); /* same visual width as .img-thumb-wrap */
}
/* ========================================
   Dashboard — Redesigned
   ======================================== */

/* --- Layout --- */
.dash {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

/* --- Alerts --- */
.dash-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  animation: dashFadeDown 0.3s ease-out;
}
.dash-alert--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.dash-alert--success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* --- Welcome Bar --- */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.dash-welcome__text h1 {
  font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.dash-welcome__text p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* --- Stats Strip --- */
.dash-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 0;
  margin-bottom: 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.dash-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dash-stat__value {
  font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dash-stat__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-stat__divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* --- Buttons --- */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dash-btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(13,148,136,0.25);
}
.dash-btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(13,148,136,0.3);
  transform: translateY(-1px);
}
.dash-btn--primary:active {
  transform: translateY(0);
}
.dash-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.dash-btn--ghost:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-muted);
}
.dash-btn--lg {
  padding: 13px 28px;
  font-size: 0.9rem;
}

/* --- Project Grid --- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* --- Card Wrapper (for delete overlay) --- */
.dash-card-wrap {
  position: relative;
}

/* --- Project Card --- */
.dash-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  height: 100%;
}
.dash-card:hover {
  border-color: rgba(13,148,136,0.35);
  box-shadow: 0 8px 28px rgba(0,0,0,0.08), 0 0 0 1px rgba(13,148,136,0.08);
  transform: translateY(-2px);
}

/* Thumbnail */
.dash-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}
.dash-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.dash-card:hover .dash-card__thumb img {
  transform: scale(1.03);
}
.dash-card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-card__placeholder-icon {
  color: var(--text-muted);
  opacity: 0.4;
}

/* Sparkle pip for cards with results */
.dash-card__result-pip {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(13,148,136,0.35);
  border: 2px solid #fff;
}

/* Body */
.dash-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.dash-card__title {
  font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dash-card__address {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}
.dash-card__counts {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-card__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.dash-card__count svg { opacity: 0.55; }
.dash-card__count--accent {
  color: var(--accent);
}
.dash-card__count--accent svg { opacity: 0.8; }
.dash-card__date {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Delete overlay */
.dash-card__delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.15s, transform 0.15s;
}
.dash-card-wrap:hover .dash-card__delete,
.dash-card__delete:focus-within {
  opacity: 1;
  transform: scale(1);
}
.dash-card__delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: none;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dash-card__delete-btn:hover {
  color: var(--danger);
  background: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.15);
}

/* New Project Card */
.dash-card--new {
  border: 2px dashed var(--border);
  background: transparent;
  cursor: pointer;
  min-height: 200px;
  transition: border-color 0.2s, background 0.2s;
}
.dash-card--new:hover {
  border-color: var(--accent);
  background: rgba(13,148,136,0.03);
  transform: none;
  box-shadow: none;
}
.dash-card--new__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: var(--text-muted);
  transition: color 0.2s;
}
.dash-card--new:hover .dash-card--new__inner {
  color: var(--accent);
}
.dash-card--new__inner span {
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- Empty State --- */
.dash-empty {
  text-align: center;
  padding: 60px 20px 80px;
}
.dash-empty__icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 50%, #f0f9ff 100%);
  border: 1px solid rgba(13,148,136,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.dash-empty h2 {
  font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.dash-empty p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 400px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.dash-empty__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
}
.dash-empty__step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.dash-empty__step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --- Modal --- */
.dash-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: dashFadeIn 0.15s ease-out;
}
.dash-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(3px);
}
.dash-modal__card {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 460px;
  animation: dashSlideUp 0.2s ease-out;
}
.dash-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.dash-modal__head h2 {
  font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.dash-modal__close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.dash-modal__close:hover {
  background: #e2e8f0;
  color: var(--text);
}
.dash-modal__form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dash-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

/* --- Form Fields --- */
.dash-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.dash-field__opt {
  font-weight: 400;
  color: var(--text-muted);
}
.dash-field__input {
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dash-field__input::placeholder {
  color: var(--text-muted);
}
.dash-field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
  background: #fff;
}
.dash-field__hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Animations --- */
@keyframes dashFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dashSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dashFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .dash { padding: 20px 16px 60px; }
  .dash-welcome { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dash-welcome__text h1 { font-size: 1.3rem; }
  .dash-btn--primary { width: 100%; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-stats { border-radius: 10px; padding: 12px 0; }
  .dash-stat__value { font-size: 1.1rem; }
  .dash-empty__steps { flex-direction: column; gap: 14px; align-items: flex-start; padding-left: 20px; }
  .dash-card__delete { opacity: 1; transform: scale(1); }
  .dash-card--new { min-height: 140px; }
}

@media (max-width: 400px) {
  .dash-modal__card { border-radius: 12px; }
  .dash-modal__form { padding: 16px 18px 20px; }
  .dash-modal__head { padding: 16px 18px 0; }
}