/* -----------------------------------------------------------------------
   CAJA by Goodwood — Interior Design Suite UI
   Palette: cream background, metallic gold, warm bronze ink.
----------------------------------------------------------------------- */

:root {
  /* cream / blush backgrounds */
  --sand-50:  #FDF6EC;
  --sand-100: #F8EADA;
  --sand-200: #EDD9BE;
  --sand-300: #DEC39D;

  /* ink (warm brown) */
  --ink-50:  #FAF4EA;
  --ink-100: #F0E6D5;
  --ink-200: #E0D1B6;
  --ink-300: #C6B08A;
  --ink-400: #9E8862;
  --ink-500: #7A6848;
  --ink-600: #55472F;
  --ink-700: #3A2F1F;
  --ink-800: #2A2217;
  --ink-900: #1B1610;

  /* CAJA gold — brand accent (from logo gradient) */
  --gold-50:  #F6E9D0;
  --gold-100: #E8CFA3;
  --gold:     #B89968;
  --gold-dark: #8E6F3F;
  --accent: #B89968;
  --accent-dark: #8E6F3F;

  --red: #B4543F;
  --red-bg: #FBEAE1;

  --shadow-card: 0 1px 2px rgba(90,65,35,0.05), 0 8px 24px rgba(90,65,35,0.07);
  --shadow-card-lg: 0 2px 4px rgba(90,65,35,0.06), 0 24px 48px rgba(90,65,35,0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;

  /* gold metallic gradient used for the wordmark and highlights */
  --gold-gradient: linear-gradient(180deg, #E4C18A 0%, #C19E62 45%, #8E6F3F 100%);
}

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

body {
  color: var(--ink-800);
  background:
    radial-gradient(1400px 700px at 85% -10%, rgba(184,153,104,0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(142,111,63,0.08), transparent 60%),
    #FDF5E8;
  background-attachment: fixed;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; }

.serif { font-family: 'Cormorant Garamond', Georgia, serif; letter-spacing: -0.01em; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 40px; } }

.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(253,246,236,0.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--ink-100);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 0; text-decoration: none; }
.brand-logo {
  height: 44px; width: auto; display: block;
}
.brand-logo-img {
  height: 44px; width: auto; display: block; object-fit: contain;
}
.brand-title { display: none; }  /* logo image already contains the wordmark */

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: 13px;
  color: var(--ink-600); transition: background-color .2s, color .2s;
  letter-spacing: 0.02em;
}
.nav-link:hover { background: var(--gold-50); color: var(--ink-900); }
.nav-link.active { background: var(--gold-dark); color: #FDF6EC; }

.user-chip { display: flex; align-items: center; gap: 12px; }
.user-info { text-align: right; line-height: 1.1; display: none; }
@media (min-width: 768px) { .user-info { display: block; } }
.user-name { font-size: 13px; color: var(--ink-900); }
.user-email { font-size: 11px; color: var(--ink-500); }

main { padding: 40px 0; min-height: calc(100vh - 64px - 72px); }
footer {
  padding: 28px 0; text-align: center; font-size: 11px; color: var(--ink-400);
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-dark);
}
.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px; color: var(--ink-900); letter-spacing: -0.01em; margin: 4px 0 0;
}
@media (min-width: 768px) { .section-title { font-size: 32px; } }

.label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-500);
}
.muted { color: var(--ink-500); }
.divider { height: 1px; background: var(--ink-100); width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid rgba(238, 236, 229, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-lg); }
.card-body { padding: 24px; }
@media (min-width: 768px) { .card-body { padding: 32px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--gold-dark); color: #FDF6EC;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 6px 16px rgba(142,111,63,0.25);
}
.btn-primary:hover:not(:disabled) { background: #6F5630; transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--ink-800); border-color: var(--ink-200); }
.btn-secondary:hover:not(:disabled) { border-color: var(--gold); background: var(--gold-50); color: var(--ink-900); }
.btn-ghost { background: transparent; color: var(--ink-600); }
.btn-ghost:hover:not(:disabled) { background: var(--gold-50); color: var(--ink-900); }
.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-bg); }

