/* AAC V104.1 Tier 2 — Consolidated Styles
 * Extracted from V104.1_PATCH_PACK to keep index.html clean.
 * Components: Create-New grid, Onboarding scorecard, Mobile push panel,
 *             Pipeline hero, Estimate top-bar (+ schedule modal).
 *
 * Brand Identity Lock: light surfaces, navy stroke (#19195F), gold accent (#C9A84C).
 * No heavy navy washes. iOS will mirror desktop.
 */

/* ------------------------------------------------------------------ */
/* 09 — ONBOARDING SCORECARD                                          */
/* ------------------------------------------------------------------ */
.aac-onboard {
  background: #fbfbf6;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #C9A84C;
  border-radius: 16px;
  padding: 20px 24px;
  margin: 16px 0 24px;
  font-family: 'Montserrat', sans-serif;
}
.aac-onboard[hidden] { display: none; }
.aac-onboard-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.aac-onboard-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: #19195F; font-weight: 700;
  margin: 0; line-height: 1.2;
}
.aac-onboard-title span { color: #C9A84C; }
.aac-onboard-sub { font-size: 12px; color: #6B7280; margin-top: 4px; }
.aac-onboard-toggle {
  background: white; border: 1px solid #e5e7eb;
  width: 28px; height: 28px; border-radius: 8px;
  color: #19195F; font-size: 18px; line-height: 1;
  cursor: pointer; transition: all .15s ease;
}
.aac-onboard-toggle:hover { border-color: #C9A84C; background: #fff8e1; }
.aac-onboard-progress {
  height: 4px; background: #f3f4f6; border-radius: 999px;
  margin: 14px 0 16px; overflow: hidden;
}
.aac-onboard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #C9A84C 0%, #19195F 100%);
  border-radius: 999px;
  transition: width .35s cubic-bezier(0.32, 1, 0.55, 1);
}
.aac-onboard-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.aac-onboard-step {
  display: grid; grid-template-columns: 28px 1fr auto;
  align-items: center; gap: 12px;
  padding: 10px 12px; background: white;
  border: 1px solid #f3f4f6; border-radius: 10px;
  transition: all .2s ease;
}
.aac-onboard-step:hover { border-color: #C9A84C; }
.aac-onboard-step[data-done="true"] { background: #fff8e1; border-color: #C9A84C; }
.aac-onboard-step[data-done="true"] .aac-onboard-label {
  text-decoration: line-through; color: #6B7280;
}
.aac-onboard-mark {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid #d1d5db; background: white;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s ease;
}
.aac-onboard-step[data-done="true"] .aac-onboard-mark { border-color: #C9A84C; background: #C9A84C; }
.aac-onboard-step[data-done="true"] .aac-onboard-mark::after {
  content: ''; width: 12px; height: 7px;
  border-left: 2.5px solid white; border-bottom: 2.5px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
}
.aac-onboard-label { font-size: 13px; color: #19195F; font-weight: 500; }
.aac-onboard-action {
  background: white; border: 1.5px solid #19195F; color: #19195F;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .15s ease; font-family: inherit;
}
.aac-onboard-action:hover { background: #19195F; color: white; }
.aac-onboard-step[data-done="true"] .aac-onboard-action { display: none; }
.aac-onboard-footer { margin-top: 14px; text-align: right; }
.aac-onboard-skip { font-size: 11px; color: #9ca3af; text-decoration: none; }
.aac-onboard-skip:hover { color: #6B7280; text-decoration: underline; }
.aac-onboard[data-collapsed="true"] .aac-onboard-progress,
.aac-onboard[data-collapsed="true"] .aac-onboard-steps,
.aac-onboard[data-collapsed="true"] .aac-onboard-footer { display: none; }
.aac-onboard[data-collapsed="true"] .aac-onboard-toggle { transform: rotate(180deg); }
@media (max-width: 540px) {
  .aac-onboard-step { grid-template-columns: 22px 1fr; }
  .aac-onboard-action { grid-column: 1 / -1; justify-self: end; }
}

/* ------------------------------------------------------------------ */
/* 06 — CREATE NEW GRID (14-verb)                                     */
/* ------------------------------------------------------------------ */
.aac-create-new {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
  font-family: 'Montserrat', sans-serif;
}
.aac-create-new-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 2px solid #C9A84C;
}
.aac-create-new-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; color: #19195F; font-weight: 700; margin: 0;
}
.aac-create-new-subtitle {
  font-size: 11px; color: #6B7280; text-transform: uppercase;
  letter-spacing: 1px; font-weight: 600;
}
.aac-create-new-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
@media (max-width: 1280px) { .aac-create-new-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px)  { .aac-create-new-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px)  { .aac-create-new-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px)  { .aac-create-new-grid { grid-template-columns: repeat(2, 1fr); } }
.aac-cn-tile {
  position: relative;
  background: #fbfbf6; border: 1.5px solid #f3f4f6; border-radius: 12px;
  padding: 16px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: all .2s ease;
  font-family: inherit; color: #19195F;
}
.aac-cn-tile:hover {
  background: white; border-color: #C9A84C;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25,25,95,0.08);
}
.aac-cn-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: white; border: 1px solid #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, border-color .2s ease;
}
.aac-cn-tile:hover .aac-cn-icon { background: #fff8e1; border-color: #C9A84C; }
.aac-cn-label {
  font-size: 11px; font-weight: 600; color: #19195F;
  text-align: center; line-height: 1.3; letter-spacing: 0.3px;
}
.aac-cn-ai-tag {
  position: absolute; top: 8px; right: 8px;
  background: #C9A84C; color: white;
  font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 5px; border-radius: 4px; line-height: 1;
}

/* ------------------------------------------------------------------ */
/* 10 — MOBILE PUSH PANEL                                             */
/* ------------------------------------------------------------------ */
.aac-mobile-panel {
  background: linear-gradient(180deg, #fbfbf6 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-top: 3px solid #C9A84C;
  border-radius: 16px;
  padding: 20px;
  font-family: 'Montserrat', sans-serif;
  max-width: 320px;
  box-shadow: 0 2px 12px rgba(25,25,95,0.04);
}
.aac-mobile-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700; color: #C9A84C; margin-bottom: 8px;
}
.aac-mobile-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px; color: #19195F; font-weight: 700;
  margin: 0 0 14px 0; line-height: 1.2;
}
.aac-mobile-qr-wrap {
  background: white; border: 1px solid #f3f4f6; border-radius: 12px;
  padding: 14px; text-align: center; margin-bottom: 14px;
}
.aac-mobile-qr { width: 140px; height: 140px; display: block; margin: 0 auto 8px; }
.aac-mobile-qr-caption {
  font-size: 10px; color: #6B7280; text-transform: uppercase;
  letter-spacing: 1px; font-weight: 600;
}
.aac-mobile-tagline { font-size: 12px; color: #4B5563; line-height: 1.6; margin: 0 0 16px 0; }
.aac-mobile-cta-row { display: flex; flex-direction: column; gap: 8px; }
.aac-mobile-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; border: 1.5px solid #19195F; color: #19195F;
  padding: 6px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600; align-self: flex-start;
}
.aac-mobile-badge-os {
  background: #19195F; color: white;
  padding: 2px 6px; border-radius: 999px;
  font-size: 9px; letter-spacing: 0.5px;
}
.aac-mobile-badge-when {
  color: #19195F; text-transform: uppercase;
  letter-spacing: 1px; font-size: 9px;
}
.aac-mobile-notify {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #19195F; color: white;
  padding: 8px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  text-decoration: none; transition: all .2s ease;
}
.aac-mobile-notify:hover { background: #0d0a3e; transform: translateY(-1px); }
.aac-mobile-footer {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid #f3f4f6;
  font-size: 9px; color: #9ca3af;
  text-align: center; letter-spacing: 0.5px;
}

/* Home wide-screen layout: Create-New + Mobile Push side-by-side */
.aac-home-create-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  margin: 0;
}
@media (min-width: 1100px) {
  .aac-home-create-row {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .aac-home-create-row .aac-create-new { margin: 0; }
  .aac-home-create-row .aac-mobile-panel { max-width: none; }
}

/* ------------------------------------------------------------------ */
/* 08 — PIPELINE HERO                                                 */
/* ------------------------------------------------------------------ */
.aac-pipeline-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px; align-items: center;
  background: linear-gradient(180deg, #fbfbf6 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-left: 4px solid #C9A84C;
  border-radius: 16px;
  padding: 24px 28px;
  margin: 16px 0 24px;
  font-family: 'Montserrat', sans-serif;
}
.aac-pipeline-hero-eyebrow {
  text-transform: uppercase; letter-spacing: 1.5px;
  font-size: 10px; font-weight: 700; color: #C9A84C; margin-bottom: 6px;
}
.aac-pipeline-hero-figure {
  font-family: 'Playfair Display', serif;
  font-size: 44px; color: #19195F; font-weight: 700;
  margin: 0; line-height: 1.05; letter-spacing: -0.5px;
}
.aac-pipeline-hero-tagline {
  font-size: 12px; color: #6B7280; margin-top: 8px; font-style: italic;
}
.aac-pipeline-hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px; align-items: stretch;
}
.aac-pipeline-stat {
  background: white; border: 1px solid #f3f4f6; border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .2s ease, transform .2s ease;
}
.aac-pipeline-stat:hover { border-color: #C9A84C; transform: translateY(-1px); }
.aac-pipeline-stat-label {
  font-size: 9px; font-weight: 600; color: #6B7280;
  text-transform: uppercase; letter-spacing: 1px;
}
.aac-pipeline-stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; color: #19195F; line-height: 1;
}
.aac-pipeline-stat-hot { color: #C9A84C; }
.aac-pipeline-refresh {
  background: white; border: 1px solid #e5e7eb; border-radius: 10px;
  width: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s ease;
}
/* Hover spin: desktop only (iOS taps stick the hover state, causing full-width tilt) */
@media (hover: hover) {
  .aac-pipeline-refresh:hover {
    border-color: #C9A84C; background: #fff8e1;
  }
  .aac-pipeline-refresh:hover .aac-ic-gear {
    transform: rotate(45deg);
  }
}
/* Tap feedback on touch: brief icon spin only, no whole-button rotation */
.aac-pipeline-refresh:active .aac-ic-gear {
  transform: rotate(45deg);
  transition: transform .15s ease;
}
@media (max-width: 900px) {
  .aac-pipeline-hero { grid-template-columns: 1fr; gap: 18px; }
  .aac-pipeline-hero-figure { font-size: 36px; }
}
@media (max-width: 540px) {
  .aac-pipeline-hero-stats { grid-template-columns: 1fr 1fr; }
  .aac-pipeline-refresh { grid-column: 1 / -1; width: 100%; padding: 8px; }
}

/* Aging badge inline next to last activity in pipeline rows */
.aac-aging-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 10px; font-weight: 700;
  border-radius: 999px;
  background: #f3f4f6; color: #6B7280;
  letter-spacing: 0.4px;
}
.aac-aging-badge.is-warn  { background: #fff8e1; color: #C9A84C; }
.aac-aging-badge.is-hot   { background: #fde8e8; color: #b91c1c; }

/* Value column shading (optional emphasis) */
.aac-pipeline-table td.aac-pipeline-value {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #19195F;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* 11 — ESTIMATE TOP-BAR (6 actions) + Schedule placeholder modal     */
/* ------------------------------------------------------------------ */
.aac-estimate-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: linear-gradient(180deg, #fbfbf6 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-bottom: 2px solid #C9A84C;
  border-radius: 12px 12px 0 0;
  font-family: 'Montserrat', sans-serif;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.aac-estimate-topbar-meta {
  display: inline-flex; align-items: baseline; gap: 8px;
  min-width: 0; flex: 1 1 280px;
}
.aac-estimate-topbar-id {
  font-family: 'Playfair Display', serif;
  font-weight: 700; color: #19195F; font-size: 15px; letter-spacing: 0.5px;
}
.aac-estimate-topbar-divider { color: #d1d5db; }
.aac-estimate-topbar-title {
  color: #4B5563; font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 360px;
}
.aac-estimate-topbar-revision {
  background: #fff8e1; color: #C9A84C; border: 1px solid #C9A84C;
  padding: 2px 8px; border-radius: 999px;
  font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.aac-estimate-topbar-actions {
  display: inline-flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: flex-end;
}
.aac-est-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
  text-decoration: none; border: 1.5px solid transparent; line-height: 1;
}
.aac-est-btn-ghost { background: white; border-color: #e5e7eb; color: #19195F; }
.aac-est-btn-ghost:hover { border-color: #19195F; background: #f8f9fa; transform: translateY(-1px); }
.aac-est-btn-ai { background: white; border-color: #C9A84C; color: #19195F; }
.aac-est-btn-ai:hover { background: #fff8e1; border-color: #b8983f; transform: translateY(-1px); }
.aac-est-btn-primary {
  background: #C9A84C; border-color: #C9A84C; color: white;
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}
.aac-est-btn-primary:hover {
  background: #b8983f; border-color: #b8983f;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.4);
}
.aac-est-btn-primary .aac-ic { filter: brightness(0) invert(1); }
.aac-est-caret { font-size: 10px; color: #6B7280; }
.aac-est-action-wrap { position: relative; }
.aac-est-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 200px; background: white;
  border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(25,25,95,0.12);
  padding: 6px; z-index: 50;
  display: flex; flex-direction: column; gap: 2px;
}
.aac-est-menu[hidden] { display: none; }
.aac-est-menu-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: transparent;
  border: none; border-radius: 8px;
  color: #19195F; font-size: 12px; font-weight: 500;
  text-align: left; cursor: pointer;
  font-family: inherit; transition: background .15s ease;
}
.aac-est-menu-item:hover { background: #fff8e1; }
.aac-est-menu-item-danger { color: #b91c1c; }
.aac-est-menu-item-danger:hover { background: #fef2f2; }
.aac-est-menu-sep { height: 1px; background: #f3f4f6; margin: 4px 6px; }

.aac-modal[hidden] { display: none; }
.aac-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif;
}
.aac-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(25, 25, 95, 0.45); backdrop-filter: blur(4px);
}
.aac-modal-card {
  position: relative; background: white;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.3);
  max-width: 480px; width: calc(100vw - 32px); overflow: hidden;
}
.aac-modal-header {
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid #C9A84C;
}
.aac-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: #19195F; font-weight: 700; margin: 0;
}
.aac-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 24px; color: #6B7280; line-height: 1;
  padding: 4px 8px;
}
.aac-modal-body { padding: 24px; }
.aac-modal-pitch { font-size: 14px; color: #4B5563; line-height: 1.7; margin: 0 0 14px 0; }
.aac-modal-cta-row { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.aac-modal-fineprint {
  margin-top: 18px; font-size: 10px; color: #9ca3af;
  text-align: center; letter-spacing: 0.5px;
}
@media (max-width: 900px) {
  .aac-est-btn span:not(.aac-ic):not([class*="aac-ic-"]):not(.aac-ai-badge):not(.aac-ai-badge *):not(.aac-est-caret) { display: none; }
  .aac-est-btn { padding: 8px 12px; }
  .aac-est-btn-ai span:nth-child(2) { display: inline; }
  .aac-est-btn-primary span:nth-child(2) { display: inline; }
}
@media (max-width: 540px) {
  .aac-estimate-topbar { padding: 10px 12px; }
  .aac-estimate-topbar-title { display: none; }
}

/* ------------------------------------------------------------------ */
/* DEMO MODE BADGE                                                    */
/* ------------------------------------------------------------------ */
.aac-demo-badge {
  position: fixed;
  top: 8px; right: 12px;
  z-index: 10000;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: #fff8e1;
  border: 1.5px solid #C9A84C;
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px; font-weight: 700;
  color: #19195F;
  text-transform: uppercase; letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(25,25,95,0.08);
  pointer-events: none;
}
.aac-demo-badge::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: #C9A84C;
  animation: aac-demo-pulse 2s ease-in-out infinite;
}
@keyframes aac-demo-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ============================================================
   V104.1.1 SHELL POLISH — fix label wrap on narrow viewports
   ============================================================ */
.app-shell__user {
    white-space: nowrap;
    flex-shrink: 0;
}
.app-shell__user > span {
    white-space: nowrap;
}
.aac-btn-invite-shell .aac-invite-label {
    white-space: nowrap;
}
.app-shell__brand-text {
    white-space: nowrap;
}

/* Progressive responsive collapse — when shell gets narrow, hide labels first then chrome */
@media (max-width: 1280px) {
    .aac-btn-invite-shell .aac-invite-label { display: none; }
    .aac-btn-invite-shell { padding: 6px 10px !important; }
}
@media (max-width: 1100px) {
    .app-shell__user { display: none !important; }
    .app-shell__brand-divider { display: none !important; }
}
@media (max-width: 900px) {
    .app-shell__brand-text { display: none; }
}

/* Ensure shell flexes properly */
.app-shell__header {
    flex-wrap: nowrap;
    overflow: visible;
}


/* Allow stat labels to wrap on narrow phone viewports (e.g., "Avg Days to Close") */
@media (max-width: 540px) {
  .aac-pipeline-stat-label {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.2;
    font-size: 9px !important;
    letter-spacing: 1px !important;
  }
}

/* ------------------------------------------------------------------ */
/* COMPANY SETTINGS MODAL (V104.1 HIGH+ May 8, 2026)                  */
/* ------------------------------------------------------------------ */
.aac-co-tabs { font-family: 'Montserrat', sans-serif; }
.aac-co-tab {
  background: transparent; border: 0;
  padding: 10px 16px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: #6B7280; border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.aac-co-tab:hover { color: #19195F; }
.aac-co-tab.is-active {
  color: #19195F; border-bottom-color: #C9A84C;
}
.aac-co-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.aac-co-field {
  display: flex; flex-direction: column; gap: 4px;
  font-family: 'Montserrat', sans-serif; font-size: 12px;
  color: #4B5563;
}
.aac-co-field > span {
  font-size: 10px; font-weight: 600; color: #19195F;
  text-transform: uppercase; letter-spacing: 1px;
}
.aac-co-field > input {
  padding: 9px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 13px; font-family: inherit;
  color: #2D2D2D; background: #fff;
  transition: border-color .15s ease;
}
.aac-co-field > input:focus {
  outline: none; border-color: #19195F;
  box-shadow: 0 0 0 3px rgba(25,25,95,0.08);
}
.aac-co-field-full { grid-column: 1 / -1; }
@media (max-width: 540px) {
  .aac-co-grid { grid-template-columns: 1fr; }
  .aac-co-field-full { grid-column: 1; }
}
