/* Directory claim/add/manage — shared styles for both local.yobi.com and practicefinder.
   Airtable design system: every --dir-* value maps onto the site tokens in style.css
   (fallbacks keep this file usable on its own). */
:root {
  --dir-primary: var(--accent, #1b61c9);
  --dir-primary-dark: var(--accent-hover, #254fad);
  --dir-primary-tint: var(--accent-tint, #e4ecf8);
  --dir-success: var(--success, #006400);
  --dir-success-tint: var(--success-tint, #e0ece0);
  --dir-warning: var(--warn, #eab308);
  --dir-warning-tint: var(--warn-tint, #fcf6e1);
  --dir-star: var(--star, #f59e0b);
  --dir-danger: var(--danger, #dc2626);
  --dir-danger-tint: var(--danger-tint, #fbe5e5);
  --dir-bg: var(--surface-soft, #f8fafc);
  --dir-border: var(--border, #e0e2e6);
  --dir-border-soft: var(--border-soft, #eef0f3);
  --dir-text: var(--fg, #181d26);
  --dir-text-2: var(--fg-2, #333333);
  --dir-muted: var(--muted, rgba(4, 14, 32, 0.69));
  --dir-radius-sm: var(--radius-sm, 12px);
  --dir-radius-md: var(--radius-md, 16px);
  --dir-radius-lg: var(--radius-lg, 24px);
  --dir-shadow: var(--elev-raised, 0 0 1px rgba(0, 0, 0, 0.32), 0 0 2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(45, 127, 249, 0.28), inset 0 0 0 0.5px rgba(0, 0, 0, 0.06));
  --dir-focus: var(--focus-ring, 0 0 0 3px rgba(27, 97, 201, 0.3));
}

.dir-container { max-width: 720px; margin: 32px auto; padding: 0; }
.dir-hero { text-align: center; padding: 48px 0 32px; }
.dir-hero h1 { font-size: 40px; margin: 0 0 12px; color: var(--dir-text); }
.dir-hero p  { color: var(--dir-text-2); font-size: 20px; line-height: 1.5; letter-spacing: 0.1px; margin: 0; }

.dir-card { background: #fff; border: 0; border-radius: var(--dir-radius-md); padding: 32px; box-shadow: var(--dir-shadow); }
.dir-card h2 { margin-top: 0; }

.dir-row   { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dir-row > *{ flex: 1 1 0; min-width: 200px; }

.dir-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.dir-field label { font-weight: 500; color: var(--dir-text); font-size: 14px; letter-spacing: 0.07px; }
.dir-field small { color: var(--dir-muted); font-size: 12px; letter-spacing: 0.07px; }
.dir-field input, .dir-field select, .dir-field textarea {
  padding: 12px 14px; border: 1px solid var(--dir-border); border-radius: var(--dir-radius-sm);
  font-size: 16px; font-family: inherit; letter-spacing: 0.08px; color: var(--dir-text); background: #fff;
  transition: border-color 150ms cubic-bezier(0.2, 0, 0, 1), box-shadow 150ms cubic-bezier(0.2, 0, 0, 1);
}
.dir-field input::placeholder, .dir-field textarea::placeholder { color: var(--dir-muted); }
.dir-field input:focus, .dir-field select:focus, .dir-field textarea:focus {
  outline: none; border-color: var(--dir-primary); box-shadow: var(--dir-focus);
}
.dir-field textarea { resize: vertical; min-height: 90px; }
/* Selects: same inset chevron as style.css (native arrow hugs the edge and ignores padding) */
.dir-field select,
.mg-switch {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23525965' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  cursor: pointer;
}

.dir-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border: 1px solid transparent; border-radius: var(--dir-radius-sm);
  background: var(--dir-primary); color: #fff; font-family: inherit; font-size: 16px; font-weight: 500;
  letter-spacing: 0.08px; line-height: 1.25; cursor: pointer; text-decoration: none;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1), border-color 150ms cubic-bezier(0.2, 0, 0, 1), box-shadow 150ms cubic-bezier(0.2, 0, 0, 1);
}
.dir-btn:hover:not(:disabled) { background: var(--dir-primary-dark); color: #fff; text-decoration: none; }
.dir-btn:focus-visible { outline: none; box-shadow: var(--dir-focus); }
.dir-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dir-btn-ghost { background: #fff; color: var(--dir-text); border-color: var(--dir-border); }
.dir-btn-ghost:hover:not(:disabled) { background: #fff; color: var(--dir-text); border-color: var(--dir-text); }

.dir-alert { padding: 16px 20px; border-radius: var(--dir-radius-sm); margin-bottom: 16px; font-size: 14px; color: var(--dir-text); }
.dir-alert.ok     { background: var(--dir-success-tint); color: var(--dir-success); }
.dir-alert.err    { background: var(--dir-danger-tint); }
.dir-alert.info   { background: var(--dir-primary-tint); }
.dir-alert.warn   { background: var(--dir-warning-tint); }

.dir-steps { display: flex; justify-content: space-between; margin-bottom: 32px; padding: 0; list-style: none; counter-reset: step; }
.dir-steps li { flex: 1; text-align: center; position: relative; font-size: 14px; color: var(--dir-muted); }
.dir-steps li::before {
  display: block; width: 28px; height: 28px; border-radius: 9999px;
  background: var(--dir-border-soft); color: var(--dir-text); line-height: 28px; margin: 0 auto 8px;
  font-weight: 500; content: counter(step); counter-increment: step;
}
.dir-steps li.active { color: var(--dir-text); }
.dir-steps li.active::before { background: var(--dir-primary); color: #fff; }
.dir-steps li.done::before   { background: var(--dir-success); color: #fff; content: "✓"; }

.dir-results { list-style: none; padding: 0; margin: 16px 0 0; }
.dir-results li {
  padding: 16px; border-radius: var(--dir-radius-sm); box-shadow: 0 0 0 1px var(--dir-border); margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.dir-results strong { display: block; color: var(--dir-text); font-weight: 500; }
.dir-results span.meta { color: var(--dir-muted); font-size: 14px; }
.dir-results .badge,
.mg-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 9999px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.14px; line-height: 1.6; white-space: nowrap;
  background: var(--fg-tint, #ecedee); color: var(--dir-text-2);
}
.dir-results .badge.claimed,
.mg-badge.claimed { background: var(--dir-success-tint); color: var(--dir-success); }

.dir-toggle { display: inline-flex; gap: 8px; align-items: center; }
.dir-footnote { color: var(--dir-muted); font-size: 14px; margin-top: 16px; text-align: center; }
.dir-hidden { display: none !important; }

@media (max-width: 600px) {
  .dir-row { flex-direction: column; gap: 0; }
  .dir-hero h1 { font-size: 32px; }
  .dir-hero p { font-size: 16px; }
  .dir-card { padding: 24px 20px; }
}

/* ---- Manage dashboard (sidebar console) ---- */
.mg-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin: 32px 0 48px; align-items: start; }
.mg-shell h1, .mg-shell h2 { border: 0; padding: 0; }
.mg-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mg-biz { display: flex; gap: 12px; align-items: center; }
.mg-biz-avatar { flex: 0 0 40px; height: 40px; border-radius: var(--dir-radius-sm); background: var(--dir-primary); color: #fff; font-weight: 500; display: flex; align-items: center; justify-content: center; }
.mg-biz-text { min-width: 0; display: flex; flex-direction: column; }
.mg-biz-text strong { color: var(--dir-text); font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-biz-text span { color: var(--dir-muted); font-size: 12px; }
.mg-switch { padding: 8px 40px 8px 12px; border: 1px solid var(--dir-border); border-radius: var(--dir-radius-sm); font: inherit; font-size: 14px; color: var(--dir-text); background-color: #fff; }
.mg-nav-links { display: flex; flex-direction: column; gap: 2px; }
.mg-nav-links button { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: transparent; border: 0; border-radius: var(--dir-radius-sm); padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.07px; color: var(--dir-text-2); cursor: pointer; }
.mg-nav-links button:hover { background: var(--dir-bg); color: var(--dir-text); }
.mg-nav-links button.active { background: var(--dir-primary-tint); color: var(--dir-primary); }
.mg-count { color: var(--dir-muted); font-size: 12px; font-weight: 500; }
.mg-signout { padding: 8px 12px; font-size: 14px; }

.mg-main { min-width: 0; }
.mg-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.mg-head-actions { display: flex; align-items: center; gap: 12px; }
.mg-head-actions .dir-footnote { margin: 0; }

/* Icon-only button (e.g. close listing). Danger variant turns red on hover/focus only. */
.mg-icon-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--dir-border); border-radius: var(--dir-radius-sm); background: #fff; color: var(--dir-muted); cursor: pointer; transition: color 150ms, background 150ms, border-color 150ms; }
.mg-icon-btn:hover { color: var(--dir-text); border-color: var(--dir-text); }
.mg-icon-btn--danger:hover { color: var(--dir-danger); border-color: var(--dir-danger); background: var(--dir-danger-tint); }
.mg-icon-btn:focus-visible { outline: none; box-shadow: var(--dir-focus); }
.mg-title { font-size: 32px; margin: 0; color: var(--dir-text); }
.mg-sub { color: var(--dir-muted); font-size: 14px; margin: 4px 0 0; font-weight: 400; }

.mg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mg-stat { background: #fff; border-radius: var(--dir-radius-md); box-shadow: var(--dir-shadow); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.mg-stat-label { color: var(--dir-muted); font-size: 14px; font-weight: 500; letter-spacing: 0.07px; }
.mg-stat-value { color: var(--dir-text); font-family: var(--font-display, inherit); font-size: 32px; font-weight: 500; line-height: 1.2; }

.mg-section { padding: 24px; margin-bottom: 16px; }
.mg-section h2 { font-size: 20px; margin: 0 0 16px; color: var(--dir-text); }
.mg-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.mg-section-head h2 { margin: 0; }
.mg-link { background: none; border: 0; padding: 0; color: var(--dir-primary); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.mg-link:hover { color: var(--dir-primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.mg-btn-sm { padding: 8px 16px; font-size: 14px; }

.mg-progress { height: 6px; background: var(--dir-border-soft); border-radius: 9999px; overflow: hidden; margin-bottom: 12px; }
.mg-progress-bar { height: 100%; background: var(--dir-success); transition: width 0.3s; }
.mg-checklist { list-style: none; margin: 0; padding: 0; }
.mg-checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--dir-border-soft); }
.mg-checklist li:first-child { border-top: 0; }
.mg-check { flex: 0 0 22px; height: 22px; border-radius: 9999px; border: 1px solid var(--dir-border); display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.mg-checklist li.done .mg-check { background: var(--dir-success); border-color: var(--dir-success); }
.mg-checklist li.done .mg-check-label { color: var(--dir-muted); text-decoration: line-through; }
.mg-check-label { flex: 1; color: var(--dir-text); }

.mg-rows { list-style: none; margin: 0; padding: 0; }
.mg-rows li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--dir-border-soft); }
.mg-rows li:first-child { border-top: 0; padding-top: 0; }
.mg-rows li:last-child { padding-bottom: 0; }
.mg-pending-label { color: var(--dir-muted); font-size: 14px; font-weight: 500; letter-spacing: 0.07px; }
.mg-pending-value { color: var(--dir-text); overflow-wrap: anywhere; }
.mg-badge--pending { background: var(--dir-warning-tint); color: var(--dir-text-2); }

.mg-review { padding: 16px 0; border-top: 1px solid var(--dir-border-soft); }
.mg-review:first-child { border-top: 0; padding-top: 0; }
.mg-review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mg-review-head .mg-stars { margin-left: auto; }
.mg-avatar-sm { flex: 0 0 32px; height: 32px; border-radius: 9999px; background: var(--fg-tint, #ecedee); color: var(--dir-text); font-weight: 500; display: flex; align-items: center; justify-content: center; }
.mg-stars { color: var(--dir-star); letter-spacing: 1px; }
.mg-review-title { font-weight: 500; margin-bottom: 4px; color: var(--dir-text); }
.mg-review-body { margin: 0 0 8px; color: var(--dir-text-2); line-height: 1.5; font-size: 16px; }
.mg-reply { margin-top: 8px; padding: 12px 16px; background: var(--dir-bg); border-radius: var(--dir-radius-sm); font-size: 14px; }
.mg-reply-head { font-size: 12px; color: var(--dir-text); font-weight: 500; margin-bottom: 4px; }

.mg-dist { display: flex; flex-direction: column; gap: 6px; }
.mg-dist-row { display: grid; grid-template-columns: 1rem 1fr 2rem; gap: 12px; align-items: center; font-size: 14px; color: var(--dir-muted); }
.mg-dist-track { height: 8px; background: var(--dir-border-soft); border-radius: 9999px; overflow: hidden; }
.mg-dist-fill { height: 100%; background: var(--dir-primary); }

.mg-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mg-photo { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--dir-radius-sm); background: var(--dir-bg); }
.mg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-photo .delete-photo { position: absolute; top: 6px; right: 6px; background: rgba(24, 29, 38, 0.7); color: #fff; border: 0; border-radius: 9999px; width: 26px; height: 26px; cursor: pointer; font-weight: 500; }
.mg-photo-empty { aspect-ratio: 4/3; border: 1px dashed var(--dir-border); border-radius: var(--dir-radius-sm); background: transparent; color: var(--dir-muted); font: inherit; font-weight: 500; cursor: pointer; }
.mg-photo-empty:hover { border-color: var(--dir-text); color: var(--dir-text); }

.mg-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; }
.mg-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.mg-bar { width: 100%; min-height: 2px; background: var(--dir-primary); border-radius: 4px 4px 0 0; }
.mg-bar-col span { font-size: 12px; color: var(--dir-muted); }

/* Contextual upsell row — one per view (scheduling, AI receptionist, reviews, SEO audit) */
.mg-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 16px; background: var(--dir-primary-tint); border-radius: var(--dir-radius-md); }
.dir-card .mg-cta { margin: 16px 0 0; }
.mg-cta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mg-cta-text strong { color: var(--dir-text); font-weight: 500; }
.mg-cta-text span { color: var(--dir-text-2); font-size: 14px; }
.mg-cta .dir-btn { flex: 0 0 auto; }

.mg-savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 14px 0; background: rgba(255, 255, 255, 0.92); border-top: 1px solid var(--dir-border); }
.mg-savebar .dir-footnote { margin: 0; }

@media (max-width: 760px) {
  .mg-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .mg-nav { position: static; }
  .mg-nav-links { flex-direction: row; overflow-x: auto; gap: 4px; }
  .mg-nav-links button { white-space: nowrap; }
  .mg-signout { align-self: flex-start; }
  .mg-cta { flex-direction: column; align-items: flex-start; }
}