/* ---------- Forms ---------- */
.input, .textarea, .select {
  width: 100%; padding: 10px 14px; font-size: 13px;
  border: 1px solid var(--ink-200); border-radius: 10px;
  background: #fff; color: var(--ink-900);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--ink-400);
  box-shadow: 0 0 0 3px var(--ink-200);
}
.textarea { min-height: 96px; resize: vertical; }
.field { display: block; }
.field + .field { margin-top: 16px; }
.field-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-500);
  display: block; margin-bottom: 6px;
}
.field-helper { font-size: 11px; color: var(--ink-400); margin-top: 4px; }
.required { color: var(--red); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--sand-50);
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
  font-size: 12px; font-weight: 500;
}
.chip.active { background: var(--gold-dark); color: #FDF6EC; border-color: var(--gold-dark); }
.chip button {
  background: none; border: 0; padding: 0;
  color: var(--ink-500); font-size: 14px; line-height: 1;
}
.chip button:hover { color: var(--ink-900); }

.chip-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 6px 10px; min-height: 44px;
  background: #fff; border: 1px solid var(--ink-200); border-radius: 10px;
}
.chip-input:focus-within { border-color: var(--ink-400); box-shadow: 0 0 0 3px var(--ink-200); }
.chip-input input {
  flex: 1 1 120px; border: 0; outline: 0; font-size: 13px;
  min-width: 120px; padding: 4px;
  color: var(--ink-900); background: transparent;
}

/* ---------- Swatches ---------- */
.palette { display: inline-flex; align-items: center; }
.palette .swatch + .swatch { margin-left: -6px; }
.swatch {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ink-200);
}
.swatch.lg { width: 36px; height: 36px; }
.swatch.sm { width: 20px; height: 20px; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .65;
}
.badge-new        { background: var(--ink-100); color: var(--ink-700); }
.badge-concepts_generated { background: var(--sand-100); color: var(--ink-800); }
.badge-concept_selected   { background: var(--gold-50); color: var(--accent-dark); }
.badge-moodboards_generated { background: var(--gold-100); color: var(--accent-dark); }
.badge-final      { background: var(--gold-dark); color: #FDF6EC; }

/* ---------- Image uploader ---------- */
.uploader {
  margin-top: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
  background: rgba(244,237,223,0.4);
  border: 1px dashed var(--ink-200); border-radius: 14px;
  cursor: pointer; transition: border-color .2s, background-color .2s;
}
.uploader:hover { border-color: var(--ink-400); }
.uploader.busy { opacity: 0.7; }
.uploader-text { font-size: 13px; color: var(--ink-700); }
.uploader-helper { font-size: 11px; color: var(--ink-400); margin-top: 4px; }
.thumb-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 640px) { .thumb-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .thumb-grid { grid-template-columns: repeat(5, 1fr); } }
.thumb {
  position: relative; aspect-ratio: 1 / 1;
  border: 1px solid var(--ink-100); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--ink-50);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: 0; border-radius: 6px; padding: 2px 8px;
  font-size: 10px; opacity: 0; transition: opacity .2s;
}
.thumb:hover .thumb-remove { opacity: 1; }

/* ---------- Skeletons / loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 14px; margin: 8px 0; }
.skel-block { height: 160px; }

/* ---------- Messages ---------- */
.alert {
  padding: 12px 14px; border-radius: 10px; font-size: 13px;
}
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(192,57,43,0.25); }
.alert-info { background: var(--sand-50); border: 1px solid var(--ink-100); color: var(--ink-700); }

/* ---------- Login page ---------- */
.login-wrap { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 1024px) { .login-wrap { grid-template-columns: 1.1fr 1fr; } }
.login-visual {
  display: none; position: relative; overflow: hidden;
  background:
    radial-gradient(800px 500px at 30% 30%, rgba(184,153,104,0.28), transparent 60%),
    radial-gradient(700px 400px at 80% 80%, rgba(142,111,63,0.16), transparent 60%),
    linear-gradient(160deg, #FBEEDA 0%, #F4E2C6 60%, #EBD1A7 100%);
}
@media (min-width: 1024px) { .login-visual { display: flex; } }
.login-visual-inner {
  position: relative; z-index: 1; width: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 48px; text-align: center; color: var(--ink-900);
}
.login-visual-logo {
  width: min(380px, 70%); height: auto; display: block;
  margin: 0 auto 32px;
  filter: drop-shadow(0 8px 24px rgba(142,111,63,0.18));
}
.login-headline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 34px; line-height: 1.25; margin: 0; max-width: 480px;
  color: var(--ink-800);
}
.login-tagline {
  margin-top: 16px; max-width: 440px;
  color: var(--ink-600);
  font-size: 14px; line-height: 1.7;
}
.login-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: #fff;
}
@media (min-width: 768px) { .login-form-wrap { padding: 64px; } }

/* ---------- Hero / project header ---------- */
.page-head {
  display: flex; flex-direction: column; gap: 16px;
  align-items: flex-start;
}
@media (min-width: 768px) {
  .page-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
}

.stats { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 20px; }
.stat-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-500); }
.stat-value { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 32px; margin-top: 8px; color: var(--ink-900); }
.stat.accent {
  background: linear-gradient(135deg, #3A2F1F 0%, #55472F 50%, #8E6F3F 100%);
  color: #FDF6EC;
}
.stat.accent .stat-label { color: rgba(253,246,236,0.72); }
.stat.accent .stat-value { color: #F6E9D0; }

/* ---------- Dashboard grid ---------- */
.project-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }

.project-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.project-card h3 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; color: var(--ink-900); }
.project-card .client { margin: 2px 0 0; font-size: 13px; color: var(--ink-600); }
.project-card .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project-card .meta { margin-top: auto; display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-500); }

/* ---------- Clients dashboard (grouped) ---------- */
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.client-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .client-grid { grid-template-columns: repeat(2, 1fr); } }

/* Master-detail workspace: full client list on the left, the selected
   client's identity + project list on the right. Stacks on narrow screens. */
.client-workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) {
  .client-workspace {
    grid-template-columns: minmax(280px, 340px) 1fr;
  }
}

/* Left pane — scrollable list of every client */
.client-list-pane {
  padding: 14px 12px 10px;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fffdf6 0%, #fffaf0 100%);
  max-height: calc(100vh - 280px);
}
.client-list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--ink-100);
}
.client-list-body {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 8px;
  overflow-y: auto;
  padding-right: 4px;
}
.client-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left; cursor: pointer; font: inherit;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.client-list-item:hover {
  background: rgba(184, 153, 104, 0.08);
  border-color: rgba(184, 153, 104, 0.18);
}
.client-list-item.active {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: #FDF6EC;
}
.client-list-item .cli-main { min-width: 0; flex: 1; }
.client-list-item .cli-name {
  font-size: 14px; font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-list-item.active .cli-name { color: #FDF6EC; }
.client-list-item .cli-sub {
  font-size: 11px; color: var(--ink-500);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-list-item.active .cli-sub { color: rgba(253, 246, 236, 0.78); }
.client-list-item .badge {
  flex-shrink: 0;
}
.client-list-item.active .client-multi-badge,
.client-list-item.active .client-single-badge {
  background: #FDF6EC; color: var(--ink-900);
}
.client-list-item.active .client-multi-badge::before,
.client-list-item.active .client-single-badge::before {
  background: var(--ink-900);
}

/* Right pane — full detail for the selected client */
.client-detail-pane {
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 18px;
}
.client-detail-pane .detail-head {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink-100);
}
.client-detail-pane .detail-head .client-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px; color: var(--ink-900);
  margin: 4px 0 0; line-height: 1.2;
  word-break: break-word;
}
.client-detail-pane .detail-head .btn-primary {
  background: var(--gold-dark);
}

.client-detail-pane .detail-grid {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 1100px) {
  .client-detail-pane .detail-grid {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}
.client-detail-pane .detail-identity {
  background: var(--sand-50);
  border-radius: 12px;
  padding: 14px 16px;
}
.client-detail-pane .detail-projects-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-100);
}
.client-detail-pane .detail-projects-list {
  display: flex; flex-direction: column;
}

.client-card {
  padding: 22px 24px 18px;
  display: flex; flex-direction: column; gap: 14px;
  background:
    linear-gradient(180deg, #fffdf6 0%, #fffaf0 100%);
}
.client-card-head {
  display: flex; flex-direction: column; gap: 10px;
  align-items: flex-start;
}
@media (min-width: 640px) {
  .client-card-head {
    flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 16px;
  }
}
.client-card-id { min-width: 0; flex: 1; }
.client-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 24px; color: var(--ink-900); margin: 0;
  letter-spacing: -0.005em;
  word-break: break-word;
}
.client-meta {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-600);
}
.client-meta-item { display: inline-flex; align-items: baseline; gap: 6px; }
.client-meta-item .k {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px;
  color: var(--ink-400);
}
.client-meta-item .v { color: var(--ink-800); font-weight: 500; }
.client-card-counters {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  flex-shrink: 0;
}
.client-multi-badge {
  background: var(--gold-dark); color: #FDF6EC;
}
.client-multi-badge::before { background: #FDF6EC; }
.client-single-badge {
  background: var(--sand-100); color: var(--ink-700);
}
.client-latest { font-size: 11px; }

.client-card-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--ink-100);
  padding-top: 12px;
}
.client-card-actions .btn-primary { background: var(--gold-dark); }

.client-projects {
  display: flex; flex-direction: column; gap: 0;
  border-top: 1px solid var(--ink-100);
  margin-top: 4px;
}
.client-projects.collapsed { display: none; }

.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "main side"
    "actions actions";
  gap: 6px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-100);
}
.project-row:last-child { border-bottom: 0; }
@media (min-width: 768px) {
  .project-row {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "main side actions";
    align-items: center;
  }
}
.project-row-main { grid-area: main; min-width: 0; }
.project-row-title {
  font-size: 14px; font-weight: 500; color: var(--ink-900);
  line-height: 1.3;
}
.project-row-sub {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-500); margin-top: 2px;
}
.project-row-sub .dot {
  display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: var(--ink-300);
}
.project-row-side { grid-area: side; align-self: start; }
.project-row-actions {
  grid-area: actions;
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: flex-start;
}
@media (min-width: 768px) {
  .project-row-actions { justify-content: flex-end; }
}

.project-empty {
  padding: 18px 0;
  font-size: 13px;
  text-align: center;
}

/* ---------- /projects/new — Choose client ---------- */
.choose-client-head {
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; justify-content: space-between;
}
@media (min-width: 640px) {
  .choose-client-head { flex-direction: row; align-items: flex-start; gap: 16px; }
}
.caja-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  color: var(--ink-400);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.caja-divider::before,
.caja-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--ink-100);
}
.caja-client-results {
  margin-top: 8px;
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(90, 65, 35, 0.06);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.caja-client-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0; background: transparent;
  text-align: left; cursor: pointer; font: inherit;
  border-bottom: 1px solid var(--ink-100);
}
.caja-client-row:last-child { border-bottom: 0; }
.caja-client-row:hover { background: var(--gold-50); }
.caja-client-row .cr-name {
  font-size: 14px; font-weight: 600; color: var(--ink-900);
}
.caja-client-row .cr-sub {
  font-size: 11px; color: var(--ink-500); margin-top: 2px;
}
.caja-client-row .cr-badge {
  background: var(--sand-100); color: var(--ink-700);
}
.caja-client-empty { padding: 14px; }

#caja-client-search-wrap.compact { opacity: 0.7; }
#caja-client-search-wrap.compact .field-helper { display: none; }

.selected-client-banner {
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #fcf3df 0%, #fbeed1 100%);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.selected-client-head {
  display: flex; flex-direction: column; gap: 10px;
  align-items: flex-start; justify-content: space-between;
}
@media (min-width: 640px) {
  .selected-client-head { flex-direction: row; align-items: flex-start; gap: 16px; }
}
.selected-client-id { min-width: 0; flex: 1; }
.selected-client-name {
  font-size: 26px; color: var(--ink-900);
  margin: 4px 0 0; line-height: 1.2;
  word-break: break-word;
}
.selected-client-meta {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-700);
}
.selected-client-meta .meta-item { display: inline-flex; align-items: baseline; gap: 6px; }
.selected-client-meta .meta-item .k {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px;
  color: var(--ink-500);
}
.selected-client-meta .meta-item .v { color: var(--ink-900); font-weight: 500; }
.selected-client-head-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.selected-client-count {
  background: var(--gold-dark); color: #FDF6EC;
}
.selected-client-count::before { background: #FDF6EC; }
.selected-client-cta {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(142, 111, 63, 0.25);
  border-radius: 12px;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px;
}
.selected-client-cta .btn-primary {
  font-size: 13px;
  padding: 10px 18px;
}
.selected-client-cta-hint {
  flex: 1; min-width: 200px;
  line-height: 1.4;
}

.selected-client-projects-wrap {
  margin-top: 14px;
  border-top: 1px solid rgba(142, 111, 63, 0.18);
  padding-top: 12px;
}
.selected-client-projects {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: flex; flex-direction: column; gap: 0;
}
.selected-client-project {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "main actions";
  gap: 6px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(142, 111, 63, 0.16);
}
.selected-client-project:last-child { border-bottom: 0; }
.selected-client-project .sp-main { grid-area: main; min-width: 0; }
.selected-client-project .sp-title {
  font-size: 14px; font-weight: 500; color: var(--ink-900);
}
.selected-client-project .sp-sub { font-size: 11px; margin-top: 2px; }
.selected-client-project .sp-actions {
  grid-area: actions;
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: flex-end;
}
@media (max-width: 640px) {
  .selected-client-project {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "actions";
  }
  .selected-client-project .sp-actions { justify-content: flex-start; }
}

/* ---------- Stepper ---------- */
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--ink-100); color: var(--ink-400);
  transition: background-color .2s, color .2s;
}
.step.reached { background: var(--gold-50); color: var(--accent-dark); }
.step.current { background: var(--gold-dark); color: #FDF6EC; }
.step-dot {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.12); font-size: 11px; font-weight: 600;
}
.step-connector { width: 24px; height: 1px; background: var(--ink-200); }

/* ---------- Concept / moodboard cards ---------- */
.gallery {
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.gallery-card { display: flex; flex-direction: column; }
.gallery-card.selected { outline: 2px solid var(--gold-dark); outline-offset: -1px; }
.gallery-card.dim { opacity: 0.6; }
.gallery-media { position: relative; aspect-ratio: 4 / 3; background: var(--ink-100); overflow: hidden; }
.gallery-media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s ease; }
.gallery-media img.loading { opacity: 0; }
.gallery-media::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, var(--ink-100) 25%, var(--sand-50) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  pointer-events: none;
  opacity: 1; transition: opacity .4s ease;
}
.gallery-media.loaded::before { opacity: 0; }
.gallery-media .ai-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(42,34,23,0.82); color: #F6E9D0;
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  pointer-events: none; z-index: 1;
  border: 1px solid rgba(246,233,208,0.12);
}
.gallery-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--gold-dark); color: #FDF6EC;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
}
.gallery-tone {
  position: absolute; bottom: 12px; left: 12px;
  background: rgba(255,255,255,0.92);
  color: var(--ink-800);
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
}
.gallery-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.gallery-body h3 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 24px; color: var(--ink-900); }
.gallery-body p { margin: 0; color: var(--ink-700); line-height: 1.6; }
.reason-box {
  background: var(--sand-50); border-radius: 12px; padding: 16px;
  font-size: 13px; color: var(--ink-700);
}

/* ---------- Info rows ---------- */
.info-list { display: flex; flex-direction: column; gap: 6px; }
.info-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 4px 0; border-bottom: 1px solid var(--ink-100);
  font-size: 13px;
}
.info-row:last-child { border-bottom: 0; }
.info-row .k { text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; color: var(--ink-500); }
.info-row .v { color: var(--ink-900); text-align: right; }
.capitalize { text-transform: capitalize; }

/* ---------- Final presentation ---------- */
.final-cover { position: relative; aspect-ratio: 16 / 7; overflow: hidden; }
.final-cover img { width: 100%; height: 100%; object-fit: cover; }
.final-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(19,18,15,0.85) 0%, rgba(19,18,15,0.1) 60%, transparent 100%);
  pointer-events: none;
}
.final-cover-text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 32px;
  color: var(--sand-50);
  pointer-events: none;
}
.final-cover-text h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 40px; margin: 8px 0 4px;
}
@media (min-width: 768px) { .final-cover-text h2 { font-size: 48px; } }

/* ---------- Misc ---------- */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.w-full { width: 100%; }
.max-w-xl { max-width: 620px; }
.max-w-2xl { max-width: 760px; }

.mobile-only { display: block; }
@media (min-width: 1024px) { .mobile-only { display: none !important; } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }
